166c1fc23SArmin Le Grand /************************************************************** 2*8bd26251Smseidel * 366c1fc23SArmin Le Grand * Licensed to the Apache Software Foundation (ASF) under one 466c1fc23SArmin Le Grand * or more contributor license agreements. See the NOTICE file 566c1fc23SArmin Le Grand * distributed with this work for additional information 666c1fc23SArmin Le Grand * regarding copyright ownership. The ASF licenses this file 766c1fc23SArmin Le Grand * to you under the Apache License, Version 2.0 (the 866c1fc23SArmin Le Grand * "License"); you may not use this file except in compliance 966c1fc23SArmin Le Grand * with the License. You may obtain a copy of the License at 10*8bd26251Smseidel * 1166c1fc23SArmin Le Grand * http://www.apache.org/licenses/LICENSE-2.0 12*8bd26251Smseidel * 1366c1fc23SArmin Le Grand * Unless required by applicable law or agreed to in writing, 1466c1fc23SArmin Le Grand * software distributed under the License is distributed on an 1566c1fc23SArmin Le Grand * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1666c1fc23SArmin Le Grand * KIND, either express or implied. See the License for the 1766c1fc23SArmin Le Grand * specific language governing permissions and limitations 1866c1fc23SArmin Le Grand * under the License. 19*8bd26251Smseidel * 2066c1fc23SArmin Le Grand *************************************************************/ 2166c1fc23SArmin Le Grand 22*8bd26251Smseidel 23*8bd26251Smseidel 2466c1fc23SArmin Le Grand #ifndef SVX_PROPERTYPANEL_AREAPAGE_HXX 2566c1fc23SArmin Le Grand #define SVX_PROPERTYPANEL_AREAPAGE_HXX 2666c1fc23SArmin Le Grand 27facb16e7SArmin Le Grand #include <svx/sidebar/ColorPopup.hxx> 288dcb2a10SAndre Fischer #include "AreaTransparencyGradientPopup.hxx" 2966c1fc23SArmin Le Grand #include <vcl/ctrl.hxx> 3066c1fc23SArmin Le Grand #include <sfx2/sidebar/SidebarPanelBase.hxx> 3166c1fc23SArmin Le Grand #include <sfx2/sidebar/ControllerItem.hxx> 326a606da0SAndre Fischer #include <sfx2/sidebar/GridLayouter.hxx> 3366c1fc23SArmin Le Grand #include <svx/xgrad.hxx> 3466c1fc23SArmin Le Grand #include <svx/itemwin.hxx> 3566c1fc23SArmin Le Grand #include <svx/xfillit0.hxx> 3666c1fc23SArmin Le Grand #include <svx/xflclit.hxx> 3766c1fc23SArmin Le Grand #include <svx/xflgrit.hxx> 3866c1fc23SArmin Le Grand #include <svx/xflhtit.hxx> 3966c1fc23SArmin Le Grand #include <svx/xbtmpit.hxx> 4066c1fc23SArmin Le Grand #include <svx/drawitem.hxx> 4166c1fc23SArmin Le Grand #include <vcl/lstbox.hxx> 4266c1fc23SArmin Le Grand #include <vcl/field.hxx> 4366c1fc23SArmin Le Grand #include <vcl/fixed.hxx> 4466c1fc23SArmin Le Grand #include <svl/intitem.hxx> 4566c1fc23SArmin Le Grand #include <svx/tbxcolorupdate.hxx> 4666c1fc23SArmin Le Grand #include <com/sun/star/ui/XUIElement.hpp> 4766c1fc23SArmin Le Grand #include <boost/scoped_ptr.hpp> 4866c1fc23SArmin Le Grand 498dcb2a10SAndre Fischer 5066c1fc23SArmin Le Grand class XFillFloatTransparenceItem; 5166c1fc23SArmin Le Grand namespace svx { class ToolboxButtonColorUpdater; } 5266c1fc23SArmin Le Grand 5366c1fc23SArmin Le Grand 5466c1fc23SArmin Le Grand namespace svx { namespace sidebar { 5566c1fc23SArmin Le Grand 568dcb2a10SAndre Fischer class PopupContainer; 578dcb2a10SAndre Fischer class AreaTransparencyGradientControl; 5802c50d82SAndre Fischer 5966c1fc23SArmin Le Grand class AreaPropertyPanel 60*8bd26251Smseidel : public Control, 61*8bd26251Smseidel public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface 6266c1fc23SArmin Le Grand { 6366c1fc23SArmin Le Grand public: 64*8bd26251Smseidel static AreaPropertyPanel* Create( 65*8bd26251Smseidel Window* pParent, 66*8bd26251Smseidel const cssu::Reference<css::frame::XFrame>& rxFrame, 67*8bd26251Smseidel SfxBindings* pBindings); 6866c1fc23SArmin Le Grand 69*8bd26251Smseidel virtual void DataChanged( 70*8bd26251Smseidel const DataChangedEvent& rEvent); 7166c1fc23SArmin Le Grand 72*8bd26251Smseidel virtual void NotifyItemUpdate( 73*8bd26251Smseidel const sal_uInt16 nSId, 74*8bd26251Smseidel const SfxItemState eState, 75*8bd26251Smseidel const SfxPoolItem* pState, 76*8bd26251Smseidel const bool bIsEnabled); 7766c1fc23SArmin Le Grand 78*8bd26251Smseidel SfxBindings* GetBindings(); 7966c1fc23SArmin Le Grand 80*8bd26251Smseidel const static sal_Int32 DEFAULT_CENTERX; 81*8bd26251Smseidel const static sal_Int32 DEFAULT_CENTERY; 82*8bd26251Smseidel const static sal_Int32 DEFAULT_ANGLE; 83*8bd26251Smseidel const static sal_Int32 DEFAULT_STARTVALUE; 84*8bd26251Smseidel const static sal_Int32 DEFAULT_ENDVALUE; 85*8bd26251Smseidel const static sal_Int32 DEFAULT_BORDER; 868dcb2a10SAndre Fischer 87*8bd26251Smseidel XGradient GetGradient (const XGradientStyle eStyle) const; 88*8bd26251Smseidel void SetGradient (const XGradient& rGradient); 89*8bd26251Smseidel sal_Int32 GetSelectedTransparencyTypeIndex (void) const; 908dcb2a10SAndre Fischer 91*8bd26251Smseidel virtual void Resize (void); 926a606da0SAndre Fischer 9366c1fc23SArmin Le Grand private: 94*8bd26251Smseidel sal_uInt16 meLastXFS; 95*8bd26251Smseidel Color maLastColor; 96*8bd26251Smseidel 97*8bd26251Smseidel sal_uInt16 mnLastPosGradient; 98*8bd26251Smseidel sal_uInt16 mnLastPosHatch; 99*8bd26251Smseidel sal_uInt16 mnLastPosBitmap; 100*8bd26251Smseidel sal_uInt16 mnLastTransSolid; 101*8bd26251Smseidel 102*8bd26251Smseidel XGradient maGradientLinear; 103*8bd26251Smseidel XGradient maGradientAxial; 104*8bd26251Smseidel XGradient maGradientRadial; 105*8bd26251Smseidel XGradient maGradientElliptical; 106*8bd26251Smseidel XGradient maGradientSquare; 107*8bd26251Smseidel XGradient maGradientRect; 108*8bd26251Smseidel 109*8bd26251Smseidel // ui controls 110*8bd26251Smseidel ::boost::scoped_ptr< FixedText > mpColorTextFT; 111*8bd26251Smseidel ::boost::scoped_ptr< SvxFillTypeBox > mpLbFillType; 112*8bd26251Smseidel ::boost::scoped_ptr< SvxFillAttrBox > mpLbFillAttr; 113*8bd26251Smseidel ::boost::scoped_ptr< Window > mpToolBoxColorBackground; 114*8bd26251Smseidel ::boost::scoped_ptr< ToolBox > mpToolBoxColor; // for new color picker 115*8bd26251Smseidel ::boost::scoped_ptr< FixedText > mpTrspTextFT; 116*8bd26251Smseidel ::boost::scoped_ptr< ListBox > mpLBTransType; 117*8bd26251Smseidel ::boost::scoped_ptr< MetricField > mpMTRTransparent; 118*8bd26251Smseidel ::boost::scoped_ptr< Window > mpBTNGradientBackground; 119*8bd26251Smseidel ::boost::scoped_ptr< ToolBox > mpBTNGradient; 120*8bd26251Smseidel 121*8bd26251Smseidel ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; 122*8bd26251Smseidel 123*8bd26251Smseidel ::boost::scoped_ptr< XFillStyleItem > mpStyleItem; 124*8bd26251Smseidel ::boost::scoped_ptr< XFillColorItem > mpColorItem; 125*8bd26251Smseidel ::boost::scoped_ptr< XFillGradientItem > mpFillGradientItem; 126*8bd26251Smseidel ::boost::scoped_ptr< XFillHatchItem > mpHatchItem; 127*8bd26251Smseidel ::boost::scoped_ptr< XFillBitmapItem > mpBitmapItem; 128*8bd26251Smseidel 129*8bd26251Smseidel ::sfx2::sidebar::ControllerItem maStyleControl; 130*8bd26251Smseidel ::sfx2::sidebar::ControllerItem maColorControl; 131*8bd26251Smseidel ::sfx2::sidebar::ControllerItem maGradientControl; 132*8bd26251Smseidel ::sfx2::sidebar::ControllerItem maHatchControl; 133*8bd26251Smseidel ::sfx2::sidebar::ControllerItem maBitmapControl; 134*8bd26251Smseidel ::sfx2::sidebar::ControllerItem maColorTableControl; 135*8bd26251Smseidel ::sfx2::sidebar::ControllerItem maGradientListControl; 136*8bd26251Smseidel ::sfx2::sidebar::ControllerItem maHatchListControl; 137*8bd26251Smseidel ::sfx2::sidebar::ControllerItem maBitmapListControl; 138*8bd26251Smseidel ::sfx2::sidebar::ControllerItem maFillTransparenceController; 139*8bd26251Smseidel ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController; 140*8bd26251Smseidel 141*8bd26251Smseidel Image maImgAxial; 142*8bd26251Smseidel Image maImgElli; 143*8bd26251Smseidel Image maImgQuad; 144*8bd26251Smseidel Image maImgRadial; 145*8bd26251Smseidel Image maImgSquare; 146*8bd26251Smseidel Image maImgLinear; 147*8bd26251Smseidel Image maImgColor; 148*8bd26251Smseidel 149*8bd26251Smseidel // for high contract 150*8bd26251Smseidel Image maImgAxialH; 151*8bd26251Smseidel Image maImgElliH; 152*8bd26251Smseidel Image maImgQuadH; 153*8bd26251Smseidel Image maImgRadialH; 154*8bd26251Smseidel Image maImgSquareH; 155*8bd26251Smseidel Image maImgLinearH; 156*8bd26251Smseidel Image maImgColorH; 157*8bd26251Smseidel 158*8bd26251Smseidel String msHelpFillType; 159*8bd26251Smseidel String msHelpFillAttr; 160*8bd26251Smseidel 161*8bd26251Smseidel AreaTransparencyGradientPopup maTrGrPopup; 162*8bd26251Smseidel ColorPopup maColorPopup; 163*8bd26251Smseidel 164*8bd26251Smseidel ::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem; 165*8bd26251Smseidel ::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem; 166*8bd26251Smseidel 167*8bd26251Smseidel cssu::Reference<css::frame::XFrame> mxFrame; 168*8bd26251Smseidel SfxBindings* mpBindings; 169*8bd26251Smseidel 170*8bd26251Smseidel // bitfield 171*8bd26251Smseidel bool mbColorAvail : 1; 172*8bd26251Smseidel 173*8bd26251Smseidel ::sfx2::sidebar::GridLayouter maLayouter; 174*8bd26251Smseidel 175*8bd26251Smseidel DECL_LINK(SelectFillTypeHdl, ListBox* ); 176*8bd26251Smseidel DECL_LINK(SelectFillAttrHdl, ListBox* ); 177*8bd26251Smseidel DECL_LINK(ChangeTrgrTypeHdl_Impl, void*); 178*8bd26251Smseidel DECL_LINK(ModifyTransparentHdl_Impl, void*); 179*8bd26251Smseidel DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* ); 180*8bd26251Smseidel 181*8bd26251Smseidel // for transparency gradient 182*8bd26251Smseidel PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent); 183*8bd26251Smseidel DECL_LINK( ClickTrGrHdl_Impl, ToolBox* ); 184*8bd26251Smseidel 185*8bd26251Smseidel // for color picker 186*8bd26251Smseidel PopupControl* CreateColorPopupControl (PopupContainer* pParent); 187*8bd26251Smseidel DECL_LINK(ToolBoxColorDropHdl, ToolBox *); // for new color picker 188*8bd26251Smseidel 189*8bd26251Smseidel // constructor/destructor 190*8bd26251Smseidel AreaPropertyPanel( 191*8bd26251Smseidel Window* pParent, 192*8bd26251Smseidel const cssu::Reference<css::frame::XFrame>& rxFrame, 193*8bd26251Smseidel SfxBindings* pBindings); 194*8bd26251Smseidel virtual ~AreaPropertyPanel(void); 195*8bd26251Smseidel 196*8bd26251Smseidel void SetupIcons(void); 197*8bd26251Smseidel void Initialize(); 198*8bd26251Smseidel void Update(); 199*8bd26251Smseidel void ImpUpdateTransparencies(); 200*8bd26251Smseidel 201*8bd26251Smseidel Color GetLastColor (void) const; 202*8bd26251Smseidel void SetColor ( 203*8bd26251Smseidel const String& rsColorName, 204*8bd26251Smseidel const Color aColor); 20566c1fc23SArmin Le Grand }; 20666c1fc23SArmin Le Grand 20766c1fc23SArmin Le Grand 2088dcb2a10SAndre Fischer } } // end of namespace ::svx::sidebar 20966c1fc23SArmin Le Grand 21066c1fc23SArmin Le Grand 21166c1fc23SArmin Le Grand 2128dcb2a10SAndre Fischer #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX 2134e8031e0SArmin Le Grand 2144e8031e0SArmin Le Grand // eof 215