update dev300-m58
[ooovba.git] / svx / source / cui / numpages.hxx
blobd0c00b121fca33efb5482485744ce8ea3132d2b5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: numpages.hxx,v $
10 * $Revision: 1.11 $
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>
44 #endif
45 #include <svtools/ctrlbox.hxx>
46 #include <svtools/svarray.hxx>
48 // -----------------------------------------------------------------------
49 class SvxNumRule;
50 class SvxBmpNumValueSet;
51 class SvxNumValueSet;
52 class ValueSet;
53 class SvxNumberingPreview;
54 class SvxBrushItem;
56 /*-----------------13.02.97 14.02-------------------
58 --------------------------------------------------*/
60 struct SvxNumSettings_Impl
62 short nNumberType;
63 short nParentNumbering;
64 rtl::OUString sPrefix;
65 rtl::OUString sSuffix;
66 rtl::OUString sBulletChar;
67 rtl::OUString sBulletFont;
68 SvxNumSettings_Impl() :
69 nNumberType(0),
70 nParentNumbering(0)
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;
85 FixedLine aValuesFL;
86 SvxNumValueSet* pExamplesVS;
87 SvxNumSettingsArr_Impl aNumSettingsArr;
88 SvxNumRule* pActNum;
89 SvxNumRule* pSaveNum;
90 USHORT nActNumLvl;
91 BOOL bModified : 1;
92 BOOL bPreset : 1;
94 String sNumCharFmtName;
95 USHORT nNumItemId;
97 protected:
98 DECL_LINK( NumSelectHdl_Impl, ValueSet*);
99 DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
101 public:
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;
126 FixedLine aValuesFL;
127 SvxNumValueSet* pExamplesVS;
128 SvxNumRule* pActNum;
129 SvxNumRule* pSaveNum;
130 USHORT nActNumLvl;
131 BOOL bModified : 1;
132 BOOL bPreset : 1;
133 USHORT nNumItemId;
135 String sBulletCharFmtName;
136 protected:
137 DECL_LINK(NumSelectHdl_Impl, ValueSet*);
138 DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
139 public:
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;
166 FixedLine aValuesFL;
167 SvxNumValueSet* pExamplesVS;
168 String sNumCharFmtName;
169 String sBulletCharFmtName;
171 SvxNumSettingsArr_Impl aNumSettingsArrays[NUM_VALUSET_COUNT]; // wird mit den fuenf Formaten initialisiert
173 SvxNumRule* pActNum;
174 SvxNumRule* pSaveNum;
175 USHORT nActNumLvl;
176 USHORT nNumItemId;
177 BOOL bModified : 1;
178 BOOL bPreset : 1;
181 protected:
182 DECL_LINK(NumSelectHdl_Impl, ValueSet*);
183 DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
185 public:
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;
212 FixedLine aValuesFL;
213 SvxBmpNumValueSet* pExamplesVS;
214 FixedText aErrorText;
215 CheckBox aLinkedCB;
217 List aGrfNames;
218 String sNumCharFmtName;
220 SvxNumRule* pActNum;
221 SvxNumRule* pSaveNum;
222 USHORT nActNumLvl;
223 USHORT nNumItemId;
224 SfxMapUnit eCoreUnit;
225 BOOL bModified : 1;
226 BOOL bPreset : 1;
228 protected:
229 DECL_LINK( NumSelectHdl_Impl, ValueSet*);
230 DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
231 DECL_LINK( LinkBmpHdl_Impl, CheckBox* );
233 public:
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;
257 FixedLine aFormatFL;
258 FixedText aLevelFT;
259 MultiListBox aLevelLB;
261 FixedText aFmtFT;
262 ListBox aFmtLB;
263 FixedText aPrefixFT;
264 Edit aPrefixED;
265 FixedText aSuffixFT;
266 Edit aSuffixED;
267 FixedText aCharFmtFT;
268 ListBox aCharFmtLB;
269 FixedText aBulColorFT;
270 ColorListBox aBulColLB;
271 FixedText aBulRelSizeFT;
272 MetricField aBulRelSizeMF;
273 FixedText aAllLevelFT;
274 NumericField aAllLevelNF;
275 FixedText aStartFT;
276 NumericField aStartED;
277 PushButton aBulletPB;
278 FixedText aAlignFT;
279 ListBox aAlignLB;
280 FixedText aBitmapFT;
281 MenuButton aBitmapMB;
282 FixedText aSizeFT;
283 MetricField aWidthMF;
284 FixedText aMultFT;
285 MetricField aHeightMF;
286 CheckBox aRatioCB;
287 FixedText aOrientFT;
288 ListBox aOrientLB;
290 FixedLine aSameLevelFL;
291 CheckBox aSameLevelCB;
293 String sNumCharFmtName;
294 String sBulletCharFmtName;
296 Timer aInvalidateTimer;
298 SvxNumberingPreview* pPreviewWIN;
300 SvxNumRule* pActNum;
301 SvxNumRule* pSaveNum;
303 Size aInitSize[SVX_MAX_NUM];
305 BOOL bLastWidthModified : 1;
306 BOOL bModified : 1;
307 BOOL bPreset : 1;
308 BOOL bAutomaticCharStyles: 1;
309 BOOL bHTMLMode : 1;
310 BOOL bMenuButtonInitialized : 1;
312 List aGrfNames;
313 Font aActBulletFont;
314 String sBullet;
315 String sStartWith;
317 BYTE nBullet;
318 USHORT nActNumLvl;
319 USHORT nNumItemId;
320 SfxMapUnit eCoreUnit;
322 void InitControls();
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* );
344 public:
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;
379 FixedText aLevelFT;
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;
388 FixedText aIndentFT;
389 MetricField aIndentMF;
390 FixedText aDistNumFT;
391 MetricField aDistNumMF;
392 FixedText aAlignFT;
393 ListBox aAlignLB;
394 // <--
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;
403 FixedText aAlign2FT;
404 ListBox aAlign2LB;
405 FixedText aAlignedAtFT;
406 MetricField aAlignedAtMF;
407 FixedText aIndentAtFT;
408 MetricField aIndentAtMF;
409 // <--
411 PushButton aStandardPB;
413 #if OSL_DEBUG_LEVEL > 1
414 FixedText* pDebugFixedText;
415 #endif
416 SvxNumberingPreview* pPreviewWIN;
418 SvxNumRule* pActNum;
419 SvxNumRule* pSaveNum;
421 USHORT nActNumLvl;
422 USHORT nNumItemId;
423 SfxMapUnit eCoreUnit;
425 BOOL bModified : 1;
426 BOOL bPreset : 1;
427 BOOL bInInintControl : 1; //Modify-Fehler umgehen, soll ab 391 behoben sein
428 // --> OD 2008-01-11 #newlistlevelattrs#
429 bool bLabelAlignmentPosAndSpaceModeActive;
430 // <--
432 void InitControls();
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* );
448 // <--
450 public:
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
468 #endif