QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgscomposerframe.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscomposerframe.h
3  ------------------------------------------------------------
4  begin : July 2012
5  copyright : (C) 2012 by Marco Hugentobler
6  email : marco dot hugentobler at sourcepole dot ch
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 
16 #ifndef QGSCOMPOSERFRAME_H
17 #define QGSCOMPOSERFRAME_H
18 
19 #include "qgscomposeritem.h"
20 
21 class QgsComposition;
23 
25 class CORE_EXPORT QgsComposerFrame: public QgsComposerItem
26 {
27  public:
28  QgsComposerFrame( QgsComposition* c, QgsComposerMultiFrame* mf, qreal x, qreal y, qreal width, qreal height );
30 
32  void setContentSection( const QRectF& section ) { mSection = section; }
33 
34  void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
35 
36  void beginItemCommand( const QString& text );
37  void endItemCommand();
38 
39  bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
40  bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
41 
42  int type() const { return ComposerFrame; }
43 
44  QgsComposerMultiFrame* multiFrame() const { return mMultiFrame; }
45 
46 
47  private:
48  QgsComposerFrame(); //forbidden
50  QRectF mSection;
51 };
52 
53 #endif // QGSCOMPOSERFRAME_H