1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _SVX_SWPOSSIZETABPAGE_HXX
28*cdf0e10cSrcweir #define _SVX_SWPOSSIZETABPAGE_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
31*cdf0e10cSrcweir #include <vcl/fixed.hxx>
32*cdf0e10cSrcweir #include <vcl/field.hxx>
33*cdf0e10cSrcweir #include <vcl/lstbox.hxx>
34*cdf0e10cSrcweir #include <svx/swframeposstrings.hxx>
35*cdf0e10cSrcweir #include <svx/swframeexample.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir /*-- 01.03.2004 15:45:01---------------------------------------------------
38*cdf0e10cSrcweir   SvxSwPosSizeTabPage - position and size page for Writer drawing objects
39*cdf0e10cSrcweir   -----------------------------------------------------------------------*/
40*cdf0e10cSrcweir struct FrmMap;
41*cdf0e10cSrcweir class SdrView;
42*cdf0e10cSrcweir class SvxSwPosSizeTabPage : public SfxTabPage
43*cdf0e10cSrcweir {
44*cdf0e10cSrcweir 	using TabPage::DeactivatePage;
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir     FixedLine   m_aSizeFL;
47*cdf0e10cSrcweir     FixedText   m_aWidthFT;
48*cdf0e10cSrcweir     MetricField m_aWidthMF;
49*cdf0e10cSrcweir     FixedText   m_aHeightFT;
50*cdf0e10cSrcweir     MetricField m_aHeightMF;
51*cdf0e10cSrcweir     CheckBox    m_aKeepRatioCB;
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir     FixedLine   m_aSeparatorFL;
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir     FixedLine   m_aAnchorFL;
56*cdf0e10cSrcweir     RadioButton m_aToPageRB;
57*cdf0e10cSrcweir     RadioButton m_aToParaRB;
58*cdf0e10cSrcweir     RadioButton m_aToCharRB;
59*cdf0e10cSrcweir     RadioButton m_aAsCharRB;
60*cdf0e10cSrcweir     RadioButton m_aToFrameRB;
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir     FixedLine   m_aProtectionFL;
63*cdf0e10cSrcweir     TriStateBox m_aPositionCB;
64*cdf0e10cSrcweir     TriStateBox m_aSizeCB;
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir     FixedLine   m_aPositionFL;
67*cdf0e10cSrcweir     FixedText   m_aHoriFT;
68*cdf0e10cSrcweir     ListBox     m_aHoriLB;
69*cdf0e10cSrcweir     FixedText   m_aHoriByFT;
70*cdf0e10cSrcweir     MetricField m_aHoriByMF;
71*cdf0e10cSrcweir     FixedText   m_aHoriToFT;
72*cdf0e10cSrcweir     ListBox     m_aHoriToLB;
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir     CheckBox    m_aHoriMirrorCB;
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir     FixedText   m_aVertFT;
77*cdf0e10cSrcweir     ListBox     m_aVertLB;
78*cdf0e10cSrcweir     FixedText   m_aVertByFT;
79*cdf0e10cSrcweir     MetricField m_aVertByMF;
80*cdf0e10cSrcweir     FixedText   m_aVertToFT;
81*cdf0e10cSrcweir     ListBox     m_aVertToLB;
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir     CheckBox    m_aFollowCB;
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir     SvxSwFrameExample m_aExampleWN;
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir     Link        m_aValidateLink;
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir     //'string provider'
90*cdf0e10cSrcweir     SvxSwFramePosString m_aFramePosString;
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir     Rectangle           m_aRect; //size of all selected objects
93*cdf0e10cSrcweir     Rectangle           m_aWorkArea;
94*cdf0e10cSrcweir     Point               m_aAnchorPos;
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir     FrmMap* m_pVMap;
97*cdf0e10cSrcweir     FrmMap* m_pHMap;
98*cdf0e10cSrcweir     const SdrView*      m_pSdrView;
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir     // initial values
101*cdf0e10cSrcweir     short   m_nOldH;
102*cdf0e10cSrcweir     short   m_nOldHRel;
103*cdf0e10cSrcweir     short   m_nOldV;
104*cdf0e10cSrcweir     short   m_nOldVRel;
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir     double  m_fWidthHeightRatio; //width-to-height ratio to support the KeepRatio button
107*cdf0e10cSrcweir     sal_uInt16  m_nHtmlMode;
108*cdf0e10cSrcweir     bool    m_bHtmlMode;
109*cdf0e10cSrcweir     bool    m_bAtHoriPosModified;
110*cdf0e10cSrcweir     bool    m_bAtVertPosModified;
111*cdf0e10cSrcweir     bool    m_bIsVerticalFrame;
112*cdf0e10cSrcweir     bool    m_bPositioningDisabled;
113*cdf0e10cSrcweir     bool    m_bIsMultiSelection;
114*cdf0e10cSrcweir     bool    m_bIsInRightToLeft;
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir     DECL_LINK( RangeModifyHdl, Edit * );
119*cdf0e10cSrcweir     DECL_LINK( AnchorTypeHdl, RadioButton * );
120*cdf0e10cSrcweir     DECL_LINK( PosHdl, ListBox * );
121*cdf0e10cSrcweir     DECL_LINK( RelHdl, ListBox * );
122*cdf0e10cSrcweir     DECL_LINK( MirrorHdl, CheckBox * );
123*cdf0e10cSrcweir     DECL_LINK( ModifyHdl, Edit * );
124*cdf0e10cSrcweir     DECL_LINK( ProtectHdl, TriStateBox *);
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir     void            InitPos(short nAnchorType, sal_uInt16 nH, sal_uInt16 nHRel,
127*cdf0e10cSrcweir                             sal_uInt16 nV,  sal_uInt16 nVRel,
128*cdf0e10cSrcweir                             long   nX,  long   nY);
129*cdf0e10cSrcweir     sal_uInt16          GetMapPos(FrmMap *pMap, ListBox &rAlignLB);
130*cdf0e10cSrcweir     short           GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, ListBox &rAlignLB, ListBox &rRelationLB);
131*cdf0e10cSrcweir     short           GetRelation(FrmMap *pMap, ListBox &rRelationLB);
132*cdf0e10cSrcweir     short           GetAnchorType(bool* pbHasChanged = 0);
133*cdf0e10cSrcweir     sal_uLong           FillRelLB(FrmMap *pMap, sal_uInt16 nLBSelPos, sal_uInt16 nAlign, sal_uInt16 nRel, ListBox &rLB, FixedText &rFT);
134*cdf0e10cSrcweir     sal_uInt16          FillPosLB(FrmMap *pMap, sal_uInt16 nAlign, const sal_uInt16 _nRel, ListBox &rLB);
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir     void            UpdateExample();
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir public:
139*cdf0e10cSrcweir     SvxSwPosSizeTabPage( Window* pParent, const SfxItemSet& rInAttrs  );
140*cdf0e10cSrcweir     ~SvxSwPosSizeTabPage();
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir     static SfxTabPage* Create( Window*, const SfxItemSet& );
143*cdf0e10cSrcweir     static sal_uInt16*     GetRanges();
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir     virtual sal_Bool FillItemSet( SfxItemSet& );
146*cdf0e10cSrcweir     virtual void Reset( const SfxItemSet & );
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir     virtual int  DeactivatePage( SfxItemSet* pSet );
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir     void    EnableAnchorTypes(sal_uInt16 nAnchorEnable);
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir     void SetValidateFramePosLink( const Link& rLink )
153*cdf0e10cSrcweir             {m_aValidateLink = rLink;}
154*cdf0e10cSrcweir 
155*cdf0e10cSrcweir     void SetView( const SdrView* pSdrView );
156*cdf0e10cSrcweir };
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir #endif
159