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> 30*6a606da0SAndre Fischer #include <sfx2/sidebar/GridLayouter.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, 598dcb2a10SAndre Fischer public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface 608dcb2a10SAndre Fischer { 618dcb2a10SAndre Fischer public: 628dcb2a10SAndre Fischer static AreaPropertyPanel* Create( 638dcb2a10SAndre Fischer Window* pParent, 648dcb2a10SAndre Fischer const cssu::Reference<css::frame::XFrame>& rxFrame, 658dcb2a10SAndre Fischer SfxBindings* pBindings); 668dcb2a10SAndre Fischer 678dcb2a10SAndre Fischer virtual void DataChanged( 688dcb2a10SAndre Fischer const DataChangedEvent& rEvent); 698dcb2a10SAndre Fischer 708dcb2a10SAndre Fischer virtual void NotifyItemUpdate( 718dcb2a10SAndre Fischer const sal_uInt16 nSId, 728dcb2a10SAndre Fischer const SfxItemState eState, 7345da7d5eSAndre Fischer const SfxPoolItem* pState, 7445da7d5eSAndre Fischer const bool bIsEnabled); 758dcb2a10SAndre Fischer 768dcb2a10SAndre Fischer SfxBindings* GetBindings(); 778dcb2a10SAndre Fischer 788dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_CENTERX; 798dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_CENTERY; 808dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_ANGLE; 818dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_STARTVALUE; 828dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_ENDVALUE; 838dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_BORDER; 848dcb2a10SAndre Fischer 858dcb2a10SAndre Fischer XGradient GetGradient (const XGradientStyle eStyle) const; 868dcb2a10SAndre Fischer void SetGradient (const XGradient& rGradient); 878dcb2a10SAndre Fischer sal_Int32 GetSelectedTransparencyTypeIndex (void) const; 888dcb2a10SAndre Fischer 89*6a606da0SAndre Fischer virtual void Resize (void); 90*6a606da0SAndre Fischer 918dcb2a10SAndre Fischer private: 928dcb2a10SAndre Fischer sal_uInt16 meLastXFS; 938dcb2a10SAndre Fischer Color maLastColor; 948dcb2a10SAndre Fischer 958dcb2a10SAndre Fischer sal_uInt16 mnLastPosGradient; 968dcb2a10SAndre Fischer sal_uInt16 mnLastPosHatch; 978dcb2a10SAndre Fischer sal_uInt16 mnLastPosBitmap; 988dcb2a10SAndre Fischer sal_uInt16 mnLastTransSolid; 998dcb2a10SAndre Fischer 1008dcb2a10SAndre Fischer XGradient maGradientLinear; 1018dcb2a10SAndre Fischer XGradient maGradientAxial; 1028dcb2a10SAndre Fischer XGradient maGradientRadial; 1038dcb2a10SAndre Fischer XGradient maGradientElliptical; 1048dcb2a10SAndre Fischer XGradient maGradientSquare; 1058dcb2a10SAndre Fischer XGradient maGradientRect; 1068dcb2a10SAndre Fischer 1078dcb2a10SAndre Fischer //ui controls 1088dcb2a10SAndre Fischer ::boost::scoped_ptr< FixedText > mpColorTextFT; 1098dcb2a10SAndre Fischer ::boost::scoped_ptr< SvxFillTypeBox > mpLbFillType; 1108dcb2a10SAndre Fischer ::boost::scoped_ptr< SvxFillAttrBox > mpLbFillAttr; 1118dcb2a10SAndre Fischer ::boost::scoped_ptr< Window > mpToolBoxColorBackground; 1128dcb2a10SAndre Fischer ::boost::scoped_ptr< ToolBox > mpToolBoxColor; // for new color picker 1138dcb2a10SAndre Fischer ::boost::scoped_ptr< FixedText > mpTrspTextFT; 1148dcb2a10SAndre Fischer ::boost::scoped_ptr< ListBox > mpLBTransType; 1158dcb2a10SAndre Fischer ::boost::scoped_ptr< MetricField > mpMTRTransparent; 1168dcb2a10SAndre Fischer ::boost::scoped_ptr< Window > mpBTNGradientBackground; 1178dcb2a10SAndre Fischer ::boost::scoped_ptr< ToolBox > mpBTNGradient; 1188dcb2a10SAndre Fischer 1198dcb2a10SAndre Fischer ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; 1208dcb2a10SAndre Fischer 1218dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillStyleItem > mpStyleItem; 1228dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillColorItem > mpColorItem; 1238dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillGradientItem > mpFillGradientItem; 1248dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillHatchItem > mpHatchItem; 1258dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillBitmapItem > mpBitmapItem; 1268dcb2a10SAndre Fischer 1278dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maStyleControl; 1288dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maColorControl; 1298dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maGradientControl; 1308dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maHatchControl; 1318dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maBitmapControl; 1328dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maColorTableControl; 1338dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maGradientListControl; 1348dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maHatchListControl; 1358dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maBitmapListControl; 1368dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maFillTransparenceController; 1378dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController; 1388dcb2a10SAndre Fischer 1398dcb2a10SAndre Fischer Image maImgAxial; 1408dcb2a10SAndre Fischer Image maImgElli; 1418dcb2a10SAndre Fischer Image maImgQuad; 1428dcb2a10SAndre Fischer Image maImgRadial; 1438dcb2a10SAndre Fischer Image maImgSquare; 1448dcb2a10SAndre Fischer Image maImgLinear; 1458dcb2a10SAndre Fischer Image maImgColor; 1468dcb2a10SAndre Fischer 1478dcb2a10SAndre Fischer //for high contract 1488dcb2a10SAndre Fischer Image maImgAxialH; 1498dcb2a10SAndre Fischer Image maImgElliH; 1508dcb2a10SAndre Fischer Image maImgQuadH; 1518dcb2a10SAndre Fischer Image maImgRadialH; 1528dcb2a10SAndre Fischer Image maImgSquareH; 1538dcb2a10SAndre Fischer Image maImgLinearH; 1548dcb2a10SAndre Fischer Image maImgColorH; 1558dcb2a10SAndre Fischer 1568dcb2a10SAndre Fischer String msHelpFillType; 1578dcb2a10SAndre Fischer String msHelpFillAttr; 1588dcb2a10SAndre Fischer 1598dcb2a10SAndre Fischer AreaTransparencyGradientPopup maTrGrPopup; 1608dcb2a10SAndre Fischer ColorPopup maColorPopup; 1618dcb2a10SAndre Fischer 1628dcb2a10SAndre Fischer ::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem; 1638dcb2a10SAndre Fischer ::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem; 1648dcb2a10SAndre Fischer 1658dcb2a10SAndre Fischer cssu::Reference<css::frame::XFrame> mxFrame; 1668dcb2a10SAndre Fischer SfxBindings* mpBindings; 1678dcb2a10SAndre Fischer 1688dcb2a10SAndre Fischer /// bitfield 1698dcb2a10SAndre Fischer bool mbColorAvail : 1; 1708dcb2a10SAndre Fischer 171*6a606da0SAndre Fischer ::sfx2::sidebar::GridLayouter maLayouter; 172*6a606da0SAndre Fischer 1738dcb2a10SAndre Fischer DECL_LINK(SelectFillTypeHdl, ListBox* ); 1748dcb2a10SAndre Fischer DECL_LINK(SelectFillAttrHdl, ListBox* ); 1758dcb2a10SAndre Fischer DECL_LINK(ChangeTrgrTypeHdl_Impl, void*); 1768dcb2a10SAndre Fischer DECL_LINK(ModifyTransparentHdl_Impl, void*); 1778dcb2a10SAndre Fischer DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* ); 1788dcb2a10SAndre Fischer 1798dcb2a10SAndre Fischer // for transparency gradient 1808dcb2a10SAndre Fischer PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent); 1818dcb2a10SAndre Fischer DECL_LINK( ClickTrGrHdl_Impl, ToolBox* ); 1828dcb2a10SAndre Fischer 1838dcb2a10SAndre Fischer // for color picker 1848dcb2a10SAndre Fischer PopupControl* CreateColorPopupControl (PopupContainer* pParent); 1858dcb2a10SAndre Fischer DECL_LINK(ToolBoxColorDropHdl, ToolBox *); //for new color picker 1868dcb2a10SAndre Fischer 1878dcb2a10SAndre Fischer // constructor/destuctor 1888dcb2a10SAndre Fischer AreaPropertyPanel( 1898dcb2a10SAndre Fischer Window* pParent, 1908dcb2a10SAndre Fischer const cssu::Reference<css::frame::XFrame>& rxFrame, 1918dcb2a10SAndre Fischer SfxBindings* pBindings); 1928dcb2a10SAndre Fischer virtual ~AreaPropertyPanel(void); 1938dcb2a10SAndre Fischer 1948dcb2a10SAndre Fischer void SetupIcons(void); 1958dcb2a10SAndre Fischer void Initialize(); 1968dcb2a10SAndre Fischer void Update(); 1978dcb2a10SAndre Fischer void ImpUpdateTransparencies(); 1988dcb2a10SAndre Fischer 1998dcb2a10SAndre Fischer Color GetLastColor (void) const; 2008dcb2a10SAndre Fischer void SetColor ( 2018dcb2a10SAndre Fischer const String& rsColorName, 2028dcb2a10SAndre Fischer const Color aColor); 2038dcb2a10SAndre Fischer }; 2048dcb2a10SAndre Fischer 2058dcb2a10SAndre Fischer 2068dcb2a10SAndre Fischer } } // end of namespace ::svx::sidebar 2078dcb2a10SAndre Fischer 2088dcb2a10SAndre Fischer 2098dcb2a10SAndre Fischer 2108dcb2a10SAndre Fischer #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX 2114e8031e0SArmin Le Grand 2124e8031e0SArmin Le Grand // eof 213