158e893aeSArmin Le Grand /************************************************************** 258e893aeSArmin Le Grand * 358e893aeSArmin Le Grand * Licensed to the Apache Software Foundation (ASF) under one 458e893aeSArmin Le Grand * or more contributor license agreements. See the NOTICE file 558e893aeSArmin Le Grand * distributed with this work for additional information 658e893aeSArmin Le Grand * regarding copyright ownership. The ASF licenses this file 758e893aeSArmin Le Grand * to you under the Apache License, Version 2.0 (the 858e893aeSArmin Le Grand * "License"); you may not use this file except in compliance 958e893aeSArmin Le Grand * with the License. You may obtain a copy of the License at 1058e893aeSArmin Le Grand * 1158e893aeSArmin Le Grand * http://www.apache.org/licenses/LICENSE-2.0 1258e893aeSArmin Le Grand * 1358e893aeSArmin Le Grand * Unless required by applicable law or agreed to in writing, 1458e893aeSArmin Le Grand * software distributed under the License is distributed on an 1558e893aeSArmin Le Grand * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1658e893aeSArmin Le Grand * KIND, either express or implied. See the License for the 1758e893aeSArmin Le Grand * specific language governing permissions and limitations 1858e893aeSArmin Le Grand * under the License. 1958e893aeSArmin Le Grand * 2058e893aeSArmin Le Grand *************************************************************/ 2158e893aeSArmin Le Grand 2258e893aeSArmin Le Grand #ifndef SVX_PROPERTYPANEL_LINEPAGE_HXX 2358e893aeSArmin Le Grand #define SVX_PROPERTYPANEL_LINEPAGE_HXX 2458e893aeSArmin Le Grand 258dcb2a10SAndre Fischer #include <svx/xdash.hxx> 2658e893aeSArmin Le Grand #include <vcl/ctrl.hxx> 2758e893aeSArmin Le Grand #include <sfx2/sidebar/SidebarPanelBase.hxx> 2858e893aeSArmin Le Grand #include <sfx2/sidebar/ControllerItem.hxx> 2958e893aeSArmin Le Grand #include <vcl/fixed.hxx> 3058e893aeSArmin Le Grand #include <vcl/field.hxx> 3158e893aeSArmin Le Grand #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" 3558e893aeSArmin Le Grand 3658e893aeSArmin Le Grand 3758e893aeSArmin Le Grand namespace svx { class ToolboxButtonColorUpdater; } 3858e893aeSArmin Le Grand class SvxLineColorPage; 3958e893aeSArmin Le Grand class SvxLineStylePage; 4058e893aeSArmin Le Grand class SvxLineWidthPage; 4158e893aeSArmin Le Grand class XLineStyleItem; 4258e893aeSArmin Le Grand class XLineDashItem; 4358e893aeSArmin Le Grand class XLineStartItem; 4458e893aeSArmin Le Grand class XLineEndItem; 4558e893aeSArmin Le Grand class XLineEndList; 46*97e8a929SArmin Le Grand class XDashList; 47d5370dc8SArmin Le Grand class ListBox; 488dcb2a10SAndre Fischer class ToolBox; 498dcb2a10SAndre Fischer class FloatingWindow; 508dcb2a10SAndre Fischer 518dcb2a10SAndre Fischer namespace { 528dcb2a10SAndre Fischer #define SIDEBAR_LINE_WIDTH_GLOBAL_VALUE String("PopupPanel_LineWidth", 20, RTL_TEXTENCODING_ASCII_US) 538dcb2a10SAndre Fischer } //end of anonymous namespace 5458e893aeSArmin Le Grand 5558e893aeSArmin Le Grand namespace svx { namespace sidebar { 5658e893aeSArmin Le Grand 578dcb2a10SAndre Fischer class PopupContainer; 588dcb2a10SAndre Fischer class ColorPopup; 598dcb2a10SAndre Fischer class LineWidthControl; 608dcb2a10SAndre Fischer 618dcb2a10SAndre Fischer 6258e893aeSArmin Le Grand class LinePropertyPanel 6358e893aeSArmin Le Grand : public Control, 6458e893aeSArmin Le Grand public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface 6558e893aeSArmin Le Grand { 6658e893aeSArmin Le Grand private: 6735fa8f12SArmin Le Grand friend class ::SvxLineStylePage; 6835fa8f12SArmin Le Grand friend class ::SvxLineWidthPage; 6958e893aeSArmin Le Grand 7058e893aeSArmin Le Grand public: 7158e893aeSArmin Le Grand static LinePropertyPanel* Create( 7258e893aeSArmin Le Grand Window* pParent, 7358e893aeSArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame, 7458e893aeSArmin Le Grand SfxBindings* pBindings); 7558e893aeSArmin Le Grand 7658e893aeSArmin Le Grand virtual void DataChanged( 7758e893aeSArmin Le Grand const DataChangedEvent& rEvent); 7858e893aeSArmin Le Grand 7958e893aeSArmin Le Grand virtual void NotifyItemUpdate( 8058e893aeSArmin Le Grand const sal_uInt16 nSId, 8158e893aeSArmin Le Grand const SfxItemState eState, 8258e893aeSArmin Le Grand const SfxPoolItem* pState); 8358e893aeSArmin Le Grand 8458e893aeSArmin Le Grand SfxBindings* GetBindings(); 8558e893aeSArmin Le Grand 868dcb2a10SAndre Fischer void SetWidth(long nWidth); 878dcb2a10SAndre Fischer void SetWidthIcon(int n); 888dcb2a10SAndre Fischer void SetWidthIcon(); 898dcb2a10SAndre Fischer 908dcb2a10SAndre Fischer void EndLineWidthPopupMode (void); 918dcb2a10SAndre Fischer 9258e893aeSArmin Le Grand private: 9358e893aeSArmin Le Grand //ui controls 9458e893aeSArmin Le Grand ::boost::scoped_ptr< FixedText > mpFTWidth; 958d3cb1a4SArmin Le Grand ::boost::scoped_ptr< Window > mpTBWidthBackground; 9658e893aeSArmin Le Grand ::boost::scoped_ptr< ToolBox > mpTBWidth; 9758e893aeSArmin Le Grand ::boost::scoped_ptr< FixedText > mpFTColor; 988d3cb1a4SArmin Le Grand ::boost::scoped_ptr< Window > mpTBColorBackground; 9958e893aeSArmin Le Grand ::boost::scoped_ptr< ToolBox > mpTBColor; 10058e893aeSArmin Le Grand ::boost::scoped_ptr< FixedText > mpFTStyle; 101*97e8a929SArmin Le Grand ::boost::scoped_ptr< ListBox > mpLBStyle; 10258e893aeSArmin Le Grand ::boost::scoped_ptr< FixedText > mpFTTrancparency; 10358e893aeSArmin Le Grand ::boost::scoped_ptr< MetricField > mpMFTransparent; 10458e893aeSArmin Le Grand ::boost::scoped_ptr< FixedText > mpFTArrow; 105a567bdc8SArmin Le Grand ::boost::scoped_ptr< ListBox > mpLBStart; 106a567bdc8SArmin Le Grand ::boost::scoped_ptr< ListBox > mpLBEnd; 107d5370dc8SArmin Le Grand ::boost::scoped_ptr< FixedText > mpFTEdgeStyle; 108d5370dc8SArmin Le Grand ::boost::scoped_ptr< ListBox > mpLBEdgeStyle; 109d5370dc8SArmin Le Grand ::boost::scoped_ptr< FixedText > mpFTCapStyle; 110d5370dc8SArmin Le Grand ::boost::scoped_ptr< ListBox > mpLBCapStyle; 11158e893aeSArmin Le Grand 11258e893aeSArmin Le Grand //ControllerItem 11358e893aeSArmin Le Grand ::sfx2::sidebar::ControllerItem maStyleControl; 11458e893aeSArmin Le Grand ::sfx2::sidebar::ControllerItem maDashControl; 11558e893aeSArmin Le Grand ::sfx2::sidebar::ControllerItem maWidthControl; 116d5370dc8SArmin Le Grand ::sfx2::sidebar::ControllerItem maColorControl; 11758e893aeSArmin Le Grand ::sfx2::sidebar::ControllerItem maStartControl; 11858e893aeSArmin Le Grand ::sfx2::sidebar::ControllerItem maEndControl; 11958e893aeSArmin Le Grand ::sfx2::sidebar::ControllerItem maLineEndListControl; 120*97e8a929SArmin Le Grand ::sfx2::sidebar::ControllerItem maLineStyleListControl; 121d5370dc8SArmin Le Grand ::sfx2::sidebar::ControllerItem maTransControl; 122d5370dc8SArmin Le Grand ::sfx2::sidebar::ControllerItem maEdgeStyle; 123d5370dc8SArmin Le Grand ::sfx2::sidebar::ControllerItem maCapStyle; 12458e893aeSArmin Le Grand 12558e893aeSArmin Le Grand Color maColor; 12658e893aeSArmin Le Grand ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; 12758e893aeSArmin Le Grand ::boost::scoped_ptr< XLineStyleItem > mpStyleItem; 12858e893aeSArmin Le Grand ::boost::scoped_ptr< XLineDashItem > mpDashItem; 12958e893aeSArmin Le Grand sal_uInt16 mnTrans; 13058e893aeSArmin Le Grand SfxMapUnit meMapUnit; 13158e893aeSArmin Le Grand sal_Int32 mnWidthCoreValue; 13258e893aeSArmin Le Grand XLineEndList* mpLineEndList; 133*97e8a929SArmin Le Grand XDashList* mpLineStyleList; 13458e893aeSArmin Le Grand ::boost::scoped_ptr< XLineStartItem > mpStartItem; 13558e893aeSArmin Le Grand ::boost::scoped_ptr< XLineEndItem > mpEndItem; 13658e893aeSArmin Le Grand 13758e893aeSArmin Le Grand //popup windows 1388dcb2a10SAndre Fischer ColorPopup maColorPopup; 1398dcb2a10SAndre Fischer LineWidthPopup maLineWidthPopup; 14058e893aeSArmin Le Grand 14158e893aeSArmin Le Grand // images from ressource 14258e893aeSArmin Le Grand Image maIMGColor; 14358e893aeSArmin Le Grand Image maIMGNone; 14458e893aeSArmin Le Grand 14558e893aeSArmin Le Grand // multi-images 1468dcb2a10SAndre Fischer ::boost::scoped_array<Image> mpIMGWidthIcon; 1478dcb2a10SAndre Fischer ::boost::scoped_array<Image> mpIMGWidthIconH; //high contrast 14858e893aeSArmin Le Grand 14958e893aeSArmin Le Grand cssu::Reference< css::frame::XFrame > mxFrame; 15058e893aeSArmin Le Grand SfxBindings* mpBindings; 15158e893aeSArmin Le Grand 15258e893aeSArmin Le Grand /// bitfield 15358e893aeSArmin Le Grand bool mbColorAvailable : 1; 15458e893aeSArmin Le Grand bool mbStyleAvailable : 1; 15558e893aeSArmin Le Grand bool mbDashAvailable : 1; 15658e893aeSArmin Le Grand bool mbTransAvailable : 1; 15758e893aeSArmin Le Grand bool mbWidthValuable : 1; 15858e893aeSArmin Le Grand bool mbStartAvailable : 1; 15958e893aeSArmin Le Grand bool mbEndAvailable : 1; 16058e893aeSArmin Le Grand 16158e893aeSArmin Le Grand void SetupIcons(void); 16258e893aeSArmin Le Grand void Initialize(); 16358e893aeSArmin Le Grand void FillLineEndList(); 164*97e8a929SArmin Le Grand void FillLineStyleList(); 16558e893aeSArmin Le Grand void SelectEndStyle(bool bStart); 166*97e8a929SArmin Le Grand void SelectLineStyle(); 16758e893aeSArmin Le Grand 16858e893aeSArmin Le Grand DECL_LINK(ImplPopupModeEndHdl, FloatingWindow* ); 16958e893aeSArmin Le Grand DECL_LINK(ImplWidthPopupModeEndHdl, FloatingWindow* ); 17058e893aeSArmin Le Grand DECL_LINK(ToolboxColorSelectHdl, ToolBox*); 171*97e8a929SArmin Le Grand DECL_LINK(ChangeLineStyleHdl, ToolBox*); 17258e893aeSArmin Le Grand DECL_LINK(ToolboxWidthSelectHdl, ToolBox*); 17358e893aeSArmin Le Grand DECL_LINK(ChangeTransparentHdl , void *); 17458e893aeSArmin Le Grand DECL_LINK(ChangeStartHdl, void *); 17558e893aeSArmin Le Grand DECL_LINK(ChangeEndHdl, void *); 176d5370dc8SArmin Le Grand DECL_LINK(ChangeEdgeStyleHdl, void *); 177d5370dc8SArmin Le Grand DECL_LINK(ChangeCapStyleHdl, void *); 17858e893aeSArmin Le Grand 17958e893aeSArmin Le Grand // constructor/destuctor 18058e893aeSArmin Le Grand LinePropertyPanel( 18158e893aeSArmin Le Grand Window* pParent, 18258e893aeSArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame, 18358e893aeSArmin Le Grand SfxBindings* pBindings); 18458e893aeSArmin Le Grand virtual ~LinePropertyPanel(void); 18558e893aeSArmin Le Grand 1868dcb2a10SAndre Fischer void SetColor( 1878dcb2a10SAndre Fischer const String& rsColorName, 1888dcb2a10SAndre Fischer const Color aColor); 18958e893aeSArmin Le Grand 1908dcb2a10SAndre Fischer PopupControl* CreateColorPopupControl (PopupContainer* pParent); 1918dcb2a10SAndre Fischer PopupControl* CreateLineWidthPopupControl (PopupContainer* pParent); 19258e893aeSArmin Le Grand }; 19358e893aeSArmin Le Grand 1948dcb2a10SAndre Fischer } } // end of namespace svx::sidebar 19558e893aeSArmin Le Grand 1968dcb2a10SAndre Fischer #endif 1974e8031e0SArmin Le Grand 1984e8031e0SArmin Le Grand // eof 199