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_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
20 #define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
22 #include <svx/sidebar/ColorPopup.hxx>
23 #include "AreaTransparencyGradientPopup.hxx"
24 #include <vcl/ctrl.hxx>
25 #include <sfx2/sidebar/SidebarPanelBase.hxx>
26 #include <sfx2/sidebar/ControllerItem.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/drawitem.hxx>
35 #include <svx/sidebar/PanelLayout.hxx>
36 #include <vcl/lstbox.hxx>
37 #include <vcl/field.hxx>
38 #include <vcl/fixed.hxx>
39 #include <svl/intitem.hxx>
40 #include <svx/tbxcolorupdate.hxx>
41 #include <com/sun/star/ui/XUIElement.hpp>
42 #include <boost/scoped_ptr.hpp>
45 class XFillFloatTransparenceItem
;
46 namespace svx
{ class ToolboxButtonColorUpdater
; }
49 namespace svx
{ namespace sidebar
{
52 class AreaTransparencyGradientControl
;
54 class AreaPropertyPanel
56 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
59 static AreaPropertyPanel
* Create(
61 const cssu::Reference
<css::frame::XFrame
>& rxFrame
,
62 SfxBindings
* pBindings
);
64 virtual void DataChanged(
65 const DataChangedEvent
& rEvent
) SAL_OVERRIDE
;
67 virtual void NotifyItemUpdate(
68 const sal_uInt16 nSId
,
69 const SfxItemState eState
,
70 const SfxPoolItem
* pState
,
71 const bool bIsEnabled
) SAL_OVERRIDE
;
73 SfxBindings
* GetBindings();
75 const static sal_Int32 DEFAULT_CENTERX
;
76 const static sal_Int32 DEFAULT_CENTERY
;
77 const static sal_Int32 DEFAULT_ANGLE
;
78 const static sal_Int32 DEFAULT_STARTVALUE
;
79 const static sal_Int32 DEFAULT_ENDVALUE
;
80 const static sal_Int32 DEFAULT_BORDER
;
82 XGradient
GetGradient (const XGradientStyle eStyle
) const;
83 void SetGradient (const XGradient
& rGradient
);
84 sal_Int32
GetSelectedTransparencyTypeIndex (void) const;
90 sal_Int32 mnLastPosGradient
;
91 sal_Int32 mnLastPosHatch
;
92 sal_Int32 mnLastPosBitmap
;
93 sal_uInt16 mnLastTransSolid
;
95 XGradient maGradientLinear
;
96 XGradient maGradientAxial
;
97 XGradient maGradientRadial
;
98 XGradient maGradientElliptical
;
99 XGradient maGradientSquare
;
100 XGradient maGradientRect
;
103 FixedText
* mpColorTextFT
;
104 SvxFillTypeBox
* mpLbFillType
;
105 SvxFillAttrBox
* mpLbFillAttr
;
106 ToolBox
* mpToolBoxColor
; // for new color picker
107 FixedText
* mpTrspTextFT
;
108 ListBox
* mpLBTransType
;
109 MetricField
* mpMTRTransparent
;
110 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
;
140 OUString msHelpFillType
;
141 OUString 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
;
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*);
160 // for transparency gradient
161 PopupControl
* CreateTransparencyGradientControl (PopupContainer
* pParent
);
162 DECL_LINK( ClickTrGrHdl_Impl
, ToolBox
* );
165 PopupControl
* CreateColorPopupControl (PopupContainer
* pParent
);
166 DECL_LINK(ToolBoxColorDropHdl
, ToolBox
*); //for new color picker
168 // constructor/destuctor
171 const cssu::Reference
<css::frame::XFrame
>& rxFrame
,
172 SfxBindings
* pBindings
);
173 virtual ~AreaPropertyPanel(void);
175 void SetupIcons(void);
178 void ImpUpdateTransparencies();
180 Color
GetLastColor (void) const;
182 const OUString
& rsColorName
,
187 } } // end of namespace ::svx::sidebar
191 #endif // INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
193 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */