Bump version to 6.4-15
[LibreOffice.git] / include / svx / sidebar / AreaPropertyPanelBase.hxx
blob858813f68136905939b0e67040f7af7c51959efb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANELBASE_HXX
20 #define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANELBASE_HXX
22 #include <memory>
23 #include <svx/sidebar/AreaTransparencyGradientPopup.hxx>
24 #include <sfx2/sidebar/ControllerItem.hxx>
25 #include <sfx2/sidebar/SidebarToolBox.hxx>
26 #include <svx/colorbox.hxx>
27 #include <svx/xgrad.hxx>
28 #include <svx/itemwin.hxx>
29 #include <svx/xfillit0.hxx>
30 #include <svx/xflclit.hxx>
31 #include <svx/xflgrit.hxx>
32 #include <svx/xflhtit.hxx>
33 #include <svx/xbtmpit.hxx>
34 #include <svx/sidebar/PanelLayout.hxx>
35 #include <vcl/lstbox.hxx>
36 #include <vcl/field.hxx>
37 #include <vcl/slider.hxx>
38 #include <vcl/fixed.hxx>
39 #include <vcl/vclptr.hxx>
40 #include <svl/intitem.hxx>
41 #include <svx/svxdllapi.h>
42 #include <sfx2/sidebar/Panel.hxx>
44 class XFillFloatTransparenceItem;
45 class XFillTransparenceItem;
46 class XFillStyleItem;
47 class XFillGradientItem;
48 class XFillColorItem;
49 class XFillHatchItem;
50 class XFillBitmapItem;
52 namespace svx { namespace sidebar {
54 class SVX_DLLPUBLIC AreaPropertyPanelBase
55 : public PanelLayout,
56 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
58 public:
60 virtual void dispose() override;
62 virtual void DataChanged(
63 const DataChangedEvent& rEvent) override;
65 virtual void NotifyItemUpdate(
66 const sal_uInt16 nSId,
67 const SfxItemState eState,
68 const SfxPoolItem* pState) override;
70 virtual void GetControlState(
71 const sal_uInt16 /*nSId*/,
72 boost::property_tree::ptree& /*rState*/) override {};
74 const static sal_Int32 DEFAULT_CENTERX;
75 const static sal_Int32 DEFAULT_CENTERY;
76 const static sal_Int32 DEFAULT_ANGLE;
77 const static sal_Int32 DEFAULT_STARTVALUE;
78 const static sal_Int32 DEFAULT_ENDVALUE;
79 const static sal_Int32 DEFAULT_BORDER;
81 const XGradient& GetGradient (const css::awt::GradientStyle eStyle) const;
82 void SetGradient (const XGradient& rGradient);
83 sal_Int32 GetSelectedTransparencyTypeIndex() const;
85 // constructor/destructor
86 AreaPropertyPanelBase(
87 vcl::Window* pParent,
88 const css::uno::Reference<css::frame::XFrame>& rxFrame);
90 virtual ~AreaPropertyPanelBase() override;
92 virtual void setFillTransparence(const XFillTransparenceItem& rItem) = 0;
93 virtual void setFillFloatTransparence(const XFillFloatTransparenceItem& rItem) = 0;
94 virtual void setFillStyle(const XFillStyleItem& rItem) = 0;
95 virtual void setFillStyleAndColor(const XFillStyleItem* pStyleItem, const XFillColorItem& aColorItem) = 0;
96 virtual void setFillStyleAndGradient(const XFillStyleItem* pStyleItem, const XFillGradientItem& aGradientItem) = 0;
97 virtual void setFillStyleAndHatch(const XFillStyleItem* pStyleItem, const XFillHatchItem& aHatchItem) = 0;
98 virtual void setFillStyleAndBitmap(const XFillStyleItem* pStyleItem, const XFillBitmapItem& aHatchItem) = 0;
100 void updateFillTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
101 void updateFillFloatTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
102 void updateFillStyle(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
103 void updateFillGradient(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
104 void updateFillHatch(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
105 void updateFillColor(bool bDefaultOrSet, const SfxPoolItem* pState);
106 void updateFillBitmap(bool BDisabled, bool bDefaultOrSet, const SfxPoolItem* pState);
108 protected:
109 sal_uInt16 meLastXFS;
111 sal_Int32 mnLastPosHatch;
112 sal_Int32 mnLastPosBitmap;
113 sal_Int32 mnLastPosPattern;
114 sal_uInt16 mnLastTransSolid;
116 XGradient maGradientLinear;
117 XGradient maGradientAxial;
118 XGradient maGradientRadial;
119 XGradient maGradientElliptical;
120 XGradient maGradientSquare;
121 XGradient maGradientRect;
123 //ui controls
124 VclPtr<FixedText> mpColorTextFT;
125 VclPtr<SvxFillTypeBox> mpLbFillType;
126 VclPtr<SvxFillAttrBox> mpLbFillAttr;
127 VclPtr<SvxColorListBox> mpLbFillGradFrom;
128 VclPtr<SvxColorListBox> mpLbFillGradTo;
129 VclPtr<sfx2::sidebar::SidebarToolBox> mpToolBoxColor; // for new color picker
130 VclPtr<FixedText> mpTrspTextFT;
131 VclPtr<ListBox> mpLBTransType;
132 VclPtr<MetricField> mpMTRTransparent;
133 VclPtr<Slider> mpSldTransparent;
134 VclPtr<ToolBox> mpBTNGradient;
135 VclPtr<MetricField> mpMTRAngle;
136 VclPtr<ListBox> mpGradientStyle;
137 VclPtr<PushButton> mpBmpImport;
139 std::unique_ptr< XFillStyleItem > mpStyleItem;
140 std::unique_ptr< XFillColorItem > mpColorItem;
141 std::unique_ptr< XFillGradientItem > mpFillGradientItem;
142 std::unique_ptr< XFillHatchItem > mpHatchItem;
143 std::unique_ptr< XFillBitmapItem > mpBitmapItem;
145 Image maImgAxial;
146 Image maImgElli;
147 Image maImgQuad;
148 Image maImgRadial;
149 Image maImgSquare;
150 Image maImgLinear;
152 VclPtr<AreaTransparencyGradientPopup> mxTrGrPopup;
153 VclPtr<sfx2::sidebar::Panel> mpPanel;
155 std::unique_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem;
156 std::unique_ptr< SfxUInt16Item > mpTransparanceItem;
158 DECL_LINK(SelectFillTypeHdl, ListBox&, void );
159 DECL_LINK(SelectFillAttrHdl, ListBox&, void );
160 DECL_LINK(SelectFillColorHdl, SvxColorListBox&, void);
161 DECL_LINK(ChangeGradientAngle, Edit&, void);
162 DECL_LINK(ChangeTrgrTypeHdl_Impl, ListBox&, void);
163 DECL_LINK(ModifyTransparentHdl_Impl, Edit&, void);
164 DECL_LINK(ModifyTransSliderHdl, Slider*, void);
165 DECL_LINK(ClickImportBitmapHdl, Button*, void);
167 // for transparency gradient
168 DECL_LINK( ClickTrGrHdl_Impl, ToolBox*, void );
170 void Initialize();
171 void Update();
172 void ImpUpdateTransparencies();
173 void SetTransparency(sal_uInt16 nVal);
174 void SelectFillAttrHdl_Impl();
177 } } // end of namespace svx::sidebar
179 #endif // INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
181 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */