18dcb2a10SAndre Fischer /************************************************************** 28dcb2a10SAndre Fischer * 38dcb2a10SAndre Fischer * Licensed to the Apache Software Foundation (ASF) under one 48dcb2a10SAndre Fischer * or more contributor license agreements. See the NOTICE file 58dcb2a10SAndre Fischer * distributed with this work for additional information 68dcb2a10SAndre Fischer * regarding copyright ownership. The ASF licenses this file 78dcb2a10SAndre Fischer * to you under the Apache License, Version 2.0 (the 88dcb2a10SAndre Fischer * "License"); you may not use this file except in compliance 98dcb2a10SAndre Fischer * with the License. You may obtain a copy of the License at 108dcb2a10SAndre Fischer * 118dcb2a10SAndre Fischer * http://www.apache.org/licenses/LICENSE-2.0 128dcb2a10SAndre Fischer * 138dcb2a10SAndre Fischer * Unless required by applicable law or agreed to in writing, 148dcb2a10SAndre Fischer * software distributed under the License is distributed on an 158dcb2a10SAndre Fischer * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 168dcb2a10SAndre Fischer * KIND, either express or implied. See the License for the 178dcb2a10SAndre Fischer * specific language governing permissions and limitations 188dcb2a10SAndre Fischer * under the License. 198dcb2a10SAndre Fischer * 208dcb2a10SAndre Fischer *************************************************************/ 218dcb2a10SAndre Fischer 228dcb2a10SAndre Fischer #ifndef SVX_PROPERTYPANEL_AREAPAGE_HXX 238dcb2a10SAndre Fischer #define SVX_PROPERTYPANEL_AREAPAGE_HXX 248dcb2a10SAndre Fischer 25facb16e7SArmin Le Grand #include <svx/sidebar/ColorPopup.hxx> 268dcb2a10SAndre Fischer #include "AreaTransparencyGradientPopup.hxx" 278dcb2a10SAndre Fischer #include <vcl/ctrl.hxx> 288dcb2a10SAndre Fischer #include <sfx2/sidebar/SidebarPanelBase.hxx> 298dcb2a10SAndre Fischer #include <sfx2/sidebar/ControllerItem.hxx> 30f120fe41SAndre Fischer #include <sfx2/sidebar/IContextChangeReceiver.hxx> 318dcb2a10SAndre Fischer #include <svx/xgrad.hxx> 328dcb2a10SAndre Fischer #include <svx/itemwin.hxx> 338dcb2a10SAndre Fischer #include <svx/xfillit0.hxx> 348dcb2a10SAndre Fischer #include <svx/xflclit.hxx> 358dcb2a10SAndre Fischer #include <svx/xflgrit.hxx> 368dcb2a10SAndre Fischer #include <svx/xflhtit.hxx> 378dcb2a10SAndre Fischer #include <svx/xbtmpit.hxx> 388dcb2a10SAndre Fischer #include <svx/drawitem.hxx> 398dcb2a10SAndre Fischer #include <vcl/lstbox.hxx> 408dcb2a10SAndre Fischer #include <vcl/field.hxx> 418dcb2a10SAndre Fischer #include <vcl/fixed.hxx> 428dcb2a10SAndre Fischer #include <svl/intitem.hxx> 438dcb2a10SAndre Fischer #include <svx/tbxcolorupdate.hxx> 448dcb2a10SAndre Fischer #include <com/sun/star/ui/XUIElement.hpp> 458dcb2a10SAndre Fischer #include <boost/scoped_ptr.hpp> 468dcb2a10SAndre Fischer 478dcb2a10SAndre Fischer 488dcb2a10SAndre Fischer class XFillFloatTransparenceItem; 498dcb2a10SAndre Fischer namespace svx { class ToolboxButtonColorUpdater; } 508dcb2a10SAndre Fischer 518dcb2a10SAndre Fischer 528dcb2a10SAndre Fischer namespace svx { namespace sidebar { 538dcb2a10SAndre Fischer 548dcb2a10SAndre Fischer class PopupContainer; 558dcb2a10SAndre Fischer class AreaTransparencyGradientControl; 568dcb2a10SAndre Fischer 578dcb2a10SAndre Fischer class AreaPropertyPanel 588dcb2a10SAndre Fischer : public Control, 59f120fe41SAndre Fischer public ::sfx2::sidebar::IContextChangeReceiver, 608dcb2a10SAndre Fischer public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface 618dcb2a10SAndre Fischer { 628dcb2a10SAndre Fischer public: 638dcb2a10SAndre Fischer static AreaPropertyPanel* Create( 648dcb2a10SAndre Fischer Window* pParent, 658dcb2a10SAndre Fischer const cssu::Reference<css::frame::XFrame>& rxFrame, 668dcb2a10SAndre Fischer SfxBindings* pBindings); 678dcb2a10SAndre Fischer 688dcb2a10SAndre Fischer virtual void DataChanged( 698dcb2a10SAndre Fischer const DataChangedEvent& rEvent); 708dcb2a10SAndre Fischer 718dcb2a10SAndre Fischer virtual void HandleContextChange( 728dcb2a10SAndre Fischer const ::sfx2::sidebar::EnumContext aContext); 738dcb2a10SAndre Fischer 748dcb2a10SAndre Fischer virtual void NotifyItemUpdate( 758dcb2a10SAndre Fischer const sal_uInt16 nSId, 768dcb2a10SAndre Fischer const SfxItemState eState, 778dcb2a10SAndre Fischer const SfxPoolItem* pState); 788dcb2a10SAndre Fischer 798dcb2a10SAndre Fischer SfxBindings* GetBindings(); 808dcb2a10SAndre Fischer 818dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_CENTERX; 828dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_CENTERY; 838dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_ANGLE; 848dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_STARTVALUE; 858dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_ENDVALUE; 868dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_BORDER; 878dcb2a10SAndre Fischer 888dcb2a10SAndre Fischer XGradient GetGradient (const XGradientStyle eStyle) const; 898dcb2a10SAndre Fischer void SetGradient (const XGradient& rGradient); 908dcb2a10SAndre Fischer sal_Int32 GetSelectedTransparencyTypeIndex (void) const; 918dcb2a10SAndre Fischer 928dcb2a10SAndre Fischer private: 938dcb2a10SAndre Fischer sal_uInt16 meLastXFS; 948dcb2a10SAndre Fischer Color maLastColor; 958dcb2a10SAndre Fischer 968dcb2a10SAndre Fischer sal_uInt16 mnLastPosGradient; 978dcb2a10SAndre Fischer sal_uInt16 mnLastPosHatch; 988dcb2a10SAndre Fischer sal_uInt16 mnLastPosBitmap; 998dcb2a10SAndre Fischer sal_uInt16 mnLastTransSolid; 1008dcb2a10SAndre Fischer 1018dcb2a10SAndre Fischer XGradient maGradientLinear; 1028dcb2a10SAndre Fischer XGradient maGradientAxial; 1038dcb2a10SAndre Fischer XGradient maGradientRadial; 1048dcb2a10SAndre Fischer XGradient maGradientElliptical; 1058dcb2a10SAndre Fischer XGradient maGradientSquare; 1068dcb2a10SAndre Fischer XGradient maGradientRect; 1078dcb2a10SAndre Fischer 1088dcb2a10SAndre Fischer //ui controls 1098dcb2a10SAndre Fischer ::boost::scoped_ptr< FixedText > mpColorTextFT; 1108dcb2a10SAndre Fischer ::boost::scoped_ptr< SvxFillTypeBox > mpLbFillType; 1118dcb2a10SAndre Fischer ::boost::scoped_ptr< SvxFillAttrBox > mpLbFillAttr; 1128dcb2a10SAndre Fischer ::boost::scoped_ptr< Window > mpToolBoxColorBackground; 1138dcb2a10SAndre Fischer ::boost::scoped_ptr< ToolBox > mpToolBoxColor; // for new color picker 1148dcb2a10SAndre Fischer ::boost::scoped_ptr< FixedText > mpTrspTextFT; 1158dcb2a10SAndre Fischer ::boost::scoped_ptr< ListBox > mpLBTransType; 1168dcb2a10SAndre Fischer ::boost::scoped_ptr< MetricField > mpMTRTransparent; 1178dcb2a10SAndre Fischer ::boost::scoped_ptr< Window > mpBTNGradientBackground; 1188dcb2a10SAndre Fischer ::boost::scoped_ptr< ToolBox > mpBTNGradient; 1198dcb2a10SAndre Fischer 1208dcb2a10SAndre Fischer ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; 1218dcb2a10SAndre Fischer 1228dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillStyleItem > mpStyleItem; 1238dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillColorItem > mpColorItem; 1248dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillGradientItem > mpFillGradientItem; 1258dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillHatchItem > mpHatchItem; 1268dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillBitmapItem > mpBitmapItem; 1278dcb2a10SAndre Fischer ::boost::scoped_ptr< SvxColorTableItem > mpColorTableItem; 1288dcb2a10SAndre Fischer ::boost::scoped_ptr< SvxGradientListItem > mpGradientListItem; 1298dcb2a10SAndre Fischer ::boost::scoped_ptr< SvxHatchListItem > mpHatchListItem; 1308dcb2a10SAndre Fischer ::boost::scoped_ptr< SvxBitmapListItem > mpBitmapListItem; 1318dcb2a10SAndre Fischer 1328dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maStyleControl; 1338dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maColorControl; 1348dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maGradientControl; 1358dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maHatchControl; 1368dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maBitmapControl; 1378dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maColorTableControl; 1388dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maGradientListControl; 1398dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maHatchListControl; 1408dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maBitmapListControl; 1418dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maFillTransparenceController; 1428dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController; 1438dcb2a10SAndre Fischer 1448dcb2a10SAndre Fischer Image maImgAxial; 1458dcb2a10SAndre Fischer Image maImgElli; 1468dcb2a10SAndre Fischer Image maImgQuad; 1478dcb2a10SAndre Fischer Image maImgRadial; 1488dcb2a10SAndre Fischer Image maImgSquare; 1498dcb2a10SAndre Fischer Image maImgLinear; 1508dcb2a10SAndre Fischer Image maImgColor; 1518dcb2a10SAndre Fischer 1528dcb2a10SAndre Fischer //for high contract 1538dcb2a10SAndre Fischer Image maImgAxialH; 1548dcb2a10SAndre Fischer Image maImgElliH; 1558dcb2a10SAndre Fischer Image maImgQuadH; 1568dcb2a10SAndre Fischer Image maImgRadialH; 1578dcb2a10SAndre Fischer Image maImgSquareH; 1588dcb2a10SAndre Fischer Image maImgLinearH; 1598dcb2a10SAndre Fischer Image maImgColorH; 1608dcb2a10SAndre Fischer 1618dcb2a10SAndre Fischer String msHelpFillType; 1628dcb2a10SAndre Fischer String msHelpFillAttr; 1638dcb2a10SAndre Fischer 1648dcb2a10SAndre Fischer AreaTransparencyGradientPopup maTrGrPopup; 1658dcb2a10SAndre Fischer ColorPopup maColorPopup; 1668dcb2a10SAndre Fischer 1678dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem; 1688dcb2a10SAndre Fischer ::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem; 1698dcb2a10SAndre Fischer 1708dcb2a10SAndre Fischer cssu::Reference<css::frame::XFrame> mxFrame; 1718dcb2a10SAndre Fischer ::sfx2::sidebar::EnumContext maContext; 1728dcb2a10SAndre Fischer SfxBindings* mpBindings; 1738dcb2a10SAndre Fischer 1748dcb2a10SAndre Fischer /// bitfield 1758dcb2a10SAndre Fischer bool mbTBShow : 1; 1768dcb2a10SAndre Fischer bool mbColorAvail : 1; 1778dcb2a10SAndre Fischer 1788dcb2a10SAndre Fischer DECL_LINK(SelectFillTypeHdl, ListBox* ); 1798dcb2a10SAndre Fischer DECL_LINK(SelectFillAttrHdl, ListBox* ); 1808dcb2a10SAndre Fischer DECL_LINK(ChangeTrgrTypeHdl_Impl, void*); 1818dcb2a10SAndre Fischer DECL_LINK(ModifyTransparentHdl_Impl, void*); 1828dcb2a10SAndre Fischer DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* ); 1838dcb2a10SAndre Fischer 1848dcb2a10SAndre Fischer // for transparency gradient 1858dcb2a10SAndre Fischer PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent); 1868dcb2a10SAndre Fischer DECL_LINK( ClickTrGrHdl_Impl, ToolBox* ); 1878dcb2a10SAndre Fischer 1888dcb2a10SAndre Fischer // for color picker 1898dcb2a10SAndre Fischer PopupControl* CreateColorPopupControl (PopupContainer* pParent); 1908dcb2a10SAndre Fischer DECL_LINK(ToolBoxColorDropHdl, ToolBox *); //for new color picker 1918dcb2a10SAndre Fischer 1928dcb2a10SAndre Fischer // constructor/destuctor 1938dcb2a10SAndre Fischer AreaPropertyPanel( 1948dcb2a10SAndre Fischer Window* pParent, 1958dcb2a10SAndre Fischer const cssu::Reference<css::frame::XFrame>& rxFrame, 1968dcb2a10SAndre Fischer SfxBindings* pBindings); 1978dcb2a10SAndre Fischer virtual ~AreaPropertyPanel(void); 1988dcb2a10SAndre Fischer 1998dcb2a10SAndre Fischer void SetupIcons(void); 2008dcb2a10SAndre Fischer void Initialize(); 2018dcb2a10SAndre Fischer void Update(); 2028dcb2a10SAndre Fischer void ImpUpdateTransparencies(); 2038dcb2a10SAndre Fischer 2048dcb2a10SAndre Fischer Color GetLastColor (void) const; 2058dcb2a10SAndre Fischer void SetColor ( 2068dcb2a10SAndre Fischer const String& rsColorName, 2078dcb2a10SAndre Fischer const Color aColor); 2088dcb2a10SAndre Fischer }; 2098dcb2a10SAndre Fischer 2108dcb2a10SAndre Fischer 2118dcb2a10SAndre Fischer } } // end of namespace ::svx::sidebar 2128dcb2a10SAndre Fischer 2138dcb2a10SAndre Fischer 2148dcb2a10SAndre Fischer 2158dcb2a10SAndre Fischer #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX 216*4e8031e0SArmin Le Grand 217*4e8031e0SArmin Le Grand // eof 218