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 .
22 #include <sfx2/tabdlg.hxx>
23 #include <svx/optgrid.hxx>
26 * Option-Tab-Page: Snap
28 class SdTpOptionsSnap final
: public SvxGridTabPage
31 SdTpOptionsSnap(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rInAttrs
);
32 static std::unique_ptr
<SfxTabPage
> Create( weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* );
33 virtual ~SdTpOptionsSnap() override
;
35 virtual bool FillItemSet( SfxItemSet
* ) override
;
36 virtual void Reset( const SfxItemSet
* ) override
;
40 * Option-Tab-Page: Contents
42 class SdTpOptionsContents final
: public SfxTabPage
46 std::unique_ptr
<weld::CheckButton
> m_xCbxRuler
;
47 std::unique_ptr
<weld::Widget
> m_xCbxRulerImg
;
48 std::unique_ptr
<weld::CheckButton
> m_xCbxDragStripes
;
49 std::unique_ptr
<weld::Widget
> m_xCbxDragStripesImg
;
50 std::unique_ptr
<weld::CheckButton
> m_xCbxHandlesBezier
;
51 std::unique_ptr
<weld::Widget
> m_xCbxHandlesBezierImg
;
52 std::unique_ptr
<weld::CheckButton
> m_xCbxMoveOutline
;
53 std::unique_ptr
<weld::Widget
> m_xCbxMoveOutlineImg
;
56 SdTpOptionsContents(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rInAttrs
);
57 static std::unique_ptr
<SfxTabPage
> Create( weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* );
58 virtual ~SdTpOptionsContents() override
;
60 virtual OUString
GetAllStrings() override
;
62 virtual bool FillItemSet( SfxItemSet
* ) override
;
63 virtual void Reset( const SfxItemSet
* ) override
;
65 virtual void PageCreated(const SfxAllItemSet
& aSet
) override
;
67 void SetDrawMode() { m_bDrawMode
= true; }
71 * Option-Tab-Page: View
74 class SdTpOptionsMisc final
: public SfxTabPage
76 friend class SdModule
;
87 std::unique_ptr
<weld::CheckButton
> m_xCbxQuickEdit
;
88 std::unique_ptr
<weld::Widget
> m_xCbxQuickEditImg
;
89 std::unique_ptr
<weld::CheckButton
> m_xCbxPickThrough
;
90 std::unique_ptr
<weld::Widget
> m_xCbxPickThroughImg
;
92 std::unique_ptr
<weld::Frame
> m_xNewDocumentFrame
;
93 std::unique_ptr
<weld::CheckButton
> m_xCbxStartWithTemplate
;
94 std::unique_ptr
<weld::Widget
> m_xCbxStartWithTemplateImg
;
96 std::unique_ptr
<weld::CheckButton
> m_xCbxMasterPageCache
;
97 std::unique_ptr
<weld::Widget
> m_xCbxMasterPageCacheImg
;
98 std::unique_ptr
<weld::CheckButton
> m_xCbxCopy
;
99 std::unique_ptr
<weld::Widget
> m_xCbxCopyImg
;
100 std::unique_ptr
<weld::CheckButton
> m_xCbxMarkedHitMovesAlways
;
101 std::unique_ptr
<weld::Widget
> m_xCbxMarkedHitMovesAlwaysImg
;
103 std::unique_ptr
<weld::ComboBox
> m_xLbMetric
;
104 std::unique_ptr
<weld::Widget
> m_xLbMetricImg
;
105 std::unique_ptr
<weld::MetricSpinButton
> m_xMtrFldTabstop
;
106 std::unique_ptr
<weld::Widget
> m_xMtrFldTabstopImg
;
108 std::unique_ptr
<weld::CheckButton
> m_xCbxCompatibility
;
109 std::unique_ptr
<weld::Widget
> m_xCbxCompatibilityImg
;
112 std::unique_ptr
<weld::Frame
> m_xScaleFrame
;
113 std::unique_ptr
<weld::ComboBox
> m_xCbScale
;
114 std::unique_ptr
<weld::Widget
> m_xCbScaleImg
;
115 std::unique_ptr
<weld::Label
> m_xNewDocLb
;
116 std::unique_ptr
<weld::Label
> m_xFiInfo1
;
117 std::unique_ptr
<weld::MetricSpinButton
> m_xMtrFldOriginalWidth
;
118 std::unique_ptr
<weld::Label
> m_xWidthLb
;
119 std::unique_ptr
<weld::Label
> m_xHeightLb
;
120 std::unique_ptr
<weld::Label
> m_xFiInfo2
;
121 std::unique_ptr
<weld::MetricSpinButton
> m_xMtrFldOriginalHeight
;
122 std::unique_ptr
<weld::CheckButton
> m_xCbxDistort
;
123 std::unique_ptr
<weld::Widget
> m_xCbxDistortImg
;
124 std::unique_ptr
<weld::MetricSpinButton
> m_xMtrFldInfo1
;
125 std::unique_ptr
<weld::MetricSpinButton
> m_xMtrFldInfo2
;
127 static OUString
GetScale( sal_Int32 nX
, sal_Int32 nY
);
128 static bool SetScale( std::u16string_view aScale
, sal_Int32
& rX
, sal_Int32
& rY
);
130 DECL_LINK( SelectMetricHdl_Impl
, weld::ComboBox
&, void );
132 /** Enable or disable the controls in the compatibility section of the
133 'general' tab page depending on whether there is at least one
136 void UpdateCompatibilityControls();
138 virtual void ActivatePage( const SfxItemSet
& rSet
) override
;
139 virtual DeactivateRC
DeactivatePage( SfxItemSet
* pSet
) override
;
142 SdTpOptionsMisc(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
& rInAttrs
);
143 static std::unique_ptr
<SfxTabPage
> Create( weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* );
144 virtual ~SdTpOptionsMisc() override
;
146 virtual OUString
GetAllStrings() override
;
148 virtual bool FillItemSet( SfxItemSet
* ) override
;
149 virtual void Reset( const SfxItemSet
* ) override
;
151 /** Hide Impress specific controls, make Draw specific controls visible
152 and arrange the visible controls. Do not call this method more than once.
156 virtual void PageCreated(const SfxAllItemSet
& aSet
) override
;
159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */