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 const bool bIsEnabled); 74 75 SfxBindings* GetBindings(); 76 77 const static sal_Int32 DEFAULT_CENTERX; 78 const static sal_Int32 DEFAULT_CENTERY; 79 const static sal_Int32 DEFAULT_ANGLE; 80 const static sal_Int32 DEFAULT_STARTVALUE; 81 const static sal_Int32 DEFAULT_ENDVALUE; 82 const static sal_Int32 DEFAULT_BORDER; 83 84 XGradient GetGradient (const XGradientStyle eStyle) const; 85 void SetGradient (const XGradient& rGradient); 86 sal_Int32 GetSelectedTransparencyTypeIndex (void) const; 87 88 private: 89 sal_uInt16 meLastXFS; 90 Color maLastColor; 91 92 sal_uInt16 mnLastPosGradient; 93 sal_uInt16 mnLastPosHatch; 94 sal_uInt16 mnLastPosBitmap; 95 sal_uInt16 mnLastTransSolid; 96 97 XGradient maGradientLinear; 98 XGradient maGradientAxial; 99 XGradient maGradientRadial; 100 XGradient maGradientElliptical; 101 XGradient maGradientSquare; 102 XGradient maGradientRect; 103 104 //ui controls 105 ::boost::scoped_ptr< FixedText > mpColorTextFT; 106 ::boost::scoped_ptr< SvxFillTypeBox > mpLbFillType; 107 ::boost::scoped_ptr< SvxFillAttrBox > mpLbFillAttr; 108 ::boost::scoped_ptr< Window > mpToolBoxColorBackground; 109 ::boost::scoped_ptr< ToolBox > mpToolBoxColor; // for new color picker 110 ::boost::scoped_ptr< FixedText > mpTrspTextFT; 111 ::boost::scoped_ptr< ListBox > mpLBTransType; 112 ::boost::scoped_ptr< MetricField > mpMTRTransparent; 113 ::boost::scoped_ptr< Window > mpBTNGradientBackground; 114 ::boost::scoped_ptr< ToolBox > mpBTNGradient; 115 116 ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; 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 maColorTableControl; 130 ::sfx2::sidebar::ControllerItem maGradientListControl; 131 ::sfx2::sidebar::ControllerItem maHatchListControl; 132 ::sfx2::sidebar::ControllerItem maBitmapListControl; 133 ::sfx2::sidebar::ControllerItem maFillTransparenceController; 134 ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController; 135 136 Image maImgAxial; 137 Image maImgElli; 138 Image maImgQuad; 139 Image maImgRadial; 140 Image maImgSquare; 141 Image maImgLinear; 142 Image maImgColor; 143 144 //for high contract 145 Image maImgAxialH; 146 Image maImgElliH; 147 Image maImgQuadH; 148 Image maImgRadialH; 149 Image maImgSquareH; 150 Image maImgLinearH; 151 Image maImgColorH; 152 153 String msHelpFillType; 154 String msHelpFillAttr; 155 156 AreaTransparencyGradientPopup maTrGrPopup; 157 ColorPopup maColorPopup; 158 159 ::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem; 160 ::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem; 161 162 cssu::Reference<css::frame::XFrame> mxFrame; 163 SfxBindings* mpBindings; 164 165 /// bitfield 166 bool mbColorAvail : 1; 167 168 DECL_LINK(SelectFillTypeHdl, ListBox* ); 169 DECL_LINK(SelectFillAttrHdl, ListBox* ); 170 DECL_LINK(ChangeTrgrTypeHdl_Impl, void*); 171 DECL_LINK(ModifyTransparentHdl_Impl, void*); 172 DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* ); 173 174 // for transparency gradient 175 PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent); 176 DECL_LINK( ClickTrGrHdl_Impl, ToolBox* ); 177 178 // for color picker 179 PopupControl* CreateColorPopupControl (PopupContainer* pParent); 180 DECL_LINK(ToolBoxColorDropHdl, ToolBox *); //for new color picker 181 182 // constructor/destuctor 183 AreaPropertyPanel( 184 Window* pParent, 185 const cssu::Reference<css::frame::XFrame>& rxFrame, 186 SfxBindings* pBindings); 187 virtual ~AreaPropertyPanel(void); 188 189 void SetupIcons(void); 190 void Initialize(); 191 void Update(); 192 void ImpUpdateTransparencies(); 193 194 Color GetLastColor (void) const; 195 void SetColor ( 196 const String& rsColorName, 197 const Color aColor); 198 }; 199 200 201 } } // end of namespace ::svx::sidebar 202 203 204 205 #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX 206 207 // eof 208