xref: /aoo41x/main/sw/source/ui/inc/num.hxx (revision 1d2dbeb0)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19*1d2dbeb0SAndrew Rist  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _NUM_HXX
24cdf0e10cSrcweir #define _NUM_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
28cdf0e10cSrcweir #ifndef _MENUBTN_HXX //autogen
29cdf0e10cSrcweir #include <vcl/menubtn.hxx>
30cdf0e10cSrcweir #endif
31cdf0e10cSrcweir #ifndef _FIELD_HXX //autogen
32cdf0e10cSrcweir #include <vcl/field.hxx>
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir #ifndef _FIXED_HXX //autogen
35cdf0e10cSrcweir #include <vcl/fixed.hxx>
36cdf0e10cSrcweir #endif
37cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
38cdf0e10cSrcweir #ifndef _BUTTON_HXX //autogen
39cdf0e10cSrcweir #include <vcl/button.hxx>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #ifndef _LSTBOX_HXX //autogen
42cdf0e10cSrcweir #include <vcl/lstbox.hxx>
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir #ifndef _EDIT_HXX //autogen
45cdf0e10cSrcweir #include <vcl/edit.hxx>
46cdf0e10cSrcweir #endif
47cdf0e10cSrcweir #include <svx/stddlg.hxx>
48cdf0e10cSrcweir #include <numprevw.hxx>
49cdf0e10cSrcweir #include "numrule.hxx"
50cdf0e10cSrcweir 
51cdf0e10cSrcweir class SwWrtShell;
52cdf0e10cSrcweir class SvxBrushItem;
53cdf0e10cSrcweir class SwOutlineTabDialog;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 
56cdf0e10cSrcweir /*-----------------13.02.97 14.02-------------------
57cdf0e10cSrcweir 
58cdf0e10cSrcweir --------------------------------------------------*/
59cdf0e10cSrcweir 
60cdf0e10cSrcweir struct SwBmpItemInfo
61cdf0e10cSrcweir {
62cdf0e10cSrcweir 	SvxBrushItem* 	pBrushItem;
63cdf0e10cSrcweir 	sal_uInt16 			nItemId;
64cdf0e10cSrcweir };
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 
67cdf0e10cSrcweir /*-----------------07.02.97 15.37-------------------
68cdf0e10cSrcweir 
69cdf0e10cSrcweir --------------------------------------------------*/
70cdf0e10cSrcweir #define NUM_PAGETYPE_BULLET			0
71cdf0e10cSrcweir #define NUM_PAGETYPE_SINGLENUM      1
72cdf0e10cSrcweir #define NUM_PAGETYPE_NUM            2
73cdf0e10cSrcweir #define NUM_PAGETYPE_BMP            3
74cdf0e10cSrcweir #define PAGETYPE_USER_START         10
75cdf0e10cSrcweir 
76cdf0e10cSrcweir /*-----------------03.12.97 10:18-------------------
77cdf0e10cSrcweir 
78cdf0e10cSrcweir --------------------------------------------------*/
79cdf0e10cSrcweir class SwNumPositionTabPage : public SfxTabPage
80cdf0e10cSrcweir {
81cdf0e10cSrcweir     	FixedLine       aLevelFL;
82cdf0e10cSrcweir 	MultiListBox	aLevelLB;
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     // --> OD 2008-02-01 #newlistlevelattrs#
85cdf0e10cSrcweir     // former set of controls shown for numbering rules containing list level
86cdf0e10cSrcweir     // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
87cdf0e10cSrcweir 	FixedLine       aPositionFL;
88cdf0e10cSrcweir 	FixedText       	aDistBorderFT;
89cdf0e10cSrcweir 	MetricField			aDistBorderMF;
90cdf0e10cSrcweir 	CheckBox			aRelativeCB;
91cdf0e10cSrcweir 	FixedText			aIndentFT;
92cdf0e10cSrcweir 	MetricField			aIndentMF;
93cdf0e10cSrcweir 	FixedText       	aDistNumFT;
94cdf0e10cSrcweir 	MetricField			aDistNumMF;
95cdf0e10cSrcweir 	FixedText			aAlignFT;
96cdf0e10cSrcweir 	ListBox				aAlignLB;
97cdf0e10cSrcweir     // <--
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     // --> OD 2008-02-01 #newlistlevelattrs#
100cdf0e10cSrcweir     // new set of controls shown for numbering rules containing list level
101cdf0e10cSrcweir     // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT
102cdf0e10cSrcweir     FixedText           aLabelFollowedByFT;
103cdf0e10cSrcweir     ListBox             aLabelFollowedByLB;
104cdf0e10cSrcweir     FixedText           aListtabFT;
105cdf0e10cSrcweir     MetricField         aListtabMF;
106cdf0e10cSrcweir     FixedText           aAlign2FT;
107cdf0e10cSrcweir     ListBox             aAlign2LB;
108cdf0e10cSrcweir     FixedText           aAlignedAtFT;
109cdf0e10cSrcweir     MetricField         aAlignedAtMF;
110cdf0e10cSrcweir     FixedText           aIndentAtFT;
111cdf0e10cSrcweir     MetricField         aIndentAtMF;
112cdf0e10cSrcweir     // <--
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 	PushButton			aStandardPB;
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 	NumberingPreview	aPreviewWIN;
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 	SwNumRule* 			pActNum;
119cdf0e10cSrcweir 	SwNumRule* 			pSaveNum;
120cdf0e10cSrcweir 	SwWrtShell* 		pWrtSh;
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 	SwOutlineTabDialog*	pOutlineDlg;
123cdf0e10cSrcweir 	sal_uInt16				nActNumLvl;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 	sal_Bool				bModified 			: 1;
126cdf0e10cSrcweir 	sal_Bool				bPreset				: 1;
127cdf0e10cSrcweir 	sal_Bool				bInInintControl		: 1;  //Modify-Fehler umgehen, soll ab 391 behoben sein
128cdf0e10cSrcweir     // --> OD 2008-02-01 #newlistlevelattrs#
129cdf0e10cSrcweir     bool                bLabelAlignmentPosAndSpaceModeActive;
130cdf0e10cSrcweir     // <--
131cdf0e10cSrcweir 
132cdf0e10cSrcweir 	void				InitControls();
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	DECL_LINK( LevelHdl, ListBox * );
135cdf0e10cSrcweir 	DECL_LINK( EditModifyHdl, Edit*);
136cdf0e10cSrcweir 	DECL_LINK( DistanceHdl, MetricField * );
137cdf0e10cSrcweir 	DECL_LINK( RelativeHdl, CheckBox * );
138cdf0e10cSrcweir 	DECL_LINK( StandardHdl, PushButton * );
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     // --> OD 2008-02-01 #newlistlevelattrs#
141cdf0e10cSrcweir     void InitPosAndSpaceMode();
142cdf0e10cSrcweir     void ShowControlsDependingOnPosAndSpaceMode();
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     DECL_LINK( LabelFollowedByHdl_Impl, ListBox* );
145cdf0e10cSrcweir     DECL_LINK( ListtabPosHdl_Impl, MetricField* );
146cdf0e10cSrcweir     DECL_LINK( AlignAtHdl_Impl, MetricField* );
147cdf0e10cSrcweir     DECL_LINK( IndentAtHdl_Impl, MetricField* );
148cdf0e10cSrcweir     // <--
149cdf0e10cSrcweir 
150cdf0e10cSrcweir     using SfxTabPage::ActivatePage;
151cdf0e10cSrcweir     using SfxTabPage::DeactivatePage;
152cdf0e10cSrcweir 
153cdf0e10cSrcweir public:
154cdf0e10cSrcweir 
155cdf0e10cSrcweir     SwNumPositionTabPage(Window* pParent,
156cdf0e10cSrcweir 							   const SfxItemSet& rSet);
157cdf0e10cSrcweir 	~SwNumPositionTabPage();
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 	virtual void 		ActivatePage(const SfxItemSet& rSet);
160cdf0e10cSrcweir 	virtual int 		DeactivatePage(SfxItemSet *pSet);
161cdf0e10cSrcweir 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
162cdf0e10cSrcweir 	virtual	void 		Reset( const SfxItemSet& rSet );
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 	static SfxTabPage*	Create( Window* pParent,
165cdf0e10cSrcweir 								const SfxItemSet& rAttrSet);
166cdf0e10cSrcweir 
SetOutlineTabDialog(SwOutlineTabDialog * pDlg)167cdf0e10cSrcweir 	void				SetOutlineTabDialog(SwOutlineTabDialog* pDlg){pOutlineDlg = pDlg;}
168cdf0e10cSrcweir 	void				SetWrtShell(SwWrtShell* pSh);
169cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1
170cdf0e10cSrcweir 	void				SetModified(sal_Bool bRepaint = sal_True);
171cdf0e10cSrcweir #else
SetModified(sal_Bool bRepaint=sal_True)172cdf0e10cSrcweir 	void				SetModified(sal_Bool bRepaint = sal_True)
173cdf0e10cSrcweir 							{   bModified = sal_True;
174cdf0e10cSrcweir 								if(bRepaint)
175cdf0e10cSrcweir 								{
176cdf0e10cSrcweir 									aPreviewWIN.SetLevel(nActNumLvl);
177cdf0e10cSrcweir 									aPreviewWIN.Invalidate();
178cdf0e10cSrcweir 								}
179cdf0e10cSrcweir 							}
180cdf0e10cSrcweir #endif
181cdf0e10cSrcweir };
182cdf0e10cSrcweir 
183cdf0e10cSrcweir class SwSvxNumBulletTabDialog : public SfxTabDialog
184cdf0e10cSrcweir {
185cdf0e10cSrcweir 	SwWrtShell&			rWrtSh;
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 	String				sRemoveText;
188cdf0e10cSrcweir 	int					nRetOptionsDialog;
189cdf0e10cSrcweir 
190cdf0e10cSrcweir 	protected:
191cdf0e10cSrcweir 		virtual short	Ok();
192cdf0e10cSrcweir 		virtual void 	PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage);
193cdf0e10cSrcweir 		DECL_LINK(RemoveNumberingHdl, PushButton*);
194cdf0e10cSrcweir 	public:
195cdf0e10cSrcweir 		SwSvxNumBulletTabDialog(Window* pParent,
196cdf0e10cSrcweir 					const SfxItemSet* pSwItemSet,
197cdf0e10cSrcweir 					SwWrtShell &);
198cdf0e10cSrcweir 		~SwSvxNumBulletTabDialog();
199cdf0e10cSrcweir };
200cdf0e10cSrcweir #endif // _NUM_CXX
201cdf0e10cSrcweir 
202