xref: /AOO41X/main/cui/source/inc/numpages.hxx (revision c4eee24dc018e70cce741d2c2ecfc43b06c69c41)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SVX_NUMPAGES_HXX
24 #define _SVX_NUMPAGES_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <sfx2/tabdlg.hxx>
29 #include <vcl/group.hxx>
30 #include <vcl/fixed.hxx>
31 #include <vcl/menubtn.hxx>
32 #include <vcl/lstbox.hxx>
33 #include <vcl/edit.hxx>
34 #include <vcl/field.hxx>
35 #ifndef _SVX_NUMDEF_HXX
36 #include <editeng/numdef.hxx>
37 #endif
38 #include <svtools/ctrlbox.hxx>
39 #include <svl/svarray.hxx>
40 
41 // -----------------------------------------------------------------------
42 class SvxNumRule;
43 class SvxBmpNumValueSet;
44 class SvxNumValueSet;
45 class ValueSet;
46 class SvxNumberingPreview;
47 class SvxBrushItem;
48 
49 /*-----------------13.02.97 14.02-------------------
50 
51 --------------------------------------------------*/
52 
53 struct SvxNumSettings_Impl
54 {
55     short           nNumberType;
56     short           nParentNumbering;
57     rtl::OUString   sPrefix;
58     rtl::OUString   sSuffix;
59     rtl::OUString   sBulletChar;
60     rtl::OUString   sBulletFont;
SvxNumSettings_ImplSvxNumSettings_Impl61     SvxNumSettings_Impl() :
62         nNumberType(0),
63         nParentNumbering(0)
64         {}
65 };
66 
67 typedef SvxNumSettings_Impl* SvxNumSettings_ImplPtr;
68 SV_DECL_PTRARR_DEL(SvxNumSettingsArr_Impl,SvxNumSettings_ImplPtr,8,4)
69 
70 /*-----------------07.02.97 11.36-------------------
71 
72 --------------------------------------------------*/
73 class SvxSingleNumPickTabPage : public SfxTabPage
74 {
75     using TabPage::ActivatePage;
76     using TabPage::DeactivatePage;
77 
78     FixedLine               aValuesFL;
79     SvxNumValueSet*         pExamplesVS;
80     SvxNumSettingsArr_Impl  aNumSettingsArr;
81     SvxNumRule*             pActNum;
82     SvxNumRule*             pSaveNum;
83     sal_uInt16                  nActNumLvl;
84     sal_Bool                    bModified   : 1;
85     sal_Bool                    bPreset     : 1;
86 
87     String              sNumCharFmtName;
88     sal_uInt16              nNumItemId;
89 
90     protected:
91         DECL_LINK( NumSelectHdl_Impl, ValueSet*);
92         DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
93 
94     public:
95         SvxSingleNumPickTabPage(Window* pParent,
96                                const SfxItemSet& rSet);
97         ~SvxSingleNumPickTabPage();
98 
99     static SfxTabPage*  Create( Window* pParent,
100                                 const SfxItemSet& rAttrSet);
101 
102     virtual void        ActivatePage(const SfxItemSet& rSet);
103     virtual int         DeactivatePage(SfxItemSet *pSet);
104     virtual sal_Bool        FillItemSet( SfxItemSet& rSet );
105     virtual void        Reset( const SfxItemSet& rSet );
106 
SetNumCharFmtName(const String & rName)107     void                SetNumCharFmtName(const String& rName){sNumCharFmtName = rName;}
108 };
109 
110 /*-----------------07.02.97 11.36-------------------
111 
112 --------------------------------------------------*/
113 
114 class SvxBulletPickTabPage : public SfxTabPage
115 {
116     using TabPage::ActivatePage;
117     using TabPage::DeactivatePage;
118 
119     FixedLine           aValuesFL;
120     SvxNumValueSet*     pExamplesVS;
121     SvxNumRule*         pActNum;
122     SvxNumRule*         pSaveNum;
123     sal_uInt16              nActNumLvl;
124     sal_Bool                bModified   : 1;
125     sal_Bool                bPreset     : 1;
126     sal_uInt16              nNumItemId;
127 
128     String              sBulletCharFmtName;
129     protected:
130         DECL_LINK(NumSelectHdl_Impl, ValueSet*);
131         DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
132     public:
133         SvxBulletPickTabPage(Window* pParent,
134                                const SfxItemSet& rSet);
135         ~SvxBulletPickTabPage();
136 
137     static SfxTabPage*  Create( Window* pParent,
138                                 const SfxItemSet& rAttrSet);
139 
140     virtual void        ActivatePage(const SfxItemSet& rSet);
141     virtual int         DeactivatePage(SfxItemSet *pSet);
142     virtual sal_Bool        FillItemSet( SfxItemSet& rSet );
143     virtual void        Reset( const SfxItemSet& rSet );
144 
SetCharFmtName(const String & rName)145     void                SetCharFmtName(const String& rName){sBulletCharFmtName = rName;}
146     virtual void        PageCreated(SfxAllItemSet aSet); // add CHINA001
147 };
148 
149 /*-----------------07.02.97 11.36-------------------
150     TabPage fuer vollstaendig Numerierung
151 --------------------------------------------------*/
152 #define NUMTYPE_MEMBER 4   // Anzahl der Elemente des FormatStrings je Ebene
153 #define NUM_VALUSET_COUNT 16
154 class SvxNumPickTabPage : public SfxTabPage
155 {
156     using TabPage::ActivatePage;
157     using TabPage::DeactivatePage;
158 
159     FixedLine           aValuesFL;
160     SvxNumValueSet*     pExamplesVS;
161     String              sNumCharFmtName;
162     String              sBulletCharFmtName;
163 
164     SvxNumSettingsArr_Impl  aNumSettingsArrays[NUM_VALUSET_COUNT];  // wird mit den fuenf Formaten initialisiert
165 
166     SvxNumRule*         pActNum;
167     SvxNumRule*         pSaveNum;
168     sal_uInt16              nActNumLvl;
169     sal_uInt16              nNumItemId;
170     sal_Bool                bModified   : 1;
171     sal_Bool                bPreset     : 1;
172 
173 
174     protected:
175         DECL_LINK(NumSelectHdl_Impl, ValueSet*);
176         DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
177 
178     public:
179         SvxNumPickTabPage(Window* pParent,
180                                const SfxItemSet& rSet);
181         ~SvxNumPickTabPage();
182 
183     static SfxTabPage*  Create( Window* pParent,
184                                 const SfxItemSet& rAttrSet);
185 
186     virtual void        ActivatePage(const SfxItemSet& rSet);
187     virtual int         DeactivatePage(SfxItemSet *pSet);
188     virtual sal_Bool        FillItemSet( SfxItemSet& rSet );
189     virtual void        Reset( const SfxItemSet& rSet );
190 
SetCharFmtNames(const String & rCharName,const String & rBulName)191     void                SetCharFmtNames(const String& rCharName, const String& rBulName)
192                             {   sNumCharFmtName = rCharName;
193                                 sBulletCharFmtName = rBulName;}
194     virtual void        PageCreated(SfxAllItemSet aSet); // add CHINA001
195 };
196 
197 /*-----------------12.02.97 07.42-------------------
198 
199 --------------------------------------------------*/
200 class SvxBitmapPickTabPage : public SfxTabPage
201 {
202     using TabPage::ActivatePage;
203     using TabPage::DeactivatePage;
204 
205     FixedLine           aValuesFL;
206     SvxBmpNumValueSet*  pExamplesVS;
207     FixedText           aErrorText;
208     CheckBox            aLinkedCB;
209 
210     List                aGrfNames;
211     String              sNumCharFmtName;
212 
213     SvxNumRule*         pActNum;
214     SvxNumRule*         pSaveNum;
215     sal_uInt16              nActNumLvl;
216     sal_uInt16              nNumItemId;
217     SfxMapUnit          eCoreUnit;
218     sal_Bool                bModified   : 1;
219     sal_Bool                bPreset     : 1;
220 
221     protected:
222         DECL_LINK( NumSelectHdl_Impl, ValueSet*);
223         DECL_LINK( DoubleClickHdl_Impl, ValueSet* );
224         DECL_LINK( LinkBmpHdl_Impl, CheckBox* );
225 
226     public:
227         SvxBitmapPickTabPage(Window* pParent,
228                                const SfxItemSet& rSet);
229         ~SvxBitmapPickTabPage();
230 
231     static SfxTabPage*  Create( Window* pParent,
232                                 const SfxItemSet& rAttrSet);
233 
234     virtual void        ActivatePage(const SfxItemSet& rSet);
235     virtual int         DeactivatePage(SfxItemSet *pSet);
236     virtual sal_Bool        FillItemSet( SfxItemSet& rSet );
237     virtual void        Reset( const SfxItemSet& rSet );
238 
SetNumCharFmtName(const String & rName)239     void                SetNumCharFmtName(const String& rName){sNumCharFmtName = rName;}
240 };
241 
242 /*-----------------01.12.97 16:13-------------------
243 
244 --------------------------------------------------*/
245 class SvxNumOptionsTabPage : public SfxTabPage
246 {
247     using TabPage::ActivatePage;
248     using TabPage::DeactivatePage;
249 
250     FixedLine       aFormatFL;
251     FixedText       aLevelFT;
252     MultiListBox    aLevelLB;
253 
254     FixedText       aFmtFT;
255     ListBox         aFmtLB;
256     FixedText       aPrefixFT;
257     Edit            aPrefixED;
258     FixedText       aSuffixFT;
259     Edit            aSuffixED;
260     FixedText       aCharFmtFT;
261     ListBox         aCharFmtLB;
262     FixedText       aBulColorFT;
263     ColorListBox    aBulColLB;
264     FixedText       aBulRelSizeFT;
265     MetricField     aBulRelSizeMF;
266     FixedText       aAllLevelFT;
267     NumericField    aAllLevelNF;
268     FixedText       aStartFT;
269     NumericField    aStartED;
270     PushButton      aBulletPB;
271     FixedText       aAlignFT;
272     ListBox         aAlignLB;
273     FixedText       aBitmapFT;
274     MenuButton      aBitmapMB;
275     FixedText       aSizeFT;
276     MetricField     aWidthMF;
277     FixedText       aMultFT;
278     MetricField     aHeightMF;
279     CheckBox        aRatioCB;
280     FixedText       aOrientFT;
281     ListBox         aOrientLB;
282 
283     FixedLine       aSameLevelFL;
284     CheckBox        aSameLevelCB;
285 
286     String          sNumCharFmtName;
287     String          sBulletCharFmtName;
288 
289     Timer           aInvalidateTimer;
290 
291     SvxNumberingPreview*    pPreviewWIN;
292 
293     SvxNumRule*         pActNum;
294     SvxNumRule*         pSaveNum;
295 
296     Size                aInitSize[SVX_MAX_NUM];
297 
298     sal_Bool                bLastWidthModified  : 1;
299     sal_Bool                bModified           : 1;
300     sal_Bool                bPreset             : 1;
301     sal_Bool                bAutomaticCharStyles: 1;
302     sal_Bool                bHTMLMode           : 1;
303     sal_Bool                bMenuButtonInitialized : 1;
304 
305     List                aGrfNames;
306     Font                aActBulletFont;
307     String              sBullet;
308     String              sStartWith;
309 
310     sal_uInt8               nBullet;
311     sal_uInt16              nActNumLvl;
312     sal_uInt16              nNumItemId;
313     SfxMapUnit          eCoreUnit;
314 
315     void                InitControls();
316     void                SwitchNumberType( sal_uInt8 nType, sal_Bool bBmp = sal_False );
317     void                CheckForStartValue_Impl(sal_uInt16 nNumberingType);
318 
319         DECL_LINK( NumberTypeSelectHdl_Impl, ListBox * );
320         DECL_LINK( LevelHdl_Impl, ListBox * );
321         DECL_LINK( PopupActivateHdl_Impl, Menu * );
322         DECL_LINK( GraphicHdl_Impl, MenuButton * );
323         DECL_LINK( BulletHdl_Impl, Button * );
324         DECL_LINK( SizeHdl_Impl, MetricField * );
325         DECL_LINK( RatioHdl_Impl, CheckBox * );
326         DECL_LINK( CharFmtHdl_Impl, ListBox * );
327         DECL_LINK( EditModifyHdl_Impl, Edit * );
328         DECL_LINK( AllLevelHdl_Impl, NumericField * );
329         DECL_LINK( OrientHdl_Impl, ListBox * );
330         DECL_LINK( SameLevelHdl_Impl, CheckBox * );
331         DECL_LINK( BulColorHdl_Impl, ColorListBox* );
332         DECL_LINK( BulRelSizeHdl_Impl, MetricField *);
333         DECL_LINK( PreviewInvalidateHdl_Impl, Timer* );
334 
335         DECL_STATIC_LINK( SvxNumOptionsTabPage, GraphicArrivedHdl_Impl, SvxBrushItem* );
336 
337     public:
338         SvxNumOptionsTabPage(Window* pParent,
339                                const SfxItemSet& rSet);
340         ~SvxNumOptionsTabPage();
341 
342     static SfxTabPage*  Create( Window* pParent,
343                                 const SfxItemSet& rAttrSet);
344 
345     virtual void        ActivatePage(const SfxItemSet& rSet);
346     virtual int         DeactivatePage(SfxItemSet *pSet);
347     virtual sal_Bool        FillItemSet( SfxItemSet& rSet );
348     virtual void        Reset( const SfxItemSet& rSet );
349 
350 //???   void                SetWrtShell(SwWrtShell* pSh);
SetCharFmts(const String & rNumName,const String & rBulletName)351     void                SetCharFmts(const String& rNumName, const String& rBulletName )
352                                 {
353                                     sNumCharFmtName = rNumName;
354                                     sBulletCharFmtName = rBulletName;
355                                 }
356     void                SetMetric(FieldUnit eSet);
357 
GetCharFmtListBox()358     ListBox&            GetCharFmtListBox() {return aCharFmtLB;}
359     void                SetModified(sal_Bool bRepaint = sal_True);
360     virtual void        PageCreated(SfxAllItemSet aSet); // add CHINA001
361 };
362 
363 /*-----------------03.12.97 10:18-------------------
364 
365 --------------------------------------------------*/
366 class SvxNumPositionTabPage : public SfxTabPage
367 {
368     using TabPage::ActivatePage;
369     using TabPage::DeactivatePage;
370 
371     FixedLine           aPositionFL;
372     FixedText           aLevelFT;
373     MultiListBox        aLevelLB;
374 
375     // --> OD 2008-01-11 #newlistlevelattrs#
376     // former set of controls shown for numbering rules containing list level
377     // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
378     FixedText           aDistBorderFT;
379     MetricField         aDistBorderMF;
380     CheckBox            aRelativeCB;
381     FixedText           aIndentFT;
382     MetricField         aIndentMF;
383     FixedText           aDistNumFT;
384     MetricField         aDistNumMF;
385     FixedText           aAlignFT;
386     ListBox             aAlignLB;
387     // <--
388 
389     // --> OD 2008-01-10 #newlistlevelattrs#
390     // new set of controls shown for numbering rules containing list level
391     // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT
392     FixedText           aLabelFollowedByFT;
393     ListBox             aLabelFollowedByLB;
394     FixedText           aListtabFT;
395     MetricField         aListtabMF;
396     FixedText           aAlign2FT;
397     ListBox             aAlign2LB;
398     FixedText           aAlignedAtFT;
399     MetricField         aAlignedAtMF;
400     FixedText           aIndentAtFT;
401     MetricField         aIndentAtMF;
402     // <--
403 
404     PushButton          aStandardPB;
405 
406 #if OSL_DEBUG_LEVEL > 1
407     FixedText*          pDebugFixedText;
408 #endif
409     SvxNumberingPreview* pPreviewWIN;
410 
411     SvxNumRule*         pActNum;
412     SvxNumRule*         pSaveNum;
413 
414     sal_uInt16              nActNumLvl;
415     sal_uInt16              nNumItemId;
416     SfxMapUnit          eCoreUnit;
417 
418     sal_Bool                bModified           : 1;
419     sal_Bool                bPreset             : 1;
420     sal_Bool                bInInintControl     : 1;  //Modify-Fehler umgehen, soll ab 391 behoben sein
421     // --> OD 2008-01-11 #newlistlevelattrs#
422     bool                bLabelAlignmentPosAndSpaceModeActive;
423     // <--
424 
425     void                InitControls();
426 
427     DECL_LINK( LevelHdl_Impl, ListBox * );
428     DECL_LINK( EditModifyHdl_Impl, Edit*);
429     DECL_LINK( DistanceHdl_Impl, MetricField * );
430     DECL_LINK( RelativeHdl_Impl, CheckBox * );
431     DECL_LINK( StandardHdl_Impl, PushButton * );
432 
433     // --> OD 2008-01-11 #newlistlevelattrs#
434     void InitPosAndSpaceMode();
435     void ShowControlsDependingOnPosAndSpaceMode();
436 
437     DECL_LINK( LabelFollowedByHdl_Impl, ListBox* );
438     DECL_LINK( ListtabPosHdl_Impl, MetricField* );
439     DECL_LINK( AlignAtHdl_Impl, MetricField* );
440     DECL_LINK( IndentAtHdl_Impl, MetricField* );
441     // <--
442 
443 public:
444         SvxNumPositionTabPage(Window* pParent,
445                                const SfxItemSet& rSet);
446         ~SvxNumPositionTabPage();
447 
448     virtual void        ActivatePage(const SfxItemSet& rSet);
449     virtual int         DeactivatePage(SfxItemSet *pSet);
450     virtual sal_Bool        FillItemSet( SfxItemSet& rSet );
451     virtual void        Reset( const SfxItemSet& rSet );
452 
453     static SfxTabPage*  Create( Window* pParent,
454                                 const SfxItemSet& rAttrSet);
455 
456     void                SetMetric(FieldUnit eSet);
457     void                SetModified(sal_Bool bRepaint = sal_True);
458     virtual void        PageCreated(SfxAllItemSet aSet); // add CHINA001
459 };
460 
461 #endif
462 
463 
464 
465 
466