~ubuntu-branches/ubuntu/edgy/koffice/edgy-updates

« back to all changes in this revision

Viewing changes to lib/kofficeui/koPageLayoutDia.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040509113300-xi5t1z4yxe7n03x7
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <qgroupbox.h>
26
26
 
27
27
#include <koGlobal.h>
 
28
#include <koUnit.h>
28
29
#include <kdialogbase.h>
29
30
 
30
31
class QButtonGroup;
35
36
class QLineEdit;
36
37
class QSpinBox;
37
38
class QRadioButton;
 
39
class QCheckBox;
 
40
class KDoubleNumInput;
38
41
 
39
 
// enums
40
 
const int FORMAT_AND_BORDERS = 1;
41
 
const int HEADER_AND_FOOTER = 2;
42
 
const int COLUMNS = 4;
43
 
const int DISABLE_BORDERS = 8;
44
 
const int KW_HEADER_AND_FOOTER = 16;
45
 
const int DISABLE_UNIT = 32;
 
42
enum { FORMAT_AND_BORDERS = 1, HEADER_AND_FOOTER = 2, COLUMNS = 4, DISABLE_BORDERS = 8,
 
43
       KW_HEADER_AND_FOOTER = 16, DISABLE_UNIT = 32 };
46
44
 
47
45
/**
48
46
 *  KoPagePreview.
57
55
    /**
58
56
     *  constructor
59
57
     */
60
 
    KoPagePreview( QWidget*, const char*, KoPageLayout );
 
58
    KoPagePreview( QWidget*, const char*, const KoPageLayout & );
61
59
    /**
62
60
     *  destructor
63
61
     */
87
85
class KoPageLayoutDiaPrivate;
88
86
 
89
87
/**
90
 
 *  With this dialog the user can specify the layout of this paper during printing.
 
88
 *  With this dialog the user can specify the layout of the paper during printing.
91
89
 */
