xref: /AOO41X/main/svx/source/sidebar/line/LinePropertyPanel.hxx (revision 45da7d5eec8bb670617c18931b2b362b2fb77cde)
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 
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 
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
548dcb2a10SAndre Fischer 
558dcb2a10SAndre Fischer namespace svx { namespace sidebar {
568dcb2a10SAndre Fischer 
578dcb2a10SAndre Fischer class PopupContainer;
588dcb2a10SAndre Fischer class ColorPopup;
598dcb2a10SAndre Fischer class LineWidthControl;
608dcb2a10SAndre Fischer 
618dcb2a10SAndre Fischer 
628dcb2a10SAndre Fischer class LinePropertyPanel
638dcb2a10SAndre Fischer :   public Control,
648dcb2a10SAndre Fischer     public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
658dcb2a10SAndre Fischer {
668dcb2a10SAndre Fischer private:
678dcb2a10SAndre Fischer     friend class ::SvxLineStylePage;
688dcb2a10SAndre Fischer     friend class ::SvxLineWidthPage;
698dcb2a10SAndre Fischer 
708dcb2a10SAndre Fischer public:
718dcb2a10SAndre Fischer     static LinePropertyPanel* Create(
728dcb2a10SAndre Fischer         Window* pParent,
738dcb2a10SAndre Fischer         const cssu::Reference<css::frame::XFrame>& rxFrame,
748dcb2a10SAndre Fischer         SfxBindings* pBindings);
758dcb2a10SAndre Fischer 
768dcb2a10SAndre Fischer     virtual void DataChanged(
778dcb2a10SAndre Fischer         const DataChangedEvent& rEvent);
788dcb2a10SAndre Fischer 
798dcb2a10SAndre Fischer     virtual void NotifyItemUpdate(
808dcb2a10SAndre Fischer         const sal_uInt16 nSId,
818dcb2a10SAndre Fischer         const SfxItemState eState,
82*45da7d5eSAndre Fischer         const SfxPoolItem* pState,
83*45da7d5eSAndre Fischer         const bool bIsEnabled);
848dcb2a10SAndre Fischer 
858dcb2a10SAndre Fischer     SfxBindings* GetBindings();
868dcb2a10SAndre Fischer 
878dcb2a10SAndre Fischer     void SetWidth(long nWidth);
888dcb2a10SAndre Fischer     void SetWidthIcon(int n);
898dcb2a10SAndre Fischer     void SetWidthIcon();
908dcb2a10SAndre Fischer 
918dcb2a10SAndre Fischer     void EndLineWidthPopupMode (void);
928dcb2a10SAndre Fischer 
938dcb2a10SAndre Fischer private:
948dcb2a10SAndre Fischer     //ui controls
958dcb2a10SAndre Fischer     ::boost::scoped_ptr< FixedText >                        mpFTWidth;
968dcb2a10SAndre Fischer     ::boost::scoped_ptr< Window >                           mpTBWidthBackground;
978dcb2a10SAndre Fischer     ::boost::scoped_ptr< ToolBox >                          mpTBWidth;
988dcb2a10SAndre Fischer     ::boost::scoped_ptr< FixedText >                        mpFTColor;
998dcb2a10SAndre Fischer     ::boost::scoped_ptr< Window >                           mpTBColorBackground;
1008dcb2a10SAndre Fischer     ::boost::scoped_ptr< ToolBox >                          mpTBColor;
1018dcb2a10SAndre Fischer     ::boost::scoped_ptr< FixedText >                        mpFTStyle;
10297e8a929SArmin Le Grand     ::boost::scoped_ptr< ListBox >                          mpLBStyle;
1038dcb2a10SAndre Fischer     ::boost::scoped_ptr< FixedText >                        mpFTTrancparency;
1048dcb2a10SAndre Fischer     ::boost::scoped_ptr< MetricField >                      mpMFTransparent;
1058dcb2a10SAndre Fischer     ::boost::scoped_ptr< FixedText >                        mpFTArrow;
106a567bdc8SArmin Le Grand     ::boost::scoped_ptr< ListBox >                          mpLBStart;
107a567bdc8SArmin Le Grand     ::boost::scoped_ptr< ListBox >                          mpLBEnd;
1088dcb2a10SAndre Fischer     ::boost::scoped_ptr< FixedText >                        mpFTEdgeStyle;
1098dcb2a10SAndre Fischer     ::boost::scoped_ptr< ListBox >                          mpLBEdgeStyle;
1108dcb2a10SAndre Fischer     ::boost::scoped_ptr< FixedText >                        mpFTCapStyle;
1118dcb2a10SAndre Fischer     ::boost::scoped_ptr< ListBox >                          mpLBCapStyle;
1128dcb2a10SAndre Fischer 
1138dcb2a10SAndre Fischer     //ControllerItem
1148dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                         maStyleControl;
1158dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                         maDashControl;
1168dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                         maWidthControl;
1178dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                         maColorControl;
1188dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                         maStartControl;
1198dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                         maEndControl;
1208dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                         maLineEndListControl;
12197e8a929SArmin Le Grand     ::sfx2::sidebar::ControllerItem                         maLineStyleListControl;
1228dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                         maTransControl;
1238dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                         maEdgeStyle;
1248dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                         maCapStyle;
1258dcb2a10SAndre Fischer 
1268dcb2a10SAndre Fischer     Color                                                   maColor;
1278dcb2a10SAndre Fischer     ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater;
1288dcb2a10SAndre Fischer     ::boost::scoped_ptr< XLineStyleItem >                   mpStyleItem;
1298dcb2a10SAndre Fischer     ::boost::scoped_ptr< XLineDashItem >                    mpDashItem;
1308dcb2a10SAndre Fischer     sal_uInt16                                              mnTrans;
1318dcb2a10SAndre Fischer     SfxMapUnit                                              meMapUnit;
1328dcb2a10SAndre Fischer     sal_Int32                                               mnWidthCoreValue;
1338dcb2a10SAndre Fischer     XLineEndList*                                           mpLineEndList;
13497e8a929SArmin Le Grand     XDashList*                                              mpLineStyleList;
1358dcb2a10SAndre Fischer     ::boost::scoped_ptr< XLineStartItem >                   mpStartItem;
1368dcb2a10SAndre Fischer     ::boost::scoped_ptr< XLineEndItem >                     mpEndItem;
1378dcb2a10SAndre Fischer 
1388dcb2a10SAndre Fischer     //popup windows
1398dcb2a10SAndre Fischer     ColorPopup maColorPopup;
1408dcb2a10SAndre Fischer     LineWidthPopup maLineWidthPopup;
1418dcb2a10SAndre Fischer 
1428dcb2a10SAndre Fischer     // images from ressource
1438dcb2a10SAndre Fischer     Image                                                   maIMGColor;
1448dcb2a10SAndre Fischer     Image                                                   maIMGNone;
1458dcb2a10SAndre Fischer 
1468dcb2a10SAndre Fischer     // multi-images
1478dcb2a10SAndre Fischer     ::boost::scoped_array<Image>                            mpIMGWidthIcon;
1488dcb2a10SAndre Fischer     ::boost::scoped_array<Image>                            mpIMGWidthIconH;	//high contrast
1498dcb2a10SAndre Fischer 
1508dcb2a10SAndre Fischer     cssu::Reference< css::frame::XFrame >                   mxFrame;
1518dcb2a10SAndre Fischer     SfxBindings*                                            mpBindings;
1528dcb2a10SAndre Fischer 
1538dcb2a10SAndre Fischer     /// bitfield
1548dcb2a10SAndre Fischer 	bool				mbColorAvailable : 1;
1558dcb2a10SAndre Fischer 	bool				mbStyleAvailable : 1;
1568dcb2a10SAndre Fischer 	bool				mbDashAvailable : 1;
1578dcb2a10SAndre Fischer 	bool				mbTransAvailable : 1;
1588dcb2a10SAndre Fischer 	bool				mbWidthValuable : 1;
1598dcb2a10SAndre Fischer 	bool				mbStartAvailable : 1;
1608dcb2a10SAndre Fischer 	bool				mbEndAvailable : 1;
1618dcb2a10SAndre Fischer 
1628dcb2a10SAndre Fischer     void SetupIcons(void);
1638dcb2a10SAndre Fischer 	void Initialize();
1648dcb2a10SAndre Fischer 	void FillLineEndList();
16597e8a929SArmin Le Grand 	void FillLineStyleList();
1668dcb2a10SAndre Fischer 	void SelectEndStyle(bool bStart);
16797e8a929SArmin Le Grand 	void SelectLineStyle();
1688dcb2a10SAndre Fischer 
1698dcb2a10SAndre Fischer 	DECL_LINK(ImplPopupModeEndHdl, FloatingWindow* );
1708dcb2a10SAndre Fischer 	DECL_LINK(ImplWidthPopupModeEndHdl, FloatingWindow* );
1718dcb2a10SAndre Fischer 	DECL_LINK(ToolboxColorSelectHdl, ToolBox*);
17297e8a929SArmin Le Grand 	DECL_LINK(ChangeLineStyleHdl, ToolBox*);
1738dcb2a10SAndre Fischer 	DECL_LINK(ToolboxWidthSelectHdl, ToolBox*);
1748dcb2a10SAndre Fischer 	DECL_LINK(ChangeTransparentHdl , void *);
1758dcb2a10SAndre Fischer 	DECL_LINK(ChangeStartHdl, void *);
1768dcb2a10SAndre Fischer 	DECL_LINK(ChangeEndHdl, void *);
1778dcb2a10SAndre Fischer 	DECL_LINK(ChangeEdgeStyleHdl, void *);
1788dcb2a10SAndre Fischer 	DECL_LINK(ChangeCapStyleHdl, void *);
1798dcb2a10SAndre Fischer 
1808dcb2a10SAndre Fischer     // constructor/destuctor
1818dcb2a10SAndre Fischer     LinePropertyPanel(
1828dcb2a10SAndre Fischer         Window* pParent,
1838dcb2a10SAndre Fischer         const cssu::Reference<css::frame::XFrame>& rxFrame,
1848dcb2a10SAndre Fischer         SfxBindings* pBindings);
1858dcb2a10SAndre Fischer     virtual ~LinePropertyPanel(void);
1868dcb2a10SAndre Fischer 
1878dcb2a10SAndre Fischer     void SetColor(
1888dcb2a10SAndre Fischer         const String& rsColorName,
1898dcb2a10SAndre Fischer         const Color aColor);
1908dcb2a10SAndre Fischer 
1918dcb2a10SAndre Fischer     PopupControl* CreateColorPopupControl (PopupContainer* pParent);
1928dcb2a10SAndre Fischer     PopupControl* CreateLineWidthPopupControl (PopupContainer* pParent);
1938dcb2a10SAndre Fischer };
1948dcb2a10SAndre Fischer 
1958dcb2a10SAndre Fischer } } // end of namespace svx::sidebar
1968dcb2a10SAndre Fischer 
1978dcb2a10SAndre Fischer #endif
1984e8031e0SArmin Le Grand 
1994e8031e0SArmin Le Grand // eof
200