~ubuntu-branches/ubuntu/hardy/qgis/hardy

« back to all changes in this revision

Viewing changes to src/qgscomposer.h

  • Committer: Bazaar Package Importer
  • Author(s): William Grant
  • Date: 2007-05-06 13:42:32 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070506134232-pyli6t388w5asd8x
Tags: 0.8.0-3ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - debian/rules, debian/qgis.install, debian/qgis.dirs debian/qgis.desktop:
    Add and install .desktop.
* debian/qgis.desktop: Remove Applications category; it's not real.
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
                         qgscomposer.h
3
 
                             -------------------
4
 
    begin                : January 2005
5
 
    copyright            : (C) 2005 by Radim Blazek
6
 
    email                : blazek@itc.it
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
 
/* $Id: qgscomposer.h,v 1.6 2005/04/05 12:22:02 rabla Exp $ */
18
 
#ifndef QGSCOMPOSER_H
19
 
#define QGSCOMPOSER_H
20
 
#ifdef WIN32
21
 
#include "qgscomposerbase.h"
22
 
#else
23
 
#include "qgscomposerbase.uic.h"
24
 
#endif
25
 
 
26
 
#include "qgscomposerview.h"
27
 
#include "qgscomposition.h"
28
 
 
29
 
class QGridLayout;
30
 
class QPrinter;
31
 
class QDomNode;
32
 
class QDomDocument;
33
 
class QMoveEvent;
34
 
class QResizeEvent;
35
 
class QgisApp;
36
 
class QgsComposerItem;
37
 
 
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)
47
 
 *         
48
 
 * If open() is called and mFirstTime == true, a new default composition is created.
49
 
 *
50
 
 */
51
 
class QgsComposer: public QgsComposerBase
52
 
{
53
 
    Q_OBJECT
54
 
 
55
 
public:
56
 
    QgsComposer(QgisApp *qgis);
57
 
    ~QgsComposer();
58
 
    
59
 
    //! Open and show, set defaults if first time
60
 
    void open();
61
 
 
62
 
    //! Zoom to full extent of the paper
63
 
    void zoomFull();
64
 
 
65
 
    //! Zoom in
66
 
    void zoomIn();
67
 
 
68
 
    //! Zoom out 
69
 
    void zoomOut();
70
 
 
71
 
    //! Refresh view 
72
 
    void refresh();
73
 
 
74
 
    //! Return pointer to map canvas
75
 
    QgsMapCanvas *mapCanvas( void );
76
 
    
77
 
    //! Return pointer to composer view
78
 
    QgsComposerView *view ( void );
79
 
 
80
 
    //! Return current composition
81
 
    QgsComposition *composition(void);
82
 
 
83
 
    //! Show composition options in widget
84
 
    void showCompositionOptions ( QWidget *w );
85
 
    
86
 
    //! Show item options in widget
87
 
    void showItemOptions ( QWidget *w );
88
 
 
89
 
    /** \brief stores statei in project */
90
 
    bool writeSettings ( void );
91
 
 
92
 
    /** \brief read state from project */
93
 
    bool readSettings ( void );
94
 
 
95
 
    //! Stores state in DOM node
96
 
    bool writeXML( QDomNode & node, QDomDocument & doc);
97
 
 
98
 
    //! Sets state from DOM document
99
 
    bool readXML( QDomNode & node );
100
 
 
101
 
    //! Save window state
102
 
    void saveWindowState();
103
 
 
104
 
    //! Restore the window and toolbar state
105
 
    void restoreWindowState();
106
 
 
107
 
    //! Move event
108
 
    void moveEvent ( QMoveEvent * );
109
 
    
110
 
    //! Resize event
111
 
    void resizeEvent ( QResizeEvent * );
112
 
 
113
 
public slots:
114
 
    //! Print the composition
115
 
    void print(void);
116
 
    
117
 
    //! Print as image
118
 
    void image(void);
119
 
    
120
 
    //! Print as SVG
121
 
    void svg(void);
122
 
    
123
 
    //! Select item
124
 
    void selectItem(void);
125
 
    
126
 
    //! Add new map
127
 
    void addMap(void);
128
 
 
129
 
    //! Add new vector legend
130
 
    void addVectorLegend(void);
131
 
    
132
 
    //! Add new label
133
 
    void addLabel(void);
134
 
    
135
 
    //! Add new scalebar
136
 
    void addScalebar(void);
137
 
 
138
 
    //! read project
139
 
    void projectRead();
140
 
 
141
 
    //! New project
142
 
    void newProject();
143
 
 
144
 
private:
145
 
    //! remove widget childrens
146
 
    void removeWidgetChildren ( QWidget *w );
147
 
 
148
 
    //! Set buttons up
149
 
    void setToolActionsOff (void);
150
 
 
151
 
    //! Pointer to composer view
152
 
    QgsComposerView *mView;
153
 
 
154
 
    //! Current composition
155
 
    QgsComposition *mComposition;
156
 
    
157
 
    //! Printer
158
 
    QPrinter *mPrinter;
159
 
 
160
 
    //! Pointer to QGIS application
161
 
    QgisApp *mQgis;
162
 
 
163
 
    //! The composer was opened first time (-> set defaults)
164
 
    bool mFirstTime;
165
 
 
166
 
    //! Layout 
167
 
    QGridLayout *mCompositionOptionsLayout;
168
 
 
169
 
    //! Layout
170
 
    QGridLayout *mItemOptionsLayout;
171
 
};
172
 
 
173
 
#endif