QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qgslegendsettings.h
Go to the documentation of this file.
1 #ifndef QGSLEGENDSETTINGS_H
2 #define QGSLEGENDSETTINGS_H
3 
4 #include <QColor>
5 #include <QSizeF>
6 
8 
16 class CORE_EXPORT QgsLegendSettings
17 {
18  public:
20 
21  void setTitle( const QString& t ) { mTitle = t; }
22  QString title() const { return mTitle; }
23 
28  Qt::AlignmentFlag titleAlignment() const { return mTitleAlignment; }
33  void setTitleAlignment( Qt::AlignmentFlag alignment ) { mTitleAlignment = alignment; }
34 
38  QgsComposerLegendStyle style( QgsComposerLegendStyle::Style s ) const { return mStyleMap.value( s ); }
39  void setStyle( QgsComposerLegendStyle::Style s, const QgsComposerLegendStyle style ) { mStyleMap[s] = style; }
40 
41  double boxSpace() const {return mBoxSpace;}
42  void setBoxSpace( double s ) {mBoxSpace = s;}
43 
44  void setWrapChar( const QString& t ) {mWrapChar = t;}
45  QString wrapChar() const {return mWrapChar;}
46 
47  double columnSpace() const {return mColumnSpace;}
48  void setColumnSpace( double s ) { mColumnSpace = s;}
49 
50  int columnCount() const { return mColumnCount; }
51  void setColumnCount( int c ) { mColumnCount = c;}
52 
53  int splitLayer() const { return mSplitLayer; }
54  void setSplitLayer( bool s ) { mSplitLayer = s;}
55 
56  int equalColumnWidth() const { return mEqualColumnWidth; }
57  void setEqualColumnWidth( bool s ) { mEqualColumnWidth = s;}
58 
59  QColor fontColor() const {return mFontColor;}
60  void setFontColor( const QColor& c ) {mFontColor = c;}
61 
62  QSizeF symbolSize() const {return mSymbolSize;}
63  void setSymbolSize( QSizeF s ) {mSymbolSize = s;}
64 
65  QSizeF wmsLegendSize() const {return mWmsLegendSize;}
66  void setWmsLegendSize( QSizeF s ) {mWmsLegendSize = s;}
67 
68  double lineSpacing() const { return mLineSpacing; }
69  void setLineSpacing( double s ) { mLineSpacing = s; }
70 
71  double mmPerMapUnit() const { return mMmPerMapUnit; }
72  void setMmPerMapUnit( double mmPerMapUnit ) { mMmPerMapUnit = mmPerMapUnit; }
73 
74  bool useAdvancedEffects() const { return mUseAdvancedEffects; }
75  void setUseAdvancedEffects( bool use ) { mUseAdvancedEffects = use; }
76 
77  private:
78 
79  QString mTitle;
80 
82  Qt::AlignmentFlag mTitleAlignment;
83 
84  QString mWrapChar;
85 
86  QColor mFontColor;
87 
89  qreal mBoxSpace;
90 
92  QSizeF mSymbolSize;
93 
96 
98  double mLineSpacing;
99 
101  double mColumnSpace;
102 
105 
108 
111 
112  QMap<QgsComposerLegendStyle::Style, QgsComposerLegendStyle> mStyleMap;
113 
116 
119 };
120 
121 #endif // QGSLEGENDSETTINGS_H
void setTitleAlignment(Qt::AlignmentFlag alignment)
Sets the alignment of the legend title.
QString wrapChar() const
void setWrapChar(const QString &t)
double boxSpace() const
void setEqualColumnWidth(bool s)
void setBoxSpace(double s)
void setMmPerMapUnit(double mmPerMapUnit)
double mMmPerMapUnit
Conversion ratio between millimeters and map units - for symbols with size given in map units...
double lineSpacing() const
QgsComposerLegendStyle & rstyle(QgsComposerLegendStyle::Style s)
Returns reference to modifiable style.
int columnCount() const
void setSymbolSize(QSizeF s)
QMap< QgsComposerLegendStyle::Style, QgsComposerLegendStyle > mStyleMap
double columnSpace() const
double mmPerMapUnit() const
QgsComposerLegendStyle style(QgsComposerLegendStyle::Style s) const
Returns style.
QSizeF mWmsLegendSize
Width and height of WMS legendGraphic pixmap.
QColor fontColor() const
int splitLayer() const
The QgsLegendSettings class stores the appearance and layout settings for legend drawing with QgsLege...
void setTitle(const QString &t)
void setFontColor(const QColor &c)
void setColumnSpace(double s)
void setStyle(QgsComposerLegendStyle::Style s, const QgsComposerLegendStyle style)
void setLineSpacing(double s)
Qt::AlignmentFlag titleAlignment() const
Returns the alignment of the legend title.
Composer legend components style.
bool mSplitLayer
Allow splitting layers into multiple columns.
void setWmsLegendSize(QSizeF s)
void setUseAdvancedEffects(bool use)
bool useAdvancedEffects() const
QSizeF mSymbolSize
Width and height of symbol icon.
bool mEqualColumnWidth
Use the same width (maximum) for all columns.
double mColumnSpace
Space between columns.
void setColumnCount(int c)
QString title() const
Qt::AlignmentFlag mTitleAlignment
Title alignment, one of Qt::AlignLeft, Qt::AlignHCenter, Qt::AlignRight)
QSizeF symbolSize() const
QSizeF wmsLegendSize() const
int equalColumnWidth() const
qreal mBoxSpace
Space between item box and contents.
int mColumnCount
Number of legend columns.
void setSplitLayer(bool s)
double mLineSpacing
Spacing between lines when wrapped.
bool mUseAdvancedEffects
Whether to use advanced effects like transparency for symbols - may require their rasterization...