Update ooo320-m1
[ooovba.git] / svx / inc / linectrl.hxx
blobe3d3a5dfbb1c7994d9c5f911c12b6a34ff4f77a5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: linectrl.hxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_LINECTRL_HXX
31 #define _SVX_LINECTRL_HXX
34 #include <svtools/valueset.hxx>
35 #include <svtools/lstner.hxx>
36 #include <sfx2/tbxctrl.hxx>
37 #include "svx/svxdllapi.h"
39 class XLineStyleItem;
40 class XLineDashItem;
41 class SvxLineBox;
42 class SvxMetricField;
43 class SvxColorBox;
44 class XLineEndList;
46 //========================================================================
47 // SvxLineStyleController:
48 //========================================================================
50 class SVX_DLLPUBLIC SvxLineStyleToolBoxControl : public SfxToolBoxControl
52 private:
53 XLineStyleItem* pStyleItem;
54 XLineDashItem* pDashItem;
56 BOOL bUpdate;
58 public:
59 SFX_DECL_TOOLBOX_CONTROL();
61 SvxLineStyleToolBoxControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
62 ~SvxLineStyleToolBoxControl();
64 virtual void StateChanged( USHORT nSID, SfxItemState eState,
65 const SfxPoolItem* pState );
66 void Update( const SfxPoolItem* pState );
67 virtual Window* CreateItemWindow( Window *pParent );
70 //========================================================================
71 // SvxLineWidthController:
72 //========================================================================
74 class SVX_DLLPUBLIC SvxLineWidthToolBoxControl : public SfxToolBoxControl
76 public:
77 SFX_DECL_TOOLBOX_CONTROL();
79 SvxLineWidthToolBoxControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
80 ~SvxLineWidthToolBoxControl();
82 virtual void StateChanged( USHORT nSID, SfxItemState eState,
83 const SfxPoolItem* pState );
84 virtual Window* CreateItemWindow( Window *pParent );
87 //========================================================================
88 // SvxLineColorController:
89 //========================================================================
91 class SVX_DLLPUBLIC SvxLineColorToolBoxControl : public SfxToolBoxControl
93 public:
94 SFX_DECL_TOOLBOX_CONTROL();
96 SvxLineColorToolBoxControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
97 ~SvxLineColorToolBoxControl();
99 virtual void StateChanged( USHORT nSID, SfxItemState eState,
100 const SfxPoolItem* pState );
101 void Update( const SfxPoolItem* pState );
102 virtual Window* CreateItemWindow( Window *pParent );
105 //========================================================================
106 // class SvxLineEndWindow
107 //========================================================================
108 class SvxLineEndWindow : public SfxPopupWindow
110 using FloatingWindow::StateChanged;
112 private:
113 XLineEndList* pLineEndList;
114 ValueSet aLineEndSet;
115 USHORT nCols;
116 USHORT nLines;
117 ULONG nLineEndWidth;
118 Size aBmpSize;
119 BOOL bPopupMode;
120 bool mbInResize;
121 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
124 DECL_LINK( SelectHdl, void * );
125 void FillValueSet();
126 void SetSize();
127 void implInit();
129 protected:
130 virtual void Resizing( Size& rSize );
131 virtual void Resize();
132 virtual BOOL Close();
133 virtual void PopupModeEnd();
135 /** This function is called when the window gets the focus. It grabs
136 the focus to the line ends value set so that it can be controlled with
137 the keyboard.
139 virtual void GetFocus (void);
141 public:
142 SvxLineEndWindow( USHORT nId,
143 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
144 const String& rWndTitle );
145 SvxLineEndWindow( USHORT nId,
146 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
147 Window* pParentWindow,
148 const String& rWndTitle );
149 ~SvxLineEndWindow();
151 void StartSelection();
153 virtual void StateChanged( USHORT nSID, SfxItemState eState,
154 const SfxPoolItem* pState );
155 virtual SfxPopupWindow* Clone() const;
158 //========================================================================
159 // class SvxColorToolBoxControl
160 //========================================================================
162 class SVX_DLLPUBLIC SvxLineEndToolBoxControl : public SfxToolBoxControl
164 public:
165 SFX_DECL_TOOLBOX_CONTROL();
166 SvxLineEndToolBoxControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
167 ~SvxLineEndToolBoxControl();
169 virtual void StateChanged( USHORT nSID, SfxItemState eState,
170 const SfxPoolItem* pState );
171 virtual SfxPopupWindowType GetPopupWindowType() const;
172 virtual SfxPopupWindow* CreatePopupWindow();
177 #endif