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: swpossizetabpage.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 ************************************************************************/
30 #ifndef _SVX_SWPOSSIZETABPAGE_HXX
31 #define _SVX_SWPOSSIZETABPAGE_HXX
33 #include <sfx2/tabdlg.hxx>
34 #ifndef _FIXED_HXX //autogen
35 #include <vcl/fixed.hxx>
37 #include <vcl/field.hxx>
38 #include <vcl/lstbox.hxx>
39 #include <swframeposstrings.hxx>
40 #include <swframeexample.hxx>
42 /*-- 01.03.2004 15:45:01---------------------------------------------------
43 SvxSwPosSizeTabPage - position and size page for Writer drawing objects
44 -----------------------------------------------------------------------*/
47 class SvxSwPosSizeTabPage
: public SfxTabPage
49 using TabPage::DeactivatePage
;
53 MetricField m_aWidthMF
;
54 FixedText m_aHeightFT
;
55 MetricField m_aHeightMF
;
56 CheckBox m_aKeepRatioCB
;
58 FixedLine m_aSeparatorFL
;
60 FixedLine m_aAnchorFL
;
61 RadioButton m_aToPageRB
;
62 RadioButton m_aToParaRB
;
63 RadioButton m_aToCharRB
;
64 RadioButton m_aAsCharRB
;
65 RadioButton m_aToFrameRB
;
67 FixedLine m_aProtectionFL
;
68 TriStateBox m_aPositionCB
;
69 TriStateBox m_aSizeCB
;
71 FixedLine m_aPositionFL
;
74 FixedText m_aHoriByFT
;
75 MetricField m_aHoriByMF
;
76 FixedText m_aHoriToFT
;
79 CheckBox m_aHoriMirrorCB
;
83 FixedText m_aVertByFT
;
84 MetricField m_aVertByMF
;
85 FixedText m_aVertToFT
;
90 SvxSwFrameExample m_aExampleWN
;
95 SvxSwFramePosString m_aFramePosString
;
97 Rectangle m_aRect
; //size of all selected objects
98 Rectangle m_aWorkArea
;
103 const SdrView
* m_pSdrView
;
111 double m_fWidthHeightRatio
; //width-to-height ratio to support the KeepRatio button
114 bool m_bAtHoriPosModified
;
115 bool m_bAtVertPosModified
;
116 bool m_bIsVerticalFrame
;
117 bool m_bPositioningDisabled
;
118 bool m_bIsMultiSelection
;
119 bool m_bIsInRightToLeft
;
123 DECL_LINK( RangeModifyHdl
, Edit
* );
124 DECL_LINK( AnchorTypeHdl
, RadioButton
* );
125 DECL_LINK( PosHdl
, ListBox
* );
126 DECL_LINK( RelHdl
, ListBox
* );
127 DECL_LINK( MirrorHdl
, CheckBox
* );
128 DECL_LINK( ModifyHdl
, Edit
* );
129 DECL_LINK( ProtectHdl
, TriStateBox
*);
131 void InitPos(short nAnchorType
, USHORT nH
, USHORT nHRel
,
132 USHORT nV
, USHORT nVRel
,
134 USHORT
GetMapPos(FrmMap
*pMap
, ListBox
&rAlignLB
);
135 short GetAlignment(FrmMap
*pMap
, USHORT nMapPos
, ListBox
&rAlignLB
, ListBox
&rRelationLB
);
136 short GetRelation(FrmMap
*pMap
, ListBox
&rRelationLB
);
137 short GetAnchorType(bool* pbHasChanged
= 0);
138 ULONG
FillRelLB(FrmMap
*pMap
, USHORT nLBSelPos
, USHORT nAlign
, USHORT nRel
, ListBox
&rLB
, FixedText
&rFT
);
139 USHORT
FillPosLB(FrmMap
*pMap
, USHORT nAlign
, const USHORT _nRel
, ListBox
&rLB
);
141 void UpdateExample();
144 SvxSwPosSizeTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
145 ~SvxSwPosSizeTabPage();
147 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
148 static USHORT
* GetRanges();
150 virtual BOOL
FillItemSet( SfxItemSet
& );
151 virtual void Reset( const SfxItemSet
& );
153 virtual int DeactivatePage( SfxItemSet
* pSet
);
155 void EnableAnchorTypes(USHORT nAnchorEnable
);
157 void SetValidateFramePosLink( const Link
& rLink
)
158 {m_aValidateLink
= rLink
;}
160 void SetView( const SdrView
* pSdrView
);