koPageLayoutDia.h
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 #include <koGlobal.h>
00027 #include <koUnit.h>
00028 #include <kdialogbase.h>
00029 #include <koPageLayout.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 KOFFICEUI_EXPORT 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, QWidget* parent = 0 );
00140
00145 static bool pageLayout( KoPageLayout&, KoHeadFoot&, KoColumns&, KoKWHeaderFooter&, int tabs, KoUnit::Unit& unit, QWidget* parent = 0 );
00150 static KDE_DEPRECATED KoPageLayout standardLayout();
00151
00155 const KoPageLayout& layout() const { return m_layout; }
00156
00160 KoHeadFoot headFoot() const;
00161
00165 KoUnit::Unit unit() const { return m_unit; }
00166
00167 private:
00168 const KoColumns& columns();
00169 const KoKWHeaderFooter& getKWHeaderFooter();
00170
00171
00172 void setupTab1();
00173 void setValuesTab1();
00174 void setValuesTab1Helper();
00175 void setupTab2( const KoHeadFoot& hf );
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 *rhFirst;
00208 QCheckBox *rhEvenOdd;
00209 QCheckBox *rfFirst;
00210 QCheckBox *rfEvenOdd;
00211
00212
00213 KoPageLayout m_layout;
00214 KoColumns m_cl;
00215 KoKWHeaderFooter kwhf;
00216
00217 KoUnit::Unit m_unit;
00218
00219 bool retPressed;
00220 bool enableBorders;
00221 int flags;
00222
00223 public slots:
00224
00225
00226 void widthChanged();
00227 void heightChanged();
00228 void leftChanged();
00229 void rightChanged();
00230 void topChanged();
00231 void bottomChanged();
00232
00233 protected slots:
00234 virtual void slotOk();
00235
00236 private slots:
00237
00238 void unitChanged( int );
00239 void formatChanged( int );
00240 void orientationChanged();
00241
00242 void rPressed() {retPressed = true;}
00243
00244
00245 void nColChanged( int );
00246 void nSpaceChanged( double );
00247
00248 private:
00249 void changed(KDoubleNumInput *line, double &pt);
00250
00251 KoPageLayoutDiaPrivate *d;
00252 };
00253
00254 #endif
This file is part of the documentation for lib Library Version 1.4.2.