15 #ifndef QGSFEATUREREQUEST_H
16 #define QGSFEATUREREQUEST_H
18 #include "qgis_core.h"
82 SubsetOfAttributes = 2,
85 Q_DECLARE_FLAGS( Flags,
Flag )
99 enum InvalidGeometryCheck
102 GeometrySkipInvalid = 1,
103 GeometryAbortOnInvalid = 2,
141 OrderByClause(
const QString &expression,
bool ascending =
true );
150 OrderByClause(
const QString &expression,
bool ascending,
bool nullsfirst );
190 bool ascending()
const;
195 void setAscending(
bool ascending );
201 bool nullsFirst()
const;
206 void setNullsFirst(
bool nullsFirst );
211 QString dump()
const;
229 class OrderBy :
public QList<QgsFeatureRequest::OrderByClause>
241 CORE_EXPORT
OrderBy(
const QList<QgsFeatureRequest::OrderByClause> &other );
249 QList<QgsFeatureRequest::OrderByClause> CORE_EXPORT list()
const;
254 void CORE_EXPORT save( QDomElement &elem )
const;
259 void CORE_EXPORT load(
const QDomElement &elem );
265 QSet<QString> CORE_EXPORT usedAttributes()
const;
271 QSet<int> CORE_EXPORT usedAttributeIndices(
const QgsFields &fields )
const;
276 QString CORE_EXPORT dump()
const;
282 static const QString ALL_ATTRIBUTES;
312 FilterType filterType()
const {
return mFilter; }
335 const QgsRectangle &filterRect()
const {
return mFilterRect; }
345 const QgsFeatureIds &filterFids()
const {
return mFilterFids; }
361 InvalidGeometryCheck invalidGeometryCheck()
const {
return mInvalidGeometryFilter; }
375 Py_BEGIN_ALLOW_THREADS
377 sipCpp->setInvalidGeometryCallback( [a0](
const QgsFeature &arg )
380 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
397 std::function< void(
const QgsFeature & ) > invalidGeometryCallback()
const {
return mInvalidGeometryCallback; }
SIP_SKIP
412 QgsExpression *filterExpression()
const {
return mFilterExpression.get(); }
446 QgsFeatureRequest &disableFilter() { mFilter = FilterNone; mFilterExpression.reset();
return *
this; }
470 QgsFeatureRequest &addOrderBy(
const QString &expression,
bool ascending,
bool nullsfirst );
499 long limit()
const {
return mLimit; }
503 const Flags &flags()
const {
return mFlags; }
603 Py_BEGIN_ALLOW_THREADS
605 sipCpp->setTransformErrorCallback( [a0](
const QgsFeature &arg )
608 Py_XDECREF( sipCallMethod( NULL, a0,
"D", &arg, sipType_QgsFeature, NULL ) );
626 std::function< void(
const QgsFeature & ) > transformErrorCallback()
const {
return mTransformErrorCallback; }
SIP_SKIP
638 bool acceptFeature(
const QgsFeature &feature );
694 bool requestMayBeNested() const;
723 std::function<
void( const
QgsFeature & ) > mInvalidGeometryCallback;
724 std::function<
void( const
QgsFeature & ) > mTransformErrorCallback;
728 int mRequestMayBeNested = false;
763 #endif // QGSFEATUREREQUEST_H