xref: /trunk/main/sw/source/ui/table/tablepg.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SWTABLEPG_HXX
24 #define _SWTABLEPG_HXX
25 #include <sfx2/tabdlg.hxx>
26 #ifndef _FIXED_HXX //autogen
27 #include <vcl/fixed.hxx>
28 #endif
29 #ifndef _IMAGEBTN_HXX //autogen
30 #include <vcl/button.hxx>
31 #endif
32 #ifndef _LSTBOX_HXX //autogen
33 #include <vcl/lstbox.hxx>
34 #endif
35 #include <actctrl.hxx>
36 #include "prcntfld.hxx"
37 #include "swtypes.hxx"
38 #include "textcontrolcombo.hxx"
39 
40 class SwWrtShell;
41 class SwTableRep;
42 
43 struct TColumn
44 {
45 	SwTwips nWidth;
46 	sal_Bool	bVisible;
47 };
48 
49 class SwFormatTablePage : public SfxTabPage
50 {
51     FixedLine        aOptionsFL;
52 	FixedText		aNameFT;
53 	TableNameEdit	aNameED;
54 	FixedText		aWidthFT;
55 	PercentField	aWidthMF;
56 	CheckBox		aRelWidthCB;
57 
58     FixedLine        aPosFL;
59 	RadioButton 	aFullBtn;
60 	RadioButton 	aLeftBtn;
61 	RadioButton 	aFromLeftBtn;
62 	RadioButton 	aRightBtn;
63 	RadioButton 	aCenterBtn;
64 	RadioButton 	aFreeBtn;
65 
66     FixedLine       aDistFL;
67 	FixedText		aLeftFT;
68 	PercentField 	aLeftMF;
69 	FixedText		aRightFT;
70 	PercentField	aRightMF;
71 	FixedText		aTopFT;
72 	MetricField 	aTopMF;
73 	FixedText		aBottomFT;
74 	MetricField 	aBottomMF;
75 
76     FixedLine       aPropertiesFL;
77     FixedText       aTextDirectionFT;
78     ListBox         aTextDirectionLB;
79 
80     SwTableRep*     pTblData;
81 	SwTwips			nSaveWidth;
82 	SwTwips			nMinTableWidth;
83 	sal_uInt16 			nOldAlign;
84 	sal_Bool			bModified;
85 	sal_Bool 			bFull:1;
86     sal_Bool            bHtmlMode : 1;
87 
88 	void		Init();
89 	void		ModifyHdl( Edit* pEdit );
90 
91 	DECL_LINK( AutoClickHdl, CheckBox * );
92 	DECL_LINK( RelWidthClickHdl, CheckBox * );
93 	DECL_LINK( RightModifyHdl, MetricField * );
94     DECL_LINK( UpDownLoseFocusHdl, MetricField * );
95 
96     using TabPage::ActivatePage;
97     using TabPage::DeactivatePage;
98 
99 public:
100 	SwFormatTablePage( Window* pParent, const SfxItemSet& rSet );
101 
102 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rAttrSet);
103 	virtual sal_Bool		FillItemSet( SfxItemSet& rSet );
104 	virtual void		Reset( const SfxItemSet& rSet );
105 	virtual void		ActivatePage( const SfxItemSet& rSet );
106 	virtual int 		DeactivatePage( SfxItemSet* pSet = 0 );
107 };
108 
109 /*-------------------------------------------------------
110  TabPage Format/Tabelle/Spalten
111 --------------------------------------------------------- */
112 #define MET_FIELDS 6 //Anzahl der verwendeten MetricFields
113 
114 class SwTableColumnPage : public SfxTabPage
115 {
116 	CheckBox		aModifyTableCB;
117 	CheckBox		aProportionalCB;
118 	FixedText		aSpaceFT;
119 	MetricField		aSpaceED;
120  	FixedLine        aColFL;
121 	ImageButton 	aUpBtn;
122 	FixedText		aFT1;
123 	PercentField	aMF1;
124 	FixedText		aFT2;
125 	PercentField	aMF2;
126 	FixedText		aFT3;
127 	PercentField	aMF3;
128 	FixedText		aFT4;
129 	PercentField	aMF4;
130 	FixedText		aFT5;
131 	PercentField	aMF5;
132 	FixedText		aFT6;
133 	PercentField	aMF6;
134 	ImageButton 	aDownBtn;
135 
136 	SwTableRep*		pTblData;
137 	PercentField*	pFieldArr[MET_FIELDS];
138 	FixedText*		pTextArr[MET_FIELDS];
139 	SwTwips 		nTableWidth;
140 	SwTwips 		nMinWidth;
141 	sal_uInt16			nNoOfCols;
142 	sal_uInt16			nNoOfVisibleCols;
143 	//Breite merken, wenn auf autom. Ausrichtung gestellt wird
144 	sal_uInt16			aValueTbl[MET_FIELDS];//primaere Zuordnung der MetricFields
145 	sal_Bool			bModified:1;
146 	sal_Bool			bModifyTbl:1;
147 	sal_Bool			bPercentMode:1;
148 
149 	void		Init(sal_Bool bWeb);
150 	DECL_LINK( AutoClickHdl, CheckBox * );
151 	void		ModifyHdl( PercentField* pEdit );
152 	DECL_LINK( UpHdl, PercentField * );
153 	DECL_LINK( DownHdl, PercentField * );
154 	DECL_LINK( LoseFocusHdl, PercentField * );
155 	DECL_LINK( ModeHdl, CheckBox * );
156 	void		UpdateCols( sal_uInt16 nAktPos );
157 	SwTwips 	GetVisibleWidth(sal_uInt16 nPos);
158 	void 		SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth);
159 
160     using TabPage::ActivatePage;
161     using TabPage::DeactivatePage;
162 
163 public:
164 	SwTableColumnPage( Window* pParent, const SfxItemSet& rSet );
165 	~SwTableColumnPage();
166 
167 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rAttrSet);
168 	virtual sal_Bool		FillItemSet( SfxItemSet& rSet );
169 	virtual void		Reset( const SfxItemSet& rSet );
170 	virtual void		ActivatePage( const SfxItemSet& rSet );
171 	virtual int 		DeactivatePage( SfxItemSet* pSet = 0 );
172 
173 };
174 
175 /*-----------------12.12.96 11.48-------------------
176         Textfluss
177 --------------------------------------------------*/
178 class SwTextFlowPage : public SfxTabPage
179 {
180     FixedLine       aFlowFL;
181 	CheckBox		aPgBrkCB;
182 	RadioButton 	aPgBrkRB;
183 	RadioButton 	aColBrkRB;
184 	RadioButton 	aPgBrkBeforeRB;
185 	RadioButton 	aPgBrkAfterRB;
186 	CheckBox		aPageCollCB;
187 	ListBox			aPageCollLB;
188 	FixedText		aPageNoFT;
189 	NumericField	aPageNoNF;
190 	CheckBox		aSplitCB;
191     TriStateBox     aSplitRowCB;
192 	CheckBox		aKeepCB;
193 	CheckBox		aHeadLineCB;
194 	FixedText		aRepeatHeaderFT;	// "dummy" to build before and after FT
195 	FixedText		aRepeatHeaderBeforeFT;
196 	NumericField	aRepeatHeaderNF;
197 	FixedText		aRepeatHeaderAfterFT;
198 	TextControlCombo	aRepeatHeaderCombo;
199     FixedText       aTextDirectionFT;
200     ListBox         aTextDirectionLB;
201 
202     FixedLine       aVertOrientFL;
203     FixedText       aVertOrientFT;
204     ListBox         aVertOrientLB;
205 
206 	SwWrtShell*		pShell;
207 
208 	sal_Bool			bPageBreak;
209 	sal_Bool			bHtmlMode;
210 
211 
212 	DECL_LINK( PageBreakHdl_Impl, CheckBox* );
213 	DECL_LINK( ApplyCollClickHdl_Impl, CheckBox* );
214 	DECL_LINK( PageBreakPosHdl_Impl, RadioButton* );
215 	DECL_LINK( PageBreakTypeHdl_Impl, RadioButton* );
216     DECL_LINK( SplitHdl_Impl, CheckBox* );
217     DECL_LINK( SplitRowHdl_Impl, TriStateBox* );
218 	DECL_LINK( HeadLineCBClickHdl, void* p = 0 );
219 
220 
221 	SwTextFlowPage( Window* pParent, const SfxItemSet& rSet );
222 	~SwTextFlowPage();
223 
224 public:
225 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rAttrSet);
226 	virtual sal_Bool		FillItemSet( SfxItemSet& rSet );
227 	virtual void		Reset( const SfxItemSet& rSet );
228 
229 	void				SetShell(SwWrtShell* pSh);
230 
231 	void				DisablePageBreak();
232 };
233 
234 #endif
235