update dev300-m58
[ooovba.git] / svx / source / cui / swpossizetabpage.hxx
blob34aff3b9887fe6eef190cf89b94b1ba2d72fc4e4
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: swpossizetabpage.hxx,v $
10 * $Revision: 1.6 $
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>
36 #endif
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 -----------------------------------------------------------------------*/
45 struct FrmMap;
46 class SdrView;
47 class SvxSwPosSizeTabPage : public SfxTabPage
49 using TabPage::DeactivatePage;
51 FixedLine m_aSizeFL;
52 FixedText m_aWidthFT;
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;
72 FixedText m_aHoriFT;
73 ListBox m_aHoriLB;
74 FixedText m_aHoriByFT;
75 MetricField m_aHoriByMF;
76 FixedText m_aHoriToFT;
77 ListBox m_aHoriToLB;
79 CheckBox m_aHoriMirrorCB;
81 FixedText m_aVertFT;
82 ListBox m_aVertLB;
83 FixedText m_aVertByFT;
84 MetricField m_aVertByMF;
85 FixedText m_aVertToFT;
86 ListBox m_aVertToLB;
88 CheckBox m_aFollowCB;
90 SvxSwFrameExample m_aExampleWN;
92 Link m_aValidateLink;
94 //'string provider'
95 SvxSwFramePosString m_aFramePosString;
97 Rectangle m_aRect; //size of all selected objects
98 Rectangle m_aWorkArea;
99 Point m_aAnchorPos;
101 FrmMap* m_pVMap;
102 FrmMap* m_pHMap;
103 const SdrView* m_pSdrView;
105 // initial values
106 short m_nOldH;
107 short m_nOldHRel;
108 short m_nOldV;
109 short m_nOldVRel;
111 double m_fWidthHeightRatio; //width-to-height ratio to support the KeepRatio button
112 USHORT m_nHtmlMode;
113 bool m_bHtmlMode;
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,
133 long nX, long nY);
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();
143 public:
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 );
163 #endif