xref: /AOO41X/main/sw/source/ui/inc/num.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _NUM_HXX
28*cdf0e10cSrcweir #define _NUM_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
32*cdf0e10cSrcweir #ifndef _MENUBTN_HXX //autogen
33*cdf0e10cSrcweir #include <vcl/menubtn.hxx>
34*cdf0e10cSrcweir #endif
35*cdf0e10cSrcweir #ifndef _FIELD_HXX //autogen
36*cdf0e10cSrcweir #include <vcl/field.hxx>
37*cdf0e10cSrcweir #endif
38*cdf0e10cSrcweir #ifndef _FIXED_HXX //autogen
39*cdf0e10cSrcweir #include <vcl/fixed.hxx>
40*cdf0e10cSrcweir #endif
41*cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
42*cdf0e10cSrcweir #ifndef _BUTTON_HXX //autogen
43*cdf0e10cSrcweir #include <vcl/button.hxx>
44*cdf0e10cSrcweir #endif
45*cdf0e10cSrcweir #ifndef _LSTBOX_HXX //autogen
46*cdf0e10cSrcweir #include <vcl/lstbox.hxx>
47*cdf0e10cSrcweir #endif
48*cdf0e10cSrcweir #ifndef _EDIT_HXX //autogen
49*cdf0e10cSrcweir #include <vcl/edit.hxx>
50*cdf0e10cSrcweir #endif
51*cdf0e10cSrcweir #include <svx/stddlg.hxx>
52*cdf0e10cSrcweir #include <numprevw.hxx>
53*cdf0e10cSrcweir #include "numrule.hxx"
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir class SwWrtShell;
56*cdf0e10cSrcweir class SvxBrushItem;
57*cdf0e10cSrcweir class SwOutlineTabDialog;
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir /*-----------------13.02.97 14.02-------------------
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir --------------------------------------------------*/
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir struct SwBmpItemInfo
65*cdf0e10cSrcweir {
66*cdf0e10cSrcweir 	SvxBrushItem* 	pBrushItem;
67*cdf0e10cSrcweir 	sal_uInt16 			nItemId;
68*cdf0e10cSrcweir };
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir /*-----------------07.02.97 15.37-------------------
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir --------------------------------------------------*/
74*cdf0e10cSrcweir #define NUM_PAGETYPE_BULLET			0
75*cdf0e10cSrcweir #define NUM_PAGETYPE_SINGLENUM      1
76*cdf0e10cSrcweir #define NUM_PAGETYPE_NUM            2
77*cdf0e10cSrcweir #define NUM_PAGETYPE_BMP            3
78*cdf0e10cSrcweir #define PAGETYPE_USER_START         10
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir /*-----------------03.12.97 10:18-------------------
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir --------------------------------------------------*/
83*cdf0e10cSrcweir class SwNumPositionTabPage : public SfxTabPage
84*cdf0e10cSrcweir {
85*cdf0e10cSrcweir     	FixedLine       aLevelFL;
86*cdf0e10cSrcweir 	MultiListBox	aLevelLB;
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir     // --> OD 2008-02-01 #newlistlevelattrs#
89*cdf0e10cSrcweir     // former set of controls shown for numbering rules containing list level
90*cdf0e10cSrcweir     // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
91*cdf0e10cSrcweir 	FixedLine       aPositionFL;
92*cdf0e10cSrcweir 	FixedText       	aDistBorderFT;
93*cdf0e10cSrcweir 	MetricField			aDistBorderMF;
94*cdf0e10cSrcweir 	CheckBox			aRelativeCB;
95*cdf0e10cSrcweir 	FixedText			aIndentFT;
96*cdf0e10cSrcweir 	MetricField			aIndentMF;
97*cdf0e10cSrcweir 	FixedText       	aDistNumFT;
98*cdf0e10cSrcweir 	MetricField			aDistNumMF;
99*cdf0e10cSrcweir 	FixedText			aAlignFT;
100*cdf0e10cSrcweir 	ListBox				aAlignLB;
101*cdf0e10cSrcweir     // <--
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir     // --> OD 2008-02-01 #newlistlevelattrs#
104*cdf0e10cSrcweir     // new set of controls shown for numbering rules containing list level
105*cdf0e10cSrcweir     // attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT
106*cdf0e10cSrcweir     FixedText           aLabelFollowedByFT;
107*cdf0e10cSrcweir     ListBox             aLabelFollowedByLB;
108*cdf0e10cSrcweir     FixedText           aListtabFT;
109*cdf0e10cSrcweir     MetricField         aListtabMF;
110*cdf0e10cSrcweir     FixedText           aAlign2FT;
111*cdf0e10cSrcweir     ListBox             aAlign2LB;
112*cdf0e10cSrcweir     FixedText           aAlignedAtFT;
113*cdf0e10cSrcweir     MetricField         aAlignedAtMF;
114*cdf0e10cSrcweir     FixedText           aIndentAtFT;
115*cdf0e10cSrcweir     MetricField         aIndentAtMF;
116*cdf0e10cSrcweir     // <--
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir 	PushButton			aStandardPB;
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 	NumberingPreview	aPreviewWIN;
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 	SwNumRule* 			pActNum;
123*cdf0e10cSrcweir 	SwNumRule* 			pSaveNum;
124*cdf0e10cSrcweir 	SwWrtShell* 		pWrtSh;
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir 	SwOutlineTabDialog*	pOutlineDlg;
127*cdf0e10cSrcweir 	sal_uInt16				nActNumLvl;
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir 	sal_Bool				bModified 			: 1;
130*cdf0e10cSrcweir 	sal_Bool				bPreset				: 1;
131*cdf0e10cSrcweir 	sal_Bool				bInInintControl		: 1;  //Modify-Fehler umgehen, soll ab 391 behoben sein
132*cdf0e10cSrcweir     // --> OD 2008-02-01 #newlistlevelattrs#
133*cdf0e10cSrcweir     bool                bLabelAlignmentPosAndSpaceModeActive;
134*cdf0e10cSrcweir     // <--
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir 	void				InitControls();
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir 	DECL_LINK( LevelHdl, ListBox * );
139*cdf0e10cSrcweir 	DECL_LINK( EditModifyHdl, Edit*);
140*cdf0e10cSrcweir 	DECL_LINK( DistanceHdl, MetricField * );
141*cdf0e10cSrcweir 	DECL_LINK( RelativeHdl, CheckBox * );
142*cdf0e10cSrcweir 	DECL_LINK( StandardHdl, PushButton * );
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir     // --> OD 2008-02-01 #newlistlevelattrs#
145*cdf0e10cSrcweir     void InitPosAndSpaceMode();
146*cdf0e10cSrcweir     void ShowControlsDependingOnPosAndSpaceMode();
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir     DECL_LINK( LabelFollowedByHdl_Impl, ListBox* );
149*cdf0e10cSrcweir     DECL_LINK( ListtabPosHdl_Impl, MetricField* );
150*cdf0e10cSrcweir     DECL_LINK( AlignAtHdl_Impl, MetricField* );
151*cdf0e10cSrcweir     DECL_LINK( IndentAtHdl_Impl, MetricField* );
152*cdf0e10cSrcweir     // <--
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir     using SfxTabPage::ActivatePage;
155*cdf0e10cSrcweir     using SfxTabPage::DeactivatePage;
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir public:
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir     SwNumPositionTabPage(Window* pParent,
160*cdf0e10cSrcweir 							   const SfxItemSet& rSet);
161*cdf0e10cSrcweir 	~SwNumPositionTabPage();
162*cdf0e10cSrcweir 
163*cdf0e10cSrcweir 	virtual void 		ActivatePage(const SfxItemSet& rSet);
164*cdf0e10cSrcweir 	virtual int 		DeactivatePage(SfxItemSet *pSet);
165*cdf0e10cSrcweir 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
166*cdf0e10cSrcweir 	virtual	void 		Reset( const SfxItemSet& rSet );
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir 	static SfxTabPage*	Create( Window* pParent,
169*cdf0e10cSrcweir 								const SfxItemSet& rAttrSet);
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir 	void				SetOutlineTabDialog(SwOutlineTabDialog* pDlg){pOutlineDlg = pDlg;}
172*cdf0e10cSrcweir 	void				SetWrtShell(SwWrtShell* pSh);
173*cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1
174*cdf0e10cSrcweir 	void				SetModified(sal_Bool bRepaint = sal_True);
175*cdf0e10cSrcweir #else
176*cdf0e10cSrcweir 	void				SetModified(sal_Bool bRepaint = sal_True)
177*cdf0e10cSrcweir 							{   bModified = sal_True;
178*cdf0e10cSrcweir 								if(bRepaint)
179*cdf0e10cSrcweir 								{
180*cdf0e10cSrcweir 									aPreviewWIN.SetLevel(nActNumLvl);
181*cdf0e10cSrcweir 									aPreviewWIN.Invalidate();
182*cdf0e10cSrcweir 								}
183*cdf0e10cSrcweir 							}
184*cdf0e10cSrcweir #endif
185*cdf0e10cSrcweir };
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir class SwSvxNumBulletTabDialog : public SfxTabDialog
188*cdf0e10cSrcweir {
189*cdf0e10cSrcweir 	SwWrtShell&			rWrtSh;
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir 	String				sRemoveText;
192*cdf0e10cSrcweir 	int					nRetOptionsDialog;
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir 	protected:
195*cdf0e10cSrcweir 		virtual short	Ok();
196*cdf0e10cSrcweir 		virtual void 	PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage);
197*cdf0e10cSrcweir 		DECL_LINK(RemoveNumberingHdl, PushButton*);
198*cdf0e10cSrcweir 	public:
199*cdf0e10cSrcweir 		SwSvxNumBulletTabDialog(Window* pParent,
200*cdf0e10cSrcweir 					const SfxItemSet* pSwItemSet,
201*cdf0e10cSrcweir 					SwWrtShell &);
202*cdf0e10cSrcweir 		~SwSvxNumBulletTabDialog();
203*cdf0e10cSrcweir };
204*cdf0e10cSrcweir #endif // _NUM_CXX
205*cdf0e10cSrcweir 
206