Update ooo320-m1
[ooovba.git] / sw / source / ui / table / tablepg.hxx
blob84c3bf9aed8939aac7c7391b7acba88e8bffc961
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tablepg.hxx,v $
10 * $Revision: 1.14 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SWTABLEPG_HXX
31 #define _SWTABLEPG_HXX
32 #include <sfx2/tabdlg.hxx>
33 #ifndef _FIXED_HXX //autogen
34 #include <vcl/fixed.hxx>
35 #endif
36 #ifndef _IMAGEBTN_HXX //autogen
37 #include <vcl/imagebtn.hxx>
38 #endif
39 #ifndef _LSTBOX_HXX //autogen
40 #include <vcl/lstbox.hxx>
41 #endif
42 #include <actctrl.hxx>
43 #include "prcntfld.hxx"
44 #include "swtypes.hxx"
45 #include "textcontrolcombo.hxx"
47 class SwWrtShell;
48 class SwTableRep;
50 struct TColumn
52 SwTwips nWidth;
53 BOOL bVisible;
56 class SwFormatTablePage : public SfxTabPage
58 FixedLine aOptionsFL;
59 FixedText aNameFT;
60 TableNameEdit aNameED;
61 FixedText aWidthFT;
62 PercentField aWidthMF;
63 CheckBox aRelWidthCB;
65 FixedLine aPosFL;
66 RadioButton aFullBtn;
67 RadioButton aLeftBtn;
68 RadioButton aFromLeftBtn;
69 RadioButton aRightBtn;
70 RadioButton aCenterBtn;
71 RadioButton aFreeBtn;
73 FixedLine aDistFL;
74 FixedText aLeftFT;
75 PercentField aLeftMF;
76 FixedText aRightFT;
77 PercentField aRightMF;
78 FixedText aTopFT;
79 MetricField aTopMF;
80 FixedText aBottomFT;
81 MetricField aBottomMF;
83 FixedLine aPropertiesFL;
84 FixedText aTextDirectionFT;
85 ListBox aTextDirectionLB;
87 SwTableRep* pTblData;
88 SwTwips nSaveWidth;
89 SwTwips nMinTableWidth;
90 USHORT nOldAlign;
91 BOOL bModified;
92 BOOL bFull:1;
93 BOOL bHtmlMode : 1;
95 void Init();
96 void ModifyHdl( Edit* pEdit );
98 DECL_LINK( AutoClickHdl, CheckBox * );
99 DECL_LINK( RelWidthClickHdl, CheckBox * );
100 DECL_LINK( RightModifyHdl, MetricField * );
101 DECL_LINK( UpDownLoseFocusHdl, MetricField * );
103 using TabPage::ActivatePage;
104 using TabPage::DeactivatePage;
106 public:
107 SwFormatTablePage( Window* pParent, const SfxItemSet& rSet );
109 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet);
110 virtual BOOL FillItemSet( SfxItemSet& rSet );
111 virtual void Reset( const SfxItemSet& rSet );
112 virtual void ActivatePage( const SfxItemSet& rSet );
113 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
116 /*-------------------------------------------------------
117 TabPage Format/Tabelle/Spalten
118 --------------------------------------------------------- */
119 #define MET_FIELDS 6 //Anzahl der verwendeten MetricFields
121 class SwTableColumnPage : public SfxTabPage
123 CheckBox aModifyTableCB;
124 CheckBox aProportionalCB;
125 FixedText aSpaceFT;
126 MetricField aSpaceED;
128 ImageButton aUpBtn;
129 FixedText aFT1;
130 PercentField aMF1;
131 FixedText aFT2;
132 PercentField aMF2;
133 FixedText aFT3;
134 PercentField aMF3;
135 FixedText aFT4;
136 PercentField aMF4;
137 FixedText aFT5;
138 PercentField aMF5;
139 FixedText aFT6;
140 PercentField aMF6;
141 ImageButton aDownBtn;
142 FixedLine aColFL;
144 SwTableRep* pTblData;
145 PercentField* pFieldArr[MET_FIELDS];
146 FixedText* pTextArr[MET_FIELDS];
147 SwTwips nTableWidth;
148 SwTwips nMinWidth;
149 USHORT nNoOfCols;
150 USHORT nNoOfVisibleCols;
151 //Breite merken, wenn auf autom. Ausrichtung gestellt wird
152 USHORT aValueTbl[MET_FIELDS];//primaere Zuordnung der MetricFields
153 BOOL bModified:1;
154 BOOL bModifyTbl:1;
155 BOOL bPercentMode:1;
157 void Init(BOOL bWeb);
158 DECL_LINK( AutoClickHdl, CheckBox * );
159 void ModifyHdl( PercentField* pEdit );
160 DECL_LINK( UpHdl, PercentField * );
161 DECL_LINK( DownHdl, PercentField * );
162 DECL_LINK( LoseFocusHdl, PercentField * );
163 DECL_LINK( ModeHdl, CheckBox * );
164 void UpdateCols( USHORT nAktPos );
165 SwTwips GetVisibleWidth(USHORT nPos);
166 void SetVisibleWidth(USHORT nPos, SwTwips nNewWidth);
168 using TabPage::ActivatePage;
169 using TabPage::DeactivatePage;
171 public:
172 SwTableColumnPage( Window* pParent, const SfxItemSet& rSet );
173 ~SwTableColumnPage();
175 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet);
176 virtual BOOL FillItemSet( SfxItemSet& rSet );
177 virtual void Reset( const SfxItemSet& rSet );
178 virtual void ActivatePage( const SfxItemSet& rSet );
179 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
183 /*-----------------12.12.96 11.48-------------------
184 Textfluss
185 --------------------------------------------------*/
186 class SwTextFlowPage : public SfxTabPage
188 FixedLine aFlowFL;
189 CheckBox aPgBrkCB;
190 RadioButton aPgBrkRB;
191 RadioButton aColBrkRB;
192 RadioButton aPgBrkBeforeRB;
193 RadioButton aPgBrkAfterRB;
194 CheckBox aPageCollCB;
195 ListBox aPageCollLB;
196 FixedText aPageNoFT;
197 NumericField aPageNoNF;
198 CheckBox aSplitCB;
199 TriStateBox aSplitRowCB;
200 CheckBox aKeepCB;
201 CheckBox aHeadLineCB;
202 FixedText aRepeatHeaderFT; // "dummy" to build before and after FT
203 FixedText aRepeatHeaderBeforeFT;
204 NumericField aRepeatHeaderNF;
205 FixedText aRepeatHeaderAfterFT;
206 TextControlCombo aRepeatHeaderCombo;
207 FixedText aTextDirectionFT;
208 ListBox aTextDirectionLB;
210 FixedLine aVertOrientFL;
211 FixedText aVertOrientFT;
212 ListBox aVertOrientLB;
214 SwWrtShell* pShell;
216 BOOL bPageBreak;
217 BOOL bHtmlMode;
220 DECL_LINK( PageBreakHdl_Impl, CheckBox* );
221 DECL_LINK( ApplyCollClickHdl_Impl, CheckBox* );
222 DECL_LINK( PageBreakPosHdl_Impl, RadioButton* );
223 DECL_LINK( PageBreakTypeHdl_Impl, RadioButton* );
224 DECL_LINK( SplitHdl_Impl, CheckBox* );
225 DECL_LINK( SplitRowHdl_Impl, TriStateBox* );
226 DECL_LINK( HeadLineCBClickHdl, void* p = 0 );
229 SwTextFlowPage( Window* pParent, const SfxItemSet& rSet );
230 ~SwTextFlowPage();
232 public:
233 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet);
234 virtual BOOL FillItemSet( SfxItemSet& rSet );
235 virtual void Reset( const SfxItemSet& rSet );
237 void SetShell(SwWrtShell* pSh);
239 void DisablePageBreak();
242 #endif