xref: /aoo42x/main/sw/source/ui/inc/outline.hxx (revision 1d2dbeb0)
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 _OUTLINE_HXX
24 #define _OUTLINE_HXX
25 
26 #include <sfx2/tabdlg.hxx>
27 
28 
29 #include <vcl/menu.hxx>
30 
31 #ifndef _BUTTON_HXX //autogen
32 #include <vcl/button.hxx>
33 #endif
34 #include <svtools/stdctrl.hxx>
35 
36 #ifndef _FIXED_HXX //autogen
37 #include <vcl/fixed.hxx>
38 #endif
39 
40 #ifndef _LSTBOX_HXX //autogen
41 #include <vcl/lstbox.hxx>
42 #endif
43 
44 #ifndef _EDIT_HXX //autogen
45 #include <vcl/edit.hxx>
46 #endif
47 
48 #ifndef _FIELD_HXX //autogen
49 #include <vcl/field.hxx>
50 #endif
51 
52 #include "swtypes.hxx"		//fuer MAXLEVEL
53 #include <numprevw.hxx>
54 #include <numberingtypelistbox.hxx>
55 
56 class SwWrtShell;
57 class SwNumRule;
58 class SwChapterNumRules;
59 
60 /* -----------------07.07.98 13:38-------------------
61  *
62  * --------------------------------------------------*/
63 class SwOutlineTabDialog : public SfxTabDialog
64 {
65     static     sal_uInt16    nNumLevel;
66 
67     String              aNullStr;
68 	String				aCollNames[MAXLEVEL];
69 	PopupMenu			aFormMenu;
70 
71 	SwWrtShell&			rWrtSh;
72 	SwNumRule*			pNumRule;
73 	SwChapterNumRules*	pChapterNumRules;
74 
75     sal_Bool                bModified : 1;
76 
77 	protected:
78 	DECL_LINK( CancelHdl, Button * );
79 	DECL_LINK( FormHdl, Button * );
80 	DECL_LINK( MenuSelectHdl, Menu * );
81 
82 		virtual void 	PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage);
83 		virtual short	Ok();
84 
85 	public:
86 		SwOutlineTabDialog(Window* pParent,
87 					const SfxItemSet* pSwItemSet,
88 					SwWrtShell &);
89 		~SwOutlineTabDialog();
90 
GetNumRule()91 	SwNumRule*			GetNumRule() {return pNumRule;}
92 	sal_uInt16 				GetLevel(const String &rFmtName) const;
GetCollNames()93 	String*				GetCollNames() {return aCollNames;}
94 
GetActNumLevel()95     static sal_uInt16       GetActNumLevel() {return nNumLevel;}
SetActNumLevel(sal_uInt16 nSet)96     static void         SetActNumLevel(sal_uInt16 nSet) {nNumLevel = nSet;}
97 };
98 /* -----------------07.07.98 13:47-------------------
99  *
100  * --------------------------------------------------*/
101 class SwOutlineSettingsTabPage : public SfxTabPage
102 {
103 	FixedLine       aLevelFL;
104 	ListBox			aLevelLB;
105 
106 	FixedLine        aNumberFL;
107 	FixedText		aCollLbl;
108 	ListBox 		aCollBox;
109 	FixedText		aNumberLbl;
110 	SwNumberingTypeListBox	aNumberBox;
111 	FixedText		aCharFmtFT;
112 	ListBox			aCharFmtLB;
113 	FixedText       aAllLevelFT;
114 	NumericField	aAllLevelNF;
115 	FixedText		aDelim;
116 	FixedText		aPrefixFT;
117 	Edit			aPrefixED;
118 	FixedText		aSuffixFT;
119 	Edit			aSuffixED;
120 	FixedText		aStartLbl;
121 	NumericField 	aStartEdit;
122 	NumberingPreview aPreviewWIN;
123 
124 	String				aNoFmtName;
125 	String				aSaveCollNames[MAXLEVEL];
126 	SwWrtShell*			pSh;
127 	SwNumRule*			pNumRule;
128 	String*				pCollNames;
129 	sal_uInt16 				nActLevel;
130 
131 	DECL_LINK( LevelHdl, ListBox * );
132 	DECL_LINK( ToggleComplete, NumericField * );
133 	DECL_LINK( CollSelect, ListBox * );
134 	DECL_LINK( CollSelectGetFocus, ListBox * );
135 	DECL_LINK( NumberSelect, SwNumberingTypeListBox * );
136 	DECL_LINK( DelimModify, Edit * );
137 	DECL_LINK( StartModified, NumericField * );
138 	DECL_LINK( CharFmtHdl, ListBox * );
139 
140 	void   	Update();
141 
SetModified()142 	void	SetModified(){aPreviewWIN.Invalidate();}
143     void    CheckForStartValue_Impl(sal_uInt16 nNumberingType);
144 
145     using SfxTabPage::ActivatePage;
146     using SfxTabPage::DeactivatePage;
147 
148 public:
149 	SwOutlineSettingsTabPage(Window* pParent, const SfxItemSet& rSet);
150 	~SwOutlineSettingsTabPage();
151 
152 	void SetWrtShell(SwWrtShell* pShell);
153 
154 	virtual void 		ActivatePage(const SfxItemSet& rSet);
155 	virtual int 		DeactivatePage(SfxItemSet *pSet);
156 
157     virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
158 	virtual	void 		Reset( const SfxItemSet& rSet );
159 	static SfxTabPage*	Create( Window* pParent,
160 								const SfxItemSet& rAttrSet);
161 };
162 #endif
163