xref: /aoo4110/main/svx/inc/svx/optgrid.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SVX_OPTGRID_HXX
24 #define _SVX_OPTGRID_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <sfx2/tabdlg.hxx>
29 #include <svl/eitem.hxx>
30 #include <vcl/group.hxx>
31 #include <vcl/fixed.hxx>
32 #include <vcl/field.hxx>
33 #include "svx/svxdllapi.h"
34 
35 class SvxGridTabPage;
36 
37 // class SvxOptionsGrid --------------------------------------------------
38 
39 class SVX_DLLPUBLIC SvxOptionsGrid
40 {
41 protected:
42 	sal_uInt32	nFldDrawX;
43 	sal_uInt32 	nFldDivisionX;
44 	sal_uInt32	nFldDrawY;
45 	sal_uInt32 	nFldDivisionY;
46 	sal_uInt32	nFldSnapX;
47 	sal_uInt32	nFldSnapY;
48 	sal_Bool	bUseGridsnap:1;
49 	sal_Bool	bSynchronize:1;
50 	sal_Bool	bGridVisible:1;
51 	sal_Bool	bEqualGrid:	 1;
52 
53 public:
54 	SvxOptionsGrid();
55 	~SvxOptionsGrid();
56 
SetFldDrawX(sal_uInt32 nSet)57 	void 	SetFldDrawX(	sal_uInt32 nSet){nFldDrawX 		= nSet;}
SetFldDivisionX(sal_uInt32 nSet)58 	void 	SetFldDivisionX(sal_uInt32 nSet){nFldDivisionX  = nSet;}
SetFldDrawY(sal_uInt32 nSet)59 	void 	SetFldDrawY   (	sal_uInt32 nSet){nFldDrawY      = nSet;}
SetFldDivisionY(sal_uInt32 nSet)60 	void 	SetFldDivisionY(sal_uInt32 nSet){nFldDivisionY  = nSet;}
SetFldSnapX(sal_uInt32 nSet)61 	void 	SetFldSnapX(	sal_uInt32 nSet){nFldSnapX 		= nSet;}
SetFldSnapY(sal_uInt32 nSet)62 	void 	SetFldSnapY   (	sal_uInt32 nSet){nFldSnapY      = nSet;}
SetUseGridSnap(sal_Bool bSet)63 	void 	SetUseGridSnap( sal_Bool bSet ) {bUseGridsnap	= bSet;}
SetSynchronize(sal_Bool bSet)64 	void 	SetSynchronize( sal_Bool bSet ) {bSynchronize	= bSet;}
SetGridVisible(sal_Bool bSet)65 	void 	SetGridVisible( sal_Bool bSet ) {bGridVisible	= bSet;}
SetEqualGrid(sal_Bool bSet)66 	void 	SetEqualGrid( sal_Bool bSet )	{bEqualGrid		= bSet;}
67 
GetFldDrawX() const68 	sal_uInt32	GetFldDrawX(	) const {  return nFldDrawX;    }
GetFldDivisionX() const69 	sal_uInt32 	GetFldDivisionX() const {  return nFldDivisionX;}
GetFldDrawY() const70 	sal_uInt32	GetFldDrawY   (	) const {  return nFldDrawY;    }
GetFldDivisionY() const71 	sal_uInt32 	GetFldDivisionY() const {  return nFldDivisionY;}
GetFldSnapX() const72 	sal_uInt32	GetFldSnapX(	) const {  return nFldSnapX;    }
GetFldSnapY() const73 	sal_uInt32	GetFldSnapY   (	) const {  return nFldSnapY;    }
GetUseGridSnap() const74 	sal_Bool	GetUseGridSnap( ) const {  return bUseGridsnap; }
GetSynchronize() const75 	sal_Bool	GetSynchronize( ) const {  return bSynchronize; }
GetGridVisible() const76 	sal_Bool	GetGridVisible( ) const {  return bGridVisible; }
GetEqualGrid() const77 	sal_Bool	GetEqualGrid()	  const {  return bEqualGrid;   }
78 };
79 
80 // class SvxGridItem -----------------------------------------------------
81 
82 class SVX_DLLPUBLIC SvxGridItem : public SvxOptionsGrid, public SfxPoolItem
83 {
84 	// #i9076#
85 	friend class SvxGridTabPage;
86 
87 public:
SvxGridItem(sal_uInt16 _nWhich)88 	SvxGridItem( sal_uInt16 _nWhich) : SfxPoolItem(_nWhich){};
89 	SvxGridItem( const SvxGridItem& pTestItem );
90 
91 	virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
92 	virtual int             operator==( const SfxPoolItem& ) const;
93 
94 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
95 									SfxMapUnit eCoreMetric,
96 									SfxMapUnit ePresMetric,
97                                     String &rText, const IntlWrapper * = 0 ) const;
98 
99 };
100 
101 // class SvxGridTabPage --------------------------------------------------
102 
103 class SVX_DLLPUBLIC SvxGridTabPage : public SfxTabPage
104 {
105 	using TabPage::ActivatePage;
106 	using TabPage::DeactivatePage;
107 
108 public:
109 	SvxGridTabPage( Window* pParent, const SfxItemSet& rSet );
110 
111 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rAttrSet );
112 
113 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
114 	virtual	void 		Reset( const SfxItemSet& rSet );
115 
116 	virtual void 		ActivatePage( const SfxItemSet& rSet );
117 	virtual int  		DeactivatePage( SfxItemSet* pSet );
118 
119 private:
120 	CheckBox			aCbxUseGridsnap;
121 	CheckBox			aCbxGridVisible;
122 
123     FixedLine           aFlResolution;
124 	FixedText			aFtDrawX;
125 	MetricField			aMtrFldDrawX;
126 	FixedText			aFtDrawY;
127 	MetricField			aMtrFldDrawY;
128 
129     FixedLine           aFlDivision;
130     FixedText           aFtDivisionX;
131     NumericField        aNumFldDivisionX;
132     FixedText           aDivisionPointX;
133 
134     FixedText           aFtDivisionY;
135     NumericField        aNumFldDivisionY;
136     FixedText           aDivisionPointY;
137 
138     CheckBox            aCbxSynchronize;
139     FixedLine           aGrpDrawGrid; // Neu
140 
141 protected:
142     //these controls are used in draw and impress
143     FixedLine       aGrpSnap;
144     CheckBox        aCbxSnapHelplines;
145 	CheckBox		aCbxSnapBorder;
146 	CheckBox		aCbxSnapFrame;
147 	CheckBox		aCbxSnapPoints;
148 	FixedText		aFtSnapArea;
149 	MetricField 	aMtrFldSnapArea;
150 
151     FixedLine       aSeparatorFL;
152 
153     FixedLine       aGrpOrtho;
154     CheckBox        aCbxOrtho;
155 	CheckBox		aCbxBigOrtho;
156 	CheckBox		aCbxRotate;
157 	MetricField 	aMtrFldAngle;
158 	FixedText		aFtBezAngle;
159 	MetricField 	aMtrFldBezAngle;
160 
161 private:
162     sal_Bool                bAttrModified;
163 //	sal_Bool				bEqualGrid; // Neu
164 
165 #ifdef _SVX_OPTGRID_CXX
166     DECL_LINK( ClickRotateHdl_Impl, void * );
167     DECL_LINK( ChangeDrawHdl_Impl, MetricField * );
168     DECL_LINK( ChangeGridsnapHdl_Impl, void * );
169     DECL_LINK( ChangeDivisionHdl_Impl, NumericField * );
170 
171 #endif
172 };
173 
174 
175 #endif
176 
177