xref: /trunk/main/svx/inc/svx/itemwin.hxx (revision 3334a7e6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SVX_ITEMWIN_HXX
24 #define _SVX_ITEMWIN_HXX
25 
26 #include <vcl/bitmap.hxx>
27 
28 #include <svx/dlgctrl.hxx>
29 #include "svx/svxdllapi.h"
30 
31 // forward ---------------------------------------------------------------
32 
33 class XLineColorItem;
34 class XLineWidthItem;
35 class SfxObjectShell;
36 
37 // class SvxLineBox ------------------------------------------------------
38 
39 class SvxLineBox : public LineLB
40 {
41 	BmpColorMode	meBmpMode;
42 	sal_uInt16			nCurPos;
43 	Timer			aDelayTimer;
44     Size            aLogicalSize;
45     sal_Bool            bRelease;
46 	SfxObjectShell* mpSh;
47     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
48 
49 #ifdef _SVX_ITEMWIN_CXX
50 					DECL_LINK( DelayHdl_Impl, Timer * );
51 
52 	void			ReleaseFocus_Impl();
53 #endif
54 public:
55 	SvxLineBox( Window* pParent,
56                 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
57 				WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
58 	~SvxLineBox();
59 
60 	void FillControl();
61 
62 protected:
63 	virtual void 	Select();
64 	virtual long	PreNotify( NotifyEvent& rNEvt );
65 	virtual long	Notify( NotifyEvent& rNEvt );
66     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
67 
68 };
69 
70 // class SvxColorBox -----------------------------------------------------
71 
72 class SvxColorBox : public ColorLB
73 {
74 	using Window::Update;
75 
76 	sal_uInt16			nCurPos;
77 	sal_uInt16			nId;
78 	Timer			aDelayTimer;
79     Size            aLogicalSize;
80     sal_Bool            bRelease;
81     ::rtl::OUString maCommand;
82     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
83 
84 #ifdef _SVX_ITEMWIN_CXX
85 					DECL_LINK( DelayHdl_Impl, Timer * );
86 
87 	void			ReleaseFocus_Impl();
88 #endif
89 
90 public:
91 	SvxColorBox( Window* pParent,
92                  const rtl::OUString& rCommand,
93                  const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
94 				 WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
95 	~SvxColorBox();
96 
97 	void			Update( const XLineColorItem* pItem );
98 
99 protected:
100 	virtual void 	Select();
101 	virtual long	PreNotify( NotifyEvent& rNEvt );
102 	virtual long	Notify( NotifyEvent& rNEvt );
103     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
104 
105 };
106 
107 // class SvxMetricField --------------------------------------------------
108 
109 class SVX_DLLPUBLIC SvxMetricField : public MetricField
110 {
111 	using Window::Update;
112 
113 	String			aCurTxt;
114 	SfxMapUnit		ePoolUnit;
115 	FieldUnit		eDlgUnit;
116     Size            aLogicalSize;
117     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
118 
119 #ifdef _SVX_ITEMWIN_CXX
120 	void			ReleaseFocus_Impl();
121 #endif
122 
123 protected:
124 	virtual void 	Modify();
125 	virtual void    Down();
126 	virtual void    Up();		// Nur zur Sicherheit
127 
128 	virtual long	PreNotify( NotifyEvent& rNEvt );
129 	virtual long	Notify( NotifyEvent& rNEvt );
130     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
131 
132 public:
133 	SvxMetricField( Window* pParent,
134                     const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
135 					WinBits nBits = WB_BORDER | WB_SPIN | WB_REPEAT );
136 	~SvxMetricField();
137 
138 	void			Update( const XLineWidthItem* pItem );
139 	void			SetCoreUnit( SfxMapUnit eUnit );
140 	void			RefreshDlgUnit();
141 };
142 
143 // class SvxFillTypeBox --------------------------------------------------
144 
145 class SvxFillTypeBox : public FillTypeLB
146 {
147 public:
148 	SvxFillTypeBox( Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
149 	~SvxFillTypeBox();
150 
Selected()151 	void			Selected() { bSelect = sal_True; }
IsRelease()152     sal_Bool            IsRelease() { return bRelease;}
153 
154 protected:
155 	virtual long	PreNotify( NotifyEvent& rNEvt );
156 	virtual long	Notify( NotifyEvent& rNEvt );
157 
158 private:
159 	sal_uInt16			nCurPos;
160 	sal_Bool			bSelect;
161     sal_Bool            bRelease;
162 
163 #ifdef _SVX_ITEMWIN_CXX
164 	void			ReleaseFocus_Impl();
165 #endif
166 };
167 
168 // class SvxFillAttrBox --------------------------------------------------
169 
170 class SvxFillAttrBox : public FillAttrLB
171 {
172 public:
173 	SvxFillAttrBox( Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
174 	~SvxFillAttrBox();
175 
IsRelease()176     sal_Bool            IsRelease() { return bRelease;}
177 
178 protected:
179 	virtual long	PreNotify( NotifyEvent& rNEvt );
180 	virtual long	Notify( NotifyEvent& rNEvt );
181 	virtual void	Select();
182 
183 private:
184 	sal_uInt16			nCurPos;
185     sal_Bool            bRelease;
186 
187 #ifdef _SVX_ITEMWIN_CXX
188 	void			ReleaseFocus_Impl();
189 #endif
190 };
191 
192 #endif // #ifndef _SVX_ITEMWIN_HXX
193 
194