QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
qgsvectorlayer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayer.h - description
3  -------------------
4  begin : Oct 29, 2003
5  copyright : (C) 2003 by Gary E.Sherman
6  email : sherman at mrcc.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSVECTORLAYER_H
19 #define QGSVECTORLAYER_H
20 
21 #include <QMap>
22 #include <QSet>
23 #include <QList>
24 #include <QStringList>
25 
26 #include "qgis.h"
27 #include "qgsmaplayer.h"
28 #include "qgsfeature.h"
29 #include "qgsfeatureiterator.h"
30 #include "qgseditorwidgetconfig.h"
31 #include "qgsfield.h"
32 #include "qgssnapper.h"
33 #include "qgsfield.h"
34 #include "qgsrelation.h"
36 
37 class QPainter;
38 class QImage;
39 
41 class QgsAttributeAction;
48 class QgsFeatureRequest;
49 class QgsGeometry;
50 class QgsGeometryCache;
51 class QgsGeometryVertexIndex;
52 class QgsLabel;
53 class QgsMapToPixel;
54 class QgsRectangle;
55 class QgsRectangle;
56 class QgsRelation;
57 class QgsRelationManager;
59 class QgsSymbolV2;
63 
64 typedef QList<int> QgsAttributeList;
65 typedef QSet<int> QgsAttributeIds;
66 
67 class CORE_EXPORT QgsAttributeEditorElement : public QObject
68 {
69  Q_OBJECT
70  public:
71 
73  {
77  AeTypeInvalid
78  };
79 
80  QgsAttributeEditorElement( AttributeEditorType type, QString name, QObject *parent = NULL )
81  : QObject( parent ), mType( type ), mName( name ) {}
82 
84 
85  QString name() const { return mName; }
86  AttributeEditorType type() const { return mType; }
87 
88  virtual QDomElement toDomElement( QDomDocument& doc ) const = 0;
89 
90  protected:
92  QString mName;
93 };
94 
96 {
97  public:
98  QgsAttributeEditorContainer( QString name, QObject *parent )
99  : QgsAttributeEditorElement( AeTypeContainer, name, parent )
100  , mIsGroupBox( true )
101  {}
102 
104 
105  virtual QDomElement toDomElement( QDomDocument& doc ) const;
106  virtual void addChildElement( QgsAttributeEditorElement *widget );
107  virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }
108  virtual bool isGroupBox() const { return mIsGroupBox; }
109  QList<QgsAttributeEditorElement*> children() const { return mChildren; }
110  virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;
111 
112  private:
113  bool mIsGroupBox;
114  QList<QgsAttributeEditorElement*> mChildren;
115 };
116 
117 
119 {
120  public:
121  QgsAttributeEditorField( QString name, int idx, QObject *parent )
122  : QgsAttributeEditorElement( AeTypeField, name, parent ), mIdx( idx ) {}
123 
125 
126  virtual QDomElement toDomElement( QDomDocument& doc ) const;
127  int idx() const { return mIdx; }
128 
129  private:
130  int mIdx;
131 };
132 
135 {
136  public:
137  QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent )
138  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
139  , mRelationId( relationId ) {}
140 
141  QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent )
142  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
143  , mRelationId( relation.id() )
144  , mRelation( relation ) {}
145 
147 
148  virtual QDomElement toDomElement( QDomDocument& doc ) const;
149  const QgsRelation& relation() const { return mRelation; }
150 
157  bool init( QgsRelationManager *relManager );
158 
159  private:
160  QString mRelationId;
161  QgsRelation mRelation;
162 };
163 
164 
165 struct CORE_EXPORT QgsVectorJoinInfo
166 {
170  QString joinLayerId;
172  QString joinFieldName;
178  QHash< QString, QgsAttributes> cachedAttributes;
179 
184 
185  bool operator==( const QgsVectorJoinInfo& other ) const
186  {
187  return targetFieldName == other.targetFieldName &&
188  joinLayerId == other.joinLayerId &&
189  joinFieldName == other.joinFieldName &&
190  joinFieldsSubset == other.joinFieldsSubset &&
191  memoryCache == other.memoryCache;
192  }
193 
196  void setJoinFieldNamesSubset( QStringList* fieldNamesSubset ) { joinFieldsSubset = QSharedPointer<QStringList>( fieldNamesSubset ); }
199  QStringList* joinFieldNamesSubset() const { return joinFieldsSubset.data(); }
200 
201 protected:
203  QSharedPointer<QStringList> joinFieldsSubset;
204 };
205 
468 class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
469 {
470  Q_OBJECT
471 
472  public:
475  {
476  GeneratedLayout = 0,
477  TabLayout = 1,
478  UiFileLayout = 2
479  };
480 
484  enum EditType
485  {
507  };
508 
512  {
513  SuppressDefault = 0, // use the application-wide setting
514  SuppressOn = 1,
515  SuppressOff = 2
516  };
517 
518  struct RangeData
519  {
520  RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
521  RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
522  : mMin( theMin ), mMax( theMax ), mStep( theStep ) {}
523 
524  QVariant mMin;
525  QVariant mMax;
526  QVariant mStep;
527  };
528 
530  {
532  ValueRelationData( QString layer, QString key, QString value, bool allowNull, bool orderByValue,
533  bool allowMulti = false,
534  QString filterExpression = QString::null )
535  : mLayer( layer )
536  , mKey( key )
537  , mValue( value )
538  , mFilterExpression( filterExpression )
539  , mAllowNull( allowNull )
540  , mOrderByValue( orderByValue )
541  , mAllowMulti( allowMulti )
542  {}
543 
544  QString mLayer;
545  QString mKey;
546  QString mValue;
550  bool mAllowMulti; /* allow selection of multiple keys */
551  };
552 
553  struct GroupData
554  {
556  GroupData( QString name, QList<QString> fields )
557  : mName( name ), mFields( fields ) {}
558  QString mName;
559  QList<QString> mFields;
560  };
561 
562  struct TabData
563  {
564  TabData() {}
565  TabData( QString name, QList<QString> fields, QList<GroupData> groups )
566  : mName( name ), mFields( fields ), mGroups( groups ) {}
567  QString mName;
568  QList<QString> mFields;
569  QList<GroupData> mGroups;
570  };
571 
585  QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
586  QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
587 
589  virtual ~QgsVectorLayer();
590 
592  QString storageType() const;
593 
595  QString capabilitiesString() const;
596 
598  QString dataComment() const;
599 
601  void setDisplayField( QString fldName = "" );
602 
604  const QString displayField() const;
605 
612  void setDisplayExpression( const QString &displayExpression );
613 
620  const QString displayExpression();
621 
623  QgsVectorDataProvider* dataProvider();
624 
628  const QgsVectorDataProvider* dataProvider() const;
629 
631  void setProviderEncoding( const QString& encoding );
632 
634  void setCoordinateSystem();
635 
639  bool addJoin( const QgsVectorJoinInfo& joinInfo );
640 
642  void removeJoin( const QString& joinLayerId );
643 
644  const QList< QgsVectorJoinInfo >& vectorJoins() const;
645 
654  void addExpressionField( const QString& exp, const QgsField& fld );
655 
663  void removeExpressionField( int index );
664 
666  QgsLabel *label();
667 
668  const QgsLabel *label() const;
669 
670  QgsAttributeAction *actions() { return mActions; }
671 
677  int selectedFeatureCount();
678 
687  void select( QgsRectangle & rect, bool addToSelection );
688 
700  void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
701 
703  void invertSelection();
704 
706  void selectAll();
707 
709  QgsFeatureIds allFeatureIds();
710 
718  void invertSelectionInRectangle( QgsRectangle & rect );
719 
728  QgsFeatureList selectedFeatures();
729 
741  QgsFeatureIterator selectedFeaturesIterator( QgsFeatureRequest request = QgsFeatureRequest() );
742 
749  const QgsFeatureIds &selectedFeaturesIds() const;
750 
758  void setSelectedFeatures( const QgsFeatureIds &ids );
759 
761  QgsRectangle boundingBoxOfSelected();
762 
764  void setDiagramRenderer( QgsDiagramRendererV2* r );
765  const QgsDiagramRendererV2* diagramRenderer() const { return mDiagramRenderer; }
766 
767  void setDiagramLayerSettings( const QgsDiagramLayerSettings& s );
768  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
769 
771  QgsFeatureRendererV2* rendererV2();
773  void setRendererV2( QgsFeatureRendererV2* r );
774 
776  QGis::GeometryType geometryType() const;
777 
779  bool hasGeometryType() const;
780 
782  QGis::WkbType wkbType() const;
783 
785  QString providerType() const;
786 
790  virtual bool readXml( const QDomNode& layer_node );
791 
795  virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );
796 
805  virtual void saveStyleToDatabase( QString name, QString description,
806  bool useAsDefault, QString uiFileContent,
807  QString &msgError );
808 
817  virtual int listStylesInDatabase( QStringList &ids, QStringList &names,
818  QStringList &descriptions, QString &msgError );
819 
823  virtual QString getStyleFromDatabase( QString styleId, QString &msgError );
824 
831  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
832 
837  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag );
838 
839  virtual bool applyNamedStyle( QString namedStyle, QString errorMsg );
840 
845  QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );
846 
852  bool readSymbology( const QDomNode& node, QString& errorMessage );
853 
860  bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
861 
862  bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
863  bool readSld( const QDomNode& node, QString& errorMessage );
864 
872  virtual long featureCount() const;
873 
880  long featureCount( QgsSymbolV2* symbol );
881 
887  bool countSymbolFeatures( bool showProgress = true );
888 
896  virtual bool setSubsetString( QString subset );
897 
902  virtual QString subsetString();
903 
907  QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() );
908 
914  bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
915 
922  bool updateFeature( QgsFeature &f );
923 
928  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
929 
934  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
935 
938  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
939 
943  bool deleteSelectedFeatures();
944 
954  int addRing( const QList<QgsPoint>& ring );
955 
966  int addPart( const QList<QgsPoint>& ring );
967 
973  int translateFeature( QgsFeatureId featureId, double dx, double dy );
974 
982  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
983 
991  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
992 
1001  Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignoreFeatures = QgsFeatureIds() );
1002 
1008  int addTopologicalPoints( QgsGeometry* geom );
1009 
1017  int addTopologicalPoints( const QgsPoint& p );
1018 
1024  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
1025 
1027  void enableLabels( bool on );
1028 
1030  bool hasLabelsEnabled() const;
1031 
1033  virtual bool isEditable() const;
1034 
1036  virtual bool isReadOnly() const;
1037 
1039  virtual bool isModified() const;
1040 
1047  bool snapPoint( QgsPoint& point, double tolerance );
1048 
1056  int snapWithContext( const QgsPoint& startPoint,
1057  double snappingTolerance,
1058  QMultiMap < double, QgsSnappingResult > &snappingResults,
1059  QgsSnapper::SnappingType snap_to );
1060 
1062  virtual void reload();
1063 
1067  virtual QgsMapLayerRenderer* createMapRenderer( QgsRenderContext& rendererContext );
1068 
1072  bool draw( QgsRenderContext& rendererContext );
1073 
1075  void drawLabels( QgsRenderContext& rendererContext );
1076 
1078  QgsRectangle extent();
1079 
1081  const QgsFields &pendingFields() const;
1082 
1084  QgsAttributeList pendingAllAttributesList();
1085 
1087  QgsAttributeList pendingPkAttributesList();
1088 
1090  int pendingFeatureCount();
1091 
1095  bool setReadOnly( bool readonly = true );
1096 
1098  bool startEditing();
1099 
1101  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
1102 
1109  Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal );
1110 
1121  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
1122 
1125  bool addAttribute( const QgsField &field );
1126 
1128  void addAttributeAlias( int attIndex, QString aliasString );
1129 
1131  void remAttributeAlias( int attIndex );
1132 
1136  void addAttributeEditorWidget( QgsAttributeEditorElement* data );
1137 
1145  const QString editorWidgetV2( int fieldIdx ) const;
1146 
1156  const QString editorWidgetV2( const QString& fieldName ) const;
1157 
1165  const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ) const;
1166 
1176  const QgsEditorWidgetConfig editorWidgetV2Config( const QString& fieldName ) const;
1177 
1181  QList< QgsAttributeEditorElement* > &attributeEditorElements();
1185  void clearAttributeEditorWidgets();
1186 
1188  QString attributeAlias( int attributeIndex ) const;
1189 
1191  QString attributeDisplayName( int attributeIndex ) const;
1192 
1193  const QMap< QString, QString >& attributeAliases() const { return mAttributeAliasMap; }
1194 
1195  const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttributesWMS; }
1196  void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttributesWMS = att; }
1197 
1198  const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttributesWFS; }
1199  void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttributesWFS = att; }
1200 
1202  bool deleteAttribute( int attr );
1203 
1211  bool deleteAttributes( QList<int> attrs );
1212 
1214  bool addFeatures( QgsFeatureList features, bool makeSelected = true );
1215 
1217  bool deleteFeature( QgsFeatureId fid );
1218 
1234  bool commitChanges();
1235  const QStringList &commitErrors();
1236 
1240  bool rollBack( bool deleteBuffer = true );
1241 
1247  Q_DECL_DEPRECATED EditType editType( int idx );
1248 
1254  Q_DECL_DEPRECATED void setEditType( int idx, EditType edit );
1255 
1257  EditorLayout editorLayout();
1258 
1260  void setEditorLayout( EditorLayout editorLayout );
1261 
1290  void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1291 
1307  void setEditorWidgetV2Config( int attrIdx, const QgsEditorWidgetConfig& config );
1308 
1314  Q_DECL_DEPRECATED void setCheckedState( int idx, QString checked, QString notChecked );
1315 
1317  QString editForm();
1318 
1320  void setEditForm( QString ui );
1321 
1324  QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { return mFeatureFormSuppress; }
1325 
1328  void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { mFeatureFormSuppress = s; }
1329 
1331  QString annotationForm() const { return mAnnotationForm; }
1332 
1334  void setAnnotationForm( const QString& ui );
1335 
1337  QString editFormInit();
1338 
1340  void setEditFormInit( QString function );
1341 
1346  Q_DECL_DEPRECATED QMap<QString, QVariant> valueMap( int idx );
1347 
1353  Q_DECL_DEPRECATED RangeData range( int idx );
1354 
1356  ValueRelationData valueRelation( int idx );
1357 
1364  QList<QgsRelation> referencingRelations( int idx );
1365 
1371  Q_DECL_DEPRECATED QString dateFormat( int idx );
1372 
1378  Q_DECL_DEPRECATED QSize widgetSize( int idx );
1379 
1381  bool fieldEditable( int idx );
1382 
1384  bool labelOnTop( int idx );
1385 
1387  void setFieldEditable( int idx, bool editable );
1388 
1390  void setLabelOnTop( int idx, bool onTop );
1391 
1393  QgsVectorLayerEditBuffer* editBuffer() { return mEditBuffer; }
1394 
1399  void beginEditCommand( QString text );
1400 
1402  void endEditCommand();
1403 
1405  void destroyEditCommand();
1406 
1408  int fieldNameIndex( const QString& fieldName ) const;
1409 
1412  {
1415  NoMarker
1416  };
1417 
1419  static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
1420 
1422  void updateFields();
1423 
1425  void createJoinCaches();
1426 
1431  void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 );
1432 
1434  QVariant minimumValue( int index );
1435 
1437  QVariant maximumValue( int index );
1438 
1439  /* Set the blending mode used for rendering each feature */
1440  void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
1441  /* Returns the current blending mode for features */
1442  QPainter::CompositionMode featureBlendMode() const;
1443 
1444  /* Set the transparency for the vector layer */
1445  void setLayerTransparency( int layerTransparency );
1446  /* Returns the current transparency for the vector layer */
1447  int layerTransparency() const;
1448 
1449  QString metadata();
1450 
1452  inline QgsGeometryCache* cache() { return mCache; }
1453 
1457  void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
1461  inline const QgsVectorSimplifyMethod& simplifyMethod() const { return mSimplifyMethod; }
1462 
1467  bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
1468 
1469  public slots:
1477  void select( const QgsFeatureId &featureId );
1478 
1486  void select( const QgsFeatureIds& featureIds );
1487 
1495  void deselect( const QgsFeatureId featureId );
1496 
1504  void deselect( const QgsFeatureIds& featureIds );
1505 
1511  void removeSelection();
1512 
1516  virtual void updateExtents();
1517 
1519  void checkJoinLayerRemove( QString theLayerId );
1520 
1521  protected slots:
1522  void invalidateSymbolCountedFlag();
1523 
1524  signals:
1525 
1533  void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
1534 
1536  void selectionChanged();
1537 
1539  void layerModified();
1540 
1542  void beforeModifiedCheck() const;
1543 
1545  void editingStarted();
1546 
1548  void editingStopped();
1549 
1551  void beforeCommitChanges();
1552 
1554  void beforeRollBack();
1555 
1564  void attributeAdded( int idx );
1573  void attributeDeleted( int idx );
1574  void featureAdded( QgsFeatureId fid );
1575  void featureDeleted( QgsFeatureId fid );
1580  void updatedFields();
1581  void layerDeleted();
1582 
1583  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
1584  void geometryChanged( QgsFeatureId fid, QgsGeometry &geom );
1585 
1587  void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
1588  void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
1589  void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
1590  void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
1591  void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1592  void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
1593 
1594  void saveLayerToProject();
1595 
1597  void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfamily );
1598 
1600  void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
1601 
1603  void layerTransparencyChanged( int layerTransparency );
1604 
1610  void editCommandStarted( const QString& text );
1611 
1617  void editCommandEnded();
1618 
1624  void editCommandDestroyed();
1625 
1635  void readCustomSymbology( const QDomElement& element, QString& errorMessage );
1636 
1646  void writeCustomSymbology( QDomElement& element, QDomDocument& doc, QString& errorMessage ) const;
1647 
1648  private slots:
1649  void onRelationsLoaded();
1650  void onJoinedFieldsChanged();
1651 
1652  protected:
1654  void setExtent( const QgsRectangle &rect );
1655 
1656  private: // Private methods
1657 
1659  QgsVectorLayer( const QgsVectorLayer & rhs );
1660 
1662  QgsVectorLayer & operator=( QgsVectorLayer const & rhs );
1663 
1668  bool setDataProvider( QString const & provider );
1669 
1671  QgsFeatureId findFreeId();
1672 
1681  void snapToGeometry( const QgsPoint& startPoint,
1682  QgsFeatureId featureId,
1683  QgsGeometry* geom,
1684  double sqrSnappingTolerance,
1685  QMultiMap<double, QgsSnappingResult>& snappingResults,
1686  QgsSnapper::SnappingType snap_to ) const;
1687 
1689  //void addJoinedAttributes( QgsFeature& f, bool all = false );
1690 
1692  void readSldLabeling( const QDomNode& node );
1693 
1694  private: // Private attributes
1695 
1697  QgsVectorDataProvider *mDataProvider;
1698 
1700  QString mDisplayField;
1701 
1703  QString mDisplayExpression;
1704 
1706  QString mProviderKey;
1707 
1709  QgsAttributeAction* mActions;
1710 
1712  bool mReadOnly;
1713 
1718  QgsFeatureIds mSelectedFeatureIds;
1719 
1721  QgsFields mUpdatedFields;
1722 
1724  QMap< QString, QString > mAttributeAliasMap;
1725 
1727  QList< QgsAttributeEditorElement* > mAttributeEditorElements;
1728 
1730  QSet<QString> mExcludeAttributesWMS;
1732  QSet<QString> mExcludeAttributesWFS;
1733 
1735  QList< TabData > mTabs;
1736 
1738  QGis::WkbType mWkbType;
1739 
1741  QgsFeatureRendererV2 *mRendererV2;
1742 
1744  QgsVectorSimplifyMethod mSimplifyMethod;
1745 
1747  QgsLabel *mLabel;
1748 
1750  bool mLabelOn;
1751 
1753  bool mLabelFontNotFoundNotified;
1754 
1756  QPainter::CompositionMode mFeatureBlendMode;
1757 
1759  int mLayerTransparency;
1760 
1762  QgsVectorLayer::VertexMarkerType mCurrentVertexMarkerType;
1763 
1765  int mCurrentVertexMarkerSize;
1766 
1768  bool mVertexMarkerOnlyForSelection;
1769 
1770  QStringList mCommitErrors;
1771 
1772  QMap< QString, bool> mFieldEditables;
1773  QMap< QString, bool> mLabelOnTop;
1774 
1775  QMap<QString, QString> mEditorWidgetV2Types;
1776  QMap<QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs;
1777 
1779  EditorLayout mEditorLayout;
1780 
1781  QString mEditForm, mEditFormInit;
1782 
1785  QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress;
1786 
1787  //annotation form for this layer
1788  QString mAnnotationForm;
1789 
1791  QgsGeometryCache* mCache;
1792 
1794  QgsVectorLayerEditBuffer* mEditBuffer;
1796 
1797  //stores information about joined layers
1798  QgsVectorLayerJoinBuffer* mJoinBuffer;
1799 
1801  QgsExpressionFieldBuffer* mExpressionFieldBuffer;
1802 
1803  //diagram rendering object. 0 if diagram drawing is disabled
1804  QgsDiagramRendererV2* mDiagramRenderer;
1805 
1806  //stores infos about diagram placement (placement type, priority, position distance)
1807  QgsDiagramLayerSettings *mDiagramLayerSettings;
1808 
1809  bool mValidExtent;
1810  bool mLazyExtent;
1811 
1812  // Features in renderer classes counted
1813  bool mSymbolFeatureCounted;
1814 
1815  // Feature counts for each renderer symbol
1816  QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap;
1817 
1819 };
1820 
1821 #endif
virtual bool isEditable() const
True if the layer can be edited.
Wrapper for iterator of features from vector data provider or vector layer.
QString annotationForm() const
get annotation form
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:315
static unsigned index
A rectangle specified with double values.
Definition: qgsrectangle.h:35
Base class for all map layer types.
Definition: qgsmaplayer.h:48
QString joinFieldName
Join field in the source layer.
const QSet< QString > & excludeAttributesWMS() const
void setExcludeAttributesWFS(const QSet< QString > &att)
virtual QString metadata()
Obtain Metadata for this layer.
QString targetFieldName
Join field in the target layer.
virtual void drawLabels(QgsRenderContext &rendererContext)
Draw labels.
virtual bool isGroupBox() const
RangeData(QVariant theMin, QVariant theMax, QVariant theStep)
QgsAttributeAction * actions()
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:317
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:322
EditorLayout
The different types to layout the attribute editor.
Manages an editor widget Widget and wrapper share the same parent.
void setExcludeAttributesWMS(const QSet< QString > &att)
int joinFieldIndex
Join field index in the source layer.
virtual bool readSymbology(const QDomNode &node, QString &errorMessage)=0
Read the symbology for the current layer from the Dom node supplied.
Storage and management of actions associated with Qgis layer attributes.
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings for fast rendering of features.
virtual void reload()
Synchronises with changes in the datasource.
Definition: qgsmaplayer.h:128
QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const
Type of feature form pop-up suppression after feature creation (overrides app setting) ...
FeatureFormSuppress
Types of feature form suppression after feature creation.
SimplifyHint
Simplification flags for fast rendering of features.
Container of fields for a vector layer.
Definition: qgsfield.h:172
GeometryType
Definition: qgis.h:155
virtual ~QgsAttributeEditorElement()
virtual QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext)
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context...
Definition: qgsmaplayer.h:133
WkbType
Used for symbology operations.
Definition: qgis.h:53
const QgsRelation & relation() const
bool memoryCache
True if the join is cached in virtual memory.
int targetFieldIndex
Join field index in the target layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:113
const QgsDiagramLayerSettings * diagramLayerSettings() const
QgsAttributeEditorField(QString name, int idx, QObject *parent)
TabData(QString name, QList< QString > fields, QList< GroupData > groups)
virtual bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage) const =0
Write the symbology for the layer into the docment provided.
QgsGeometryCache * cache()
QgsAttributeEditorRelation(QString name, const QString &relationId, QObject *parent)
Returns diagram settings for a feature.
Manages joined fields for a vector layer.
virtual bool draw(QgsRenderContext &rendererContext)
This is the method that does the actual work of drawing the layer onto a paint device.
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:34
SnappingType
Snap to vertex, to segment or both.
Definition: qgssnapper.h:66
QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on...
void setJoinFieldNamesSubset(QStringList *fieldNamesSubset)
Set subset of fields to be used from joined layer.
bool operator==(const QgsVectorJoinInfo &other) const
value map from an table
virtual bool writeXml(QDomNode &layer_node, QDomDocument &document)
called by writeLayerXML(), used by children to write state specific to them to project files...
const QSet< QString > & excludeAttributesWFS() const
VertexMarkerType
Editing vertex markers.
virtual void setExtent(const QgsRectangle &rect)
Set the extent.
The attribute value should not be changed in the attribute form.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QList< int > QgsAttributeList
AttributeEditorType type() const
QSharedPointer< QStringList > joinFieldsSubset
Subset of fields to use from joined layer.
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:33
const QMap< QString, QString > & attributeAliases() const
const QgsDiagramRendererV2 * diagramRenderer() const
A class to represent a point.
Definition: qgspoint.h:63
virtual bool readSld(const QDomNode &node, QString &errorMessage)
Definition: qgsmaplayer.h:343
QList< QgsAttributeEditorElement * > children() const
Partial snapshot of vector layer's state (only the members necessary for access to features) ...
QList< QString > mFields
A class to render labels.
Definition: qgslabel.h:51
modularized edit widgets
This class contains information how to simplify geometries fetched from a vector layer.
Contains information about the context of a rendering operation.
ValueRelationData(QString layer, QString key, QString value, bool allowNull, bool orderByValue, bool allowMulti=false, QString filterExpression=QString::null)
Buffers information about expression fields for a vector layer.
virtual QDomElement toDomElement(QDomDocument &doc) const =0
QHash< QString, QgsAttributes > cachedAttributes
Cache for joined attributes to provide fast lookup (size is 0 if no memory caching) ...
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Definition: qgsfeature.h:312
The attribute value should not be shown in the attribute form.
GroupData(QString name, QList< QString > fields)
virtual void setIsGroupBox(bool isGroupBox)
This class manages a set of relations between layers.
virtual bool readXml(const QDomNode &layer_node)
called by readLayerXML(), used by children to read state specific to them from project files...
uuid generator - readonly and automatically intialized
QgsAttributeEditorRelation(QString name, const QgsRelation &relation, QObject *parent)
Class for doing transforms between two map coordinate systems.
void setSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Set the simplification settings for fast rendering of features.
QMap< QString, QVariant > QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
qint64 QgsFeatureId
Definition: qgsfeature.h:30
Base class for utility classes that encapsulate information necessary for rendering of map layers...
void setFeatureFormSuppress(QgsVectorLayer::FeatureFormSuppress s)
Set type of feature form pop-up suppression after feature creation (overrides app setting) ...
QStringList * joinFieldNamesSubset() const
Get subset of fields to be used from joined layer.
virtual QString loadNamedStyle(const QString &theURI, bool &theResultFlag)
Retrieve a named style for this layer if one exists (either as a .qml file on disk or as a record in ...
QList< QString > mFields
QgsAttributeEditorElement(AttributeEditorType type, QString name, QObject *parent=NULL)
QSet< int > QgsAttributeIds
QgsAttributeEditorContainer(QString name, QObject *parent)
This is the base class for vector data providers.
QList< int > QgsAttributeList
virtual QgsRectangle extent()
Return the extent of the layer.
Represents a vector layer which manages a vector based data sets.
QString joinLayerId
Source layer.
AttributeEditorType mType
Abstract base class for simplify geometries using a specific algorithm.
QList< GroupData > mGroups