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