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
25namespace weld { class CheckButton; }
26namespace weld { class MetricSpinButton; }
27namespace weld { class SpinButton; }
28namespace weld { class ToggleButton; }
29namespace weld { class Widget; }
30
32{
33protected:
34 sal_uInt32 nFldDrawX;
35 sal_uInt32 nFldDivisionX;
36 sal_uInt32 nFldDrawY;
37 sal_uInt32 nFldDivisionY;
38 sal_uInt32 nFldSnapX;
39 sal_uInt32 nFldSnapY;
43 bool bEqualGrid: 1;
44
45public:
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
76public:
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{
91public:
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
103private:
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;
113protected:
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::Toggleable&, void);
128private:
129 DECL_DLLPRIVATE_LINK(ChangeDrawHdl_Impl, weld::MetricSpinButton&, void);
130 DECL_DLLPRIVATE_LINK(ChangeGridsnapHdl_Impl, weld::Toggleable&, void);
131 DECL_DLLPRIVATE_LINK(ChangeDivisionHdl_Impl, weld::SpinButton&, void);
132};
133
134#endif
135
136/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxGridItem(TypedWhichId< SvxGridItem > _nWhich)
Definition: optgrid.hxx:77
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldSnapArea
Definition: optgrid.hxx:120
std::unique_ptr< weld::CheckButton > m_xCbxSynchronize
Definition: optgrid.hxx:112
DECL_LINK(ClickRotateHdl_Impl, weld::Toggleable &, void)
std::unique_ptr< weld::CheckButton > m_xCbxOrtho
Definition: optgrid.hxx:121
std::unique_ptr< weld::SpinButton > m_xNumFldDivisionX
Definition: optgrid.hxx:110
std::unique_ptr< weld::CheckButton > m_xCbxUseGridsnap
Definition: optgrid.hxx:106
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldDrawY
Definition: optgrid.hxx:109
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldDrawX
Definition: optgrid.hxx:108
DECL_DLLPRIVATE_LINK(ChangeDrawHdl_Impl, weld::MetricSpinButton &, void)
std::unique_ptr< weld::CheckButton > m_xCbxRotate
Definition: optgrid.hxx:123
bool bAttrModified
Definition: optgrid.hxx:104
std::unique_ptr< weld::SpinButton > m_xNumFldDivisionY
Definition: optgrid.hxx:111
std::unique_ptr< weld::Widget > m_xSnapFrames
Definition: optgrid.hxx:115
std::unique_ptr< weld::CheckButton > m_xCbxSnapFrame
Definition: optgrid.hxx:118
DECL_DLLPRIVATE_LINK(ChangeGridsnapHdl_Impl, weld::Toggleable &, void)
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldBezAngle
Definition: optgrid.hxx:125
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldAngle
Definition: optgrid.hxx:124
std::unique_ptr< weld::CheckButton > m_xCbxSnapBorder
Definition: optgrid.hxx:117
std::unique_ptr< weld::CheckButton > m_xCbxSnapPoints
Definition: optgrid.hxx:119
std::unique_ptr< weld::CheckButton > m_xCbxSnapHelplines
Definition: optgrid.hxx:116
DECL_DLLPRIVATE_LINK(ChangeDivisionHdl_Impl, weld::SpinButton &, void)
std::unique_ptr< weld::CheckButton > m_xCbxGridVisible
Definition: optgrid.hxx:107
std::unique_ptr< weld::CheckButton > m_xCbxBigOrtho
Definition: optgrid.hxx:122
sal_uInt32 nFldSnapY
Definition: optgrid.hxx:39
bool GetGridVisible() const
Definition: optgrid.hxx:67
bool GetUseGridSnap() const
Definition: optgrid.hxx:65
sal_uInt32 GetFieldSnapY() const
Definition: optgrid.hxx:64
void SetFieldSnapY(sal_uInt32 nSet)
Definition: optgrid.hxx:53
bool bUseGridsnap
Definition: optgrid.hxx:40
sal_uInt32 nFldDrawX
Definition: optgrid.hxx:34
void SetFieldDrawX(sal_uInt32 nSet)
Definition: optgrid.hxx:48
void SetUseGridSnap(bool bSet)
Definition: optgrid.hxx:54
void SetFieldDrawY(sal_uInt32 nSet)
Definition: optgrid.hxx:50
sal_uInt32 GetFieldDivisionY() const
Definition: optgrid.hxx:62
bool GetSynchronize() const
Definition: optgrid.hxx:66
void SetSynchronize(bool bSet)
Definition: optgrid.hxx:55
sal_uInt32 nFldSnapX
Definition: optgrid.hxx:38
void SetEqualGrid(bool bSet)
Definition: optgrid.hxx:57
sal_uInt32 GetFieldDrawY() const
Definition: optgrid.hxx:61
sal_uInt32 nFldDrawY
Definition: optgrid.hxx:36
bool bEqualGrid
Definition: optgrid.hxx:43
void SetGridVisible(bool bSet)
Definition: optgrid.hxx:56
void SetFieldSnapX(sal_uInt32 nSet)
Definition: optgrid.hxx:52
void SetFieldDivisionY(sal_uInt32 nSet)
Definition: optgrid.hxx:51
sal_uInt32 GetFieldSnapX() const
Definition: optgrid.hxx:63
bool bGridVisible
Definition: optgrid.hxx:42
bool bSynchronize
Definition: optgrid.hxx:41
bool GetEqualGrid() const
Definition: optgrid.hxx:68
void SetFieldDivisionX(sal_uInt32 nSet)
Definition: optgrid.hxx:49
sal_uInt32 nFldDivisionY
Definition: optgrid.hxx:37
sal_uInt32 nFldDivisionX
Definition: optgrid.hxx:35
sal_uInt32 GetFieldDrawX() const
Definition: optgrid.hxx:59
sal_uInt32 GetFieldDivisionX() const
Definition: optgrid.hxx:60
MapUnit
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
SfxItemPresentation
static SfxItemSet & rSet
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
DeactivateRC
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)