F:/KPlato/koffice/libs/kofficeui/KoPageLayoutDia.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 // Description: Page Layout Dialog (header)
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     // paint page
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     // setup tabs
00169     void setupTab1( bool enableBorders );
00170     void setupTab2( const KoHeadFoot& hf );
00171     void setupTab3();
00172     void setupTab4( const KoKWHeaderFooter kwhf );
00173 
00174     // dialog objects
00175     QLineEdit *eHeadLeft;
00176     QLineEdit *eHeadMid;
00177     QLineEdit *eHeadRight;
00178     QLineEdit *eFootLeft;
00179     QLineEdit *eFootMid;
00180     QLineEdit *eFootRight;
00181 
00182     // layout
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

Généré le Wed Nov 22 23:41:05 2006 pour KPlato par  doxygen 1.5.1-p1