Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SVX_PARAGRPH_HXX
29 : : #define _SVX_PARAGRPH_HXX
30 : :
31 : : #include <vcl/button.hxx>
32 : : #include <vcl/fixed.hxx>
33 : : #include <sfx2/tabdlg.hxx>
34 : : #include <svx/relfld.hxx> // SvxRelativeField
35 : : #include <svx/paraprev.hxx> // Preview
36 : : #include <svx/frmdirlbox.hxx>
37 : : #include <vcl/lstbox.hxx>
38 : : #include <svx/flagsdef.hxx>
39 : :
40 : : // forward ---------------------------------------------------------------
41 : :
42 : : class SvxLineSpacingItem;
43 : :
44 : : // class SvxStdParagraphTabPage ------------------------------------------
45 : :
46 : : /* {k:\svx\prototyp\dialog\parastd.bmp}
47 : :
48 : : [Description]
49 : : With this TabPage standard attributes of a paragraph can be set
50 : : (indention, distance, alignment, line spacing).
51 : :
52 : : [Items]
53 : : <SvxAdjustItem><SID_ATTR_PARA_ADJUST>
54 : : <SvxLineSpacingItem><SID_ATTR_PARA_LINESPACE>
55 : : <SvxULSpaceItem><SID_ATTR_ULSPACE>
56 : : <SvxLRSpaceItem><SID_ATTR_LRSPACE>
57 : : */
58 : :
59 [ # # ][ # # ]: 0 : class SvxStdParagraphTabPage: public SfxTabPage
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
60 : : {
61 : : using TabPage::DeactivatePage;
62 : :
63 : : private:
64 : : SvxStdParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
65 : :
66 : : FixedLine aIndentFrm;
67 : : // indention
68 : : FixedText aLeftLabel;
69 : : SvxRelativeField aLeftIndent;
70 : :
71 : : FixedText aRightLabel;
72 : : SvxRelativeField aRightIndent;
73 : :
74 : : FixedText aFLineLabel;
75 : : SvxRelativeField aFLineIndent;
76 : : CheckBox aAutoCB;
77 : :
78 : : FixedLine aDistFrm;
79 : :
80 : : // distance
81 : : FixedText aTopLabel;
82 : : SvxRelativeField aTopDist;
83 : : FixedText aBottomLabel;
84 : : SvxRelativeField aBottomDist;
85 : : CheckBox aContextualCB;
86 : :
87 : : // line spacing
88 : : FixedLine aLineDistFrm;
89 : : ListBox aLineDist;
90 : : FixedText aLineDistAtLabel;
91 : : MetricField aLineDistAtPercentBox;
92 : : MetricField aLineDistAtMetricBox;
93 : : String sAbsDist;
94 : : SvxParaPrevWindow aExampleWin;
95 : :
96 : : // only writer
97 : : FixedLine aRegisterFL;
98 : : CheckBox aRegisterCB;
99 : :
100 : : Edit* pActLineDistFld;
101 : : long nAbst;
102 : : long nWidth;
103 : : long nMinFixDist;
104 : : sal_Bool bRelativeMode;
105 : : sal_Bool bNegativeIndents;
106 : :
107 : : #ifdef _SVX_PARAGRPH_CXX
108 : : void SetLineSpacing_Impl( const SvxLineSpacingItem& rAttr );
109 : : void Init_Impl();
110 : : void UpdateExample_Impl( sal_Bool bAll = sal_False );
111 : :
112 : : DECL_LINK( LineDistHdl_Impl, ListBox* );
113 : : DECL_LINK(ModifyHdl_Impl, void *);
114 : : DECL_LINK( AutoHdl_Impl, CheckBox* );
115 : : #endif
116 : :
117 : : protected:
118 : : virtual int DeactivatePage( SfxItemSet* pSet = 0 );
119 : :
120 : : public:
121 : : DECL_LINK(ELRLoseFocusHdl, void *);
122 : :
123 : : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
124 : : static sal_uInt16* GetRanges();
125 : :
126 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
127 : : virtual void Reset( const SfxItemSet& rSet );
128 : :
129 : :
130 : : void SetPageWidth( sal_uInt16 nPageWidth );
131 : : void EnableRelativeMode();
132 : : void EnableRegisterMode();
133 : : void EnableContextualMode();
134 : : void EnableAutoFirstLine();
135 : : void EnableAbsLineDist(long nMinTwip);
136 : : void EnableNegativeMode();
137 : : virtual void PageCreated(SfxAllItemSet aSet);
138 : : };
139 : :
140 : : // class SvxParaAlignTabPage ------------------------------------------------
141 : :
142 : : class SvxParaAlignTabPage : public SfxTabPage
143 : : {
144 : : using TabPage::DeactivatePage;
145 : :
146 : : // alignment
147 : : FixedLine aAlignFrm;
148 : : RadioButton aLeft;
149 : : RadioButton aRight;
150 : : RadioButton aCenter;
151 : : RadioButton aJustify;
152 : : FixedText aLastLineFT;
153 : : ListBox aLastLineLB;
154 : : CheckBox aExpandCB;
155 : :
156 : : CheckBox aSnapToGridCB;
157 : :
158 : : //preview
159 : : SvxParaPrevWindow aExampleWin;
160 : : //vertical alignment
161 : : FixedLine aVertAlignFL;
162 : :
163 : : FixedText aVertAlignFT;
164 : : ListBox aVertAlignLB;
165 : :
166 : : FixedLine aPropertiesFL;
167 : : FixedText aTextDirectionFT;
168 : : svx::FrameDirectionListBox aTextDirectionLB;
169 : :
170 : : #ifdef _SVX_PARAGRPH_CXX
171 : : DECL_LINK(AlignHdl_Impl, void *);
172 : : DECL_LINK(LastLineHdl_Impl, void *);
173 : : DECL_LINK(TextDirectionHdl_Impl, void *);
174 : :
175 : : void UpdateExample_Impl( sal_Bool bAll = sal_False );
176 : : #endif
177 : :
178 : : SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSet );
179 : : virtual ~SvxParaAlignTabPage();
180 : :
181 : : protected:
182 : : virtual int DeactivatePage( SfxItemSet* pSet = 0 );
183 : :
184 : : public:
185 : : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
186 : : static sal_uInt16* GetRanges();
187 : :
188 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
189 : : virtual void Reset( const SfxItemSet& rSet );
190 : :
191 : : void EnableJustifyExt();
192 : : virtual void PageCreated(SfxAllItemSet aSet);
193 : : };
194 : :
195 : : // class SvxExtParagraphTabPage ------------------------------------------
196 : :
197 : : /* {k:\svx\prototyp\dialog\paraext.bmp}
198 : :
199 : : [Description]
200 : : With this TabPage special attributes of a paragraph can be set
201 : : (hyphenation, pagebreak, orphan, widow, ...).
202 : :
203 : : [Items]
204 : : <SvxHyphenZoneItem><SID_ATTR_PARA_HYPHENZONE>
205 : : <SvxFmtBreakItem><SID_ATTR_PARA_PAGEBREAK>
206 : : <SvxFmtSplitItem><SID_ATTR_PARA_SPLIT>
207 : : <SvxWidowsItem><SID_ATTR_PARA_WIDOWS>
208 : : <SvxOrphansItem><SID_ATTR_PARA_ORPHANS>
209 : : */
210 : :
211 : : class SvxExtParagraphTabPage: public SfxTabPage
212 : : {
213 : : using TabPage::DeactivatePage;
214 : :
215 : : public:
216 : : virtual ~SvxExtParagraphTabPage();
217 : :
218 : : static SfxTabPage* Create( Window* pParent,
219 : : const SfxItemSet& rSet );
220 : : static sal_uInt16* GetRanges();
221 : :
222 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
223 : : virtual void Reset( const SfxItemSet& rSet );
224 : :
225 : : void DisablePageBreak();
226 : :
227 : : protected:
228 : : virtual int DeactivatePage( SfxItemSet* pSet = 0 );
229 : :
230 : : private:
231 : : SvxExtParagraphTabPage( Window* pParent, const SfxItemSet& rSet );
232 : :
233 : : // hyphenation
234 : : FixedLine aExtFL;
235 : : TriStateBox aHyphenBox;
236 : : FixedText aBeforeText;
237 : : NumericField aExtHyphenBeforeBox;
238 : : FixedText aAfterText;
239 : : NumericField aExtHyphenAfterBox;
240 : : FixedText aMaxHyphenLabel;
241 : : NumericField aMaxHyphenEdit;
242 : :
243 : : // pagebreak
244 : : FixedLine aBreaksFL;
245 : : TriStateBox aPageBreakBox;
246 : : FixedText aBreakTypeFT;
247 : : ListBox aBreakTypeLB;
248 : : FixedText aBreakPositionFT;
249 : : ListBox aBreakPositionLB;
250 : : TriStateBox aApplyCollBtn;
251 : : ListBox aApplyCollBox;
252 : : FixedText aPagenumText;
253 : : NumericField aPagenumEdit;
254 : :
255 : : FixedLine aExtendFL;
256 : :
257 : : // paragraph division
258 : : TriStateBox aKeepTogetherBox;
259 : : TriStateBox aKeepParaBox;
260 : :
261 : : // orphan/widow
262 : : TriStateBox aOrphanBox;
263 : : NumericField aOrphanRowNo;
264 : : FixedText aOrphanRowLabel;
265 : :
266 : : TriStateBox aWidowBox;
267 : : NumericField aWidowRowNo;
268 : : FixedText aWidowRowLabel;
269 : :
270 : : sal_Bool bPageBreak;
271 : : sal_Bool bHtmlMode;
272 : : sal_uInt16 nStdPos;
273 : :
274 : : #ifdef _SVX_PARAGRPH_CXX
275 : : DECL_LINK(PageBreakHdl_Impl, void *);
276 : : DECL_LINK(KeepTogetherHdl_Impl, void *);
277 : : DECL_LINK(WidowHdl_Impl, void *);
278 : : DECL_LINK(OrphanHdl_Impl, void *);
279 : : DECL_LINK(HyphenClickHdl_Impl, void *);
280 : : DECL_LINK(ApplyCollClickHdl_Impl, void *);
281 : : DECL_LINK( PageBreakPosHdl_Impl, ListBox* );
282 : : DECL_LINK( PageBreakTypeHdl_Impl, ListBox* );
283 : : #endif
284 : : virtual void PageCreated(SfxAllItemSet aSet);
285 : : };
286 : :
287 : : //--------------------------------------------------------------------------
288 : : class SvxAsianTabPage : public SfxTabPage
289 : : {
290 : : FixedLine aOptionsFL;
291 : :
292 : : TriStateBox aForbiddenRulesCB;
293 : : TriStateBox aHangingPunctCB;
294 : :
295 : : TriStateBox aScriptSpaceCB;
296 : :
297 : : SvxAsianTabPage( Window* pParent, const SfxItemSet& rSet );
298 : :
299 : : #ifdef _SVX_PARAGRPH_CXX
300 : : DECL_LINK( ClickHdl_Impl, TriStateBox* );
301 : : #endif
302 : : public:
303 : : ~SvxAsianTabPage();
304 : :
305 : :
306 : : static SfxTabPage* Create( Window* pParent,
307 : : const SfxItemSet& rSet );
308 : : static sal_uInt16* GetRanges();
309 : :
310 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
311 : : virtual void Reset( const SfxItemSet& rSet );
312 : :
313 : : };
314 : :
315 : : #endif // #ifndef _SVX_PARAGRPH_HXX
316 : :
317 : :
318 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|