00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#ifndef __KOPGLAYOUTDIA_H__
00023
#define __KOPGLAYOUTDIA_H__
00024
00025
#include <qgroupbox.h>
00026
00027
#include <koGlobal.h>
00028
#include <koUnit.h>
00029
#include <kdialogbase.h>
00030
00031
class QButtonGroup;
00032
class QWidget;
00033
class QGridLayout;
00034
class QLabel;
00035
class QComboBox;
00036
class QLineEdit;
00037
class QSpinBox;
00038
class QRadioButton;
00039
class QCheckBox;
00040
class KDoubleNumInput;
00041
00042
enum { FORMAT_AND_BORDERS = 1, HEADER_AND_FOOTER = 2, COLUMNS = 4, DISABLE_BORDERS = 8,
00043 KW_HEADER_AND_FOOTER = 16, DISABLE_UNIT = 32 };
00044
00049 class KoPagePreview :
public QGroupBox
00050 {
00051 Q_OBJECT
00052
00053
public:
00054
00058
KoPagePreview(
QWidget*,
const char*,
const KoPageLayout & );
00062
~KoPagePreview();
00063
00067
void setPageLayout(
const KoPageLayout& );
00068
void setPageColumns(
const KoColumns& );
00069
00070
protected:
00071
00072
00073
void drawContents(
QPainter* );
00074
00075
double pgWidth;
00076
double pgHeight;
00077
double pgX;
00078
double pgY;
00079
double pgW;
00080
double pgH;
00081
int columns;
00082 };
00083
00084
00085
class KoPageLayoutDiaPrivate;
00086
00090 class KoPageLayoutDia :
public KDialogBase
00091 {
00092 Q_OBJECT
00093
00094
public:
00095
00106
KoPageLayoutDia(
QWidget* parent,
const char* name,
00107
const KoPageLayout& layout,
00108
const KoHeadFoot& headfoot,
00109
int tabs, KoUnit::Unit
unit,
bool modal=
true );
00110
00123
KoPageLayoutDia(
QWidget* parent,
const char* name,
00124
const KoPageLayout& layout,
00125
const KoHeadFoot& headfoot,
00126
const KoColumns& columns,
00127
const KoKWHeaderFooter& kwheadfoot,
00128
int tabs, KoUnit::Unit unit );
00129
00133
~KoPageLayoutDia();
00134
00139
static bool pageLayout(
KoPageLayout&,
KoHeadFoot&,
int tabs, KoUnit::Unit& unit);
00140
00145
static bool pageLayout(
KoPageLayout&,
KoHeadFoot&,
KoColumns&,
KoKWHeaderFooter&,
int tabs, KoUnit::Unit& unit );
00146
00150
static KoPageLayout standardLayout();
00151
00155 KoPageLayout getLayout() {
return layout; }
00156
00160
KoHeadFoot getHeadFoot();
00161
00165 KoUnit::Unit
unit()
const {
return m_unit; }
00166
00167
protected:
00168
KoColumns getColumns();
00169
KoKWHeaderFooter getKWHeaderFooter();
00170
00171
00172
void setupTab1();
00173
void setValuesTab1();
00174
void setValuesTab1Helper();
00175
void setupTab2();
00176
void setupTab3();
00177
void setupTab4();
00178
00179
00180
void updatePreview(
const KoPageLayout& );
00181
00182
00183
QComboBox *cpgFormat;
00184
QComboBox *cpgUnit;
00185
QRadioButton *rbPortrait;
00186
QRadioButton *rbLandscape;
00187 KDoubleNumInput *epgWidth;
00188 KDoubleNumInput *epgHeight;
00189 KDoubleNumInput *ebrLeft;
00190 KDoubleNumInput *ebrRight;
00191 KDoubleNumInput *ebrTop;
00192 KDoubleNumInput *ebrBottom;
00193
KoPagePreview *pgPreview;
00194
KoPagePreview *pgPreview2;
00195
QLineEdit *eHeadLeft;
00196
QLineEdit *eHeadMid;
00197
QLineEdit *eHeadRight;
00198
QLineEdit *eFootLeft;
00199
QLineEdit *eFootMid;
00200
QLineEdit *eFootRight;
00201
QSpinBox *nColumns;
00202 KDoubleNumInput *nCSpacing;
00203
00204 KDoubleNumInput *nHSpacing;
00205 KDoubleNumInput *nFSpacing;
00206 KDoubleNumInput *nFNSpacing;
00207
QCheckBox *rhSame_unused;
00208
QCheckBox *rhFirst;
00209
QCheckBox *rhEvenOdd;
00210
QCheckBox *rfSame_unused;
00211
QCheckBox *rfFirst;
00212
QCheckBox *rfEvenOdd;
00213
00214
00215
KoPageLayout layout;
00216
KoHeadFoot hf;
00217
KoColumns cl;
00218
KoKWHeaderFooter kwhf;
00219
00220 KoUnit::Unit m_unit;
00221
00222
bool retPressed;
00223
bool enableBorders;
00224
int flags;
00225
00226
public slots:
00227
00228
00229
void widthChanged();
00230
void heightChanged();
00231
void leftChanged();
00232
void rightChanged();
00233
void topChanged();
00234
void bottomChanged();
00235
00236
protected slots:
00237
virtual void slotOk();
00238
00239
private slots:
00240
00241
void unitChanged(
int );
00242
void formatChanged(
int );
00243
void orientationChanged();
00244
00245
void rPressed() {retPressed =
true;}
00246
00247
00248
void nColChanged(
int );
00249
void nSpaceChanged(
double );
00250
00251
private:
00252
void changed(KDoubleNumInput *line,
double &pt);
00253
00254 KoPageLayoutDiaPrivate *d;
00255 };
00256
00257
#endif