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> 3066c1fc23SArmin Le Grand #include <svx/xgrad.hxx> 3166c1fc23SArmin Le Grand #include <svx/itemwin.hxx> 3266c1fc23SArmin Le Grand #include <svx/xfillit0.hxx> 3366c1fc23SArmin Le Grand #include <svx/xflclit.hxx> 3466c1fc23SArmin Le Grand #include <svx/xflgrit.hxx> 3566c1fc23SArmin Le Grand #include <svx/xflhtit.hxx> 3666c1fc23SArmin Le Grand #include <svx/xbtmpit.hxx> 3766c1fc23SArmin Le Grand #include <svx/drawitem.hxx> 3866c1fc23SArmin Le Grand #include <vcl/lstbox.hxx> 3966c1fc23SArmin Le Grand #include <vcl/field.hxx> 4066c1fc23SArmin Le Grand #include <vcl/fixed.hxx> 4166c1fc23SArmin Le Grand #include <svl/intitem.hxx> 4266c1fc23SArmin Le Grand #include <svx/tbxcolorupdate.hxx> 4366c1fc23SArmin Le Grand #include <com/sun/star/ui/XUIElement.hpp> 4466c1fc23SArmin Le Grand #include <boost/scoped_ptr.hpp> 4566c1fc23SArmin Le Grand 468dcb2a10SAndre Fischer 4766c1fc23SArmin Le Grand class XFillFloatTransparenceItem; 4866c1fc23SArmin Le Grand namespace svx { class ToolboxButtonColorUpdater; } 4966c1fc23SArmin Le Grand 5066c1fc23SArmin Le Grand 5166c1fc23SArmin Le Grand namespace svx { namespace sidebar { 5266c1fc23SArmin Le Grand 538dcb2a10SAndre Fischer class PopupContainer; 548dcb2a10SAndre Fischer class AreaTransparencyGradientControl; 5502c50d82SAndre Fischer 5666c1fc23SArmin Le Grand class AreaPropertyPanel 5766c1fc23SArmin Le Grand : public Control, 5866c1fc23SArmin Le Grand public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface 5966c1fc23SArmin Le Grand { 6066c1fc23SArmin Le Grand public: 6166c1fc23SArmin Le Grand static AreaPropertyPanel* Create( 6266c1fc23SArmin Le Grand Window* pParent, 6366c1fc23SArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame, 6466c1fc23SArmin Le Grand SfxBindings* pBindings); 6566c1fc23SArmin Le Grand 6666c1fc23SArmin Le Grand virtual void DataChanged( 6766c1fc23SArmin Le Grand const DataChangedEvent& rEvent); 6866c1fc23SArmin Le Grand 6966c1fc23SArmin Le Grand virtual void NotifyItemUpdate( 7066c1fc23SArmin Le Grand const sal_uInt16 nSId, 7166c1fc23SArmin Le Grand const SfxItemState eState, 72*45da7d5eSAndre Fischer const SfxPoolItem* pState, 73*45da7d5eSAndre Fischer const bool bIsEnabled); 7466c1fc23SArmin Le Grand 7566c1fc23SArmin Le Grand SfxBindings* GetBindings(); 7666c1fc23SArmin Le Grand 778dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_CENTERX; 788dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_CENTERY; 798dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_ANGLE; 808dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_STARTVALUE; 818dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_ENDVALUE; 828dcb2a10SAndre Fischer const static sal_Int32 DEFAULT_BORDER; 838dcb2a10SAndre Fischer 848dcb2a10SAndre Fischer XGradient GetGradient (const XGradientStyle eStyle) const; 858dcb2a10SAndre Fischer void SetGradient (const XGradient& rGradient); 868dcb2a10SAndre Fischer sal_Int32 GetSelectedTransparencyTypeIndex (void) const; 878dcb2a10SAndre Fischer 8866c1fc23SArmin Le Grand private: 8958e893aeSArmin Le Grand sal_uInt16 meLastXFS; 9066c1fc23SArmin Le Grand Color maLastColor; 9166c1fc23SArmin Le Grand 9266c1fc23SArmin Le Grand sal_uInt16 mnLastPosGradient; 9366c1fc23SArmin Le Grand sal_uInt16 mnLastPosHatch; 9466c1fc23SArmin Le Grand sal_uInt16 mnLastPosBitmap; 9566c1fc23SArmin Le Grand sal_uInt16 mnLastTransSolid; 9666c1fc23SArmin Le Grand 9766c1fc23SArmin Le Grand XGradient maGradientLinear; 9866c1fc23SArmin Le Grand XGradient maGradientAxial; 9966c1fc23SArmin Le Grand XGradient maGradientRadial; 10066c1fc23SArmin Le Grand XGradient maGradientElliptical; 10166c1fc23SArmin Le Grand XGradient maGradientSquare; 10266c1fc23SArmin Le Grand XGradient maGradientRect; 10366c1fc23SArmin Le Grand 10466c1fc23SArmin Le Grand //ui controls 10566c1fc23SArmin Le Grand ::boost::scoped_ptr< FixedText > mpColorTextFT; 10666c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxFillTypeBox > mpLbFillType; 10766c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxFillAttrBox > mpLbFillAttr; 1088d3cb1a4SArmin Le Grand ::boost::scoped_ptr< Window > mpToolBoxColorBackground; 10966c1fc23SArmin Le Grand ::boost::scoped_ptr< ToolBox > mpToolBoxColor; // for new color picker 11066c1fc23SArmin Le Grand ::boost::scoped_ptr< FixedText > mpTrspTextFT; 11166c1fc23SArmin Le Grand ::boost::scoped_ptr< ListBox > mpLBTransType; 11266c1fc23SArmin Le Grand ::boost::scoped_ptr< MetricField > mpMTRTransparent; 1138d3cb1a4SArmin Le Grand ::boost::scoped_ptr< Window > mpBTNGradientBackground; 11466c1fc23SArmin Le Grand ::boost::scoped_ptr< ToolBox > mpBTNGradient; 11566c1fc23SArmin Le Grand 11666c1fc23SArmin Le Grand ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; 11766c1fc23SArmin Le Grand 11866c1fc23SArmin Le Grand ::boost::scoped_ptr< XFillStyleItem > mpStyleItem; 11966c1fc23SArmin Le Grand ::boost::scoped_ptr< XFillColorItem > mpColorItem; 12066c1fc23SArmin Le Grand ::boost::scoped_ptr< XFillGradientItem > mpFillGradientItem; 12166c1fc23SArmin Le Grand ::boost::scoped_ptr< XFillHatchItem > mpHatchItem; 12266c1fc23SArmin Le Grand ::boost::scoped_ptr< XFillBitmapItem > mpBitmapItem; 12366c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxColorTableItem > mpColorTableItem; 12466c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxGradientListItem > mpGradientListItem; 12566c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxHatchListItem > mpHatchListItem; 12666c1fc23SArmin Le Grand ::boost::scoped_ptr< SvxBitmapListItem > mpBitmapListItem; 12766c1fc23SArmin Le Grand 12866c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maStyleControl; 12966c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maColorControl; 13066c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maGradientControl; 13166c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maHatchControl; 13266c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maBitmapControl; 13366c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maColorTableControl; 13466c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maGradientListControl; 13566c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maHatchListControl; 13666c1fc23SArmin Le Grand ::sfx2::sidebar::ControllerItem maBitmapListControl; 137d5370dc8SArmin Le Grand ::sfx2::sidebar::ControllerItem maFillTransparenceController; 138d5370dc8SArmin Le Grand ::sfx2::sidebar::ControllerItem maFillFloatTransparenceController; 13966c1fc23SArmin Le Grand 14066c1fc23SArmin Le Grand Image maImgAxial; 14166c1fc23SArmin Le Grand Image maImgElli; 14266c1fc23SArmin Le Grand Image maImgQuad; 14366c1fc23SArmin Le Grand Image maImgRadial; 14466c1fc23SArmin Le Grand Image maImgSquare; 14566c1fc23SArmin Le Grand Image maImgLinear; 14666c1fc23SArmin Le Grand Image maImgColor; 14766c1fc23SArmin Le Grand 14866c1fc23SArmin Le Grand //for high contract 14966c1fc23SArmin Le Grand Image maImgAxialH; 15066c1fc23SArmin Le Grand Image maImgElliH; 15166c1fc23SArmin Le Grand Image maImgQuadH; 15266c1fc23SArmin Le Grand Image maImgRadialH; 15366c1fc23SArmin Le Grand Image maImgSquareH; 15466c1fc23SArmin Le Grand Image maImgLinearH; 15566c1fc23SArmin Le Grand Image maImgColorH; 15666c1fc23SArmin Le Grand 15766c1fc23SArmin Le Grand String msHelpFillType; 15866c1fc23SArmin Le Grand String msHelpFillAttr; 15966c1fc23SArmin Le Grand 1608dcb2a10SAndre Fischer AreaTransparencyGradientPopup maTrGrPopup; 1618dcb2a10SAndre Fischer ColorPopup maColorPopup; 16289729eb3SArmin Le Grand 163d5370dc8SArmin Le Grand ::boost::scoped_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem; 164d5370dc8SArmin Le Grand ::boost::scoped_ptr< SfxUInt16Item > mpTransparanceItem; 16566c1fc23SArmin Le Grand 16666c1fc23SArmin Le Grand cssu::Reference<css::frame::XFrame> mxFrame; 16766c1fc23SArmin Le Grand SfxBindings* mpBindings; 16866c1fc23SArmin Le Grand 16966c1fc23SArmin Le Grand /// bitfield 17035fa8f12SArmin Le Grand bool mbTBShow : 1; 17135fa8f12SArmin Le Grand bool mbColorAvail : 1; 17266c1fc23SArmin Le Grand 17366c1fc23SArmin Le Grand DECL_LINK(SelectFillTypeHdl, ListBox* ); 17466c1fc23SArmin Le Grand DECL_LINK(SelectFillAttrHdl, ListBox* ); 17566c1fc23SArmin Le Grand DECL_LINK(ChangeTrgrTypeHdl_Impl, void*); 17666c1fc23SArmin Le Grand DECL_LINK(ModifyTransparentHdl_Impl, void*); 17766c1fc23SArmin Le Grand DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* ); 17866c1fc23SArmin Le Grand 17958e893aeSArmin Le Grand // for transparency gradient 1808dcb2a10SAndre Fischer PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent); 1818dcb2a10SAndre Fischer DECL_LINK( ClickTrGrHdl_Impl, ToolBox* ); 18266c1fc23SArmin Le Grand 18358e893aeSArmin Le Grand // for color picker 1848dcb2a10SAndre Fischer PopupControl* CreateColorPopupControl (PopupContainer* pParent); 1858dcb2a10SAndre Fischer DECL_LINK(ToolBoxColorDropHdl, ToolBox *); //for new color picker 18666c1fc23SArmin Le Grand 18758e893aeSArmin Le Grand // constructor/destuctor 18866c1fc23SArmin Le Grand AreaPropertyPanel( 18966c1fc23SArmin Le Grand Window* pParent, 19066c1fc23SArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame, 19166c1fc23SArmin Le Grand SfxBindings* pBindings); 19266c1fc23SArmin Le Grand virtual ~AreaPropertyPanel(void); 19366c1fc23SArmin Le Grand 19466c1fc23SArmin Le Grand void SetupIcons(void); 19566c1fc23SArmin Le Grand void Initialize(); 19658e893aeSArmin Le Grand void Update(); 197d5370dc8SArmin Le Grand void ImpUpdateTransparencies(); 1988dcb2a10SAndre Fischer 1998dcb2a10SAndre Fischer Color GetLastColor (void) const; 2008dcb2a10SAndre Fischer void SetColor ( 2018dcb2a10SAndre Fischer const String& rsColorName, 2028dcb2a10SAndre Fischer const Color aColor); 20366c1fc23SArmin Le Grand }; 20466c1fc23SArmin Le Grand 20566c1fc23SArmin Le Grand 2068dcb2a10SAndre Fischer } } // end of namespace ::svx::sidebar 20766c1fc23SArmin Le Grand 20866c1fc23SArmin Le Grand 20966c1fc23SArmin Le Grand 2108dcb2a10SAndre Fischer #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX 2114e8031e0SArmin Le Grand 2124e8031e0SArmin Le Grand // eof 213