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 .
19 #ifndef _SVX_SWPOSSIZETABPAGE_HXX
20 #define _SVX_SWPOSSIZETABPAGE_HXX
22 #include <sfx2/tabdlg.hxx>
23 #include <vcl/fixed.hxx>
24 #include <vcl/field.hxx>
25 #include <vcl/lstbox.hxx>
26 #include <svx/swframeposstrings.hxx>
27 #include <svx/swframeexample.hxx>
29 // SvxSwPosSizeTabPage - position and size page for Writer drawing objects
32 class SvxSwPosSizeTabPage
: public SfxTabPage
34 using TabPage::DeactivatePage
;
38 MetricField m_aWidthMF
;
39 FixedText m_aHeightFT
;
40 MetricField m_aHeightMF
;
41 CheckBox m_aKeepRatioCB
;
43 FixedLine m_aSeparatorFL
;
45 FixedLine m_aAnchorFL
;
46 RadioButton m_aToPageRB
;
47 RadioButton m_aToParaRB
;
48 RadioButton m_aToCharRB
;
49 RadioButton m_aAsCharRB
;
50 RadioButton m_aToFrameRB
;
52 FixedLine m_aProtectionFL
;
53 TriStateBox m_aPositionCB
;
54 TriStateBox m_aSizeCB
;
56 FixedLine m_aPositionFL
;
59 FixedText m_aHoriByFT
;
60 MetricField m_aHoriByMF
;
61 FixedText m_aHoriToFT
;
64 CheckBox m_aHoriMirrorCB
;
68 FixedText m_aVertByFT
;
69 MetricField m_aVertByMF
;
70 FixedText m_aVertToFT
;
75 SvxSwFrameExample m_aExampleWN
;
80 SvxSwFramePosString m_aFramePosString
;
82 Rectangle m_aRect
; //size of all selected objects
83 Rectangle m_aWorkArea
;
88 const SdrView
* m_pSdrView
;
96 double m_fWidthHeightRatio
; //width-to-height ratio to support the KeepRatio button
97 sal_uInt16 m_nHtmlMode
;
99 bool m_bAtHoriPosModified
;
100 bool m_bAtVertPosModified
;
101 bool m_bIsVerticalFrame
;
102 bool m_bPositioningDisabled
;
103 bool m_bIsMultiSelection
;
104 bool m_bIsInRightToLeft
;
108 DECL_LINK(RangeModifyHdl
, void *);
109 DECL_LINK(AnchorTypeHdl
, void *);
110 DECL_LINK( PosHdl
, ListBox
* );
111 DECL_LINK( RelHdl
, ListBox
* );
112 DECL_LINK(MirrorHdl
, void *);
113 DECL_LINK( ModifyHdl
, Edit
* );
114 DECL_LINK(ProtectHdl
, void *);
116 void InitPos(short nAnchorType
, sal_uInt16 nH
, sal_uInt16 nHRel
,
117 sal_uInt16 nV
, sal_uInt16 nVRel
,
119 sal_uInt16
GetMapPos(FrmMap
*pMap
, ListBox
&rAlignLB
);
120 short GetAlignment(FrmMap
*pMap
, sal_uInt16 nMapPos
, ListBox
&rAlignLB
, ListBox
&rRelationLB
);
121 short GetRelation(FrmMap
*pMap
, ListBox
&rRelationLB
);
122 short GetAnchorType(bool* pbHasChanged
= 0);
123 sal_uLong
FillRelLB(FrmMap
*pMap
, sal_uInt16 nLBSelPos
, sal_uInt16 nAlign
, sal_uInt16 nRel
, ListBox
&rLB
, FixedText
&rFT
);
124 sal_uInt16
FillPosLB(FrmMap
*pMap
, sal_uInt16 nAlign
, const sal_uInt16 _nRel
, ListBox
&rLB
);
126 void UpdateExample();
129 SvxSwPosSizeTabPage( Window
* pParent
, const SfxItemSet
& rInAttrs
);
130 ~SvxSwPosSizeTabPage();
132 static SfxTabPage
* Create( Window
*, const SfxItemSet
& );
133 static sal_uInt16
* GetRanges();
135 virtual sal_Bool
FillItemSet( SfxItemSet
& );
136 virtual void Reset( const SfxItemSet
& );
138 virtual int DeactivatePage( SfxItemSet
* pSet
);
140 void EnableAnchorTypes(sal_uInt16 nAnchorEnable
);
142 void SetValidateFramePosLink( const Link
& rLink
)
143 {m_aValidateLink
= rLink
;}
145 void SetView( const SdrView
* pSdrView
);
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */