1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
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>
31 #include <svx/swframeexample.hxx>
32 #include <prcntfld.hxx>
33 #include <globals.hrc>
35 namespace sfx2
{class FileDialogHelper
;}
38 // OD 12.11.2003 #i22341#
41 /*--------------------------------------------------------------------
42 Description: frame dialog
43 --------------------------------------------------------------------*/
44 class SwFrmPage
: public SfxTabPage
49 FixedText aWidthAutoFT
;
50 PercentField aWidthED
;
52 CheckBox aAutoWidthCB
;
54 FixedText aHeightAutoFT
;
55 PercentField aHeightED
;
56 CheckBox aRelHeightCB
;
57 CheckBox aAutoHeightCB
;
58 CheckBox aFixedRatioCB
;
59 PushButton aRealSizeBT
;
64 RadioButton aAnchorAtPageRB
;
65 RadioButton aAnchorAtParaRB
;
66 RadioButton aAnchorAtCharRB
;
67 RadioButton aAnchorAsCharRB
;
68 RadioButton aAnchorAtFrameRB
;
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
;
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
;
89 SvxSwFrameExample aExampleWN
;
92 SvxSwFramePosString aFramePosString
;
94 sal_Bool bAtHorzPosModified
;
95 sal_Bool bAtVertPosModified
;
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
105 sal_uInt16 nHtmlMode
;
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
;
126 bool m_bAllowVertPositioning
;
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
,
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* );
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
156 sal_uInt16
FillPosLB( const FrmMap
* _pMap
,
157 const sal_uInt16 _nAlign
,
158 const sal_uInt16 _nRel
,
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
,
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
);
178 SwWrtShell
*getFrmDlgParentShell();
180 using SfxTabPage::ActivatePage
;
181 using SfxTabPage::DeactivatePage
;
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
202 CheckBox aMirrorVertBox
;
203 CheckBox aMirrorHorzBox
;
204 RadioButton aAllPagesRB
;
205 RadioButton aLeftPagesRB
;
206 RadioButton aRightPagesRB
;
209 FixedLine aConnectFL
;
210 FixedText aConnectFT
;
212 PushButton aBrowseBT
;
215 String aGrfName
, aNewGrfName
;
217 ::sfx2::FileDialogHelper
* pGrfDlg
;
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
);
229 using SfxTabPage::ActivatePage
;
230 using SfxTabPage::DeactivatePage
;
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
244 FixedLine aHyperLinkFL
;
247 PushButton aSearchPB
;
258 DECL_LINK(InsertFileHdl
, void *);
261 SwFrmURLPage(Window
*pParent
, const SfxItemSet
&rSet
);
264 using SfxTabPage::ActivatePage
;
265 using SfxTabPage::DeactivatePage
;
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
280 FixedText aAltNameFT
;
286 FixedLine aProtectFL
;
288 CheckBox aProtectContentCB
;
289 CheckBox aProtectFrameCB
;
290 CheckBox aProtectSizeCB
;
293 CheckBox aEditInReadonlyCB
;
294 CheckBox aPrintFrameCB
;
295 FixedText aTextFlowFT
;
306 DECL_LINK(EditModifyHdl
, void *);
307 DECL_LINK(ChainModifyHdl
, ListBox
*);
309 SwFrmAddPage(Window
*pParent
, const SfxItemSet
&rSet
);
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: */