LibreOffice Module svx (master)  1
optgrid.hxx
Go to the documentation of this file.
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 <svx/svxdllapi.h>
24 
25 namespace weld { class CheckButton; }
26 namespace weld { class MetricSpinButton; }
27 namespace weld { class SpinButton; }
28 namespace weld { class ToggleButton; }
29 namespace weld { class Widget; }
30 
32 {
33 protected:
34  sal_uInt32 nFldDrawX;
35  sal_uInt32 nFldDivisionX;
36  sal_uInt32 nFldDrawY;
37  sal_uInt32 nFldDivisionY;
38  sal_uInt32 nFldSnapX;
39  sal_uInt32 nFldSnapY;
40  bool bUseGridsnap:1;
41  bool bSynchronize:1;
42  bool bGridVisible:1;
43  bool bEqualGrid: 1;
44 
45 public:
47 
48  void SetFieldDrawX( sal_uInt32 nSet){nFldDrawX = nSet;}
49  void SetFieldDivisionX(sal_uInt32 nSet){nFldDivisionX = nSet;}
50  void SetFieldDrawY ( sal_uInt32 nSet){nFldDrawY = nSet;}
51  void SetFieldDivisionY(sal_uInt32 nSet){nFldDivisionY = nSet;}
52  void SetFieldSnapX( sal_uInt32 nSet){nFldSnapX = nSet;}
53  void SetFieldSnapY ( sal_uInt32 nSet){nFldSnapY = nSet;}
54  void SetUseGridSnap( bool bSet ) {bUseGridsnap = bSet;}
55  void SetSynchronize( bool bSet ) {bSynchronize = bSet;}
56  void SetGridVisible( bool bSet ) {bGridVisible = bSet;}
57  void SetEqualGrid( bool bSet ) {bEqualGrid = bSet;}
58 
59  sal_uInt32 GetFieldDrawX( ) const { return nFldDrawX; }
60  sal_uInt32 GetFieldDivisionX() const { return nFldDivisionX;}
61  sal_uInt32 GetFieldDrawY ( ) const { return nFldDrawY; }
62  sal_uInt32 GetFieldDivisionY() const { return nFldDivisionY;}
63  sal_uInt32 GetFieldSnapX( ) const { return nFldSnapX; }
64  sal_uInt32 GetFieldSnapY ( ) const { return nFldSnapY; }
65  bool GetUseGridSnap( ) const { return bUseGridsnap; }
66  bool GetSynchronize( ) const { return bSynchronize; }
67  bool GetGridVisible( ) const { return bGridVisible; }
68  bool GetEqualGrid() const { return bEqualGrid; }
69 };
70 
72 {
73  // #i9076#
74  friend class SvxGridTabPage;
75 
76 public:
77  SvxGridItem( sal_uInt16 _nWhich) : SfxPoolItem(_nWhich){};
78 
79  virtual SvxGridItem* Clone( SfxItemPool *pPool = nullptr ) const override;
80  virtual bool operator==( const SfxPoolItem& ) const override;
81 
82  virtual bool GetPresentation( SfxItemPresentation ePres,
83  MapUnit eCoreMetric,
84  MapUnit ePresMetric,
85  OUString &rText, const IntlWrapper& ) const override;
86 
87 };
88 
90 {
91 public:
92  SvxGridTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
93  virtual ~SvxGridTabPage() override;
94 
95  static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rAttrSet);
96 
97  virtual bool FillItemSet( SfxItemSet* rSet ) override;
98  virtual void Reset( const SfxItemSet* rSet ) override;
99 
100  virtual void ActivatePage( const SfxItemSet& rSet ) override;
101  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
102 
103 private:
105 
106  std::unique_ptr<weld::CheckButton> m_xCbxUseGridsnap;
107  std::unique_ptr<weld::CheckButton> m_xCbxGridVisible;
108  std::unique_ptr<weld::MetricSpinButton> m_xMtrFldDrawX;
109  std::unique_ptr<weld::MetricSpinButton> m_xMtrFldDrawY;
110  std::unique_ptr<weld::SpinButton> m_xNumFldDivisionX;
111  std::unique_ptr<weld::SpinButton> m_xNumFldDivisionY;
112  std::unique_ptr<weld::CheckButton> m_xCbxSynchronize;
113 protected:
114  //these controls are used in draw and impress
115  std::unique_ptr<weld::Widget> m_xSnapFrames;
116  std::unique_ptr<weld::CheckButton> m_xCbxSnapHelplines;
117  std::unique_ptr<weld::CheckButton> m_xCbxSnapBorder;
118  std::unique_ptr<weld::CheckButton> m_xCbxSnapFrame;
119  std::unique_ptr<weld::CheckButton> m_xCbxSnapPoints;
120  std::unique_ptr<weld::MetricSpinButton> m_xMtrFldSnapArea;
121  std::unique_ptr<weld::CheckButton> m_xCbxOrtho;
122  std::unique_ptr<weld::CheckButton> m_xCbxBigOrtho;
123  std::unique_ptr<weld::CheckButton> m_xCbxRotate;
124  std::unique_ptr<weld::MetricSpinButton> m_xMtrFldAngle;
125  std::unique_ptr<weld::MetricSpinButton> m_xMtrFldBezAngle;
126 
127  DECL_LINK(ClickRotateHdl_Impl, weld::ToggleButton&, void);
128 private:
129  DECL_LINK(ChangeDrawHdl_Impl, weld::MetricSpinButton&, void);
130  DECL_LINK(ChangeGridsnapHdl_Impl, weld::ToggleButton&, void);
131  DECL_LINK(ChangeDivisionHdl_Impl, weld::SpinButton&, void);
132 };
133 
134 #endif
135 
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt32 GetFieldDivisionY() const
Definition: optgrid.hxx:62
std::unique_ptr< weld::SpinButton > m_xNumFldDivisionY
Definition: optgrid.hxx:111
void SetFieldDrawX(sal_uInt32 nSet)
Definition: optgrid.hxx:48
std::unique_ptr< weld::CheckButton > m_xCbxRotate
Definition: optgrid.hxx:123
virtual bool operator==(const SfxPoolItem &) const =0
bool GetEqualGrid() const
Definition: optgrid.hxx:68
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
void SetFieldSnapY(sal_uInt32 nSet)
Definition: optgrid.hxx:53
void SetFieldDrawY(sal_uInt32 nSet)
Definition: optgrid.hxx:50
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
sal_uInt32 nFldDivisionY
Definition: optgrid.hxx:37
sal_uInt32 GetFieldDrawX() const
Definition: optgrid.hxx:59
virtual void ActivatePage(const SfxItemSet &)
sal_uInt32 nFldDivisionX
Definition: optgrid.hxx:35
void SetEqualGrid(bool bSet)
Definition: optgrid.hxx:57
void SetFieldDivisionY(sal_uInt32 nSet)
Definition: optgrid.hxx:51
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldDrawY
Definition: optgrid.hxx:109
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet)
virtual bool FillItemSet(SfxItemSet *)
sal_uInt32 GetFieldSnapX() const
Definition: optgrid.hxx:63
std::unique_ptr< weld::CheckButton > m_xCbxSnapFrame
Definition: optgrid.hxx:118
std::unique_ptr< weld::CheckButton > m_xCbxGridVisible
Definition: optgrid.hxx:107
virtual void Reset(const SfxItemSet *)
std::unique_ptr< weld::CheckButton > m_xCbxSnapBorder
Definition: optgrid.hxx:117
bool bAttrModified
Definition: optgrid.hxx:104
sal_uInt32 GetFieldSnapY() const
Definition: optgrid.hxx:64
sal_uInt32 nFldSnapY
Definition: optgrid.hxx:39
SvxGridItem(sal_uInt16 _nWhich)
Definition: optgrid.hxx:77
void SetGridVisible(bool bSet)
Definition: optgrid.hxx:56
std::unique_ptr< weld::SpinButton > m_xNumFldDivisionX
Definition: optgrid.hxx:110
SfxItemPresentation
bool GetUseGridSnap() const
Definition: optgrid.hxx:65
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldBezAngle
Definition: optgrid.hxx:125
sal_uInt32 GetFieldDivisionX() const
Definition: optgrid.hxx:60
sal_uInt32 nFldDrawX
Definition: optgrid.hxx:34
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldAngle
Definition: optgrid.hxx:124
void SetFieldDivisionX(sal_uInt32 nSet)
Definition: optgrid.hxx:49
std::unique_ptr< weld::CheckButton > m_xCbxOrtho
Definition: optgrid.hxx:121
bool GetSynchronize() const
Definition: optgrid.hxx:66
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldDrawX
Definition: optgrid.hxx:108
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
void SetSynchronize(bool bSet)
Definition: optgrid.hxx:55
void SetUseGridSnap(bool bSet)
Definition: optgrid.hxx:54
sal_uInt32 nFldSnapX
Definition: optgrid.hxx:38
std::unique_ptr< weld::CheckButton > m_xCbxSnapPoints
Definition: optgrid.hxx:119
sal_uInt32 nFldDrawY
Definition: optgrid.hxx:36
std::unique_ptr< weld::CheckButton > m_xCbxBigOrtho
Definition: optgrid.hxx:122
sal_uInt32 GetFieldDrawY() const
Definition: optgrid.hxx:61
std::unique_ptr< weld::CheckButton > m_xCbxSynchronize
Definition: optgrid.hxx:112
std::unique_ptr< weld::Widget > m_xSnapFrames
Definition: optgrid.hxx:115
DeactivateRC
MapUnit
void SetFieldSnapX(sal_uInt32 nSet)
Definition: optgrid.hxx:52
std::unique_ptr< weld::CheckButton > m_xCbxUseGridsnap
Definition: optgrid.hxx:106
bool GetGridVisible() const
Definition: optgrid.hxx:67
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldSnapArea
Definition: optgrid.hxx:120
std::unique_ptr< weld::CheckButton > m_xCbxSnapHelplines
Definition: optgrid.hxx:116