92
90
class KoPageLayoutDia : public KDialogBase
93
91
{
103
101
     *  @param layout   The layout.
104
102
     *  @param headfoot The header and the footer.
105
103
     *  @param tabs     The number of tabs.
 
104
     *  @param unit     The unit to use for displaying the values to the user
106
105
     */
107
 
    KoPageLayoutDia( QWidget* _parent, const char* _name, KoPageLayout _layout, KoHeadFoot _headfoot, int _tabs );
 
106
    KoPageLayoutDia( QWidget* parent, const char* name,
 
107
                     const KoPageLayout& layout,
 
108
                     const KoHeadFoot& headfoot,
 
109
                     int tabs, KoUnit::Unit unit, bool modal=true );
108
110
 
109
111
    /**
110
112
     *  Constructor.
116
118
     *  @param columns    The number of columns on the page.
117
119
     *  @param kwheadfoot The KWord header and footer.
118
120
     *  @param tabs       The number of tabs.
 
121
     *  @param unit       The unit to use for displaying the values to the user
119
122
     */
120
 
    KoPageLayoutDia( QWidget* parent, const char* name, KoPageLayout layout, KoHeadFoot headfoot,
121
 
                    KoColumns columns, KoKWHeaderFooter kwheadfoot, int tabs );
 
123
    KoPageLayoutDia( QWidget* parent, const char* name,
 
124
                     const KoPageLayout& layout,
 
125
                     const KoHeadFoot& headfoot,
 
126
                     const KoColumns& columns,
 
127
                     const KoKWHeaderFooter& kwheadfoot,
 
128
                     int tabs, KoUnit::Unit unit );
122
129
 
123
130
    /**
124
131
     *  Destructor.
127
134
 
128
135
    /**
129
136
     *  Show page layout dialog.
 
137
     *  See constructor for documentation on the parameters
130
138
     */
131
 
    static bool pageLayout( KoPageLayout&, KoHeadFoot&, int );
 
139
    static bool pageLayout( KoPageLayout&, KoHeadFoot&, int tabs, KoUnit::Unit& unit);
132
140
 
133
141
    /**
134
142
     *  Show page layout dialog.
 
143
     *  See constructor for documentation on the parameters
135
144
     */
136
 
    static bool pageLayout( KoPageLayout&, KoHeadFoot&, KoColumns&, KoKWHeaderFooter&, int );
 
145
    static bool pageLayout( KoPageLayout&, KoHeadFoot&, KoColumns&, KoKWHeaderFooter&, int tabs, KoUnit::Unit& unit );
137
146
 
138
147
    /**
139
148
     *  Retrieves a standard page layout.
140
149
     */
141
150
    static KoPageLayout standardLayout();
142
151
 
 
152
    /**
 
153
     *  Returns the layout
 
154
     */
 
155
    KoPageLayout getLayout() { return layout; } // BIC: make const
 
156
 
 
157
    /**
 
158
     *  Returns the header and footer information
 
159
     */
 
160
    KoHeadFoot getHeadFoot(); // BIC: make const
 
161
 
 
162
    /**
 
163
     *  Returns the unit
 
164
     */
 
165
    KoUnit::Unit unit() const { return m_unit; }
 
166
 
143
167
protected:
144
 
    KoPageLayout getLayout() {return layout;};
145
 
    KoHeadFoot getHeadFoot();
146
168
    KoColumns getColumns();
147
169
    KoKWHeaderFooter getKWHeaderFooter();
148
170
 
155
177
    void setupTab4();
156
178
 
157
179
    // update preview
158
 
    void updatePreview( KoPageLayout );
 
180
    void updatePreview( const KoPageLayout& );
159
181
 
160
182
    // dialog objects
161
183
    QComboBox *cpgFormat;
162
 
    QComboBox *cpgOrientation;
163
184
    QComboBox *cpgUnit;
164
 
    QLineEdit *epgWidth;
165
 
    QLineEdit *epgHeight;
166
 
    QLineEdit *ebrLeft;
167
 
    QLineEdit *ebrRight;
168
 
    QLineEdit *ebrTop;
169
 
    QLineEdit *ebrBottom;
 
185
    QRadioButton *rbPortrait;
 
186
    QRadioButton *rbLandscape;
 
187
    KDoubleNumInput *epgWidth;
 
188
    KDoubleNumInput *epgHeight;
 
189
    KDoubleNumInput *ebrLeft;
 
190
    KDoubleNumInput *ebrRight;
 
191
    KDoubleNumInput *ebrTop;
 
192
    KDoubleNumInput *ebrBottom;
170
193
    KoPagePreview *pgPreview;
171
194
    KoPagePreview *pgPreview2;
172
195
    QLineEdit *eHeadLeft;
176
199
    QLineEdit *eFootMid;
177
200
    QLineEdit *eFootRight;
178
201
    QSpinBox *nColumns;
179
 
    QLineEdit *nCSpacing;
180
 
    QLineEdit *nHSpacing;
181
 
    QLineEdit *nFSpacing;
182
 
    QRadioButton *rhSame;
183
 
    QRadioButton *rhFirst;
184
 
    QRadioButton *rhEvenOdd;
185
 
    QRadioButton *rfSame;
186
 
    QRadioButton *rfFirst;
187
 
    QRadioButton *rfEvenOdd;
 
202
    KDoubleNumInput *nCSpacing;
 
203
 
 
204
    KDoubleNumInput *nHSpacing;
 
205
    KDoubleNumInput *nFSpacing;
 
206
    KDoubleNumInput *nFNSpacing;
 
207
    QCheckBox *rhSame_unused; // BIC: remove
 
208
    QCheckBox *rhFirst;
 
209
    QCheckBox *rhEvenOdd;
 
210
    QCheckBox *rfSame_unused; // BIC: remove
 
211
    QCheckBox *rfFirst;
 
212
    QCheckBox *rfEvenOdd;
188
213
 
189
214
    // layout
190
215
    KoPageLayout layout;
192
217
    KoColumns cl;
193
218
    KoKWHeaderFooter kwhf;
194
219
 
 
220
    KoUnit::Unit m_unit;
 
221
 
195
222
    bool retPressed;
196
223
    bool enableBorders;
197
224
    int flags;
198
225
 
199
 
private slots:
200
 
    // take changes
201
 
    void Ok() {}
202
 
 
203
 
    // combos
204
 
    void unitChanged( int );
205
 
    void formatChanged( int );
206
 
    void orientationChanged( int );
 
226
public slots:
207
227
 
208
228
    // linedits
209
229
    void widthChanged();
212
232
    void rightChanged();
213
233
    void topChanged();
214
234
    void bottomChanged();
 
235
 
 
236
protected slots:
 
237
    virtual void slotOk();
 
238
 
 
239
private slots:
 
240
    // combos and radios
 
241
    void unitChanged( int );
 
242
    void formatChanged( int );
 
243
    void orientationChanged();
 
244
 
215
245
    void rPressed() {retPressed = true;}
216
246
 
217
247
    // spinboxes
218
248
    void nColChanged( int );
219
 
    void nSpaceChanged( const QString & );
 
249
    void nSpaceChanged( double );
220
250
 
221
251
private:
222
 
    void changed(QLineEdit *line, double &mm, double &pt, double &inch);
 
252
    void changed(KDoubleNumInput *line, double &pt);
223
253
 
224
254
    KoPageLayoutDiaPrivate *d;
225
255
};