1
/***************************************************************************
5
copyright : (C) 2005 by Radim Blazek
7
***************************************************************************/
9
/***************************************************************************
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. *
16
***************************************************************************/
17
/* $Id: qgscomposer.h,v 1.6 2005/04/05 12:22:02 rabla Exp $ */
21
#include "qgscomposerbase.h"
23
#include "qgscomposerbase.uic.h"
26
#include "qgscomposerview.h"
27
#include "qgscomposition.h"
36
class QgsComposerItem;
38
/* The constructor creates empty composer, without compositions and mFirstTime set to true.
39
* - if signal projectRead() is recieved all old compositions are deleted and
40
* - if the composition exists in project it is created from project settings (mFirstTime set to false)
41
* - if the composition does not exist in project
42
* - if the composer is visible new default composition is created (mFirstTime set to false)
43
* - if the composer is not visible the composer is left empty (mFirstTime set to true)
44
* - if signal newProject() is recieved all old compositions are deleted and
45
* - if the composer is visible a new default composition is created (mFirstTime set to false)
46
* - if the composer is not visible the composer is left empty (mFirstTime set to true)
48
* If open() is called and mFirstTime == true, a new default composition is created.
51
class QgsComposer: public QgsComposerBase
56
QgsComposer(QgisApp *qgis);
59
//! Open and show, set defaults if first time
62
//! Zoom to full extent of the paper
74
//! Return pointer to map canvas
75
QgsMapCanvas *mapCanvas( void );
77
//! Return pointer to composer view
78
QgsComposerView *view ( void );
80
//! Return current composition
81
QgsComposition *composition(void);
83
//! Show composition options in widget
84
void showCompositionOptions ( QWidget *w );
86
//! Show item options in widget
87
void showItemOptions ( QWidget *w );
89
/** \brief stores statei in project */
90
bool writeSettings ( void );
92
/** \brief read state from project */
93
bool readSettings ( void );
95
//! Stores state in DOM node
96
bool writeXML( QDomNode & node, QDomDocument & doc);
98
//! Sets state from DOM document
99
bool readXML( QDomNode & node );
101
//! Save window state
102
void saveWindowState();
104
//! Restore the window and toolbar state
105
void restoreWindowState();
108
void moveEvent ( QMoveEvent * );
111
void resizeEvent ( QResizeEvent * );
114
//! Print the composition
124
void selectItem(void);
129
//! Add new vector legend
130
void addVectorLegend(void);
136
void addScalebar(void);
145
//! remove widget childrens
146
void removeWidgetChildren ( QWidget *w );
149
void setToolActionsOff (void);
151
//! Pointer to composer view
152
QgsComposerView *mView;
154
//! Current composition
155
QgsComposition *mComposition;
160
//! Pointer to QGIS application
163
//! The composer was opened first time (-> set defaults)
167
QGridLayout *mCompositionOptionsLayout;
170
QGridLayout *mItemOptionsLayout;