1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: frmpage.hxx,v $
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 ************************************************************************/
34 #ifndef _FIXED_HXX //autogen
35 #include <vcl/fixed.hxx>
37 #ifndef _BUTTON_HXX //autogen
38 #include <vcl/button.hxx>
40 #ifndef _LSTBOX_HXX //autogen
41 #include <vcl/lstbox.hxx>
43 #ifndef _FIELD_HXX //autogen
44 #include <vcl/field.hxx>
46 #include <sfx2/tabdlg.hxx>
47 #include <svx/swframeposstrings.hxx>
48 #include <swtypes.hxx>
50 #include <svx/swframeexample.hxx>
51 #include <prcntfld.hxx>
53 #include <globals.hrc>
57 namespace sfx2
{class FileDialogHelper
;}
60 // OD 12.11.2003 #i22341#
63 /*--------------------------------------------------------------------
64 Beschreibung: Rahmendialog
65 --------------------------------------------------------------------*/
67 class SwFrmPage
: public SfxTabPage
71 FixedText aWidthAutoFT
;
72 PercentField aWidthED
;
74 CheckBox aAutoWidthCB
;
76 FixedText aHeightAutoFT
;
77 PercentField aHeightED
;
78 CheckBox aRelHeightCB
;
79 CheckBox aAutoHeightCB
;
80 CheckBox aFixedRatioCB
;
81 PushButton aRealSizeBT
;
87 RadioButton aAnchorAtPageRB
;
88 RadioButton aAnchorAtParaRB
;
89 RadioButton aAnchorAtCharRB
;
90 RadioButton aAnchorAsCharRB
;
91 RadioButton aAnchorAtFrameRB
;
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
;
112 SvxSwFrameExample aExampleWN
;
115 SvxSwFramePosString aFramePosString
;
117 BOOL bAtHorzPosModified
;
118 BOOL bAtVertPosModified
;
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
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
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
,
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
174 USHORT
FillPosLB( const FrmMap
* _pMap
,
175 const USHORT _nAlign
,
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
,
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
);
196 using SfxTabPage::ActivatePage
;
197 using SfxTabPage::DeactivatePage
;
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
217 CheckBox aMirrorVertBox
;
218 CheckBox aMirrorHorzBox
;
219 RadioButton aAllPagesRB
;
220 RadioButton aLeftPagesRB
;
221 RadioButton aRightPagesRB
;
224 FixedLine aConnectFL
;
225 FixedText aConnectFT
;
227 PushButton aBrowseBT
;
230 String aGrfName
, aNewGrfName
;
232 ::sfx2::FileDialogHelper
* pGrfDlg
;
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
);
244 using SfxTabPage::ActivatePage
;
245 using SfxTabPage::DeactivatePage
;
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
260 FixedLine aHyperLinkFL
;
263 PushButton aSearchPB
;
274 DECL_LINK( InsertFileHdl
, PushButton
* );
277 SwFrmURLPage(Window
*pParent
, const SfxItemSet
&rSet
);
280 using SfxTabPage::ActivatePage
;
281 using SfxTabPage::DeactivatePage
;
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
299 FixedText aAltNameFT
;
307 CheckBox aProtectContentCB
;
308 CheckBox aProtectFrameCB
;
309 CheckBox aProtectSizeCB
;
310 FixedLine aProtectFL
;
312 CheckBox aEditInReadonlyCB
;
313 CheckBox aPrintFrameCB
;
314 FixedText aTextFlowFT
;
326 DECL_LINK(EditModifyHdl
, Edit
*);
327 DECL_LINK(ChainModifyHdl
, ListBox
*);
329 SwFrmAddPage(Window
*pParent
, const SfxItemSet
&rSet
);
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