Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SVX_OPTGRID_HXX
29 : : #define _SVX_OPTGRID_HXX
30 : :
31 : : #include <sfx2/tabdlg.hxx>
32 : : #include <svl/eitem.hxx>
33 : : #include <vcl/group.hxx>
34 : : #include <vcl/fixed.hxx>
35 : : #include <vcl/field.hxx>
36 : : #include "svx/svxdllapi.h"
37 : :
38 : : class SvxGridTabPage;
39 : :
40 : : // class SvxOptionsGrid --------------------------------------------------
41 : :
42 : : class SVX_DLLPUBLIC SvxOptionsGrid
43 : : {
44 : : protected:
45 : : sal_uInt32 nFldDrawX;
46 : : sal_uInt32 nFldDivisionX;
47 : : sal_uInt32 nFldDrawY;
48 : : sal_uInt32 nFldDivisionY;
49 : : sal_uInt32 nFldSnapX;
50 : : sal_uInt32 nFldSnapY;
51 : : sal_Bool bUseGridsnap:1;
52 : : sal_Bool bSynchronize:1;
53 : : sal_Bool bGridVisible:1;
54 : : sal_Bool bEqualGrid: 1;
55 : :
56 : : public:
57 : : SvxOptionsGrid();
58 : : ~SvxOptionsGrid();
59 : :
60 : 439 : void SetFldDrawX( sal_uInt32 nSet){nFldDrawX = nSet;}
61 : 439 : void SetFldDivisionX(sal_uInt32 nSet){nFldDivisionX = nSet;}
62 : 439 : void SetFldDrawY ( sal_uInt32 nSet){nFldDrawY = nSet;}
63 : 439 : void SetFldDivisionY(sal_uInt32 nSet){nFldDivisionY = nSet;}
64 : 114 : void SetFldSnapX( sal_uInt32 nSet){nFldSnapX = nSet;}
65 : 114 : void SetFldSnapY ( sal_uInt32 nSet){nFldSnapY = nSet;}
66 : 406 : void SetUseGridSnap( sal_Bool bSet ) {bUseGridsnap = bSet;}
67 : 406 : void SetSynchronize( sal_Bool bSet ) {bSynchronize = bSet;}
68 : 376 : void SetGridVisible( sal_Bool bSet ) {bGridVisible = bSet;}
69 : 51 : void SetEqualGrid( sal_Bool bSet ) {bEqualGrid = bSet;}
70 : :
71 : 1992 : sal_uInt32 GetFldDrawX( ) const { return nFldDrawX; }
72 : 1712 : sal_uInt32 GetFldDivisionX() const { return nFldDivisionX;}
73 : 1992 : sal_uInt32 GetFldDrawY ( ) const { return nFldDrawY; }
74 : 1712 : sal_uInt32 GetFldDivisionY() const { return nFldDivisionY;}
75 : 63 : sal_uInt32 GetFldSnapX( ) const { return nFldSnapX; }
76 : 63 : sal_uInt32 GetFldSnapY ( ) const { return nFldSnapY; }
77 : 1110 : sal_Bool GetUseGridSnap( ) const { return bUseGridsnap; }
78 : 309 : sal_Bool GetSynchronize( ) const { return bSynchronize; }
79 : 1070 : sal_Bool GetGridVisible( ) const { return bGridVisible; }
80 : 63 : sal_Bool GetEqualGrid() const { return bEqualGrid; }
81 : : };
82 : :
83 : : // class SvxGridItem -----------------------------------------------------
84 : :
85 [ # # ][ # # ]: 0 : class SVX_DLLPUBLIC SvxGridItem : public SvxOptionsGrid, public SfxPoolItem
86 : : {
87 : : // #i9076#
88 : : friend class SvxGridTabPage;
89 : :
90 : : public:
91 [ # # ]: 0 : SvxGridItem( sal_uInt16 _nWhich) : SfxPoolItem(_nWhich){};
92 : : SvxGridItem( const SvxGridItem& pTestItem );
93 : :
94 : : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
95 : : virtual int operator==( const SfxPoolItem& ) const;
96 : :
97 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
98 : : SfxMapUnit eCoreMetric,
99 : : SfxMapUnit ePresMetric,
100 : : String &rText, const IntlWrapper * = 0 ) const;
101 : :
102 : : };
103 : :
104 : : // class SvxGridTabPage --------------------------------------------------
105 : :
106 : 0 : class SVX_DLLPUBLIC SvxGridTabPage : public SfxTabPage
107 : : {
108 : : using TabPage::ActivatePage;
109 : : using TabPage::DeactivatePage;
110 : :
111 : : public:
112 : : SvxGridTabPage( Window* pParent, const SfxItemSet& rSet );
113 : :
114 : : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
115 : :
116 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
117 : : virtual void Reset( const SfxItemSet& rSet );
118 : :
119 : : virtual void ActivatePage( const SfxItemSet& rSet );
120 : : virtual int DeactivatePage( SfxItemSet* pSet );
121 : :
122 : : private:
123 : : CheckBox aCbxUseGridsnap;
124 : : CheckBox aCbxGridVisible;
125 : :
126 : : FixedLine aFlResolution;
127 : : FixedText aFtDrawX;
128 : : MetricField aMtrFldDrawX;
129 : : FixedText aFtDrawY;
130 : : MetricField aMtrFldDrawY;
131 : :
132 : : FixedLine aFlDivision;
133 : : FixedText aFtDivisionX;
134 : : NumericField aNumFldDivisionX;
135 : : FixedText aDivisionPointX;
136 : :
137 : : FixedText aFtDivisionY;
138 : : NumericField aNumFldDivisionY;
139 : : FixedText aDivisionPointY;
140 : :
141 : : CheckBox aCbxSynchronize;
142 : : FixedLine aGrpDrawGrid;
143 : :
144 : : protected:
145 : : //these controls are used in draw and impress
146 : : FixedLine aGrpSnap;
147 : : CheckBox aCbxSnapHelplines;
148 : : CheckBox aCbxSnapBorder;
149 : : CheckBox aCbxSnapFrame;
150 : : CheckBox aCbxSnapPoints;
151 : : FixedText aFtSnapArea;
152 : : MetricField aMtrFldSnapArea;
153 : :
154 : : FixedLine aSeparatorFL;
155 : :
156 : : FixedLine aGrpOrtho;
157 : : CheckBox aCbxOrtho;
158 : : CheckBox aCbxBigOrtho;
159 : : CheckBox aCbxRotate;
160 : : MetricField aMtrFldAngle;
161 : : FixedText aFtBezAngle;
162 : : MetricField aMtrFldBezAngle;
163 : :
164 : : private:
165 : : sal_Bool bAttrModified;
166 : :
167 : : #ifdef _SVX_OPTGRID_CXX
168 : : DECL_LINK( ClickRotateHdl_Impl, void * );
169 : : DECL_LINK( ChangeDrawHdl_Impl, MetricField * );
170 : : DECL_LINK( ChangeGridsnapHdl_Impl, void * );
171 : : DECL_LINK( ChangeDivisionHdl_Impl, NumericField * );
172 : :
173 : : #endif
174 : : };
175 : :
176 : :
177 : : #endif
178 : :
179 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|