Line data Source code
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_AREAPROPERTYPANEL_HXX
20 : #define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
21 :
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 <svx/sidebar/PanelLayout.hxx>
35 : #include <vcl/lstbox.hxx>
36 : #include <vcl/field.hxx>
37 : #include <vcl/fixed.hxx>
38 : #include <vcl/vclptr.hxx>
39 : #include <svl/intitem.hxx>
40 : #include <com/sun/star/ui/XUIElement.hpp>
41 : #include <boost/scoped_ptr.hpp>
42 :
43 :
44 : class XFillFloatTransparenceItem;
45 :
46 :
47 : namespace svx { namespace sidebar {
48 :
49 : class PopupContainer;
50 : class AreaTransparencyGradientControl;
51 :
52 : class AreaPropertyPanel
53 : : public PanelLayout,
54 : public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
55 : {
56 : public:
57 : virtual ~AreaPropertyPanel();
58 : virtual void dispose() SAL_OVERRIDE;
59 :
60 : static VclPtr<vcl::Window> Create(
61 : vcl::Window* pParent,
62 : const css::uno::Reference<css::frame::XFrame>& rxFrame,
63 : SfxBindings* pBindings);
64 :
65 : virtual void DataChanged(
66 : const DataChangedEvent& rEvent) SAL_OVERRIDE;
67 :
68 : virtual void NotifyItemUpdate(
69 : const sal_uInt16 nSId,
70 : const SfxItemState eState,
71 : const SfxPoolItem* pState,
72 : const bool bIsEnabled) SAL_OVERRIDE;
73 :
74 0 : SfxBindings* GetBindings() { return mpBindings;}
75 :
76 : const static sal_Int32 DEFAULT_CENTERX;
77 : const static sal_Int32 DEFAULT_CENTERY;
78 : const static sal_Int32 DEFAULT_ANGLE;
79 : const static sal_Int32 DEFAULT_STARTVALUE;
80 : const static sal_Int32 DEFAULT_ENDVALUE;
81 : const static sal_Int32 DEFAULT_BORDER;
82 :
83 : XGradient GetGradient (const css::awt::GradientStyle eStyle) const;
84 : void SetGradient (const XGradient& rGradient);
85 : sal_Int32 GetSelectedTransparencyTypeIndex() const;
86 :
87 : // constructor/destuctor
88 : AreaPropertyPanel(
89 : vcl::Window* pParent,
90 : const css::uno::Reference<css::frame::XFrame>& rxFrame,
91 : SfxBindings* pBindings);
92 :
93 : private:
94 : sal_uInt16 meLastXFS;
95 :
96 : sal_Int32 mnLastPosGradient;
97 : sal_Int32 mnLastPosHatch;
98 : sal_Int32 mnLastPosBitmap;
99 : sal_uInt16 mnLastTransSolid;
100 :
101 : XGradient maGradientLinear;
102 : XGradient maGradientAxial;
103 : XGradient maGradientRadial;
104 : XGradient maGradientElliptical;
105 : XGradient maGradientSquare;
106 : XGradient maGradientRect;
107 :
108 : //ui controls
109 : VclPtr<FixedText> mpColorTextFT;
110 : VclPtr<SvxFillTypeBox> mpLbFillType;
111 : VclPtr<SvxFillAttrBox> mpLbFillAttr;
112 : VclPtr<ToolBox> mpToolBoxColor; // for new color picker
113 : VclPtr<FixedText> mpTrspTextFT;
114 : VclPtr<ListBox> mpLBTransType;
115 : VclPtr<MetricField> mpMTRTransparent;
116 : VclPtr<ToolBox> mpBTNGradient;
117 :
118 : ::boost::scoped_ptr< XFillStyleItem > mpStyleItem;
119 : ::boost::scoped_ptr< XFillColorItem > mpColorItem;
120 : ::boost::scoped_ptr< XFillGradientItem > mpFillGradientItem;
121 : ::boost::scoped_ptr< XFillHatchItem > mpHatchItem;
122 : ::boost::scoped_ptr< XFillBitmapItem > mpBitmapItem;
123 :
124 : ::sfx2::sidebar::ControllerItem maStyleControl;
125 : ::sfx2::sidebar::ControllerItem maColorControl;
126 : ::sfx2::sidebar::ControllerItem maGradientControl;
127 : ::sfx2::sidebar::ControllerItem maHatchControl;
128 : ::sfx2::sidebar::ControllerItem maBitmapControl;
129 : ::sfx2::sidebar::ControllerItem maGradientListControl;
130 : ::sfx2::sidebar::ControllerItem maHatchListControl;
131 : ::sfx2::sidebar::ControllerItem maBitmapListControl;
132 : ::sfx2::sidebar::ControllerItem maFillTransparenceController;
133 : ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController;
134 :
135 : Image maImgAxial;
136 : Image maImgElli;
137 : Image maImgQuad;
138 : Image maImgRadial;
139 : Image maImgSquare;
140 : Image maImgLinear;
141 :
142 : AreaTransparencyGradientPopup maTrGrPopup;
143 :
144 : ::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem;
145 : ::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem;
146 :
147 : css::uno::Reference<css::frame::XFrame> mxFrame;
148 : SfxBindings* mpBindings;
149 :
150 : DECL_LINK(SelectFillTypeHdl, ListBox* );
151 : DECL_LINK(SelectFillAttrHdl, ListBox* );
152 : DECL_LINK(ChangeTrgrTypeHdl_Impl, void*);
153 : DECL_LINK(ModifyTransparentHdl_Impl, void*);
154 :
155 : // for transparency gradient
156 : VclPtr<PopupControl> CreateTransparencyGradientControl (PopupContainer* pParent);
157 : DECL_LINK_TYPED( ClickTrGrHdl_Impl, ToolBox*, void );
158 :
159 : static void SetupIcons();
160 : void Initialize();
161 : void Update();
162 : void ImpUpdateTransparencies();
163 : };
164 :
165 :
166 : } } // end of namespace svx::sidebar
167 :
168 :
169 :
170 : #endif // INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX
171 :
172 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|