lib

KoPageLayoutDia.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20// Description: Page Layout Dialog (header)
21
22#ifndef __KOPGLAYOUTDIA_H__
23#define __KOPGLAYOUTDIA_H__
24
25#include <tqgroupbox.h>
26#include <KoGlobal.h>
27#include <KoUnit.h>
28#include <kdialogbase.h>
29#include <KoPageLayout.h>
30
31class TQButtonGroup;
32class TQComboBox;
33class TQLineEdit;
34class TQCheckBox;
39
40enum { FORMAT_AND_BORDERS = 1, HEADER_AND_FOOTER = 2, COLUMNS = 4, DISABLE_BORDERS = 8,
41 KW_HEADER_AND_FOOTER = 16, DISABLE_UNIT = 32 };
42
47class KoPagePreview : public TQGroupBox
48{
49 TQ_OBJECT
50
51
52public:
53
57 KoPagePreview( TQWidget*, const char*, const KoPageLayout & );
62
66 void setPageLayout( const KoPageLayout& );
67 void setPageColumns( const KoColumns& );
68
69protected:
70
71 // paint page
72 void drawContents( TQPainter* );
73
74 double m_pageHeight, m_pageWidth, m_textFrameX, m_textFrameY, m_textFrameWidth, m_textFrameHeight;
75 int columns;
76};
77
78class KoPageLayoutDiaPrivate;
79
83class KOFFICEUI_EXPORT KoPageLayoutDia : public KDialogBase
84{
85 TQ_OBJECT
86
87
88public:
89
101 KoPageLayoutDia( TQWidget* parent, const char* name,
102 const KoPageLayout& layout,
103 const KoHeadFoot& headfoot,
104 int flags, KoUnit::Unit unit, bool modal=true );
105
118 KoPageLayoutDia( TQWidget* parent, const char* name,
119 const KoPageLayout& layout,
120 const KoHeadFoot& headfoot,
121 const KoColumns& columns,
122 const KoKWHeaderFooter& kwheadfoot,
123 int tabs, KoUnit::Unit unit );
124
129
134 static bool pageLayout( KoPageLayout&, KoHeadFoot&, int tabs, KoUnit::Unit& unit, TQWidget* parent = 0 );
135
140 static bool pageLayout( KoPageLayout&, KoHeadFoot&, KoColumns&, KoKWHeaderFooter&, int tabs, KoUnit::Unit& unit, TQWidget* parent = 0 );
145 static TDE_DEPRECATED KoPageLayout standardLayout();
146
150 const KoPageLayout& layout() const { return m_layout; }
151
155 KoHeadFoot headFoot() const;
156
160 KoUnit::Unit unit() const { return m_unit; }
161
162private:
163 const KoColumns& columns() { return m_column; }
164 const KoKWHeaderFooter& headerFooter();
165
166 // setup tabs
167 void setupTab1( bool enableBorders );
168 void setupTab2( const KoHeadFoot& hf );
169 void setupTab3();
170 void setupTab4( const KoKWHeaderFooter kwhf );
171
172 // dialog objects
173 TQLineEdit *eHeadLeft;
174 TQLineEdit *eHeadMid;
175 TQLineEdit *eHeadRight;
176 TQLineEdit *eFootLeft;
177 TQLineEdit *eFootMid;
178 TQLineEdit *eFootRight;
179
180 // layout
181 KoPageLayout m_layout;
182 KoColumns m_column;
183
184 KoUnit::Unit m_unit;
185
186 int flags;
187
188protected slots:
189 virtual void slotOk();
190
191private slots:
192 void sizeUpdated(KoPageLayout &layout);
193 void columnsUpdated(KoColumns &columns);
194
195private:
196 KoPageLayoutSize *m_pageSizeTab;
197 KoPageLayoutColumns *m_columnsTab;
198 KoPageLayoutHeader *m_headerTab;
199 KoPageLayoutDiaPrivate *d;
200};
201
202#endif
KDialogBase(TQWidget *parent=0, const char *name=0, bool modal=true, const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
virtual void slotOk()
This class is a widget that shows the KoColumns data structure and allows the user to change it.
static bool pageLayout(KoPageLayout &, KoHeadFoot &, int tabs, KoUnit::Unit &unit, TQWidget *parent=0)
Show page layout dialog.
KoPageLayoutDia(TQWidget *parent, const char *name, const KoPageLayout &layout, const KoHeadFoot &headfoot, int flags, KoUnit::Unit unit, bool modal=true)
Constructor.
KoUnit::Unit unit() const
Returns the unit.
const KoPageLayout & layout() const
Returns the layout.
static TDE_DEPRECATED KoPageLayout standardLayout()
Retrieves a standard page layout.
This class is a widget that shows the KoKWHeaderFooter data structure and allows the user to change i...
This class is a widget that shows the KoPageLayout data structure and allows the user to change it.
~KoPagePreview()
destructor
KoPagePreview(TQWidget *, const char *, const KoPageLayout &)
constructor
void setPageLayout(const KoPageLayout &)
set page layout
Spin box for double precision numbers with unit display.
Unit
Length units supported by KOffice.
Definition KoUnit.h:63
structure for columns
structure for header-footer
structure for KWord header-footer
This structure defines the page layout, including its size in pt, its format (e.g.