QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsvectorlayerlabeling.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayerlabeling.h
3  ---------------------
4  begin : September 2015
5  copyright : (C) 2015 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSVECTORLAYERLABELING_H
16 #define QGSVECTORLAYERLABELING_H
17 
18 #include <QString>
19 #include <QStringList>
20 
21 class QDomDocument;
22 class QDomElement;
23 
25 class QgsVectorLayer;
27 
36 {
37  public:
38 
40 
42  virtual QString type() const = 0;
43 
45  virtual QgsVectorLayerLabelProvider* provider( QgsVectorLayer* layer ) const = 0;
46 
48  virtual QDomElement save( QDomDocument& doc ) const = 0;
49 
51  virtual QStringList subProviders() const { return QStringList( QString() ); }
52 
55  virtual QgsPalLayerSettings settings( QgsVectorLayer* layer, const QString& providerId = QString() ) const = 0;
56 
57  // static stuff
58 
60  static QgsAbstractVectorLayerLabeling* create( const QDomElement& element );
61 };
62 
73 {
74  public:
75 
76  virtual QString type() const override;
77  virtual QgsVectorLayerLabelProvider* provider( QgsVectorLayer* layer ) const override;
78  virtual QDomElement save( QDomDocument& doc ) const override;
79  virtual QgsPalLayerSettings settings( QgsVectorLayer* layer, const QString& providerId = QString() ) const override;
80 };
81 
82 #endif // QGSVECTORLAYERLABELING_H
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
virtual QgsPalLayerSettings settings(QgsVectorLayer *layer, const QString &providerId=QString()) const =0
Get associated label settings.
virtual QStringList subProviders() const
Get list of sub-providers within the layer&#39;s labeling.
virtual QDomElement save(QDomDocument &doc) const =0
Return labeling configuration as XML element.
Abstract base class - its implementations define different approaches to the labeling of a vector lay...
Basic implementation of the labeling interface.
virtual QString type() const =0
Unique type string of the labeling configuration implementation.
Represents a vector layer which manages a vector based data sets.
virtual QgsVectorLayerLabelProvider * provider(QgsVectorLayer *layer) const =0
Factory for label provider implementation.