kword

KWFrameDia.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3 Copyright (C) 2005 Thomas Zander <zander@kde.org>
4
5 This library is free software; you can redistribute it and/m_or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, m_or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY m_or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef framedia_h
22#define framedia_h
23
24#include "defs.h"
25#include "KWTextFrameSet.h"
26#include <kdialogbase.h>
27#include <KoUnit.h>
28#include <KoUnitWidgets.h>
29#include <tqgroupbox.h>
30
31class KoBorderPreview;
32class KWFrame;
33class KWDocument;
34class KWPage;
35class TQWidget;
36class TQGridLayout;
37class TQGroupBox;
38class TQRadioButton;
39class TQCheckBox;
40class TQLabel;
41class TQCloseEvent;
42class TQListView;
43class TQListViewItem;
44class TQLineEdit;
45class KColorButton;
46class KDoubleNumInput;
47
48/******************************************************************/
49/* Class: KWBrushStylePreview */
50/******************************************************************/
51class KWBrushStylePreview : public TQFrame
52{
53 TQ_OBJECT
54
55public:
56 KWBrushStylePreview( TQWidget* );
57 ~KWBrushStylePreview() {}
58 void setBrush( const TQBrush& _brush ) { brush = _brush; }
59protected:
60 void drawContents( TQPainter* );
61private:
62 TQBrush brush;
63};
64
69class KWFourSideConfigWidget : public TQGroupBox
70{
71 TQ_OBJECT
72
73public:
74 KWFourSideConfigWidget( KWDocument* m_doc, const TQString& title, TQWidget*, const char* name = 0 );
75
76 bool changed() const { return m_changed; }
77
78 void setValues( double left, double right, double top, double bottom ); // in pt
79 double leftValue() const; // in pt
80 double rightValue() const; // in pt
81 double topValue() const; // in pt
82 double bottomValue() const; // in pt
83
84signals:
85
86public slots:
87 void slotValueChanged( double );
88
89private:
90 KoUnitDoubleSpinBox *m_inputLeft, *m_inputRight, *m_inputTop, *m_inputBottom;
91 TQCheckBox *m_synchronize;
92 KWDocument *m_doc;
93 bool m_changed;
94 bool m_noSignal;
95};
96
97/******************************************************************/
98/* Class: KWFrameDia */
99/******************************************************************/
100class KWFrameDia : public KDialogBase
101{
102 TQ_OBJECT
103
104public:
106 KWFrameDia( TQWidget *parent, KWFrame *_frame,KWDocument *_doc,FrameSetType _ft);
107 KWFrameDia( TQWidget *parent, KWFrame *_frame);
108 KWFrameDia( TQWidget *parent, TQPtrList<KWFrame> allFrames);
109 //KWFrameDia( TQWidget *parent, KWCanvas *_canvas);
110
111 //void setCanvas(KWCanvas *_canvas) {canvas =_canvas;}
112
113protected:
114 void init();
115 bool applyChanges();
116 void setupTab1();
117 void setupTab2();
118 void setupTab3();
119 void setupTab4();
120 void setupTab5();
121 void setupTab6();
122 void initBorderSettings();
123 void initGeometrySettings();
124
125 void updateFrames();
126 void enableOnNewPageOptions();
127 void initBrush();
128 bool mayDeleteFrameSet(KWTextFrameSet *fs);
129 void enableSizeAndPosition();
130
131 TQBrush frameBrushStyle() const;
132 void calcRatio();
133
134protected slots:
135 virtual void slotApply();
136 virtual void slotOk();
137 void connectListSelected( TQListViewItem * );
138 void setFrameBehaviorInputOn();
139 void setFrameBehaviorInputOff();
140 void slotFloatingToggled(bool);
141 void slotProtectSizeToggled(bool);
142 void textNameFrameChanged ( const TQString & );
143 //void updateBrushPreview();
144 void slotProtectContentChanged( bool );
145 void enableRunAround();
146 void selectExistingFrameset();
147 void selectNewFrameset(bool on);
148 void slotUpdateWidthForHeight(double height);
149 void slotUpdateHeightForWidth( double width );
150 void slotKeepRatioToggled(bool on);
151 void ensureValidFramesetSelected();
152 void brdLeftToggled( bool );
153 void brdRightToggled( bool );
154 void brdTopToggled( bool );
155 void brdBottomToggled( bool );
156 void slotPressEvent(TQMouseEvent *_ev);
157private:
158 // TAB 1:
159 TQWidget *m_tab1;
160 TQGridLayout *m_grid1, *m_eofGrid, *m_onpGrid, *m_sideGrid;
161 TQGroupBox *m_endOfFrame, *m_onNewPage, *m_sideHeads;
162 TQCheckBox *m_cbCopy, *m_cbAspectRatio, *m_cbAllFrames;
163 TQCheckBox *m_cbProtectContent;
164 TQRadioButton *m_rResizeFrame, *m_rAppendFrame, *m_rNoShow, *m_reconnect, *m_noFollowup, *m_copyRadio;
165 TQLabel *sideTitle1, *sideTitle2;
166 TQLineEdit *m_sideWidth, *m_sideGap;
167 TQComboBox *m_sideAlign;
168
169 // TAB 2:
170 TQWidget *m_tab2;
171 TQRadioButton *m_rRunNo, *m_rRunBounding, *m_rRunSkip;
172 TQRadioButton *m_rRunLeft, *m_rRunRight, *m_rRunBiggest;
173 TQGroupBox *m_runGroup, *m_runSideGroup;
174 KWFourSideConfigWidget* m_raDistConfigWidget;
175
176 // TAB 3:
177 TQWidget *m_tab3;
178 TQLineEdit *m_eFrameSetName;
179 TQListView *m_lFrameSList;
180 TQRadioButton *m_rExistingFrameset, *m_rNewFrameset;
181
182
183 // TAB 4:
184 TQWidget *m_tab4;
185 TQGroupBox *m_grp1;
186 TQLabel *m_lx, *m_ly, *m_lw, *m_lh;
187 KoUnitDoubleSpinBox *m_sx, *m_sy, *m_sw, *m_sh;
188 KWFourSideConfigWidget* m_paddingConfigWidget;
189 TQCheckBox *m_floating;
190 TQCheckBox *m_protectSize;
191
192 // TAB 5:
193 TQWidget *m_tab5;
194
195 // TAB 6:
196 TQWidget *m_tab6;
197 TQComboBox *m_cWidth, *m_cStyle;
198 TQPushButton *m_bLeft, *m_bRight, *m_bTop, *m_bBottom;
199 KColorButton *m_bColor;
200 KoBorder m_leftBorder, m_rightBorder, m_topBorder, m_bottomBorder;
201 KoBorderPreview *m_prev3;
202
203 //TQComboBox *brushStyle;
204 TQCheckBox* m_transparentCB;
205 KColorButton *m_brushColor;
206 //KWBrushStylePreview *brushPreview;
207 TQCheckBox *m_overwriteColor;
208
209 KWFrame *m_frame;
210 KWFrame *m_mainFrame;
211 TQPtrList<KWFrame> m_allFrames;
212 KWDocument *m_doc;
213 FrameSetType m_frameType;
214 bool m_frameSetFloating;
215 bool m_frameSetProtectedSize;
216 bool m_mainFrameSetIncluded;
217 bool m_defaultFrameSetIncluded; // header, m_footer m_or m_footnote
218 double m_oldX, m_oldY, m_oldW, m_oldH;
219 double m_heightByWidthRatio;
220 int /*FrameBehavior*/ m_frameBehavior;
221 KoUnit::Unit m_frameUnits;
222 TQString m_oldFrameSetName;
223 TQBrush m_newBrushStyle;
224 bool m_noSignal;
225};
226
227#endif
A widget showing unitwidgets for 4 doubles (for left/right/top/bottom values) and a checkbox to synch...
Definition KWFrameDia.h:70
This class represents a single frame.
Definition KWFrame.h:68
This class represents a printed page of the document.
Definition KWPage.h:30
Class: KWTextFrameSet Contains text (KoTextObject) and frames to display that text.