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 #ifndef SVX_PROPERTYPANEL_AREAPAGE_HXX 23 #define SVX_PROPERTYPANEL_AREAPAGE_HXX 24 25 #include <svx/sidebar/ColorPopup.hxx> 26 #include "AreaTransparencyGradientPopup.hxx" 27 #include <vcl/ctrl.hxx> 28 #include <sfx2/sidebar/SidebarPanelBase.hxx> 29 #include <sfx2/sidebar/ControllerItem.hxx> 30 #include <svx/xgrad.hxx> 31 #include <svx/itemwin.hxx> 32 #include <svx/xfillit0.hxx> 33 #include <svx/xflclit.hxx> 34 #include <svx/xflgrit.hxx> 35 #include <svx/xflhtit.hxx> 36 #include <svx/xbtmpit.hxx> 37 #include <svx/drawitem.hxx> 38 #include <vcl/lstbox.hxx> 39 #include <vcl/field.hxx> 40 #include <vcl/fixed.hxx> 41 #include <svl/intitem.hxx> 42 #include <svx/tbxcolorupdate.hxx> 43 #include <com/sun/star/ui/XUIElement.hpp> 44 #include <boost/scoped_ptr.hpp> 45 46 47 class XFillFloatTransparenceItem; 48 namespace svx { class ToolboxButtonColorUpdater; } 49 50 51 namespace svx { namespace sidebar { 52 53 class PopupContainer; 54 class AreaTransparencyGradientControl; 55 56 class AreaPropertyPanel 57 : public Control, 58 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface 59 { 60 public: 61 static AreaPropertyPanel* Create( 62 Window* pParent, 63 const cssu::Reference<css::frame::XFrame>& rxFrame, 64 SfxBindings* pBindings); 65 66 virtual void DataChanged( 67 const DataChangedEvent& rEvent); 68 69 virtual void NotifyItemUpdate( 70 const sal_uInt16 nSId, 71 const SfxItemState eState, 72 const SfxPoolItem* pState); 73 74 SfxBindings* GetBindings(); 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 XGradientStyle eStyle) const; 84 void SetGradient (const XGradient& rGradient); 85 sal_Int32 GetSelectedTransparencyTypeIndex (void) const; 86 87 private: 88 sal_uInt16 meLastXFS; 89 Color maLastColor; 90 91 sal_uInt16 mnLastPosGradient; 92 sal_uInt16 mnLastPosHatch; 93 sal_uInt16 mnLastPosBitmap; 94 sal_uInt16 mnLastTransSolid; 95 96 XGradient maGradientLinear; 97 XGradient maGradientAxial; 98 XGradient maGradientRadial; 99 XGradient maGradientElliptical; 100 XGradient maGradientSquare; 101 XGradient maGradientRect; 102 103 //ui controls 104 ::boost::scoped_ptr< FixedText > mpColorTextFT; 105 ::boost::scoped_ptr< SvxFillTypeBox > mpLbFillType; 106 ::boost::scoped_ptr< SvxFillAttrBox > mpLbFillAttr; 107 ::boost::scoped_ptr< Window > mpToolBoxColorBackground; 108 ::boost::scoped_ptr< ToolBox > mpToolBoxColor; // for new color picker 109 ::boost::scoped_ptr< FixedText > mpTrspTextFT; 110 ::boost::scoped_ptr< ListBox > mpLBTransType; 111 ::boost::scoped_ptr< MetricField > mpMTRTransparent; 112 ::boost::scoped_ptr< Window > mpBTNGradientBackground; 113 ::boost::scoped_ptr< ToolBox > mpBTNGradient; 114 115 ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; 116 117 ::boost::scoped_ptr< XFillStyleItem > mpStyleItem; 118 ::boost::scoped_ptr< XFillColorItem > mpColorItem; 119 ::boost::scoped_ptr< XFillGradientItem > mpFillGradientItem; 120 ::boost::scoped_ptr< XFillHatchItem > mpHatchItem; 121 ::boost::scoped_ptr< XFillBitmapItem > mpBitmapItem; 122 ::boost::scoped_ptr< SvxColorTableItem > mpColorTableItem; 123 ::boost::scoped_ptr< SvxGradientListItem > mpGradientListItem; 124 ::boost::scoped_ptr< SvxHatchListItem > mpHatchListItem; 125 ::boost::scoped_ptr< SvxBitmapListItem > mpBitmapListItem; 126 127 ::sfx2::sidebar::ControllerItem maStyleControl; 128 ::sfx2::sidebar::ControllerItem maColorControl; 129 ::sfx2::sidebar::ControllerItem maGradientControl; 130 ::sfx2::sidebar::ControllerItem maHatchControl; 131 ::sfx2::sidebar::ControllerItem maBitmapControl; 132 ::sfx2::sidebar::ControllerItem maColorTableControl; 133 ::sfx2::sidebar::ControllerItem maGradientListControl; 134 ::sfx2::sidebar::ControllerItem maHatchListControl; 135 ::sfx2::sidebar::ControllerItem maBitmapListControl; 136 ::sfx2::sidebar::ControllerItem maFillTransparenceController; 137 ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController; 138 139 Image maImgAxial; 140 Image maImgElli; 141 Image maImgQuad; 142 Image maImgRadial; 143 Image maImgSquare; 144 Image maImgLinear; 145 Image maImgColor; 146 147 //for high contract 148 Image maImgAxialH; 149 Image maImgElliH; 150 Image maImgQuadH; 151 Image maImgRadialH; 152 Image maImgSquareH; 153 Image maImgLinearH; 154 Image maImgColorH; 155 156 String msHelpFillType; 157 String msHelpFillAttr; 158 159 AreaTransparencyGradientPopup maTrGrPopup; 160 ColorPopup maColorPopup; 161 162 ::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem; 163 ::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem; 164 165 cssu::Reference<css::frame::XFrame> mxFrame; 166 SfxBindings* mpBindings; 167 168 /// bitfield 169 bool mbTBShow : 1; 170 bool mbColorAvail : 1; 171 172 DECL_LINK(SelectFillTypeHdl, ListBox* ); 173 DECL_LINK(SelectFillAttrHdl, ListBox* ); 174 DECL_LINK(ChangeTrgrTypeHdl_Impl, void*); 175 DECL_LINK(ModifyTransparentHdl_Impl, void*); 176 DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* ); 177 178 // for transparency gradient 179 PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent); 180 DECL_LINK( ClickTrGrHdl_Impl, ToolBox* ); 181 182 // for color picker 183 PopupControl* CreateColorPopupControl (PopupContainer* pParent); 184 DECL_LINK(ToolBoxColorDropHdl, ToolBox *); //for new color picker 185 186 // constructor/destuctor 187 AreaPropertyPanel( 188 Window* pParent, 189 const cssu::Reference<css::frame::XFrame>& rxFrame, 190 SfxBindings* pBindings); 191 virtual ~AreaPropertyPanel(void); 192 193 void SetupIcons(void); 194 void Initialize(); 195 void Update(); 196 void ImpUpdateTransparencies(); 197 198 Color GetLastColor (void) const; 199 void SetColor ( 200 const String& rsColorName, 201 const Color aColor); 202 }; 203 204 205 } } // end of namespace ::svx::sidebar 206 207 208 209 #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX 210 211 // eof 212