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: optgrid.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_OPTGRID_HXX
31 #define _SVX_OPTGRID_HXX
33 // include ---------------------------------------------------------------
35 #include <sfx2/tabdlg.hxx>
36 #include <svtools/eitem.hxx>
37 #include <vcl/group.hxx>
38 #include <vcl/fixed.hxx>
39 #include <vcl/field.hxx>
40 #include "svx/svxdllapi.h"
44 // class SvxOptionsGrid --------------------------------------------------
46 class SVX_DLLPUBLIC SvxOptionsGrid
64 void SetFldDrawX( UINT32 nSet
){nFldDrawX
= nSet
;}
65 void SetFldDivisionX(UINT32 nSet
){nFldDivisionX
= nSet
;}
66 void SetFldDrawY ( UINT32 nSet
){nFldDrawY
= nSet
;}
67 void SetFldDivisionY(UINT32 nSet
){nFldDivisionY
= nSet
;}
68 void SetFldSnapX( UINT32 nSet
){nFldSnapX
= nSet
;}
69 void SetFldSnapY ( UINT32 nSet
){nFldSnapY
= nSet
;}
70 void SetUseGridSnap( BOOL bSet
) {bUseGridsnap
= bSet
;}
71 void SetSynchronize( BOOL bSet
) {bSynchronize
= bSet
;}
72 void SetGridVisible( BOOL bSet
) {bGridVisible
= bSet
;}
73 void SetEqualGrid( BOOL bSet
) {bEqualGrid
= bSet
;}
75 UINT32
GetFldDrawX( ) const { return nFldDrawX
; }
76 UINT32
GetFldDivisionX() const { return nFldDivisionX
;}
77 UINT32
GetFldDrawY ( ) const { return nFldDrawY
; }
78 UINT32
GetFldDivisionY() const { return nFldDivisionY
;}
79 UINT32
GetFldSnapX( ) const { return nFldSnapX
; }
80 UINT32
GetFldSnapY ( ) const { return nFldSnapY
; }
81 BOOL
GetUseGridSnap( ) const { return bUseGridsnap
; }
82 BOOL
GetSynchronize( ) const { return bSynchronize
; }
83 BOOL
GetGridVisible( ) const { return bGridVisible
; }
84 BOOL
GetEqualGrid() const { return bEqualGrid
; }
87 // class SvxGridItem -----------------------------------------------------
89 class SVX_DLLPUBLIC SvxGridItem
: public SvxOptionsGrid
, public SfxPoolItem
92 friend class SvxGridTabPage
;
95 SvxGridItem( USHORT _nWhich
) : SfxPoolItem(_nWhich
){};
96 SvxGridItem( const SvxGridItem
& pTestItem
);
98 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
99 virtual int operator==( const SfxPoolItem
& ) const;
101 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
102 SfxMapUnit eCoreMetric
,
103 SfxMapUnit ePresMetric
,
104 String
&rText
, const IntlWrapper
* = 0 ) const;
108 // class SvxGridTabPage --------------------------------------------------
110 class SVX_DLLPUBLIC SvxGridTabPage
: public SfxTabPage
112 using TabPage::ActivatePage
;
113 using TabPage::DeactivatePage
;
116 SvxGridTabPage( Window
* pParent
, const SfxItemSet
& rSet
);
118 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
120 virtual BOOL
FillItemSet( SfxItemSet
& rSet
);
121 virtual void Reset( const SfxItemSet
& rSet
);
123 virtual void ActivatePage( const SfxItemSet
& rSet
);
124 virtual int DeactivatePage( SfxItemSet
* pSet
);
127 CheckBox aCbxUseGridsnap
;
128 CheckBox aCbxGridVisible
;
130 FixedLine aFlResolution
;
132 MetricField aMtrFldDrawX
;
134 MetricField aMtrFldDrawY
;
136 FixedLine aFlDivision
;
137 FixedText aFtDivisionX
;
138 NumericField aNumFldDivisionX
;
139 FixedText aDivisionPointX
;
141 FixedText aFtDivisionY
;
142 NumericField aNumFldDivisionY
;
143 FixedText aDivisionPointY
;
145 CheckBox aCbxSynchronize
;
146 FixedLine aGrpDrawGrid
; // Neu
149 //these controls are used in draw and impress
151 CheckBox aCbxSnapHelplines
;
152 CheckBox aCbxSnapBorder
;
153 CheckBox aCbxSnapFrame
;
154 CheckBox aCbxSnapPoints
;
155 FixedText aFtSnapArea
;
156 MetricField aMtrFldSnapArea
;
158 FixedLine aSeparatorFL
;
162 CheckBox aCbxBigOrtho
;
164 MetricField aMtrFldAngle
;
165 FixedText aFtBezAngle
;
166 MetricField aMtrFldBezAngle
;
170 // BOOL bEqualGrid; // Neu
172 #ifdef _SVX_OPTGRID_CXX
173 DECL_LINK( ClickRotateHdl_Impl
, void * );
174 DECL_LINK( ChangeDrawHdl_Impl
, MetricField
* );
175 DECL_LINK( ChangeGridsnapHdl_Impl
, void * );
176 DECL_LINK( ChangeDivisionHdl_Impl
, NumericField
* );