1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SVX_OPTGRID_HXX
20 #define INCLUDED_SVX_OPTGRID_HXX
22 #include <sfx2/tabdlg.hxx>
23 #include <svx/svxdllapi.h>
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
; }
31 class SVX_DLLPUBLIC SvxOptionsGrid
35 sal_uInt32 nFldDivisionX
;
37 sal_uInt32 nFldDivisionY
;
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
;}
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
; }
71 class SVX_DLLPUBLIC SvxGridItem
: public SvxOptionsGrid
, public SfxPoolItem
74 friend class SvxGridTabPage
;
77 SvxGridItem( sal_uInt16 _nWhich
) : SfxPoolItem(_nWhich
){};
79 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
80 virtual bool operator==( const SfxPoolItem
& ) const override
;
82 virtual bool GetPresentation( SfxItemPresentation ePres
,
85 OUString
&rText
, const IntlWrapper
& ) const override
;
89 class SVX_DLLPUBLIC SvxGridTabPage
: public SfxTabPage
91 using TabPage::ActivatePage
;
92 using TabPage::DeactivatePage
;
95 SvxGridTabPage(TabPageParent pParent
, const SfxItemSet
& rSet
);
96 virtual ~SvxGridTabPage() override
;
98 static VclPtr
<SfxTabPage
> Create(TabPageParent pParent
, const SfxItemSet
& rAttrSet
);
100 virtual bool FillItemSet( SfxItemSet
* rSet
) override
;
101 virtual void Reset( const SfxItemSet
* rSet
) override
;
103 virtual void ActivatePage( const SfxItemSet
& rSet
) override
;
104 virtual DeactivateRC
DeactivatePage( SfxItemSet
* pSet
) override
;
109 std::unique_ptr
<weld::CheckButton
> m_xCbxUseGridsnap
;
110 std::unique_ptr
<weld::CheckButton
> m_xCbxGridVisible
;
111 std::unique_ptr
<weld::MetricSpinButton
> m_xMtrFldDrawX
;
112 std::unique_ptr
<weld::MetricSpinButton
> m_xMtrFldDrawY
;
113 std::unique_ptr
<weld::SpinButton
> m_xNumFldDivisionX
;
114 std::unique_ptr
<weld::SpinButton
> m_xNumFldDivisionY
;
115 std::unique_ptr
<weld::CheckButton
> m_xCbxSynchronize
;
117 //these controls are used in draw and impress
118 std::unique_ptr
<weld::Widget
> m_xSnapFrames
;
119 std::unique_ptr
<weld::CheckButton
> m_xCbxSnapHelplines
;
120 std::unique_ptr
<weld::CheckButton
> m_xCbxSnapBorder
;
121 std::unique_ptr
<weld::CheckButton
> m_xCbxSnapFrame
;
122 std::unique_ptr
<weld::CheckButton
> m_xCbxSnapPoints
;
123 std::unique_ptr
<weld::MetricSpinButton
> m_xMtrFldSnapArea
;
124 std::unique_ptr
<weld::CheckButton
> m_xCbxOrtho
;
125 std::unique_ptr
<weld::CheckButton
> m_xCbxBigOrtho
;
126 std::unique_ptr
<weld::CheckButton
> m_xCbxRotate
;
127 std::unique_ptr
<weld::MetricSpinButton
> m_xMtrFldAngle
;
128 std::unique_ptr
<weld::MetricSpinButton
> m_xMtrFldBezAngle
;
130 DECL_LINK(ClickRotateHdl_Impl
, weld::ToggleButton
&, void);
132 DECL_LINK(ChangeDrawHdl_Impl
, weld::MetricSpinButton
&, void);
133 DECL_LINK(ChangeGridsnapHdl_Impl
, weld::ToggleButton
&, void);
134 DECL_LINK(ChangeDivisionHdl_Impl
, weld::SpinButton
&, void);
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */