1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: numpages.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_NUMPAGES_HXX
31 #define _SVX_NUMPAGES_HXX
33 // include ---------------------------------------------------------------
35 #include <sfx2/tabdlg.hxx>
36 #include <vcl/group.hxx>
37 #include <vcl/fixed.hxx>
38 #include <vcl/menubtn.hxx>
39 #include <vcl/lstbox.hxx>
40 #include <vcl/edit.hxx>
41 #include <vcl/field.hxx>
42 #ifndef _SVX_NUMDEF_HXX
43 #include <svx/numdef.hxx>
45 #include <svtools/ctrlbox.hxx>
46 #include <svtools/svarray.hxx>
48 // -----------------------------------------------------------------------
50 class SvxBmpNumValueSet
;
53 class SvxNumberingPreview
;
56 /*-----------------13.02.97 14.02-------------------
58 --------------------------------------------------*/
60 struct SvxNumSettings_Impl
63 short nParentNumbering
;
64 rtl::OUString sPrefix
;
65 rtl::OUString sSuffix
;
66 rtl::OUString sBulletChar
;
67 rtl::OUString sBulletFont
;
68 SvxNumSettings_Impl() :
74 typedef SvxNumSettings_Impl
* SvxNumSettings_ImplPtr
;
75 SV_DECL_PTRARR_DEL(SvxNumSettingsArr_Impl
,SvxNumSettings_ImplPtr
,8,4)
77 /*-----------------07.02.97 11.36-------------------
79 --------------------------------------------------*/
80 class SvxSingleNumPickTabPage
: public SfxTabPage
82 using TabPage::ActivatePage
;
83 using TabPage::DeactivatePage
;
86 SvxNumValueSet
* pExamplesVS
;
87 SvxNumSettingsArr_Impl aNumSettingsArr
;
94 String sNumCharFmtName
;
98 DECL_LINK( NumSelectHdl_Impl
, ValueSet
*);
99 DECL_LINK( DoubleClickHdl_Impl
, ValueSet
* );
102 SvxSingleNumPickTabPage(Window
* pParent
,
103 const SfxItemSet
& rSet
);
104 ~SvxSingleNumPickTabPage();
106 static SfxTabPage
* Create( Window
* pParent
,
107 const SfxItemSet
& rAttrSet
);
109 virtual void ActivatePage(const SfxItemSet
& rSet
);
110 virtual int DeactivatePage(SfxItemSet
*pSet
);
111 virtual BOOL
FillItemSet( SfxItemSet
& rSet
);
112 virtual void Reset( const SfxItemSet
& rSet
);
114 void SetNumCharFmtName(const String
& rName
){sNumCharFmtName
= rName
;}
117 /*-----------------07.02.97 11.36-------------------
119 --------------------------------------------------*/
121 class SvxBulletPickTabPage
: public SfxTabPage
123 using TabPage::ActivatePage
;
124 using TabPage::DeactivatePage
;
127 SvxNumValueSet
* pExamplesVS
;
129 SvxNumRule
* pSaveNum
;
135 String sBulletCharFmtName
;
137 DECL_LINK(NumSelectHdl_Impl
, ValueSet
*);
138 DECL_LINK( DoubleClickHdl_Impl
, ValueSet
* );
140 SvxBulletPickTabPage(Window
* pParent
,
141 const SfxItemSet
& rSet
);
142 ~SvxBulletPickTabPage();
144 static SfxTabPage
* Create( Window
* pParent
,
145 const SfxItemSet
& rAttrSet
);
147 virtual void ActivatePage(const SfxItemSet
& rSet
);
148 virtual int DeactivatePage(SfxItemSet
*pSet
);
149 virtual BOOL
FillItemSet( SfxItemSet
& rSet
);
150 virtual void Reset( const SfxItemSet
& rSet
);
152 void SetCharFmtName(const String
& rName
){sBulletCharFmtName
= rName
;}
153 virtual void PageCreated(SfxAllItemSet aSet
); // add CHINA001
156 /*-----------------07.02.97 11.36-------------------
157 TabPage fuer vollstaendig Numerierung
158 --------------------------------------------------*/
159 #define NUMTYPE_MEMBER 4 // Anzahl der Elemente des FormatStrings je Ebene
160 #define NUM_VALUSET_COUNT 16
161 class SvxNumPickTabPage
: public SfxTabPage
163 using TabPage::ActivatePage
;
164 using TabPage::DeactivatePage
;
167 SvxNumValueSet
* pExamplesVS
;
168 String sNumCharFmtName
;
169 String sBulletCharFmtName
;
171 SvxNumSettingsArr_Impl aNumSettingsArrays
[NUM_VALUSET_COUNT
]; // wird mit den fuenf Formaten initialisiert
174 SvxNumRule
* pSaveNum
;
182 DECL_LINK(NumSelectHdl_Impl
, ValueSet
*);
183 DECL_LINK( DoubleClickHdl_Impl
, ValueSet
* );
186 SvxNumPickTabPage(Window
* pParent
,
187 const SfxItemSet
& rSet
);
188 ~SvxNumPickTabPage();
190 static SfxTabPage
* Create( Window
* pParent
,
191 const SfxItemSet
& rAttrSet
);
193 virtual void ActivatePage(const SfxItemSet
& rSet
);
194 virtual int DeactivatePage(SfxItemSet
*pSet
);
195 virtual BOOL
FillItemSet( SfxItemSet
& rSet
);
196 virtual void Reset( const SfxItemSet
& rSet
);
198 void SetCharFmtNames(const String
& rCharName
, const String
& rBulName
)
199 { sNumCharFmtName
= rCharName
;
200 sBulletCharFmtName
= rBulName
;}
201 virtual void PageCreated(SfxAllItemSet aSet
); // add CHINA001
204 /*-----------------12.02.97 07.42-------------------
206 --------------------------------------------------*/
207 class SvxBitmapPickTabPage
: public SfxTabPage
209 using TabPage::ActivatePage
;
210 using TabPage::DeactivatePage
;
213 SvxBmpNumValueSet
* pExamplesVS
;
214 FixedText aErrorText
;
218 String sNumCharFmtName
;
221 SvxNumRule
* pSaveNum
;
224 SfxMapUnit eCoreUnit
;
229 DECL_LINK( NumSelectHdl_Impl
, ValueSet
*);
230 DECL_LINK( DoubleClickHdl_Impl
, ValueSet
* );
231 DECL_LINK( LinkBmpHdl_Impl
, CheckBox
* );
234 SvxBitmapPickTabPage(Window
* pParent
,
235 const SfxItemSet
& rSet
);
236 ~SvxBitmapPickTabPage();
238 static SfxTabPage
* Create( Window
* pParent
,
239 const SfxItemSet
& rAttrSet
);
241 virtual void ActivatePage(const SfxItemSet
& rSet
);
242 virtual int DeactivatePage(SfxItemSet
*pSet
);
243 virtual BOOL
FillItemSet( SfxItemSet
& rSet
);
244 virtual void Reset( const SfxItemSet
& rSet
);
246 void SetNumCharFmtName(const String
& rName
){sNumCharFmtName
= rName
;}
249 /*-----------------01.12.97 16:13-------------------
251 --------------------------------------------------*/
252 class SvxNumOptionsTabPage
: public SfxTabPage
254 using TabPage::ActivatePage
;
255 using TabPage::DeactivatePage
;
259 MultiListBox aLevelLB
;
267 FixedText aCharFmtFT
;
269 FixedText aBulColorFT
;
270 ColorListBox aBulColLB
;
271 FixedText aBulRelSizeFT
;
272 MetricField aBulRelSizeMF
;
273 FixedText aAllLevelFT
;
274 NumericField aAllLevelNF
;
276 NumericField aStartED
;
277 PushButton aBulletPB
;
281 MenuButton aBitmapMB
;
283 MetricField aWidthMF
;
285 MetricField aHeightMF
;
290 FixedLine aSameLevelFL
;
291 CheckBox aSameLevelCB
;
293 String sNumCharFmtName
;
294 String sBulletCharFmtName
;
296 Timer aInvalidateTimer
;
298 SvxNumberingPreview
* pPreviewWIN
;
301 SvxNumRule
* pSaveNum
;
303 Size aInitSize
[SVX_MAX_NUM
];
305 BOOL bLastWidthModified
: 1;
308 BOOL bAutomaticCharStyles
: 1;
310 BOOL bMenuButtonInitialized
: 1;
320 SfxMapUnit eCoreUnit
;
323 void SwitchNumberType( BYTE nType
, BOOL bBmp
= FALSE
);
324 void CheckForStartValue_Impl(sal_uInt16 nNumberingType
);
326 DECL_LINK( NumberTypeSelectHdl_Impl
, ListBox
* );
327 DECL_LINK( LevelHdl_Impl
, ListBox
* );
328 DECL_LINK( PopupActivateHdl_Impl
, Menu
* );
329 DECL_LINK( GraphicHdl_Impl
, MenuButton
* );
330 DECL_LINK( BulletHdl_Impl
, Button
* );
331 DECL_LINK( SizeHdl_Impl
, MetricField
* );
332 DECL_LINK( RatioHdl_Impl
, CheckBox
* );
333 DECL_LINK( CharFmtHdl_Impl
, ListBox
* );
334 DECL_LINK( EditModifyHdl_Impl
, Edit
* );
335 DECL_LINK( AllLevelHdl_Impl
, NumericField
* );
336 DECL_LINK( OrientHdl_Impl
, ListBox
* );
337 DECL_LINK( SameLevelHdl_Impl
, CheckBox
* );
338 DECL_LINK( BulColorHdl_Impl
, ColorListBox
* );
339 DECL_LINK( BulRelSizeHdl_Impl
, MetricField
*);
340 DECL_LINK( PreviewInvalidateHdl_Impl
, Timer
* );
342 DECL_STATIC_LINK( SvxNumOptionsTabPage
, GraphicArrivedHdl_Impl
, SvxBrushItem
* );
345 SvxNumOptionsTabPage(Window
* pParent
,
346 const SfxItemSet
& rSet
);
347 ~SvxNumOptionsTabPage();
349 static SfxTabPage
* Create( Window
* pParent
,
350 const SfxItemSet
& rAttrSet
);
352 virtual void ActivatePage(const SfxItemSet
& rSet
);
353 virtual int DeactivatePage(SfxItemSet
*pSet
);
354 virtual BOOL
FillItemSet( SfxItemSet
& rSet
);
355 virtual void Reset( const SfxItemSet
& rSet
);
357 //??? void SetWrtShell(SwWrtShell* pSh);
358 void SetCharFmts(const String
& rNumName
, const String
& rBulletName
)
360 sNumCharFmtName
= rNumName
;
361 sBulletCharFmtName
= rBulletName
;
363 void SetMetric(FieldUnit eSet
);
365 ListBox
& GetCharFmtListBox() {return aCharFmtLB
;}
366 void SetModified(BOOL bRepaint
= TRUE
);
367 virtual void PageCreated(SfxAllItemSet aSet
); // add CHINA001
370 /*-----------------03.12.97 10:18-------------------
372 --------------------------------------------------*/
373 class SvxNumPositionTabPage
: public SfxTabPage
375 using TabPage::ActivatePage
;
376 using TabPage::DeactivatePage
;
378 FixedLine aPositionFL
;
380 MultiListBox aLevelLB
;
382 // --> OD 2008-01-11 #newlistlevelattrs#
383 // former set of controls shown for numbering rules containing list level
384 // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
385 FixedText aDistBorderFT
;
386 MetricField aDistBorderMF
;
387 CheckBox aRelativeCB
;
389 MetricField aIndentMF
;
390 FixedText aDistNumFT
;
391 MetricField aDistNumMF
;
396 // --> OD 2008-01-10 #newlistlevelattrs#
397 // new set of controls shown for numbering rules containing list level
398 // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT
399 FixedText aLabelFollowedByFT
;
400 ListBox aLabelFollowedByLB
;
401 FixedText aListtabFT
;
402 MetricField aListtabMF
;
405 FixedText aAlignedAtFT
;
406 MetricField aAlignedAtMF
;
407 FixedText aIndentAtFT
;
408 MetricField aIndentAtMF
;
411 PushButton aStandardPB
;
413 #if OSL_DEBUG_LEVEL > 1
414 FixedText
* pDebugFixedText
;
416 SvxNumberingPreview
* pPreviewWIN
;
419 SvxNumRule
* pSaveNum
;
423 SfxMapUnit eCoreUnit
;
427 BOOL bInInintControl
: 1; //Modify-Fehler umgehen, soll ab 391 behoben sein
428 // --> OD 2008-01-11 #newlistlevelattrs#
429 bool bLabelAlignmentPosAndSpaceModeActive
;
434 DECL_LINK( LevelHdl_Impl
, ListBox
* );
435 DECL_LINK( EditModifyHdl_Impl
, Edit
*);
436 DECL_LINK( DistanceHdl_Impl
, MetricField
* );
437 DECL_LINK( RelativeHdl_Impl
, CheckBox
* );
438 DECL_LINK( StandardHdl_Impl
, PushButton
* );
440 // --> OD 2008-01-11 #newlistlevelattrs#
441 void InitPosAndSpaceMode();
442 void ShowControlsDependingOnPosAndSpaceMode();
444 DECL_LINK( LabelFollowedByHdl_Impl
, ListBox
* );
445 DECL_LINK( ListtabPosHdl_Impl
, MetricField
* );
446 DECL_LINK( AlignAtHdl_Impl
, MetricField
* );
447 DECL_LINK( IndentAtHdl_Impl
, MetricField
* );
451 SvxNumPositionTabPage(Window
* pParent
,
452 const SfxItemSet
& rSet
);
453 ~SvxNumPositionTabPage();
455 virtual void ActivatePage(const SfxItemSet
& rSet
);
456 virtual int DeactivatePage(SfxItemSet
*pSet
);
457 virtual BOOL
FillItemSet( SfxItemSet
& rSet
);
458 virtual void Reset( const SfxItemSet
& rSet
);
460 static SfxTabPage
* Create( Window
* pParent
,
461 const SfxItemSet
& rAttrSet
);
463 void SetMetric(FieldUnit eSet
);
464 void SetModified(BOOL bRepaint
= TRUE
);
465 virtual void PageCreated(SfxAllItemSet aSet
); // add CHINA001