bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / frmpage.hxx
blobe2e0c026b57a07e2ead489d956ea0e6f766cb782
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _FRMPAGE_HXX
21 #define _FRMPAGE_HXX
23 #include <vcl/fixed.hxx>
24 #include <vcl/button.hxx>
25 #include <vcl/lstbox.hxx>
26 #include <vcl/field.hxx>
27 #include <sfx2/tabdlg.hxx>
28 #include <svx/swframeposstrings.hxx>
29 #include <swtypes.hxx>
30 #include <bmpwin.hxx>
31 #include <svx/swframeexample.hxx>
32 #include <prcntfld.hxx>
33 #include <globals.hrc>
35 namespace sfx2{class FileDialogHelper;}
36 class SwWrtShell;
37 struct FrmMap;
38 // OD 12.11.2003 #i22341#
39 struct SwPosition;
41 /*--------------------------------------------------------------------
42 Description: frame dialog
43 --------------------------------------------------------------------*/
44 class SwFrmPage: public SfxTabPage
46 // size
47 FixedLine aSizeFL;
48 FixedText aWidthFT;
49 FixedText aWidthAutoFT;
50 PercentField aWidthED;
51 CheckBox aRelWidthCB;
52 CheckBox aAutoWidthCB;
53 FixedText aHeightFT;
54 FixedText aHeightAutoFT;
55 PercentField aHeightED;
56 CheckBox aRelHeightCB;
57 CheckBox aAutoHeightCB;
58 CheckBox aFixedRatioCB;
59 PushButton aRealSizeBT;
61 // anchor
62 FixedLine aTypeSepFL;
63 FixedLine aTypeFL;
64 RadioButton aAnchorAtPageRB;
65 RadioButton aAnchorAtParaRB;
66 RadioButton aAnchorAtCharRB;
67 RadioButton aAnchorAsCharRB;
68 RadioButton aAnchorAtFrameRB;
70 // position
71 FixedLine aPositionFL;
72 FixedText aHorizontalFT;
73 ListBox aHorizontalDLB;
74 FixedText aAtHorzPosFT;
75 MetricField aAtHorzPosED;
76 FixedText aHoriRelationFT;
77 ListBox aHoriRelationLB;
78 CheckBox aMirrorPagesCB;
79 FixedText aVerticalFT;
80 ListBox aVerticalDLB;
81 FixedText aAtVertPosFT;
82 MetricField aAtVertPosED;
83 FixedText aVertRelationFT;
84 ListBox aVertRelationLB;
85 // OD 02.10.2003 #i18732# - check box for new option 'FollowTextFlow'
86 CheckBox aFollowTextFlowCB;
88 // example
89 SvxSwFrameExample aExampleWN;
91 //'string provider'
92 SvxSwFramePosString aFramePosString;
94 sal_Bool bAtHorzPosModified;
95 sal_Bool bAtVertPosModified;
97 sal_Bool bFormat;
98 sal_Bool bNew;
99 sal_Bool bNoModifyHdl;
100 bool bIsVerticalFrame; //current frame is in vertical environment - strings are exchanged
101 // --> OD 2009-08-31 #mongolianlayou#
102 sal_Bool bIsVerticalL2R;
103 sal_Bool bIsInRightToLeft; // current frame is in right-to-left environment - strings are exchanged
104 sal_Bool bHtmlMode;
105 sal_uInt16 nHtmlMode;
106 sal_uInt16 nDlgType;
107 Size aGrfSize;
108 Size aWrap;
109 SwTwips nUpperBorder;
110 SwTwips nLowerBorder;
111 double fWidthHeightRatio; //width-to-height ratio to support the KeepRatio button
113 // OD 12.11.2003 #i22341# - keep content position of character for
114 // to character anchored objects.
115 const SwPosition* mpToCharCntntPos;
117 // old alignment
118 short nOldH;
119 short nOldHRel;
120 short nOldV;
121 short nOldVRel;
123 FrmMap* pVMap;
124 FrmMap* pHMap;
126 bool m_bAllowVertPositioning;
127 bool m_bIsMathOLE;
128 bool m_bIsMathBaselineAlignment;
130 virtual void ActivatePage(const SfxItemSet& rSet);
131 virtual int DeactivatePage(SfxItemSet *pSet);
134 DECL_LINK(RangeModifyHdl, void *);
135 DECL_LINK(AnchorTypeHdl, void *);
136 DECL_LINK( PosHdl, ListBox * );
137 DECL_LINK( RelHdl, ListBox * );
138 void InitPos(RndStdIds eId, sal_uInt16 nH, sal_uInt16 nHRel,
139 sal_uInt16 nV, sal_uInt16 nVRel,
140 long nX, long nY);
142 DECL_LINK(RealSizeHdl, void *);
143 DECL_LINK( RelSizeClickHdl, CheckBox * );
144 DECL_LINK(MirrorHdl, void *);
146 DECL_LINK( AutoWidthClickHdl, void* );
147 DECL_LINK( AutoHeightClickHdl, void* );
149 // update example
150 void UpdateExample();
151 DECL_LINK( ModifyHdl, Edit * );
153 void Init(const SfxItemSet& rSet, sal_Bool bReset = sal_False);
154 // OD 12.11.2003 #i22341# - adjustment to handle maps, that are ambigous
155 // in the alignment.
156 sal_uInt16 FillPosLB( const FrmMap* _pMap,
157 const sal_uInt16 _nAlign,
158 const sal_uInt16 _nRel,
159 ListBox& _rLB );
160 // OD 14.11.2003 #i22341# - adjustment to handle maps, that are ambigous
161 // in their string entries.
162 sal_uLong FillRelLB( const FrmMap* _pMap,
163 const sal_uInt16 _nLBSelPos,
164 const sal_uInt16 _nAlign,
165 sal_uInt16 _nRel,
166 ListBox& _rLB,
167 FixedText& _rFT );
168 sal_uInt16 GetMapPos( const FrmMap *pMap, ListBox &rAlignLB );
169 short GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, ListBox &rAlignLB, ListBox &rRelationLB);
170 short GetRelation(FrmMap *pMap, ListBox &rRelationLB);
171 RndStdIds GetAnchor();
173 void EnableGraficMode( void ); // hides auto check boxes and re-org controls for "Real Size" button
175 SwFrmPage(Window *pParent, const SfxItemSet &rSet);
176 ~SwFrmPage();
178 SwWrtShell *getFrmDlgParentShell();
180 using SfxTabPage::ActivatePage;
181 using SfxTabPage::DeactivatePage;
183 public:
185 static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
186 static sal_uInt16* GetRanges();
188 virtual sal_Bool FillItemSet(SfxItemSet &rSet);
189 virtual void Reset(const SfxItemSet &rSet);
191 void SetNewFrame(sal_Bool bNewFrame) { bNew = bNewFrame; }
192 void SetFormatUsed(sal_Bool bFmt);
193 void SetFrmType(sal_uInt16 nType) { nDlgType = nType; }
194 inline sal_Bool IsInGraficMode( void ) { return nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE; }
195 void EnableVerticalPositioning( bool bEnable );
198 class SwGrfExtPage: public SfxTabPage
200 // mirror
201 FixedLine aMirrorFL;
202 CheckBox aMirrorVertBox;
203 CheckBox aMirrorHorzBox;
204 RadioButton aAllPagesRB;
205 RadioButton aLeftPagesRB;
206 RadioButton aRightPagesRB;
207 BmpWindow aBmpWin;
209 FixedLine aConnectFL;
210 FixedText aConnectFT;
211 Edit aConnectED;
212 PushButton aBrowseBT;
214 String aFilterName;
215 String aGrfName, aNewGrfName;
217 ::sfx2::FileDialogHelper* pGrfDlg;
219 sal_Bool bHtmlMode;
221 // handler for mirroring
222 DECL_LINK(MirrorHdl, void *);
223 DECL_LINK(BrowseHdl, void *);
225 virtual void ActivatePage(const SfxItemSet& rSet);
226 SwGrfExtPage(Window *pParent, const SfxItemSet &rSet);
227 ~SwGrfExtPage();
229 using SfxTabPage::ActivatePage;
230 using SfxTabPage::DeactivatePage;
232 public:
234 static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
236 virtual sal_Bool FillItemSet(SfxItemSet &rSet);
237 virtual void Reset(const SfxItemSet &rSet);
238 virtual int DeactivatePage(SfxItemSet *pSet);
241 class SwFrmURLPage : public SfxTabPage
243 // hyperlink
244 FixedLine aHyperLinkFL;
245 FixedText aURLFT;
246 Edit aURLED;
247 PushButton aSearchPB;
248 FixedText aNameFT;
249 Edit aNameED;
250 FixedText aFrameFT;
251 ComboBox aFrameCB;
253 // image map
254 FixedLine aImageFL;
255 CheckBox aServerCB;
256 CheckBox aClientCB;
258 DECL_LINK(InsertFileHdl, void *);
261 SwFrmURLPage(Window *pParent, const SfxItemSet &rSet);
262 ~SwFrmURLPage();
264 using SfxTabPage::ActivatePage;
265 using SfxTabPage::DeactivatePage;
267 public:
269 static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
271 virtual sal_Bool FillItemSet(SfxItemSet &rSet);
272 virtual void Reset(const SfxItemSet &rSet);
275 class SwFrmAddPage : public SfxTabPage
277 FixedLine aNamesFL;
278 FixedText aNameFT;
279 Edit aNameED;
280 FixedText aAltNameFT;
281 Edit aAltNameED;
282 FixedText aPrevFT;
283 ListBox aPrevLB;
284 FixedText aNextFT;
285 ListBox aNextLB;
286 FixedLine aProtectFL;
288 CheckBox aProtectContentCB;
289 CheckBox aProtectFrameCB;
290 CheckBox aProtectSizeCB;
291 FixedLine aExtFL;
293 CheckBox aEditInReadonlyCB;
294 CheckBox aPrintFrameCB;
295 FixedText aTextFlowFT;
296 ListBox aTextFlowLB;
299 SwWrtShell* pWrtSh;
301 sal_uInt16 nDlgType;
302 sal_Bool bHtmlMode;
303 sal_Bool bFormat;
304 sal_Bool bNew;
306 DECL_LINK(EditModifyHdl, void *);
307 DECL_LINK(ChainModifyHdl, ListBox*);
309 SwFrmAddPage(Window *pParent, const SfxItemSet &rSet);
310 ~SwFrmAddPage();
312 public:
314 static SfxTabPage* Create(Window *pParent, const SfxItemSet &rSet);
315 static sal_uInt16* GetRanges();
317 virtual sal_Bool FillItemSet(SfxItemSet &rSet);
318 virtual void Reset(const SfxItemSet &rSet);
320 void SetFormatUsed(sal_Bool bFmt);
321 void SetFrmType(sal_uInt16 nType) { nDlgType = nType; }
322 void SetNewFrame(sal_Bool bNewFrame) { bNew = bNewFrame; }
323 void SetShell(SwWrtShell* pSh) { pWrtSh = pSh; }
327 #endif // _FRMPAGE_HXX
329 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */