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