bump product version to 4.1.6.2
[LibreOffice.git] / svx / source / sidebar / area / AreaPropertyPanel.hxx
blobcaf005a8fd271080de0c5f936b971038aadf0aa8
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #ifndef SVX_PROPERTYPANEL_AREAPAGE_HXX
19 #define SVX_PROPERTYPANEL_AREAPAGE_HXX
21 #include <svx/sidebar/ColorPopup.hxx>
22 #include "AreaTransparencyGradientPopup.hxx"
23 #include <vcl/ctrl.hxx>
24 #include <sfx2/sidebar/SidebarPanelBase.hxx>
25 #include <sfx2/sidebar/ControllerItem.hxx>
26 #include <svx/xgrad.hxx>
27 #include <svx/itemwin.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>
33 #include <svx/drawitem.hxx>
34 #include <vcl/lstbox.hxx>
35 #include <vcl/field.hxx>
36 #include <vcl/fixed.hxx>
37 #include <svl/intitem.hxx>
38 #include <svx/tbxcolorupdate.hxx>
39 #include <com/sun/star/ui/XUIElement.hpp>
40 #include <boost/scoped_ptr.hpp>
43 class XFillFloatTransparenceItem;
44 namespace svx { class ToolboxButtonColorUpdater; }
47 namespace svx { namespace sidebar {
49 class PopupContainer;
50 class AreaTransparencyGradientControl;
52 class AreaPropertyPanel
53 : public Control,
54 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
56 public:
57 static AreaPropertyPanel* Create(
58 Window* pParent,
59 const cssu::Reference<css::frame::XFrame>& rxFrame,
60 SfxBindings* pBindings);
62 virtual void DataChanged(
63 const DataChangedEvent& rEvent);
65 virtual void NotifyItemUpdate(
66 const sal_uInt16 nSId,
67 const SfxItemState eState,
68 const SfxPoolItem* pState,
69 const bool bIsEnabled);
71 SfxBindings* GetBindings();
73 const static sal_Int32 DEFAULT_CENTERX;
74 const static sal_Int32 DEFAULT_CENTERY;
75 const static sal_Int32 DEFAULT_ANGLE;
76 const static sal_Int32 DEFAULT_STARTVALUE;
77 const static sal_Int32 DEFAULT_ENDVALUE;
78 const static sal_Int32 DEFAULT_BORDER;
80 XGradient GetGradient (const XGradientStyle eStyle) const;
81 void SetGradient (const XGradient& rGradient);
82 sal_Int32 GetSelectedTransparencyTypeIndex (void) const;
84 private:
85 sal_uInt16 meLastXFS;
86 Color maLastColor;
88 sal_uInt16 mnLastPosGradient;
89 sal_uInt16 mnLastPosHatch;
90 sal_uInt16 mnLastPosBitmap;
91 sal_uInt16 mnLastTransSolid;
93 XGradient maGradientLinear;
94 XGradient maGradientAxial;
95 XGradient maGradientRadial;
96 XGradient maGradientElliptical;
97 XGradient maGradientSquare;
98 XGradient maGradientRect;
100 //ui controls
101 ::boost::scoped_ptr< FixedText > mpColorTextFT;
102 ::boost::scoped_ptr< SvxFillTypeBox > mpLbFillType;
103 ::boost::scoped_ptr< SvxFillAttrBox > mpLbFillAttr;
104 ::boost::scoped_ptr< Window > mpToolBoxColorBackground;
105 ::boost::scoped_ptr< ToolBox > mpToolBoxColor; // for new color picker
106 ::boost::scoped_ptr< FixedText > mpTrspTextFT;
107 ::boost::scoped_ptr< ListBox > mpLBTransType;
108 ::boost::scoped_ptr< MetricField > mpMTRTransparent;
109 ::boost::scoped_ptr< Window > mpBTNGradientBackground;
110 ::boost::scoped_ptr< ToolBox > mpBTNGradient;
112 ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater;
114 ::boost::scoped_ptr< XFillStyleItem > mpStyleItem;
115 ::boost::scoped_ptr< XFillColorItem > mpColorItem;
116 ::boost::scoped_ptr< XFillGradientItem > mpFillGradientItem;
117 ::boost::scoped_ptr< XFillHatchItem > mpHatchItem;
118 ::boost::scoped_ptr< XFillBitmapItem > mpBitmapItem;
120 ::sfx2::sidebar::ControllerItem maStyleControl;
121 ::sfx2::sidebar::ControllerItem maColorControl;
122 ::sfx2::sidebar::ControllerItem maGradientControl;
123 ::sfx2::sidebar::ControllerItem maHatchControl;
124 ::sfx2::sidebar::ControllerItem maBitmapControl;
125 ::sfx2::sidebar::ControllerItem maColorTableControl;
126 ::sfx2::sidebar::ControllerItem maGradientListControl;
127 ::sfx2::sidebar::ControllerItem maHatchListControl;
128 ::sfx2::sidebar::ControllerItem maBitmapListControl;
129 ::sfx2::sidebar::ControllerItem maFillTransparenceController;
130 ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController;
132 Image maImgAxial;
133 Image maImgElli;
134 Image maImgQuad;
135 Image maImgRadial;
136 Image maImgSquare;
137 Image maImgLinear;
138 Image maImgColor;
140 String msHelpFillType;
141 String msHelpFillAttr;
143 AreaTransparencyGradientPopup maTrGrPopup;
144 ColorPopup maColorPopup;
146 ::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem;
147 ::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem;
149 cssu::Reference<css::frame::XFrame> mxFrame;
150 SfxBindings* mpBindings;
152 /// bitfield
153 bool mbColorAvail : 1;
155 DECL_LINK(SelectFillTypeHdl, ListBox* );
156 DECL_LINK(SelectFillAttrHdl, ListBox* );
157 DECL_LINK(ChangeTrgrTypeHdl_Impl, void*);
158 DECL_LINK(ModifyTransparentHdl_Impl, void*);
159 DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* );
161 // for transparency gradient
162 PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent);
163 DECL_LINK( ClickTrGrHdl_Impl, ToolBox* );
165 // for color picker
166 PopupControl* CreateColorPopupControl (PopupContainer* pParent);
167 DECL_LINK(ToolBoxColorDropHdl, ToolBox *); //for new color picker
169 // constructor/destuctor
170 AreaPropertyPanel(
171 Window* pParent,
172 const cssu::Reference<css::frame::XFrame>& rxFrame,
173 SfxBindings* pBindings);
174 virtual ~AreaPropertyPanel(void);
176 void SetupIcons(void);
177 void Initialize();
178 void Update();
179 void ImpUpdateTransparencies();
181 Color GetLastColor (void) const;
182 void SetColor (
183 const String& rsColorName,
184 const Color aColor);
188 } } // end of namespace ::svx::sidebar
192 #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX
194 // eof