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