166c1fc23SArmin Le Grand /************************************************************** 266c1fc23SArmin Le Grand * 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 1066c1fc23SArmin Le Grand * 1166c1fc23SArmin Le Grand * http://www.apache.org/licenses/LICENSE-2.0 1266c1fc23SArmin Le Grand * 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. 1966c1fc23SArmin Le Grand * 2066c1fc23SArmin Le Grand *************************************************************/ 2166c1fc23SArmin Le Grand 2266c1fc23SArmin Le Grand #ifndef SVX_PROPERTYPANEL_AREAPAGE_HXX 2366c1fc23SArmin Le Grand #define SVX_PROPERTYPANEL_AREAPAGE_HXX 2466c1fc23SArmin Le Grand 25facb16e7SArmin Le Grand #include <svx/sidebar/ColorPopup.hxx> 268dcb2a10SAndre Fischer #include "AreaTransparencyGradientPopup.hxx" 2766c1fc23SArmin Le Grand #include <vcl/ctrl.hxx> 2866c1fc23SArmin Le Grand #include <sfx2/sidebar/SidebarPanelBase.hxx> 2966c1fc23SArmin Le Grand #include <sfx2/sidebar/ControllerItem.hxx> 30f120fe41SAndre Fischer #include <sfx2/sidebar/IContextChangeReceiver.hxx> 3166c1fc23SArmin Le Grand #include <svx/xgrad.hxx> 3266c1fc23SArmin Le Grand #include <svx/itemwin.hxx> 3366c1fc23SArmin Le Grand #include <svx/xfillit0.hxx> 3466c1fc23SArmin Le Grand #include <svx/xflclit.hxx> 3566c1fc23SArmin Le Grand #include <svx/xflgrit.hxx> 3666c1fc23SArmin Le Grand #include <svx/xflhtit.hxx> 3766c1fc23SArmin Le Grand #include <svx/xbtmpit.hxx> 3866c1fc23SArmin Le Grand #include <svx/drawitem.hxx> 3966c1fc23SArmin Le Grand #include <vcl/lstbox.hxx> 4066c1fc23SArmin Le Grand #include <vcl/field.hxx> 4166c1fc23SArmin Le Grand #include <vcl/fixed.hxx> 4266c1fc23SArmin Le Grand #include <svl/intitem.hxx> 4366c1fc23SArmin Le Grand #include <svx/tbxcolorupdate.hxx> 4466c1fc23SArmin Le Grand #include <com/sun/star/ui/XUIElement.hpp> 4566c1fc23SArmin Le Grand #include <boost/scoped_ptr.hpp> 4666c1fc23SArmin Le Grand 478dcb2a10SAndre Fischer 4866c1fc23SArmin Le Grand class XFillFloatTransparenceItem; 4966c1fc23SArmin Le Grand namespace svx { class ToolboxButtonColorUpdater; } 5066c1fc23SArmin Le Grand 5166c1fc23SArmin Le Grand 5266c1fc23SArmin Le Grand namespace svx { namespace sidebar { 5366c1fc23SArmin Le Grand 548dcb2a10SAndre Fischer class PopupContainer; 558dcb2a10SAndre Fischer class AreaTransparencyGradientControl; 5602c50d82SAndre Fischer 5766c1fc23SArmin Le Grand class AreaPropertyPanel 5866c1fc23SArmin Le Grand : public Control, 59f120fe41SAndre Fischer public ::sfx2::sidebar::IContextChangeReceiver, 6066c1fc23SArmin Le Grand public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface 6166c1fc23SArmin Le Grand { 6266c1fc23SArmin Le Grand public: 6366c1fc23SArmin Le Grand static AreaPropertyPanel* Create( 6466c1fc23SArmin Le Grand Window* pParent, 6566c1fc23SArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame, 6666c1fc23SArmin Le Grand SfxBindings* pBindings); 6766c1fc23SArmin Le Grand 6866c1fc23SArmin Le Grand virtual void DataChanged( 6966c1fc23SArmin Le Grand const DataChangedEvent& rEvent); 7066c1fc23SArmin Le Grand 7166c1fc23SArmin Le Grand virtual void HandleContextChange( 7266c1fc23SArmin Le Grand const ::sfx2::sidebar::EnumContext aContext); 7366c1fc23SArmin Le Grand 7466c1fc23SArmin Le Grand virtual void NotifyItemUpdate( 7566c1fc23SArmin Le Grand const sal_uInt16 nSId, 7666c1fc23SArmin Le Grand const SfxItemState eState, 7766c1fc23SArmin Le Grand const SfxPoolItem* pState); 7866c1fc23SArmin Le Grand 7966c1fc23SArmin Le Grand SfxBindings* GetBindings(); 8066c1fc23SArmin Le Grand 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 9266c1fc23SArmin Le Grand private: 9358e893aeSArmin Le Grand sal_uInt16 meLastXFS; 9466c1fc23SArmin Le Grand Color maLastColor; 9566c1fc23SArmin Le Grand 9666c1fc23SArmin Le Grand sal_uInt16 mnLastPosGradient; 9766c1fc23SArmin Le Grand sal_uInt16 mnLastPosHatch; 9866c1fc23SArmin Le Grand sal_uInt16 mnLastPosBitmap; 9966c1fc23SArmin Le Grand sal_uInt16 mnLastTransSolid; 10066c1fc23SArmin Le Grand 10166c1fc23SArmin Le Grand XGradient maGradientLinear; 10266c1fc23SArmin Le Grand XGradient maGradientAxial; 10366c1fc23SArmin Le Grand XGradient maGradientRadial; 10466c1fc23SArmin Le Grand XGradient maGradientElliptical; 10566c1fc23SArmin Le Grand XGradient maGradientSquare; 10666c1fc23SArmin Le Grand XGradient maGradientRect; 10766c1fc23SArmin Le Grand 10866c1fc23SArmin Le Grand //ui controls 10966c1fc23SArmin Le Grand ::boost::scoped_ptr< FixedText > mpColorTextFT; 11066c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxFillTypeBox > mpLbFillType; 11166c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxFillAttrBox > mpLbFillAttr; 1128d3cb1a4SArmin Le Grand ::boost::scoped_ptr< Window > mpToolBoxColorBackground; 11366c1fc23SArmin Le Grand ::boost::scoped_ptr< ToolBox > mpToolBoxColor; // for new color picker 11466c1fc23SArmin Le Grand ::boost::scoped_ptr< FixedText > mpTrspTextFT; 11566c1fc23SArmin Le Grand ::boost::scoped_ptr< ListBox > mpLBTransType; 11666c1fc23SArmin Le Grand ::boost::scoped_ptr< MetricField > mpMTRTransparent; 1178d3cb1a4SArmin Le Grand ::boost::scoped_ptr< Window > mpBTNGradientBackground; 11866c1fc23SArmin Le Grand ::boost::scoped_ptr< ToolBox > mpBTNGradient; 11966c1fc23SArmin Le Grand 12066c1fc23SArmin Le Grand ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; 12166c1fc23SArmin Le Grand 12266c1fc23SArmin Le Grand ::boost::scoped_ptr< XFillStyleItem > mpStyleItem; 12366c1fc23SArmin Le Grand ::boost::scoped_ptr< XFillColorItem > mpColorItem; 12466c1fc23SArmin Le Grand ::boost::scoped_ptr< XFillGradientItem > mpFillGradientItem; 12566c1fc23SArmin Le Grand ::boost::scoped_ptr< XFillHatchItem > mpHatchItem; 12666c1fc23SArmin Le Grand ::boost::scoped_ptr< XFillBitmapItem > mpBitmapItem; 12766c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxColorTableItem > mpColorTableItem; 12866c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxGradientListItem > mpGradientListItem; 12966c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxHatchListItem > mpHatchListItem; 13066c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxBitmapListItem > mpBitmapListItem; 13166c1fc23SArmin Le Grand 13266c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maStyleControl; 13366c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maColorControl; 13466c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maGradientControl; 13566c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maHatchControl; 13666c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maBitmapControl; 13766c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maColorTableControl; 13866c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maGradientListControl; 13966c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maHatchListControl; 14066c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maBitmapListControl; 141d5370dc8SArmin Le Grand ::sfx2::sidebar::ControllerItem maFillTransparenceController; 142d5370dc8SArmin Le Grand ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController; 14366c1fc23SArmin Le Grand 14466c1fc23SArmin Le Grand Image maImgAxial; 14566c1fc23SArmin Le Grand Image maImgElli; 14666c1fc23SArmin Le Grand Image maImgQuad; 14766c1fc23SArmin Le Grand Image maImgRadial; 14866c1fc23SArmin Le Grand Image maImgSquare; 14966c1fc23SArmin Le Grand Image maImgLinear; 15066c1fc23SArmin Le Grand Image maImgColor; 15166c1fc23SArmin Le Grand 15266c1fc23SArmin Le Grand //for high contract 15366c1fc23SArmin Le Grand Image maImgAxialH; 15466c1fc23SArmin Le Grand Image maImgElliH; 15566c1fc23SArmin Le Grand Image maImgQuadH; 15666c1fc23SArmin Le Grand Image maImgRadialH; 15766c1fc23SArmin Le Grand Image maImgSquareH; 15866c1fc23SArmin Le Grand Image maImgLinearH; 15966c1fc23SArmin Le Grand Image maImgColorH; 16066c1fc23SArmin Le Grand 16166c1fc23SArmin Le Grand String msHelpFillType; 16266c1fc23SArmin Le Grand String msHelpFillAttr; 16366c1fc23SArmin Le Grand 1648dcb2a10SAndre Fischer AreaTransparencyGradientPopup maTrGrPopup; 1658dcb2a10SAndre Fischer ColorPopup maColorPopup; 16689729eb3SArmin Le Grand 167d5370dc8SArmin Le Grand ::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem; 168d5370dc8SArmin Le Grand ::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem; 16966c1fc23SArmin Le Grand 17066c1fc23SArmin Le Grand cssu::Reference<css::frame::XFrame> mxFrame; 17166c1fc23SArmin Le Grand ::sfx2::sidebar::EnumContext maContext; 17266c1fc23SArmin Le Grand SfxBindings* mpBindings; 17366c1fc23SArmin Le Grand 17466c1fc23SArmin Le Grand /// bitfield 17535fa8f12SArmin Le Grand bool mbTBShow : 1; 17635fa8f12SArmin Le Grand bool mbColorAvail : 1; 17766c1fc23SArmin Le Grand 17866c1fc23SArmin Le Grand DECL_LINK(SelectFillTypeHdl, ListBox* ); 17966c1fc23SArmin Le Grand DECL_LINK(SelectFillAttrHdl, ListBox* ); 18066c1fc23SArmin Le Grand DECL_LINK(ChangeTrgrTypeHdl_Impl, void*); 18166c1fc23SArmin Le Grand DECL_LINK(ModifyTransparentHdl_Impl, void*); 18266c1fc23SArmin Le Grand DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* ); 18366c1fc23SArmin Le Grand 18458e893aeSArmin Le Grand // for transparency gradient 1858dcb2a10SAndre Fischer PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent); 1868dcb2a10SAndre Fischer DECL_LINK( ClickTrGrHdl_Impl, ToolBox* ); 18766c1fc23SArmin Le Grand 18858e893aeSArmin Le Grand // for color picker 1898dcb2a10SAndre Fischer PopupControl* CreateColorPopupControl (PopupContainer* pParent); 1908dcb2a10SAndre Fischer DECL_LINK(ToolBoxColorDropHdl, ToolBox *); //for new color picker 19166c1fc23SArmin Le Grand 19258e893aeSArmin Le Grand // constructor/destuctor 19366c1fc23SArmin Le Grand AreaPropertyPanel( 19466c1fc23SArmin Le Grand Window* pParent, 19566c1fc23SArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame, 19666c1fc23SArmin Le Grand SfxBindings* pBindings); 19766c1fc23SArmin Le Grand virtual ~AreaPropertyPanel(void); 19866c1fc23SArmin Le Grand 19966c1fc23SArmin Le Grand void SetupIcons(void); 20066c1fc23SArmin Le Grand void Initialize(); 20158e893aeSArmin Le Grand void Update(); 202d5370dc8SArmin Le Grand void ImpUpdateTransparencies(); 2038dcb2a10SAndre Fischer 2048dcb2a10SAndre Fischer Color GetLastColor (void) const; 2058dcb2a10SAndre Fischer void SetColor ( 2068dcb2a10SAndre Fischer const String& rsColorName, 2078dcb2a10SAndre Fischer const Color aColor); 20866c1fc23SArmin Le Grand }; 20966c1fc23SArmin Le Grand 21066c1fc23SArmin Le Grand 2118dcb2a10SAndre Fischer } } // end of namespace ::svx::sidebar 21266c1fc23SArmin Le Grand 21366c1fc23SArmin Le Grand 21466c1fc23SArmin Le Grand 2158dcb2a10SAndre Fischer #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX 216*4e8031e0SArmin Le Grand 217*4e8031e0SArmin Le Grand // eof 218