merge the formfield patch from ooo-build
[ooovba.git] / sw / source / ui / inc / frmpage.hxx
blobfb20ab92fcb98cb4f24639da7637eaad695713ea
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: frmpage.hxx,v $
10 * $Revision: 1.22 $
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 _FRMPAGE_HXX
32 #define _FRMPAGE_HXX
34 #ifndef _FIXED_HXX //autogen
35 #include <vcl/fixed.hxx>
36 #endif
37 #ifndef _BUTTON_HXX //autogen
38 #include <vcl/button.hxx>
39 #endif
40 #ifndef _LSTBOX_HXX //autogen
41 #include <vcl/lstbox.hxx>
42 #endif
43 #ifndef _FIELD_HXX //autogen
44 #include <vcl/field.hxx>
45 #endif
46 #include <sfx2/tabdlg.hxx>
47 #include <svx/swframeposstrings.hxx>
48 #include <swtypes.hxx>
49 #include <bmpwin.hxx>
50 #include <svx/swframeexample.hxx>
51 #include <prcntfld.hxx>
52 #ifndef _GLOBALS_HRC
53 #include <globals.hrc>
54 #endif
57 namespace sfx2{class FileDialogHelper;}
58 class SwWrtShell;
59 struct FrmMap;
60 // OD 12.11.2003 #i22341#
61 struct SwPosition;
63 /*--------------------------------------------------------------------
64 Beschreibung: Rahmendialog
65 --------------------------------------------------------------------*/
67 class SwFrmPage: public SfxTabPage
69 // Size
70 FixedText aWidthFT;
71 FixedText aWidthAutoFT;
72 PercentField aWidthED;
73 CheckBox aRelWidthCB;
74 CheckBox aAutoWidthCB;
75 FixedText aHeightFT;
76 FixedText aHeightAutoFT;
77 PercentField aHeightED;
78 CheckBox aRelHeightCB;
79 CheckBox aAutoHeightCB;
80 CheckBox aFixedRatioCB;
81 PushButton aRealSizeBT;
82 FixedLine aSizeFL;
84 // Anker
85 FixedLine aTypeFL;
86 FixedLine aTypeSepFL;
87 RadioButton aAnchorAtPageRB;
88 RadioButton aAnchorAtParaRB;
89 RadioButton aAnchorAtCharRB;
90 RadioButton aAnchorAsCharRB;
91 RadioButton aAnchorAtFrameRB;
93 // Position
94 FixedText aHorizontalFT;
95 ListBox aHorizontalDLB;
96 FixedText aAtHorzPosFT;
97 MetricField aAtHorzPosED;
98 FixedText aHoriRelationFT;
99 ListBox aHoriRelationLB;
100 CheckBox aMirrorPagesCB;
101 FixedText aVerticalFT;
102 ListBox aVerticalDLB;
103 FixedText aAtVertPosFT;
104 MetricField aAtVertPosED;
105 FixedText aVertRelationFT;
106 ListBox aVertRelationLB;
107 // OD 02.10.2003 #i18732# - check box for new option 'FollowTextFlow'
108 CheckBox aFollowTextFlowCB;
109 FixedLine aPositionFL;
111 // Example
112 SvxSwFrameExample aExampleWN;
114 //'string provider'
115 SvxSwFramePosString aFramePosString;
117 BOOL bAtHorzPosModified;
118 BOOL bAtVertPosModified;
120 BOOL bFormat;
121 BOOL bNew;
122 BOOL bNoModifyHdl;
123 BOOL bVerticalChanged; //check done whether frame is in vertical environment
124 BOOL bIsVerticalFrame; //current frame is in vertical environment - strings are exchanged
125 BOOL bIsInRightToLeft; // current frame is in right-to-left environment - strings are exchanged
126 BOOL bHtmlMode;
127 USHORT nHtmlMode;
128 USHORT nDlgType;
129 Size aGrfSize;
130 Size aWrap;
131 SwTwips nUpperBorder;
132 SwTwips nLowerBorder;
133 double fWidthHeightRatio; //width-to-height ratio to support the KeepRatio button
135 // OD 12.11.2003 #i22341# - keep content position of character for
136 // to character anchored objects.
137 const SwPosition* mpToCharCntntPos;
139 // Die alten Ausrichtungen
140 short nOldH;
141 short nOldHRel;
142 short nOldV;
143 short nOldVRel;
145 FrmMap* pVMap;
146 FrmMap* pHMap;
148 virtual void ActivatePage(const SfxItemSet& rSet);
149 virtual int DeactivatePage(SfxItemSet *pSet);
152 DECL_LINK( RangeModifyHdl, Edit * );
153 DECL_LINK( AnchorTypeHdl, RadioButton * );
154 DECL_LINK( PosHdl, ListBox * );
155 DECL_LINK( RelHdl, ListBox * );
156 void InitPos(RndStdIds eId, USHORT nH, USHORT nHRel,
157 USHORT nV, USHORT nVRel,
158 long nX, long nY);
160 DECL_LINK( RealSizeHdl, Button * );
161 DECL_LINK( RelSizeClickHdl, CheckBox * );
162 DECL_LINK( MirrorHdl, CheckBox * );
164 DECL_LINK( AutoWidthClickHdl, void* );
165 DECL_LINK( AutoHeightClickHdl, void* );
167 // Beispiel aktualisieren
168 void UpdateExample();
169 DECL_LINK( ModifyHdl, Edit * );
171 void Init(const SfxItemSet& rSet, BOOL bReset = FALSE);
172 // OD 12.11.2003 #i22341# - adjustment to handle maps, that are ambigous
173 // in the alignment.
174 USHORT FillPosLB( const FrmMap* _pMap,
175 const USHORT _nAlign,
176 const USHORT _nRel,
177 ListBox& _rLB );
178 // OD 14.11.2003 #i22341# - adjustment to handle maps, that are ambigous
179 // in their string entries.
180 ULONG FillRelLB( const FrmMap* _pMap,
181 const USHORT _nLBSelPos,
182 const USHORT _nAlign,
183 USHORT _nRel,
184 ListBox& _rLB,
185 FixedText& _rFT );
186 USHORT GetMapPos( const FrmMap *pMap, ListBox &rAlignLB );
187 short GetAlignment(FrmMap *pMap, USHORT nMapPos, ListBox &rAlignLB, ListBox &rRelationLB);
188 short GetRelation(FrmMap *pMap, ListBox &rRelationLB);
189 RndStdIds GetAnchor();
191 void EnableGraficMode( void ); // hides auto check boxes and re-org controls for "Real Size" button
193 SwFrmPage(Window *pParent, const SfxItemSet &rSet);
194 ~SwFrmPage();
196 using SfxTabPage::ActivatePage;
197 using SfxTabPage::DeactivatePage;
199 public:
201 static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
202 static USHORT* GetRanges();
204 virtual BOOL FillItemSet(SfxItemSet &rSet);
205 virtual void Reset(const SfxItemSet &rSet);
207 void SetNewFrame(BOOL bNewFrame) { bNew = bNewFrame; }
208 void SetFormatUsed(BOOL bFmt);
209 void SetFrmType(USHORT nType) { nDlgType = nType; }
210 inline BOOL IsInGraficMode( void ) { return nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE; }
213 class SwGrfExtPage: public SfxTabPage
215 // Spiegeln
216 FixedLine aMirrorFL;
217 CheckBox aMirrorVertBox;
218 CheckBox aMirrorHorzBox;
219 RadioButton aAllPagesRB;
220 RadioButton aLeftPagesRB;
221 RadioButton aRightPagesRB;
222 BmpWindow aBmpWin;
224 FixedLine aConnectFL;
225 FixedText aConnectFT;
226 Edit aConnectED;
227 PushButton aBrowseBT;
229 String aFilterName;
230 String aGrfName, aNewGrfName;
232 ::sfx2::FileDialogHelper* pGrfDlg;
234 BOOL bHtmlMode;
236 // Handler fuer Spiegeln
237 DECL_LINK( MirrorHdl, CheckBox * );
238 DECL_LINK( BrowseHdl, Button * );
240 virtual void ActivatePage(const SfxItemSet& rSet);
241 SwGrfExtPage(Window *pParent, const SfxItemSet &rSet);
242 ~SwGrfExtPage();
244 using SfxTabPage::ActivatePage;
245 using SfxTabPage::DeactivatePage;
247 public:
249 static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
251 virtual BOOL FillItemSet(SfxItemSet &rSet);
252 virtual void Reset(const SfxItemSet &rSet);
253 virtual int DeactivatePage(SfxItemSet *pSet);
257 class SwFrmURLPage : public SfxTabPage
259 //Hyperlink
260 FixedLine aHyperLinkFL;
261 FixedText aURLFT;
262 Edit aURLED;
263 PushButton aSearchPB;
264 FixedText aNameFT;
265 Edit aNameED;
266 FixedText aFrameFT;
267 ComboBox aFrameCB;
269 //Image map
270 FixedLine aImageFL;
271 CheckBox aServerCB;
272 CheckBox aClientCB;
274 DECL_LINK( InsertFileHdl, PushButton * );
277 SwFrmURLPage(Window *pParent, const SfxItemSet &rSet);
278 ~SwFrmURLPage();
280 using SfxTabPage::ActivatePage;
281 using SfxTabPage::DeactivatePage;
283 public:
285 static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
287 virtual BOOL FillItemSet(SfxItemSet &rSet);
288 virtual void Reset(const SfxItemSet &rSet);
291 /*-----------------13.11.96 12.59-------------------
293 --------------------------------------------------*/
295 class SwFrmAddPage : public SfxTabPage
297 FixedText aNameFT;
298 Edit aNameED;
299 FixedText aAltNameFT;
300 Edit aAltNameED;
301 FixedText aPrevFT;
302 ListBox aPrevLB;
303 FixedText aNextFT;
304 ListBox aNextLB;
305 FixedLine aNamesFL;
307 CheckBox aProtectContentCB;
308 CheckBox aProtectFrameCB;
309 CheckBox aProtectSizeCB;
310 FixedLine aProtectFL;
312 CheckBox aEditInReadonlyCB;
313 CheckBox aPrintFrameCB;
314 FixedText aTextFlowFT;
315 ListBox aTextFlowLB;
317 FixedLine aExtFL;
319 SwWrtShell* pWrtSh;
321 USHORT nDlgType;
322 BOOL bHtmlMode;
323 BOOL bFormat;
324 BOOL bNew;
326 DECL_LINK(EditModifyHdl, Edit*);
327 DECL_LINK(ChainModifyHdl, ListBox*);
329 SwFrmAddPage(Window *pParent, const SfxItemSet &rSet);
330 ~SwFrmAddPage();
332 public:
334 static SfxTabPage* Create(Window *pParent, const SfxItemSet &rSet);
335 static USHORT* GetRanges();
337 virtual BOOL FillItemSet(SfxItemSet &rSet);
338 virtual void Reset(const SfxItemSet &rSet);
340 void SetFormatUsed(BOOL bFmt);
341 void SetFrmType(USHORT nType) { nDlgType = nType; }
342 void SetNewFrame(BOOL bNewFrame) { bNew = bNewFrame; }
343 void SetShell(SwWrtShell* pSh) { pWrtSh = pSh; }
347 #endif // _FRMPAGE_HXX