1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef SVX_PROPERTYPANEL_AREAPAGE_HXX 25 #define SVX_PROPERTYPANEL_AREAPAGE_HXX 26 27 #include <svx/sidebar/ColorPopup.hxx> 28 #include "AreaTransparencyGradientPopup.hxx" 29 #include <vcl/ctrl.hxx> 30 #include <sfx2/sidebar/SidebarPanelBase.hxx> 31 #include <sfx2/sidebar/ControllerItem.hxx> 32 #include <sfx2/sidebar/GridLayouter.hxx> 33 #include <svx/xgrad.hxx> 34 #include <svx/itemwin.hxx> 35 #include <svx/xfillit0.hxx> 36 #include <svx/xflclit.hxx> 37 #include <svx/xflgrit.hxx> 38 #include <svx/xflhtit.hxx> 39 #include <svx/xbtmpit.hxx> 40 #include <svx/drawitem.hxx> 41 #include <vcl/lstbox.hxx> 42 #include <vcl/field.hxx> 43 #include <vcl/fixed.hxx> 44 #include <svl/intitem.hxx> 45 #include <svx/tbxcolorupdate.hxx> 46 #include <com/sun/star/ui/XUIElement.hpp> 47 #include <boost/scoped_ptr.hpp> 48 49 50 class XFillFloatTransparenceItem; 51 namespace svx { class ToolboxButtonColorUpdater; } 52 53 54 namespace svx { namespace sidebar { 55 56 class PopupContainer; 57 class AreaTransparencyGradientControl; 58 59 class AreaPropertyPanel 60 : public Control, 61 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface 62 { 63 public: 64 static AreaPropertyPanel* Create( 65 Window* pParent, 66 const cssu::Reference<css::frame::XFrame>& rxFrame, 67 SfxBindings* pBindings); 68 69 virtual void DataChanged( 70 const DataChangedEvent& rEvent); 71 72 virtual void NotifyItemUpdate( 73 const sal_uInt16 nSId, 74 const SfxItemState eState, 75 const SfxPoolItem* pState, 76 const bool bIsEnabled); 77 78 SfxBindings* GetBindings(); 79 80 const static sal_Int32 DEFAULT_CENTERX; 81 const static sal_Int32 DEFAULT_CENTERY; 82 const static sal_Int32 DEFAULT_ANGLE; 83 const static sal_Int32 DEFAULT_STARTVALUE; 84 const static sal_Int32 DEFAULT_ENDVALUE; 85 const static sal_Int32 DEFAULT_BORDER; 86 87 XGradient GetGradient (const XGradientStyle eStyle) const; 88 void SetGradient (const XGradient& rGradient); 89 sal_Int32 GetSelectedTransparencyTypeIndex (void) const; 90 91 virtual void Resize (void); 92 93 private: 94 sal_uInt16 meLastXFS; 95 Color maLastColor; 96 97 sal_uInt16 mnLastPosGradient; 98 sal_uInt16 mnLastPosHatch; 99 sal_uInt16 mnLastPosBitmap; 100 sal_uInt16 mnLastTransSolid; 101 102 XGradient maGradientLinear; 103 XGradient maGradientAxial; 104 XGradient maGradientRadial; 105 XGradient maGradientElliptical; 106 XGradient maGradientSquare; 107 XGradient maGradientRect; 108 109 // ui controls 110 ::boost::scoped_ptr< FixedText > mpColorTextFT; 111 ::boost::scoped_ptr< SvxFillTypeBox > mpLbFillType; 112 ::boost::scoped_ptr< SvxFillAttrBox > mpLbFillAttr; 113 ::boost::scoped_ptr< Window > mpToolBoxColorBackground; 114 ::boost::scoped_ptr< ToolBox > mpToolBoxColor; // for new color picker 115 ::boost::scoped_ptr< FixedText > mpTrspTextFT; 116 ::boost::scoped_ptr< ListBox > mpLBTransType; 117 ::boost::scoped_ptr< MetricField > mpMTRTransparent; 118 ::boost::scoped_ptr< Window > mpBTNGradientBackground; 119 ::boost::scoped_ptr< ToolBox > mpBTNGradient; 120 121 ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; 122 123 ::boost::scoped_ptr< XFillStyleItem > mpStyleItem; 124 ::boost::scoped_ptr< XFillColorItem > mpColorItem; 125 ::boost::scoped_ptr< XFillGradientItem > mpFillGradientItem; 126 ::boost::scoped_ptr< XFillHatchItem > mpHatchItem; 127 ::boost::scoped_ptr< XFillBitmapItem > mpBitmapItem; 128 129 ::sfx2::sidebar::ControllerItem maStyleControl; 130 ::sfx2::sidebar::ControllerItem maColorControl; 131 ::sfx2::sidebar::ControllerItem maGradientControl; 132 ::sfx2::sidebar::ControllerItem maHatchControl; 133 ::sfx2::sidebar::ControllerItem maBitmapControl; 134 ::sfx2::sidebar::ControllerItem maColorTableControl; 135 ::sfx2::sidebar::ControllerItem maGradientListControl; 136 ::sfx2::sidebar::ControllerItem maHatchListControl; 137 ::sfx2::sidebar::ControllerItem maBitmapListControl; 138 ::sfx2::sidebar::ControllerItem maFillTransparenceController; 139 ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController; 140 141 Image maImgAxial; 142 Image maImgElli; 143 Image maImgQuad; 144 Image maImgRadial; 145 Image maImgSquare; 146 Image maImgLinear; 147 Image maImgColor; 148 149 // for high contract 150 Image maImgAxialH; 151 Image maImgElliH; 152 Image maImgQuadH; 153 Image maImgRadialH; 154 Image maImgSquareH; 155 Image maImgLinearH; 156 Image maImgColorH; 157 158 String msHelpFillType; 159 String msHelpFillAttr; 160 161 AreaTransparencyGradientPopup maTrGrPopup; 162 ColorPopup maColorPopup; 163 164 ::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem; 165 ::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem; 166 167 cssu::Reference<css::frame::XFrame> mxFrame; 168 SfxBindings* mpBindings; 169 170 // bitfield 171 bool mbColorAvail : 1; 172 173 ::sfx2::sidebar::GridLayouter maLayouter; 174 175 DECL_LINK(SelectFillTypeHdl, ListBox* ); 176 DECL_LINK(SelectFillAttrHdl, ListBox* ); 177 DECL_LINK(ChangeTrgrTypeHdl_Impl, void*); 178 DECL_LINK(ModifyTransparentHdl_Impl, void*); 179 DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* ); 180 181 // for transparency gradient 182 PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent); 183 DECL_LINK( ClickTrGrHdl_Impl, ToolBox* ); 184 185 // for color picker 186 PopupControl* CreateColorPopupControl (PopupContainer* pParent); 187 DECL_LINK(ToolBoxColorDropHdl, ToolBox *); // for new color picker 188 189 // constructor/destructor 190 AreaPropertyPanel( 191 Window* pParent, 192 const cssu::Reference<css::frame::XFrame>& rxFrame, 193 SfxBindings* pBindings); 194 virtual ~AreaPropertyPanel(void); 195 196 void SetupIcons(void); 197 void Initialize(); 198 void Update(); 199 void ImpUpdateTransparencies(); 200 201 Color GetLastColor (void) const; 202 void SetColor ( 203 const String& rsColorName, 204 const Color aColor); 205 }; 206 207 208 } } // end of namespace ::svx::sidebar 209 210 211 212 #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX 213 214 // eof 215