xref: /aoo41x/main/sw/source/ui/inc/column.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 
24cdf0e10cSrcweir #ifndef _COLUMN_HXX
25cdf0e10cSrcweir #define _COLUMN_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #ifndef _FIXED_HXX //autogen
29cdf0e10cSrcweir #include <vcl/fixed.hxx>
30cdf0e10cSrcweir #endif
31cdf0e10cSrcweir #ifndef _FIELD_HXX //autogen
32cdf0e10cSrcweir #include <vcl/field.hxx>
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir #ifndef _IMAGE_HXX //autogen
35cdf0e10cSrcweir #include <vcl/image.hxx>
36cdf0e10cSrcweir #endif
37cdf0e10cSrcweir #ifndef _GROUP_HXX //autogen
38cdf0e10cSrcweir #include <vcl/group.hxx>
39cdf0e10cSrcweir #endif
40cdf0e10cSrcweir #ifndef _LSTBOX_HXX //autogen
41cdf0e10cSrcweir #include <vcl/lstbox.hxx>
42cdf0e10cSrcweir #endif
43cdf0e10cSrcweir #ifndef _BUTTON_HXX //autogen
44cdf0e10cSrcweir #include <vcl/button.hxx>
45cdf0e10cSrcweir #endif
46cdf0e10cSrcweir #include <vcl/timer.hxx>
47cdf0e10cSrcweir #ifndef _IMAGEBTN_HXX //autogen
48cdf0e10cSrcweir #include <vcl/button.hxx>
49cdf0e10cSrcweir #endif
50cdf0e10cSrcweir #include <svtools/ctrlbox.hxx>
51cdf0e10cSrcweir #include <svtools/valueset.hxx>
52cdf0e10cSrcweir #include <sfx2/basedlgs.hxx>
53cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
54cdf0e10cSrcweir #include <fmtclbl.hxx>
55cdf0e10cSrcweir #include <colex.hxx>
56cdf0e10cSrcweir #include <prcntfld.hxx>
57cdf0e10cSrcweir 
58cdf0e10cSrcweir const int nMaxCols = 99;
59cdf0e10cSrcweir class SwColMgr;
60cdf0e10cSrcweir class SwWrtShell;
61cdf0e10cSrcweir class SwColumnPage;
62cdf0e10cSrcweir /*--------------------------------------------------------------------
63cdf0e10cSrcweir 	Beschreibung:
64cdf0e10cSrcweir  --------------------------------------------------------------------*/
65cdf0e10cSrcweir 
66cdf0e10cSrcweir class SwColumnDlg : public SfxModalDialog
67cdf0e10cSrcweir {
68cdf0e10cSrcweir 	OKButton 			aOK;
69cdf0e10cSrcweir 	CancelButton 		aCancel;
70cdf0e10cSrcweir 	HelpButton 			aHelp;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	FixedText			aApplyToFT;
73cdf0e10cSrcweir 	ListBox				aApplyToLB;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 	SwWrtShell& 		rWrtShell;
76cdf0e10cSrcweir 	SwColumnPage*		pTabPage;
77cdf0e10cSrcweir 	SfxItemSet* 		pPageSet;
78cdf0e10cSrcweir 	SfxItemSet* 		pSectionSet;
79cdf0e10cSrcweir 	SfxItemSet* 		pSelectionSet;
80cdf0e10cSrcweir 	SfxItemSet* 		pFrameSet;
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	long				nOldSelection;
83cdf0e10cSrcweir 	long 				nSelectionWidth;
84cdf0e10cSrcweir 	long 				nPageWidth;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 	sal_Bool				bPageChanged : 1;
87cdf0e10cSrcweir 	sal_Bool				bSectionChanged : 1;
88cdf0e10cSrcweir 	sal_Bool				bSelSectionChanged : 1;
89cdf0e10cSrcweir 	sal_Bool				bFrameChanged : 1;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	DECL_LINK(ObjectHdl, ListBox*);
93cdf0e10cSrcweir 	DECL_LINK(OkHdl, OKButton*);
94cdf0e10cSrcweir 
95cdf0e10cSrcweir public:
96cdf0e10cSrcweir 	SwColumnDlg(Window* pParent, SwWrtShell& rSh);
97cdf0e10cSrcweir 	virtual ~SwColumnDlg();
98cdf0e10cSrcweir 
GetWrtShell()99cdf0e10cSrcweir 	SwWrtShell& 	GetWrtShell()	{ return rWrtShell; }
100cdf0e10cSrcweir };
101cdf0e10cSrcweir 
102cdf0e10cSrcweir /*-----------------07.03.97 08.26-------------------
103cdf0e10cSrcweir 
104cdf0e10cSrcweir --------------------------------------------------*/
105cdf0e10cSrcweir class ColumnValueSet : public ValueSet
106cdf0e10cSrcweir {
107cdf0e10cSrcweir 	public:
ColumnValueSet(Window * pParent,const ResId & rResId)108cdf0e10cSrcweir 		ColumnValueSet(Window* pParent, const ResId& rResId) :
109cdf0e10cSrcweir 			ValueSet(pParent, rResId){}
110cdf0e10cSrcweir 		~ColumnValueSet();
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 	virtual void	UserDraw( const UserDrawEvent& rUDEvt );
113cdf0e10cSrcweir     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
114cdf0e10cSrcweir };
115cdf0e10cSrcweir 
116cdf0e10cSrcweir /*--------------------------------------------------------------------
117cdf0e10cSrcweir 	Beschreibung:	Spaltendialog jetzt als TabPage
118cdf0e10cSrcweir  --------------------------------------------------------------------*/
119cdf0e10cSrcweir class SwColumnPage : public SfxTabPage
120cdf0e10cSrcweir {
121cdf0e10cSrcweir 	FixedLine		aFLGroup;
122cdf0e10cSrcweir 	FixedText		aClNrLbl;
123cdf0e10cSrcweir 	NumericField	aCLNrEdt;
124cdf0e10cSrcweir 	ColumnValueSet	aDefaultVS;
125cdf0e10cSrcweir 	ImageList		aPreColsIL;
126cdf0e10cSrcweir 	CheckBox		aBalanceColsCB;
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 	FixedLine		aFLLayout;
129cdf0e10cSrcweir 	ImageButton		aBtnUp;
130cdf0e10cSrcweir     FixedText       aColumnFT;
131cdf0e10cSrcweir 	FixedText		aWidthFT;
132cdf0e10cSrcweir 	FixedText		aDistFT;
133cdf0e10cSrcweir     FixedText       aLbl1;
134cdf0e10cSrcweir 	PercentField	aEd1;
135cdf0e10cSrcweir 	PercentField	aDistEd1;
136cdf0e10cSrcweir     FixedText       aLbl2;
137cdf0e10cSrcweir 	PercentField	aEd2;
138cdf0e10cSrcweir 	PercentField	aDistEd2;
139cdf0e10cSrcweir     FixedText       aLbl3;
140cdf0e10cSrcweir 	PercentField	aEd3;
141cdf0e10cSrcweir 	ImageButton		aBtnDown;
142cdf0e10cSrcweir 	CheckBox		aAutoWidthBox;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 	FixedLine		aFLLineType;
146cdf0e10cSrcweir 	FixedText		aLineTypeLbl;
147cdf0e10cSrcweir 	LineListBox		aLineTypeDLB;
148cdf0e10cSrcweir 	FixedText		aLineHeightLbl;
149cdf0e10cSrcweir 	MetricField		aLineHeightEdit;
150cdf0e10cSrcweir 	FixedText		aLinePosLbl;
151cdf0e10cSrcweir 	ListBox			aLinePosDLB;
152cdf0e10cSrcweir 
153cdf0e10cSrcweir     FixedLine       aVertFL;
154cdf0e10cSrcweir     FixedLine       aPropertiesFL;
155cdf0e10cSrcweir     FixedText       aTextDirectionFT;
156cdf0e10cSrcweir     ListBox         aTextDirectionLB;
157cdf0e10cSrcweir 
158cdf0e10cSrcweir     // Example
159cdf0e10cSrcweir 	SwColExample 		aPgeExampleWN;
160cdf0e10cSrcweir 	SwColumnOnlyExample	aFrmExampleWN;
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 	SwColMgr*       pColMgr;
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 	sal_uInt16			nFirstVis;
165cdf0e10cSrcweir 	sal_uInt16			nCols;
166cdf0e10cSrcweir 	long			nColWidth[nMaxCols];
167cdf0e10cSrcweir 	long			nColDist[nMaxCols];
168cdf0e10cSrcweir 	sal_uInt16			nMinWidth;
169cdf0e10cSrcweir 	PercentField	*pModifiedField;
170cdf0e10cSrcweir 	sal_Bool 			bFormat;
171cdf0e10cSrcweir 	sal_Bool			bFrm;
172cdf0e10cSrcweir 	sal_Bool 			bHtmlMode;
173cdf0e10cSrcweir 	sal_Bool			bLockUpdate;
174cdf0e10cSrcweir 
175cdf0e10cSrcweir 	// Handler
176cdf0e10cSrcweir 	DECL_LINK( ColModify, NumericField * );
177cdf0e10cSrcweir 	DECL_LINK( GapModify, PercentField * );
178cdf0e10cSrcweir 	DECL_LINK( EdModify, PercentField * );
179cdf0e10cSrcweir 	DECL_LINK( AutoWidthHdl, CheckBox * );
180cdf0e10cSrcweir 	DECL_LINK( Timeout, Timer * );
181cdf0e10cSrcweir 	DECL_LINK( SetDefaultsHdl, ValueSet * );
182cdf0e10cSrcweir 
183cdf0e10cSrcweir 	DECL_LINK( Up, Button * );
184cdf0e10cSrcweir 	DECL_LINK( Down, Button * );
185cdf0e10cSrcweir 	void			Apply(Button *);
186cdf0e10cSrcweir 	DECL_LINK( UpdateColMgr, void* );
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 	void			Update();
189cdf0e10cSrcweir 	void			UpdateCols();
190cdf0e10cSrcweir 	void			Init();
191cdf0e10cSrcweir 	void			ResetColWidth();
192cdf0e10cSrcweir 	void			SetLabels( sal_uInt16 nVis );
193cdf0e10cSrcweir 
194cdf0e10cSrcweir     using SfxTabPage::ActivatePage;
195cdf0e10cSrcweir     using SfxTabPage::DeactivatePage;
196cdf0e10cSrcweir 
197cdf0e10cSrcweir 	virtual void 	ActivatePage(const SfxItemSet& rSet);
198cdf0e10cSrcweir 	virtual int 	DeactivatePage(SfxItemSet *pSet);
199cdf0e10cSrcweir 
200cdf0e10cSrcweir 	SwColumnPage(Window *pParent, const SfxItemSet &rSet);
201cdf0e10cSrcweir 
202cdf0e10cSrcweir public:
203cdf0e10cSrcweir     virtual ~SwColumnPage();
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 	static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
206cdf0e10cSrcweir 	static sal_uInt16* GetRanges();
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 	virtual sal_Bool 	FillItemSet(SfxItemSet &rSet);
209cdf0e10cSrcweir 	virtual void 	Reset(const SfxItemSet &rSet);
210cdf0e10cSrcweir 
211cdf0e10cSrcweir 	void SetFrmMode(sal_Bool bMod);
212cdf0e10cSrcweir 	void SetPageWidth(long nPageWidth);
213cdf0e10cSrcweir 
SetFormatUsed(sal_Bool bFmt)214cdf0e10cSrcweir 	void SetFormatUsed(sal_Bool bFmt) { bFormat = bFmt; }
215cdf0e10cSrcweir 
ShowBalance(sal_Bool bShow)216cdf0e10cSrcweir 	void ShowBalance(sal_Bool bShow) {aBalanceColsCB.Show(bShow);}
217cdf0e10cSrcweir     void SetInSection(sal_Bool bSet);
218cdf0e10cSrcweir 
ActivateColumnControl()219cdf0e10cSrcweir     void ActivateColumnControl() {aCLNrEdt.GrabFocus();}
220cdf0e10cSrcweir };
221cdf0e10cSrcweir 
222cdf0e10cSrcweir #endif
223cdf0e10cSrcweir 
224