LibreOffice Module svx (master) 1
AreaPropertyPanelBase.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_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANELBASE_HXX
20#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANELBASE_HXX
21
22#include <memory>
25#include <svx/colorbox.hxx>
28#include <svx/xfillit0.hxx>
29#include <svx/xflclit.hxx>
30#include <svx/xflgrit.hxx>
31#include <svx/xflhtit.hxx>
32#include <svx/xbtmpit.hxx>
34#include <svl/intitem.hxx>
35#include <svx/svxdllapi.h>
36
41class XFillStyleItem;
43class XFillColorItem;
44class XFillHatchItem;
45class XFillBitmapItem;
46
47namespace svx::sidebar {
48
50: public PanelLayout,
52{
53public:
54
55 virtual void NotifyItemUpdate(
56 const sal_uInt16 nSId,
57 const SfxItemState eState,
58 const SfxPoolItem* pState) override;
59
60 virtual void GetControlState(
61 const sal_uInt16 /*nSId*/,
62 boost::property_tree::ptree& /*rState*/) override {};
63
64 const static sal_Int32 DEFAULT_CENTERX;
65 const static sal_Int32 DEFAULT_CENTERY;
66 const static sal_Int32 DEFAULT_ANGLE;
67 const static sal_Int32 DEFAULT_STARTVALUE;
68 const static sal_Int32 DEFAULT_ENDVALUE;
69 const static sal_Int32 DEFAULT_BORDER;
70
71 const basegfx::BGradient& GetGradient (const css::awt::GradientStyle eStyle) const;
72 void SetGradient (const basegfx::BGradient& rGradient);
73 sal_Int32 GetSelectedTransparencyTypeIndex() const;
74
75 // constructor/destructor
77 weld::Widget* pParent,
78 const css::uno::Reference<css::frame::XFrame>& rxFrame);
79
80 virtual ~AreaPropertyPanelBase() override;
81
82 virtual void setFillTransparence(const XFillTransparenceItem& rItem) = 0;
84 virtual void setFillStyle(const XFillStyleItem& rItem) = 0;
85 virtual void setFillStyleAndColor(const XFillStyleItem* pStyleItem, const XFillColorItem& aColorItem) = 0;
86 virtual void setFillStyleAndGradient(const XFillStyleItem* pStyleItem, const XFillGradientItem& aGradientItem) = 0;
87 virtual void setFillStyleAndHatch(const XFillStyleItem* pStyleItem, const XFillHatchItem& aHatchItem) = 0;
88 virtual void setFillStyleAndBitmap(const XFillStyleItem* pStyleItem, const XFillBitmapItem& aHatchItem) = 0;
89 virtual void setFillUseBackground(const XFillStyleItem* pStyleItem, const XFillUseSlideBackgroundItem& rItem) = 0;
90
91 void updateFillTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
92 void updateFillFloatTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
93 void updateFillStyle(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
94 void updateFillGradient(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
95 void updateFillHatch(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
96 void updateFillColor(bool bDefaultOrSet, const SfxPoolItem* pState);
97 void updateFillBitmap(bool BDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
98 void updateFillUseBackground(bool BDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
99
100private:
101 void Initialize();
102
103protected:
104 const css::uno::Reference<css::frame::XFrame>& mxFrame;
105
106 sal_uInt16 meLastXFS;
107
108 sal_Int32 mnLastPosHatch;
112
119
120 //ui controls
121 std::unique_ptr<weld::Label> mxColorTextFT;
122 std::unique_ptr<weld::ComboBox> mxLbFillType;
123 std::unique_ptr<weld::ComboBox> mxLbFillAttr;
124 std::unique_ptr<ColorListBox> mxLbFillGradFrom;
125 std::unique_ptr<ColorListBox> mxLbFillGradTo;
126 std::unique_ptr<weld::Toolbar> mxToolBoxColor; // for new color picker
127 std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch;
128 std::unique_ptr<weld::Label> mxTrspTextFT;
129 std::unique_ptr<weld::ComboBox> mxLBTransType;
130 std::unique_ptr<weld::MetricSpinButton> mxMTRTransparent;
131 std::unique_ptr<weld::Scale> mxSldTransparent;
132 std::unique_ptr<weld::Toolbar> mxBTNGradient;
133 std::unique_ptr<weld::MetricSpinButton> mxMTRAngle;
134 std::unique_ptr<weld::ComboBox> mxGradientStyle;
135 std::unique_ptr<weld::Button> mxBmpImport;
136 std::unique_ptr<AreaTransparencyGradientPopup> mxTrGrPopup;
137
138 std::unique_ptr< XFillStyleItem > mpStyleItem;
139 std::unique_ptr< XFillColorItem > mpColorItem;
140 std::unique_ptr< XFillGradientItem > mpFillGradientItem;
141 std::unique_ptr< XFillHatchItem > mpHatchItem;
142 std::unique_ptr< XFillBitmapItem > mpBitmapItem;
143
144 OUString maImgAxial;
145 OUString maImgElli;
146 OUString maImgQuad;
147 OUString maImgRadial;
148 OUString maImgSquare;
149 OUString maImgLinear;
150
151 std::unique_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem;
152 std::unique_ptr< SfxUInt16Item > mpTransparenceItem;
153
154 // MCGR: Preserve ColorStops until we have a UI to edit these
156
157 DECL_DLLPRIVATE_LINK(SelectFillTypeHdl, weld::ComboBox&, void );
158 DECL_DLLPRIVATE_LINK(SelectFillAttrHdl, weld::ComboBox&, void );
159 DECL_DLLPRIVATE_LINK(SelectFillColorHdl, ColorListBox&, void);
160 DECL_DLLPRIVATE_LINK(ChangeGradientAngle, weld::MetricSpinButton&, void);
161 DECL_DLLPRIVATE_LINK(ChangeTrgrTypeHdl_Impl, weld::ComboBox&, void);
162 DECL_DLLPRIVATE_LINK(ModifyTransparentHdl_Impl, weld::MetricSpinButton&, void);
163 DECL_DLLPRIVATE_LINK(ModifyTransSliderHdl, weld::Scale&, void);
164 DECL_DLLPRIVATE_LINK(ClickImportBitmapHdl, weld::Button&, void);
165 DECL_DLLPRIVATE_LINK(ToolbarHdl_Impl, const OUString&, void);
166
167 void ImpUpdateTransparencies();
168 void SetTransparency(sal_uInt16 nVal);
169 void SelectFillAttrHdl_Impl();
170 void FillStyleChanged(bool bUpdateModel);
171
172 // MCGR: Preserve ColorStops until we have a UI to edit these
173 basegfx::BColorStops createColorStops();
174};
175
176} // end of namespace svx::sidebar
177
178#endif // INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
179
180/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Item to enable slide background for filled objects.
std::unique_ptr< XFillStyleItem > mpStyleItem
DECL_DLLPRIVATE_LINK(ModifyTransparentHdl_Impl, weld::MetricSpinButton &, void)
std::unique_ptr< weld::ComboBox > mxLbFillAttr
virtual void setFillUseBackground(const XFillStyleItem *pStyleItem, const XFillUseSlideBackgroundItem &rItem)=0
std::unique_ptr< ToolbarUnoDispatcher > mxColorDispatch
DECL_DLLPRIVATE_LINK(ToolbarHdl_Impl, const OUString &, void)
std::unique_ptr< XFillBitmapItem > mpBitmapItem
virtual void setFillTransparence(const XFillTransparenceItem &rItem)=0
DECL_DLLPRIVATE_LINK(ChangeGradientAngle, weld::MetricSpinButton &, void)
DECL_DLLPRIVATE_LINK(SelectFillTypeHdl, weld::ComboBox &, void)
std::unique_ptr< SfxUInt16Item > mpTransparenceItem
std::unique_ptr< weld::ComboBox > mxLbFillType
std::unique_ptr< weld::ComboBox > mxGradientStyle
virtual void setFillStyleAndBitmap(const XFillStyleItem *pStyleItem, const XFillBitmapItem &aHatchItem)=0
std::unique_ptr< weld::Button > mxBmpImport
std::unique_ptr< ColorListBox > mxLbFillGradFrom
std::unique_ptr< XFillGradientItem > mpFillGradientItem
virtual void setFillStyle(const XFillStyleItem &rItem)=0
virtual void GetControlState(const sal_uInt16, boost::property_tree::ptree &) override
DECL_DLLPRIVATE_LINK(ChangeTrgrTypeHdl_Impl, weld::ComboBox &, void)
virtual void setFillFloatTransparence(const XFillFloatTransparenceItem &rItem)=0
const css::uno::Reference< css::frame::XFrame > & mxFrame
std::unique_ptr< ColorListBox > mxLbFillGradTo
std::unique_ptr< weld::Toolbar > mxBTNGradient
std::unique_ptr< XFillHatchItem > mpHatchItem
std::unique_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem
virtual void setFillStyleAndHatch(const XFillStyleItem *pStyleItem, const XFillHatchItem &aHatchItem)=0
std::unique_ptr< weld::Label > mxTrspTextFT
virtual void setFillStyleAndGradient(const XFillStyleItem *pStyleItem, const XFillGradientItem &aGradientItem)=0
std::unique_ptr< AreaTransparencyGradientPopup > mxTrGrPopup
DECL_DLLPRIVATE_LINK(ClickImportBitmapHdl, weld::Button &, void)
std::unique_ptr< XFillColorItem > mpColorItem
std::unique_ptr< weld::MetricSpinButton > mxMTRTransparent
std::unique_ptr< weld::Scale > mxSldTransparent
DECL_DLLPRIVATE_LINK(ModifyTransSliderHdl, weld::Scale &, void)
DECL_DLLPRIVATE_LINK(SelectFillColorHdl, ColorListBox &, void)
std::unique_ptr< weld::ComboBox > mxLBTransType
std::unique_ptr< weld::Label > mxColorTextFT
virtual void setFillStyleAndColor(const XFillStyleItem *pStyleItem, const XFillColorItem &aColorItem)=0
std::unique_ptr< weld::Toolbar > mxToolBoxColor
DECL_DLLPRIVATE_LINK(SelectFillAttrHdl, weld::ComboBox &, void)
std::unique_ptr< weld::MetricSpinButton > mxMTRAngle
SfxItemState
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28