xref: /trunk/main/sw/source/ui/fldui/fldvar.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _SWFLDVAR_HXX
28 #define _SWFLDVAR_HXX
29 
30 #include <sfx2/tabdlg.hxx>
31 #include <vcl/fixed.hxx>
32 #include <vcl/lstbox.hxx>
33 #ifndef _SV_BUTTON_HXX //autogen
34 #include <vcl/button.hxx>
35 #endif
36 #include <vcl/group.hxx>
37 #include <vcl/toolbox.hxx>
38 #include <vcl/edit.hxx>
39 
40 #include "fldpage.hxx"
41 #include "condedit.hxx"
42 #include "numfmtlb.hxx"
43 
44 class SwFldVarPage;
45 
46 /*--------------------------------------------------------------------
47    Beschreibung:
48  --------------------------------------------------------------------*/
49 
50 class SelectionListBox : public ListBox
51 {
52 	SwFldVarPage* 	pDlg;
53 	sal_Bool 			bCallAddSelection;
54 
55 	virtual long		PreNotify( NotifyEvent& rNEvt );
56 
57 public:
58 	SelectionListBox( SwFldVarPage* pDialog, const ResId& rResId );
59 
60 	//	Selektieren per Ctrl oder Alt erkennen und mit SelectHdl auswerten
61 	sal_Bool			IsCallAddSelection() const {return bCallAddSelection;}
62 	void 			ResetCallAddSelection() {bCallAddSelection = sal_False;}
63 };
64 
65 /*--------------------------------------------------------------------
66    Beschreibung:
67  --------------------------------------------------------------------*/
68 
69 class SwFldVarPage : public SwFldPage
70 {
71 	friend class SelectionListBox;
72 
73 	FixedText 			aTypeFT;
74 	ListBox 			aTypeLB;
75 	FixedText 			aSelectionFT;
76 	SelectionListBox	aSelectionLB;
77 	FixedText 			aNameFT;
78 	Edit				aNameED;
79 	FixedText 			aValueFT;
80 	ConditionEdit 		aValueED;
81 	FixedText			aFormatFT;
82 	NumFormatListBox	aNumFormatLB;
83 	ListBox				aFormatLB;
84 	FixedText 			aChapterHeaderFT;
85 	FixedText 			aChapterLevelFT;
86 	ListBox				aChapterLevelLB;
87 	CheckBox			aInvisibleCB;
88 	FixedText			aSeparatorFT;
89 	Edit				aSeparatorED;
90 	ToolBox				aNewDelTBX;
91 
92 	String				sOldValueFT;
93 	String				sOldNameFT;
94 
95 	sal_uLong				nOldFormat;
96 	sal_Bool				bInit;
97 
98 	DECL_LINK( TypeHdl, ListBox* pLB = 0 );
99 	DECL_LINK( SubTypeHdl, ListBox* pLB = 0 );
100 	DECL_LINK( ModifyHdl, Edit *pED = 0 );
101 	DECL_LINK( TBClickHdl, ToolBox *pTB = 0);
102 	DECL_LINK( ChapterHdl, ListBox *pLB = 0);
103 	DECL_LINK( SeparatorHdl, Edit *pED = 0 );
104 
105 	void				UpdateSubType();
106 	sal_uInt16				FillFormatLB(sal_uInt16 nTypeId);
107 
108 protected:
109 	virtual sal_uInt16		GetGroup();
110 
111 public:
112 						SwFldVarPage(Window* pParent, const SfxItemSet& rSet);
113 
114 						~SwFldVarPage();
115 
116 	static SfxTabPage*  Create(Window* pParent, const SfxItemSet& rAttrSet);
117 
118 	virtual sal_Bool        FillItemSet( SfxItemSet& rSet );
119 	virtual void        Reset( const SfxItemSet& rSet );
120 
121 	virtual void		FillUserData();
122 };
123 
124 
125 #endif
126 
127