QGIS API Documentation  2.5.0-Master
 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  private:
47  QgsComposerFrame(); //forbidden
49  QRectF mSection;
50 };
51 
52 #endif // QGSCOMPOSERFRAME_H
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
virtual void beginItemCommand(const QString &text)
A item that forms part of a map composition.
QgsComposerMultiFrame * mMultiFrame
Abstract base class for composer entries with the ability to distribute the content to several frames...
Graphics scene for map printing.
Frame for html, table, text which can be divided onto several frames.
virtual void endItemCommand()
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)
Sets item state from DOM element.
void setContentSection(const QRectF &section)
Sets the part of this frame (relative to the total multiframe extent in mm)
QgsComposerMultiFrame * multiFrame() const
int type() const
return correct graphics item type.