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_LINEPAGE_HXX 238dcb2a10SAndre Fischer #define SVX_PROPERTYPANEL_LINEPAGE_HXX 248dcb2a10SAndre Fischer 258dcb2a10SAndre Fischer #include <svx/xdash.hxx> 268dcb2a10SAndre Fischer #include <vcl/ctrl.hxx> 278dcb2a10SAndre Fischer #include <sfx2/sidebar/SidebarPanelBase.hxx> 288dcb2a10SAndre Fischer #include <sfx2/sidebar/ControllerItem.hxx> 29*6a606da0SAndre Fischer #include <sfx2/sidebar/GridLayouter.hxx> 308dcb2a10SAndre Fischer #include <vcl/fixed.hxx> 318dcb2a10SAndre Fischer #include <vcl/field.hxx> 328dcb2a10SAndre Fischer #include <boost/scoped_ptr.hpp> 338dcb2a10SAndre Fischer #include <boost/scoped_array.hpp> 34facb16e7SArmin Le Grand #include <svx/sidebar/ColorPopup.hxx> 358dcb2a10SAndre Fischer #include "LineWidthPopup.hxx" 368dcb2a10SAndre Fischer 378dcb2a10SAndre Fischer namespace svx { class ToolboxButtonColorUpdater; } 388dcb2a10SAndre Fischer class SvxLineColorPage; 398dcb2a10SAndre Fischer class SvxLineStylePage; 408dcb2a10SAndre Fischer class SvxLineWidthPage; 418dcb2a10SAndre Fischer class XLineStyleItem; 428dcb2a10SAndre Fischer class XLineDashItem; 438dcb2a10SAndre Fischer class XLineStartItem; 448dcb2a10SAndre Fischer class XLineEndItem; 458dcb2a10SAndre Fischer class XLineEndList; 4697e8a929SArmin Le Grand class XDashList; 478dcb2a10SAndre Fischer class ListBox; 488dcb2a10SAndre Fischer class ToolBox; 498dcb2a10SAndre Fischer class FloatingWindow; 508dcb2a10SAndre Fischer 51c7be74b1SArmin Le Grand typedef ::boost::shared_ptr< XLineEndList > XLineEndListSharedPtr; 52c7be74b1SArmin Le Grand typedef ::boost::shared_ptr< XDashList > XDashListSharedPtr; 53c7be74b1SArmin Le Grand 548dcb2a10SAndre Fischer namespace { 558dcb2a10SAndre Fischer #define SIDEBAR_LINE_WIDTH_GLOBAL_VALUE String("PopupPanel_LineWidth", 20, RTL_TEXTENCODING_ASCII_US) 568dcb2a10SAndre Fischer } //end of anonymous namespace 578dcb2a10SAndre Fischer 588dcb2a10SAndre Fischer namespace svx { namespace sidebar { 598dcb2a10SAndre Fischer 608dcb2a10SAndre Fischer class PopupContainer; 618dcb2a10SAndre Fischer class ColorPopup; 628dcb2a10SAndre Fischer class LineWidthControl; 638dcb2a10SAndre Fischer 648dcb2a10SAndre Fischer 658dcb2a10SAndre Fischer class LinePropertyPanel 668dcb2a10SAndre Fischer : public Control, 678dcb2a10SAndre Fischer public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface 688dcb2a10SAndre Fischer { 698dcb2a10SAndre Fischer private: 708dcb2a10SAndre Fischer friend class ::SvxLineStylePage; 718dcb2a10SAndre Fischer friend class ::SvxLineWidthPage; 728dcb2a10SAndre Fischer 738dcb2a10SAndre Fischer public: 748dcb2a10SAndre Fischer static LinePropertyPanel* Create( 758dcb2a10SAndre Fischer Window* pParent, 768dcb2a10SAndre Fischer const cssu::Reference<css::frame::XFrame>& rxFrame, 778dcb2a10SAndre Fischer SfxBindings* pBindings); 788dcb2a10SAndre Fischer 798dcb2a10SAndre Fischer virtual void DataChanged( 808dcb2a10SAndre Fischer const DataChangedEvent& rEvent); 818dcb2a10SAndre Fischer 828dcb2a10SAndre Fischer virtual void NotifyItemUpdate( 838dcb2a10SAndre Fischer const sal_uInt16 nSId, 848dcb2a10SAndre Fischer const SfxItemState eState, 8545da7d5eSAndre Fischer const SfxPoolItem* pState, 8645da7d5eSAndre Fischer const bool bIsEnabled); 878dcb2a10SAndre Fischer 888dcb2a10SAndre Fischer SfxBindings* GetBindings(); 898dcb2a10SAndre Fischer 908dcb2a10SAndre Fischer void SetWidth(long nWidth); 918dcb2a10SAndre Fischer void SetWidthIcon(int n); 928dcb2a10SAndre Fischer void SetWidthIcon(); 938dcb2a10SAndre Fischer 948dcb2a10SAndre Fischer void EndLineWidthPopupMode (void); 958dcb2a10SAndre Fischer 96*6a606da0SAndre Fischer virtual void Resize (void); 97*6a606da0SAndre Fischer 988dcb2a10SAndre Fischer private: 998dcb2a10SAndre Fischer //ui controls 1008dcb2a10SAndre Fischer ::boost::scoped_ptr< FixedText > mpFTWidth; 1018dcb2a10SAndre Fischer ::boost::scoped_ptr< Window > mpTBWidthBackground; 1028dcb2a10SAndre Fischer ::boost::scoped_ptr< ToolBox > mpTBWidth; 1038dcb2a10SAndre Fischer ::boost::scoped_ptr< FixedText > mpFTColor; 1048dcb2a10SAndre Fischer ::boost::scoped_ptr< Window > mpTBColorBackground; 1058dcb2a10SAndre Fischer ::boost::scoped_ptr< ToolBox > mpTBColor; 1068dcb2a10SAndre Fischer ::boost::scoped_ptr< FixedText > mpFTStyle; 10797e8a929SArmin Le Grand ::boost::scoped_ptr< ListBox > mpLBStyle; 1088dcb2a10SAndre Fischer ::boost::scoped_ptr< FixedText > mpFTTrancparency; 1098dcb2a10SAndre Fischer ::boost::scoped_ptr< MetricField > mpMFTransparent; 1108dcb2a10SAndre Fischer ::boost::scoped_ptr< FixedText > mpFTArrow; 111a567bdc8SArmin Le Grand ::boost::scoped_ptr< ListBox > mpLBStart; 112a567bdc8SArmin Le Grand ::boost::scoped_ptr< ListBox > mpLBEnd; 1138dcb2a10SAndre Fischer ::boost::scoped_ptr< FixedText > mpFTEdgeStyle; 1148dcb2a10SAndre Fischer ::boost::scoped_ptr< ListBox > mpLBEdgeStyle; 1158dcb2a10SAndre Fischer ::boost::scoped_ptr< FixedText > mpFTCapStyle; 1168dcb2a10SAndre Fischer ::boost::scoped_ptr< ListBox > mpLBCapStyle; 1178dcb2a10SAndre Fischer 1188dcb2a10SAndre Fischer //ControllerItem 1198dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maStyleControl; 1208dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maDashControl; 1218dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maWidthControl; 1228dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maColorControl; 1238dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maStartControl; 1248dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maEndControl; 1258dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maLineEndListControl; 12697e8a929SArmin Le Grand ::sfx2::sidebar::ControllerItem maLineStyleListControl; 1278dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maTransControl; 1288dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maEdgeStyle; 1298dcb2a10SAndre Fischer ::sfx2::sidebar::ControllerItem maCapStyle; 1308dcb2a10SAndre Fischer 1318dcb2a10SAndre Fischer Color maColor; 1328dcb2a10SAndre Fischer ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; 1338dcb2a10SAndre Fischer ::boost::scoped_ptr< XLineStyleItem > mpStyleItem; 1348dcb2a10SAndre Fischer ::boost::scoped_ptr< XLineDashItem > mpDashItem; 1358dcb2a10SAndre Fischer sal_uInt16 mnTrans; 1368dcb2a10SAndre Fischer SfxMapUnit meMapUnit; 1378dcb2a10SAndre Fischer sal_Int32 mnWidthCoreValue; 138c7be74b1SArmin Le Grand XLineEndListSharedPtr maLineEndList; 139c7be74b1SArmin Le Grand XDashListSharedPtr maLineStyleList; 1408dcb2a10SAndre Fischer ::boost::scoped_ptr< XLineStartItem > mpStartItem; 1418dcb2a10SAndre Fischer ::boost::scoped_ptr< XLineEndItem > mpEndItem; 1428dcb2a10SAndre Fischer 1438dcb2a10SAndre Fischer //popup windows 1448dcb2a10SAndre Fischer ColorPopup maColorPopup; 1458dcb2a10SAndre Fischer LineWidthPopup maLineWidthPopup; 1468dcb2a10SAndre Fischer 1478dcb2a10SAndre Fischer // images from ressource 1488dcb2a10SAndre Fischer Image maIMGColor; 1498dcb2a10SAndre Fischer Image maIMGNone; 1508dcb2a10SAndre Fischer 1518dcb2a10SAndre Fischer // multi-images 1528dcb2a10SAndre Fischer ::boost::scoped_array<Image> mpIMGWidthIcon; 1538dcb2a10SAndre Fischer ::boost::scoped_array<Image> mpIMGWidthIconH; //high contrast 1548dcb2a10SAndre Fischer 1558dcb2a10SAndre Fischer cssu::Reference< css::frame::XFrame > mxFrame; 1568dcb2a10SAndre Fischer SfxBindings* mpBindings; 1578dcb2a10SAndre Fischer 1588dcb2a10SAndre Fischer /// bitfield 1598dcb2a10SAndre Fischer bool mbColorAvailable : 1; 1608dcb2a10SAndre Fischer bool mbWidthValuable : 1; 1618dcb2a10SAndre Fischer 162*6a606da0SAndre Fischer ::sfx2::sidebar::GridLayouter maLayouter; 163*6a606da0SAndre Fischer 1648dcb2a10SAndre Fischer void SetupIcons(void); 1658dcb2a10SAndre Fischer void Initialize(); 1668dcb2a10SAndre Fischer void FillLineEndList(); 16797e8a929SArmin Le Grand void FillLineStyleList(); 1688dcb2a10SAndre Fischer void SelectEndStyle(bool bStart); 16997e8a929SArmin Le Grand void SelectLineStyle(); 1708dcb2a10SAndre Fischer 1718dcb2a10SAndre Fischer DECL_LINK(ImplPopupModeEndHdl, FloatingWindow* ); 1728dcb2a10SAndre Fischer DECL_LINK(ImplWidthPopupModeEndHdl, FloatingWindow* ); 1738dcb2a10SAndre Fischer DECL_LINK(ToolboxColorSelectHdl, ToolBox*); 17497e8a929SArmin Le Grand DECL_LINK(ChangeLineStyleHdl, ToolBox*); 1758dcb2a10SAndre Fischer DECL_LINK(ToolboxWidthSelectHdl, ToolBox*); 1768dcb2a10SAndre Fischer DECL_LINK(ChangeTransparentHdl , void *); 1778dcb2a10SAndre Fischer DECL_LINK(ChangeStartHdl, void *); 1788dcb2a10SAndre Fischer DECL_LINK(ChangeEndHdl, void *); 1798dcb2a10SAndre Fischer DECL_LINK(ChangeEdgeStyleHdl, void *); 1808dcb2a10SAndre Fischer DECL_LINK(ChangeCapStyleHdl, void *); 1818dcb2a10SAndre Fischer 1828dcb2a10SAndre Fischer // constructor/destuctor 1838dcb2a10SAndre Fischer LinePropertyPanel( 1848dcb2a10SAndre Fischer Window* pParent, 1858dcb2a10SAndre Fischer const cssu::Reference<css::frame::XFrame>& rxFrame, 1868dcb2a10SAndre Fischer SfxBindings* pBindings); 1878dcb2a10SAndre Fischer virtual ~LinePropertyPanel(void); 1888dcb2a10SAndre Fischer 1898dcb2a10SAndre Fischer void SetColor( 1908dcb2a10SAndre Fischer const String& rsColorName, 1918dcb2a10SAndre Fischer const Color aColor); 1928dcb2a10SAndre Fischer 1938dcb2a10SAndre Fischer PopupControl* CreateColorPopupControl (PopupContainer* pParent); 1948dcb2a10SAndre Fischer PopupControl* CreateLineWidthPopupControl (PopupContainer* pParent); 1958dcb2a10SAndre Fischer }; 1968dcb2a10SAndre Fischer 1978dcb2a10SAndre Fischer } } // end of namespace svx::sidebar 1988dcb2a10SAndre Fischer 1998dcb2a10SAndre Fischer #endif 2004e8031e0SArmin Le Grand 2014e8031e0SArmin Le Grand // eof 202