QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
qgscomposermapoverview.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscomposermapoverview.h
3  --------------------
4  begin : July 2014
5  copyright : (C) 2014 by Nyall Dawson
6  email : nyall dot dawson at gmail dot 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 QGSCOMPOSERMAPOVERVIEW_H
19 #define QGSCOMPOSERMAPOVERVIEW_H
20 
21 #include "qgscomposermap.h"
22 #include <QString>
23 #include <QObject>
24 
25 class QDomDocument;
26 class QDomElement;
27 class QPainter;
28 class QgsFillSymbolV2;
29 
30 class CORE_EXPORT QgsComposerMapOverview : public QObject
31 {
32  Q_OBJECT
33 
34  public:
35 
36  QgsComposerMapOverview( const QString& name, QgsComposerMap* map );
38 
39  void drawOverview( QPainter* painter ) const;
40 
45  bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
46 
51  bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
52 
53  void setName( const QString& name ) { mName = name; }
54  QString name() const { return mName; }
55 
56  QString id() const { return mUuid; }
57 
58  void setEnabled( const bool enabled ) { mEnabled = enabled; }
59  bool enabled() const { return mEnabled; }
60 
64  void setFrameMap( const int mapId );
65 
69  int frameMapId() const { return mFrameMapId; }
70 
71  void setFrameSymbol( QgsFillSymbolV2* symbol );
72 
73  QgsFillSymbolV2* frameSymbol() { return mFrameSymbol; }
74  const QgsFillSymbolV2* frameSymbol() const { return mFrameSymbol; }
75 
77  QPainter::CompositionMode blendMode() const { return mBlendMode; }
78 
80  void setBlendMode( const QPainter::CompositionMode blendMode );
81 
83  bool inverted() const { return mInverted; }
84 
86  void setInverted( const bool inverted );
87 
89  bool centered() const { return mCentered; }
90 
92  void setCentered( const bool centered );
93 
97  void connectSignals();
98 
99  public slots:
100 
101  void overviewExtentChanged();
102 
103  private:
104  QgsComposerMapOverview(); //forbidden
105 
106  QgsComposerMap* mComposerMap;
107  QString mName;
108  QString mUuid;
109 
110  bool mEnabled;
111 
113  int mFrameMapId;
114 
116  QgsFillSymbolV2* mFrameSymbol;
117 
119  QPainter::CompositionMode mBlendMode;
120 
121  bool mInverted;
122 
124  bool mCentered;
125 
126  void createDefaultFrameSymbol();
127 };
128 
129 #endif // QGSCOMPOSERMAPOVERVIEW_H
bool centered() const
Returns true if the extent is forced to center on the overview.
Definition: qgscomposermapoverview.h:89
QString id() const
Definition: qgscomposermapoverview.h:56
Definition: qgssymbolv2.h:275
void setEnabled(const bool enabled)
Definition: qgscomposermapoverview.h:58
bool enabled() const
Definition: qgscomposermapoverview.h:59
Definition: qgscomposermapoverview.h:30
QgsFillSymbolV2 * frameSymbol()
Definition: qgscomposermapoverview.h:73
QPainter::CompositionMode blendMode() const
Returns the overview's blending mode.
Definition: qgscomposermapoverview.h:77
void setName(const QString &name)
Definition: qgscomposermapoverview.h:53
Object representing map window.
Definition: qgscomposermap.h:45
QString name() const
Definition: qgscomposermapoverview.h:54
const QgsFillSymbolV2 * frameSymbol() const
Definition: qgscomposermapoverview.h:74
int frameMapId() const
Returns id of overview frame (or -1 if no overfiew frame)
Definition: qgscomposermapoverview.h:69
bool inverted() const
Returns true if the overview frame is inverted.
Definition: qgscomposermapoverview.h:83