Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_SVX_OPTGRID_HXX
20 : #define INCLUDED_SVX_OPTGRID_HXX
21 :
22 : #include <sfx2/tabdlg.hxx>
23 : #include <svl/eitem.hxx>
24 : #include <vcl/group.hxx>
25 : #include <vcl/fixed.hxx>
26 : #include <vcl/field.hxx>
27 : #include <svx/svxdllapi.h>
28 :
29 : class SvxGridTabPage;
30 :
31 : // class SvxOptionsGrid --------------------------------------------------
32 :
33 : class SVX_DLLPUBLIC SvxOptionsGrid
34 : {
35 : protected:
36 : sal_uInt32 nFldDrawX;
37 : sal_uInt32 nFldDivisionX;
38 : sal_uInt32 nFldDrawY;
39 : sal_uInt32 nFldDivisionY;
40 : sal_uInt32 nFldSnapX;
41 : sal_uInt32 nFldSnapY;
42 : bool bUseGridsnap:1;
43 : bool bSynchronize:1;
44 : bool bGridVisible:1;
45 : bool bEqualGrid: 1;
46 :
47 : public:
48 : SvxOptionsGrid();
49 : ~SvxOptionsGrid();
50 :
51 547 : void SetFieldDrawX( sal_uInt32 nSet){nFldDrawX = nSet;}
52 547 : void SetFieldDivisionX(sal_uInt32 nSet){nFldDivisionX = nSet;}
53 547 : void SetFieldDrawY ( sal_uInt32 nSet){nFldDrawY = nSet;}
54 547 : void SetFieldDivisionY(sal_uInt32 nSet){nFldDivisionY = nSet;}
55 97 : void SetFieldSnapX( sal_uInt32 nSet){nFldSnapX = nSet;}
56 97 : void SetFieldSnapY ( sal_uInt32 nSet){nFldSnapY = nSet;}
57 521 : void SetUseGridSnap( bool bSet ) {bUseGridsnap = bSet;}
58 521 : void SetSynchronize( bool bSet ) {bSynchronize = bSet;}
59 499 : void SetGridVisible( bool bSet ) {bGridVisible = bSet;}
60 49 : void SetEqualGrid( bool bSet ) {bEqualGrid = bSet;}
61 :
62 2538 : sal_uInt32 GetFieldDrawX( ) const { return nFldDrawX; }
63 2017 : sal_uInt32 GetFieldDivisionX() const { return nFldDivisionX;}
64 2538 : sal_uInt32 GetFieldDrawY ( ) const { return nFldDrawY; }
65 2017 : sal_uInt32 GetFieldDivisionY() const { return nFldDivisionY;}
66 48 : sal_uInt32 GetFieldSnapX( ) const { return nFldSnapX; }
67 48 : sal_uInt32 GetFieldSnapY ( ) const { return nFldSnapY; }
68 1551 : bool GetUseGridSnap( ) const { return bUseGridsnap; }
69 320 : bool GetSynchronize( ) const { return bSynchronize; }
70 1265 : bool GetGridVisible( ) const { return bGridVisible; }
71 48 : bool GetEqualGrid() const { return bEqualGrid; }
72 : };
73 :
74 : // class SvxGridItem -----------------------------------------------------
75 :
76 0 : class SVX_DLLPUBLIC SvxGridItem : public SvxOptionsGrid, public SfxPoolItem
77 : {
78 : // #i9076#
79 : friend class SvxGridTabPage;
80 :
81 : public:
82 0 : SvxGridItem( sal_uInt16 _nWhich) : SfxPoolItem(_nWhich){};
83 : SvxGridItem( const SvxGridItem& pTestItem );
84 :
85 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
86 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
87 :
88 : virtual bool GetPresentation( SfxItemPresentation ePres,
89 : SfxMapUnit eCoreMetric,
90 : SfxMapUnit ePresMetric,
91 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
92 :
93 : };
94 :
95 : // class SvxGridTabPage --------------------------------------------------
96 :
97 : class SVX_DLLPUBLIC SvxGridTabPage : public SfxTabPage
98 : {
99 : using TabPage::ActivatePage;
100 : using TabPage::DeactivatePage;
101 :
102 : public:
103 : SvxGridTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
104 : virtual ~SvxGridTabPage();
105 : virtual void dispose() SAL_OVERRIDE;
106 :
107 : static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet& rAttrSet );
108 :
109 : virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
110 : virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
111 :
112 : virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
113 : virtual sfxpg DeactivatePage( SfxItemSet* pSet ) SAL_OVERRIDE;
114 :
115 : private:
116 : VclPtr<CheckBox> pCbxUseGridsnap;
117 : VclPtr<CheckBox> pCbxGridVisible;
118 :
119 : VclPtr<MetricField> pMtrFldDrawX;
120 : VclPtr<MetricField> pMtrFldDrawY;
121 :
122 : VclPtr<NumericField> pNumFldDivisionX;
123 : VclPtr<NumericField> pNumFldDivisionY;
124 :
125 : VclPtr<CheckBox> pCbxSynchronize;
126 : protected:
127 : //these controls are used in draw and impress
128 : VclPtr<VclContainer> pSnapFrames;
129 : VclPtr<CheckBox> pCbxSnapHelplines;
130 : VclPtr<CheckBox> pCbxSnapBorder;
131 : VclPtr<CheckBox> pCbxSnapFrame;
132 : VclPtr<CheckBox> pCbxSnapPoints;
133 : VclPtr<MetricField> pMtrFldSnapArea;
134 :
135 : VclPtr<CheckBox> pCbxOrtho;
136 : VclPtr<CheckBox> pCbxBigOrtho;
137 : VclPtr<CheckBox> pCbxRotate;
138 : VclPtr<MetricField> pMtrFldAngle;
139 : VclPtr<MetricField> pMtrFldBezAngle;
140 :
141 : private:
142 : bool bAttrModified;
143 :
144 : DECL_LINK( ClickRotateHdl_Impl, void * );
145 : DECL_LINK( ChangeDrawHdl_Impl, MetricField * );
146 : DECL_LINK( ChangeGridsnapHdl_Impl, void * );
147 : DECL_LINK( ChangeDivisionHdl_Impl, NumericField * );
148 : };
149 :
150 : #endif
151 :
152 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|