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>
00026 #include <KoGlobal.h>
00027 #include <KoUnit.h>
00028 #include <KoPageLayout.h>
00029 #include <kpagedialog.h>
00030
00031 class QComboBox;
00032 class QLineEdit;
00033 class QCheckBox;
00034 class KoUnitDoubleSpinBox;
00035 class KoPageLayoutColumns;
00036 class KoPageLayoutSize;
00037 class KoPageLayoutHeader;
00038
00039 enum { FORMAT_AND_BORDERS = 1, HEADER_AND_FOOTER = 2, COLUMNS = 4, DISABLE_BORDERS = 8,
00040 KW_HEADER_AND_FOOTER = 16, DISABLE_UNIT = 32 };
00041
00046 class KoPagePreview : public QGroupBox
00047 {
00048 Q_OBJECT
00049
00050 public:
00051
00055 KoPagePreview( QWidget*, const char*, const KoPageLayout & );
00059 ~KoPagePreview();
00060
00064 void setPageLayout( const KoPageLayout& );
00068 void setPageColumns( const KoColumns& );
00069
00070 protected:
00071
00072
00073 virtual void paintEvent ( QPaintEvent * event );
00074 virtual void resizeEvent ( QResizeEvent * event );
00075 void updateZoomedSize();
00076 double m_pageHeight, m_pageWidth, m_textFrameX, m_textFrameY, m_textFrameWidth, m_textFrameHeight;
00077 int columns;
00078 KoPageLayout m_layout;
00079 };
00080
00081 class KoPageLayoutDiaPrivate;
00082
00086 class KOFFICEUI_EXPORT KoPageLayoutDia : public KPageDialog
00087 {
00088 Q_OBJECT
00089
00090 public:
00091
00103 KoPageLayoutDia( QWidget* parent, const char* name,
00104 const KoPageLayout& layout,
00105 const KoHeadFoot& headfoot,
00106 int flags, KoUnit::Unit unit, bool modal=true );
00107
00120 KoPageLayoutDia( QWidget* parent, const char* name,
00121 const KoPageLayout& layout,
00122 const KoHeadFoot& headfoot,
00123 const KoColumns& columns,
00124 const KoKWHeaderFooter& kwheadfoot,
00125 int tabs, KoUnit::Unit unit );
00126
00130 ~KoPageLayoutDia();
00131
00136 static bool pageLayout( KoPageLayout&, KoHeadFoot&, int tabs, KoUnit::Unit& unit, QWidget* parent = 0 );
00137
00142 static bool pageLayout( KoPageLayout&, KoHeadFoot&, KoColumns&, KoKWHeaderFooter&, int tabs, KoUnit::Unit& unit, QWidget* parent = 0 );
00147 static KDE_DEPRECATED KoPageLayout standardLayout();
00148
00152 const KoPageLayout& layout() const { return m_layout; }
00153
00157 KoHeadFoot headFoot() const;
00158
00162 KoUnit::Unit unit() const { return m_unit; }
00163
00164 private:
00165 const KoColumns& columns() { return m_column; }
00166 const KoKWHeaderFooter& headerFooter();
00167
00168
00169 void setupTab1( bool enableBorders );
00170 void setupTab2( const KoHeadFoot& hf );
00171 void setupTab3();
00172 void setupTab4( const KoKWHeaderFooter kwhf );
00173
00174
00175 QLineEdit *eHeadLeft;
00176 QLineEdit *eHeadMid;
00177 QLineEdit *eHeadRight;
00178 QLineEdit *eFootLeft;
00179 QLineEdit *eFootMid;
00180 QLineEdit *eFootRight;
00181
00182
00183 KoPageLayout m_layout;
00184 KoColumns m_column;
00185
00186 KoUnit::Unit m_unit;
00187
00188 int flags;
00189
00190 protected slots:
00191 virtual void slotOk();
00192
00193 private slots:
00194 void sizeUpdated(KoPageLayout &layout);
00195 void columnsUpdated(KoColumns &columns);
00196
00197 private:
00198 KoPageLayoutSize *m_pageSizeTab;
00199 KoPageLayoutColumns *m_columnsTab;
00200 KoPageLayoutHeader *m_headerTab;
00201 KoPageLayoutDiaPrivate *d;
00202 };
00203
00204 #endif