xref: /aoo41x/main/sw/source/ui/table/tablepg.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 _SWTABLEPG_HXX
28 #define _SWTABLEPG_HXX
29 #include <sfx2/tabdlg.hxx>
30 #ifndef _FIXED_HXX //autogen
31 #include <vcl/fixed.hxx>
32 #endif
33 #ifndef _IMAGEBTN_HXX //autogen
34 #include <vcl/button.hxx>
35 #endif
36 #ifndef _LSTBOX_HXX //autogen
37 #include <vcl/lstbox.hxx>
38 #endif
39 #include <actctrl.hxx>
40 #include "prcntfld.hxx"
41 #include "swtypes.hxx"
42 #include "textcontrolcombo.hxx"
43 
44 class SwWrtShell;
45 class SwTableRep;
46 
47 struct TColumn
48 {
49 	SwTwips nWidth;
50 	sal_Bool	bVisible;
51 };
52 
53 class SwFormatTablePage : public SfxTabPage
54 {
55     FixedLine        aOptionsFL;
56 	FixedText		aNameFT;
57 	TableNameEdit	aNameED;
58 	FixedText		aWidthFT;
59 	PercentField	aWidthMF;
60 	CheckBox		aRelWidthCB;
61 
62     FixedLine        aPosFL;
63 	RadioButton 	aFullBtn;
64 	RadioButton 	aLeftBtn;
65 	RadioButton 	aFromLeftBtn;
66 	RadioButton 	aRightBtn;
67 	RadioButton 	aCenterBtn;
68 	RadioButton 	aFreeBtn;
69 
70     FixedLine       aDistFL;
71 	FixedText		aLeftFT;
72 	PercentField 	aLeftMF;
73 	FixedText		aRightFT;
74 	PercentField	aRightMF;
75 	FixedText		aTopFT;
76 	MetricField 	aTopMF;
77 	FixedText		aBottomFT;
78 	MetricField 	aBottomMF;
79 
80     FixedLine       aPropertiesFL;
81     FixedText       aTextDirectionFT;
82     ListBox         aTextDirectionLB;
83 
84     SwTableRep*     pTblData;
85 	SwTwips			nSaveWidth;
86 	SwTwips			nMinTableWidth;
87 	sal_uInt16 			nOldAlign;
88 	sal_Bool			bModified;
89 	sal_Bool 			bFull:1;
90     sal_Bool            bHtmlMode : 1;
91 
92 	void		Init();
93 	void		ModifyHdl( Edit* pEdit );
94 
95 	DECL_LINK( AutoClickHdl, CheckBox * );
96 	DECL_LINK( RelWidthClickHdl, CheckBox * );
97 	DECL_LINK( RightModifyHdl, MetricField * );
98     DECL_LINK( UpDownLoseFocusHdl, MetricField * );
99 
100     using TabPage::ActivatePage;
101     using TabPage::DeactivatePage;
102 
103 public:
104 	SwFormatTablePage( Window* pParent, const SfxItemSet& rSet );
105 
106 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rAttrSet);
107 	virtual sal_Bool		FillItemSet( SfxItemSet& rSet );
108 	virtual void		Reset( const SfxItemSet& rSet );
109 	virtual void		ActivatePage( const SfxItemSet& rSet );
110 	virtual int 		DeactivatePage( SfxItemSet* pSet = 0 );
111 };
112 
113 /*-------------------------------------------------------
114  TabPage Format/Tabelle/Spalten
115 --------------------------------------------------------- */
116 #define MET_FIELDS 6 //Anzahl der verwendeten MetricFields
117 
118 class SwTableColumnPage : public SfxTabPage
119 {
120 	CheckBox		aModifyTableCB;
121 	CheckBox		aProportionalCB;
122 	FixedText		aSpaceFT;
123 	MetricField		aSpaceED;
124  	FixedLine        aColFL;
125 	ImageButton 	aUpBtn;
126 	FixedText		aFT1;
127 	PercentField	aMF1;
128 	FixedText		aFT2;
129 	PercentField	aMF2;
130 	FixedText		aFT3;
131 	PercentField	aMF3;
132 	FixedText		aFT4;
133 	PercentField	aMF4;
134 	FixedText		aFT5;
135 	PercentField	aMF5;
136 	FixedText		aFT6;
137 	PercentField	aMF6;
138 	ImageButton 	aDownBtn;
139 
140 	SwTableRep*		pTblData;
141 	PercentField*	pFieldArr[MET_FIELDS];
142 	FixedText*		pTextArr[MET_FIELDS];
143 	SwTwips 		nTableWidth;
144 	SwTwips 		nMinWidth;
145 	sal_uInt16			nNoOfCols;
146 	sal_uInt16			nNoOfVisibleCols;
147 	//Breite merken, wenn auf autom. Ausrichtung gestellt wird
148 	sal_uInt16			aValueTbl[MET_FIELDS];//primaere Zuordnung der MetricFields
149 	sal_Bool			bModified:1;
150 	sal_Bool			bModifyTbl:1;
151 	sal_Bool			bPercentMode:1;
152 
153 	void		Init(sal_Bool bWeb);
154 	DECL_LINK( AutoClickHdl, CheckBox * );
155 	void		ModifyHdl( PercentField* pEdit );
156 	DECL_LINK( UpHdl, PercentField * );
157 	DECL_LINK( DownHdl, PercentField * );
158 	DECL_LINK( LoseFocusHdl, PercentField * );
159 	DECL_LINK( ModeHdl, CheckBox * );
160 	void		UpdateCols( sal_uInt16 nAktPos );
161 	SwTwips 	GetVisibleWidth(sal_uInt16 nPos);
162 	void 		SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth);
163 
164     using TabPage::ActivatePage;
165     using TabPage::DeactivatePage;
166 
167 public:
168 	SwTableColumnPage( Window* pParent, const SfxItemSet& rSet );
169 	~SwTableColumnPage();
170 
171 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rAttrSet);
172 	virtual sal_Bool		FillItemSet( SfxItemSet& rSet );
173 	virtual void		Reset( const SfxItemSet& rSet );
174 	virtual void		ActivatePage( const SfxItemSet& rSet );
175 	virtual int 		DeactivatePage( SfxItemSet* pSet = 0 );
176 
177 };
178 
179 /*-----------------12.12.96 11.48-------------------
180         Textfluss
181 --------------------------------------------------*/
182 class SwTextFlowPage : public SfxTabPage
183 {
184     FixedLine       aFlowFL;
185 	CheckBox		aPgBrkCB;
186 	RadioButton 	aPgBrkRB;
187 	RadioButton 	aColBrkRB;
188 	RadioButton 	aPgBrkBeforeRB;
189 	RadioButton 	aPgBrkAfterRB;
190 	CheckBox		aPageCollCB;
191 	ListBox			aPageCollLB;
192 	FixedText		aPageNoFT;
193 	NumericField	aPageNoNF;
194 	CheckBox		aSplitCB;
195     TriStateBox     aSplitRowCB;
196 	CheckBox		aKeepCB;
197 	CheckBox		aHeadLineCB;
198 	FixedText		aRepeatHeaderFT;	// "dummy" to build before and after FT
199 	FixedText		aRepeatHeaderBeforeFT;
200 	NumericField	aRepeatHeaderNF;
201 	FixedText		aRepeatHeaderAfterFT;
202 	TextControlCombo	aRepeatHeaderCombo;
203     FixedText       aTextDirectionFT;
204     ListBox         aTextDirectionLB;
205 
206     FixedLine       aVertOrientFL;
207     FixedText       aVertOrientFT;
208     ListBox         aVertOrientLB;
209 
210 	SwWrtShell*		pShell;
211 
212 	sal_Bool			bPageBreak;
213 	sal_Bool			bHtmlMode;
214 
215 
216 	DECL_LINK( PageBreakHdl_Impl, CheckBox* );
217 	DECL_LINK( ApplyCollClickHdl_Impl, CheckBox* );
218 	DECL_LINK( PageBreakPosHdl_Impl, RadioButton* );
219 	DECL_LINK( PageBreakTypeHdl_Impl, RadioButton* );
220     DECL_LINK( SplitHdl_Impl, CheckBox* );
221     DECL_LINK( SplitRowHdl_Impl, TriStateBox* );
222 	DECL_LINK( HeadLineCBClickHdl, void* p = 0 );
223 
224 
225 	SwTextFlowPage( Window* pParent, const SfxItemSet& rSet );
226 	~SwTextFlowPage();
227 
228 public:
229 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rAttrSet);
230 	virtual sal_Bool		FillItemSet( SfxItemSet& rSet );
231 	virtual void		Reset( const SfxItemSet& rSet );
232 
233 	void				SetShell(SwWrtShell* pSh);
234 
235 	void				DisablePageBreak();
236 };
237 
238 #endif
239