xref: /aoo41x/main/vcl/inc/ilstbox.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _SV_ILSTBOX_HXX
29*cdf0e10cSrcweir #define _SV_ILSTBOX_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <vcl/sv.h>
32*cdf0e10cSrcweir #include <vcl/image.hxx>
33*cdf0e10cSrcweir #include <vcl/ctrl.hxx>
34*cdf0e10cSrcweir #include <vcl/button.hxx>
35*cdf0e10cSrcweir #include <vcl/floatwin.hxx>
36*cdf0e10cSrcweir #include <vcl/lstbox.h>
37*cdf0e10cSrcweir #include <vcl/timer.hxx>
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir #include "vcl/quickselectionengine.hxx"
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir class ScrollBar;
42*cdf0e10cSrcweir class ScrollBarBox;
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir // -----------------
45*cdf0e10cSrcweir // - ListBox-Types -
46*cdf0e10cSrcweir // -----------------
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir #define HORZ_SCROLL 		4
49*cdf0e10cSrcweir #define IMG_TXT_DISTANCE	6
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir enum LB_EVENT_TYPE
52*cdf0e10cSrcweir {
53*cdf0e10cSrcweir 	LET_MBDOWN,
54*cdf0e10cSrcweir 	LET_TRACKING,
55*cdf0e10cSrcweir 	LET_TRACKING_END,
56*cdf0e10cSrcweir 	LET_KEYMOVE,
57*cdf0e10cSrcweir 	LET_KEYSPACE
58*cdf0e10cSrcweir };
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir // -----------------
61*cdf0e10cSrcweir // - ImplEntryType -
62*cdf0e10cSrcweir // -----------------
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir struct ImplEntryType
65*cdf0e10cSrcweir {
66*cdf0e10cSrcweir 	XubString	maStr;
67*cdf0e10cSrcweir 	Image		maImage;
68*cdf0e10cSrcweir 	void*		mpUserData;
69*cdf0e10cSrcweir 	sal_Bool		mbIsSelected;
70*cdf0e10cSrcweir 	long		mnFlags;
71*cdf0e10cSrcweir     long        mnHeight;
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir 				ImplEntryType( const XubString& rStr, const Image& rImage ) :
74*cdf0e10cSrcweir 					maStr( rStr ),
75*cdf0e10cSrcweir 					maImage( rImage ),
76*cdf0e10cSrcweir 					mnFlags( 0 ),
77*cdf0e10cSrcweir                     mnHeight( 0 )
78*cdf0e10cSrcweir 				{
79*cdf0e10cSrcweir 					mbIsSelected = sal_False;
80*cdf0e10cSrcweir 					mpUserData = NULL;
81*cdf0e10cSrcweir 				}
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir 				ImplEntryType( const XubString& rStr ) :
84*cdf0e10cSrcweir 					maStr( rStr ),
85*cdf0e10cSrcweir 					mnFlags( 0 ),
86*cdf0e10cSrcweir                     mnHeight( 0 )
87*cdf0e10cSrcweir 				{
88*cdf0e10cSrcweir 					mbIsSelected = sal_False;
89*cdf0e10cSrcweir 					mpUserData = NULL;
90*cdf0e10cSrcweir 				}
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir 				ImplEntryType( const Image& rImage ) :
93*cdf0e10cSrcweir 					maImage( rImage ),
94*cdf0e10cSrcweir 					mnFlags( 0 ),
95*cdf0e10cSrcweir                     mnHeight( 0 )
96*cdf0e10cSrcweir 				{
97*cdf0e10cSrcweir 					mbIsSelected = sal_False;
98*cdf0e10cSrcweir 					mpUserData = NULL;
99*cdf0e10cSrcweir 				}
100*cdf0e10cSrcweir };
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir // -----------------
103*cdf0e10cSrcweir // - ImplEntryList -
104*cdf0e10cSrcweir // -----------------
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir class ImplEntryList : private List
107*cdf0e10cSrcweir {
108*cdf0e10cSrcweir private:
109*cdf0e10cSrcweir     Window*         mpWindow;   // For getting the current locale when matching strings
110*cdf0e10cSrcweir 	sal_uInt16			mnLastSelected;
111*cdf0e10cSrcweir 	sal_uInt16			mnSelectionAnchor;
112*cdf0e10cSrcweir 	sal_uInt16			mnImages;
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir 	sal_uInt16			mnMRUCount;
115*cdf0e10cSrcweir 	sal_uInt16			mnMaxMRUCount;
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir 	Link			maSelectionChangedHdl;
118*cdf0e10cSrcweir 	sal_Bool			mbCallSelectionChangedHdl;
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 	ImplEntryType*	GetEntry( sal_uInt16 nPos )	const { return (ImplEntryType*)List::GetObject( nPos ); }
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir public:
123*cdf0e10cSrcweir 					ImplEntryList( Window* pWindow );
124*cdf0e10cSrcweir 					~ImplEntryList();
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir 	sal_uInt16					InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry, sal_Bool bSort );
127*cdf0e10cSrcweir 	void					RemoveEntry( sal_uInt16 nPos );
128*cdf0e10cSrcweir 	const ImplEntryType* 	GetEntryPtr( sal_uInt16 nPos ) const { return (const ImplEntryType*) GetObject( nPos ); }
129*cdf0e10cSrcweir 	ImplEntryType* 	        GetMutableEntryPtr( sal_uInt16 nPos ) const { return (ImplEntryType*) GetObject( nPos ); }
130*cdf0e10cSrcweir 	void					Clear();
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir 	sal_uInt16			FindMatchingEntry( const XubString& rStr, sal_uInt16 nStart = 0, sal_Bool bForward = sal_True, sal_Bool bLazy = sal_True ) const;
133*cdf0e10cSrcweir 	sal_uInt16			FindEntry( const XubString& rStr, sal_Bool bSearchMRUArea = sal_False ) const;
134*cdf0e10cSrcweir 	sal_uInt16			FindEntry( const void* pData ) const;
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir     // helper: add up heights up to index nEndIndex.
137*cdf0e10cSrcweir     // GetAddedHeight( 0 ) returns 0
138*cdf0e10cSrcweir     // GetAddedHeight( LISTBOX_ENTRY_NOTFOUND ) returns 0
139*cdf0e10cSrcweir     // GetAddedHeight( i, k ) with k > i is equivalent -GetAddedHeight( k, i )
140*cdf0e10cSrcweir     long            GetAddedHeight( sal_uInt16 nEndIndex, sal_uInt16 nBeginIndex = 0, long nBeginHeight = 0 ) const;
141*cdf0e10cSrcweir     long            GetEntryHeight( sal_uInt16 nPos ) const;
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir 	sal_uInt16			GetEntryCount() const { return (sal_uInt16)List::Count(); }
144*cdf0e10cSrcweir 	sal_Bool			HasImages() const { return mnImages ? sal_True : sal_False; }
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir 	XubString		GetEntryText( sal_uInt16 nPos ) const;
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir 	sal_Bool			HasEntryImage( sal_uInt16 nPos ) const;
149*cdf0e10cSrcweir 	Image			GetEntryImage( sal_uInt16 nPos ) const;
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir 	void			SetEntryData( sal_uInt16 nPos, void* pNewData );
152*cdf0e10cSrcweir 	void*			GetEntryData( sal_uInt16 nPos ) const;
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir 	void			SetEntryFlags( sal_uInt16 nPos, long nFlags );
155*cdf0e10cSrcweir 	long			GetEntryFlags( sal_uInt16 nPos ) const;
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir 	void			SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir 	sal_uInt16			GetSelectEntryCount() const;
160*cdf0e10cSrcweir 	XubString		GetSelectEntry( sal_uInt16 nIndex ) const;
161*cdf0e10cSrcweir 	sal_uInt16			GetSelectEntryPos( sal_uInt16 nIndex ) const;
162*cdf0e10cSrcweir 	sal_Bool			IsEntrySelected( const XubString& rStr ) const;
163*cdf0e10cSrcweir 	sal_Bool			IsEntryPosSelected( sal_uInt16 nIndex ) const;
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir 	void			SetLastSelected( sal_uInt16 nPos )	{ mnLastSelected = nPos; }
166*cdf0e10cSrcweir 	sal_uInt16			GetLastSelected() const { return mnLastSelected; }
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir 	void			SetSelectionAnchor( sal_uInt16 nPos )	{ mnSelectionAnchor = nPos; }
169*cdf0e10cSrcweir 	sal_uInt16			GetSelectionAnchor() const { return mnSelectionAnchor; }
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir 	void			SetSelectionChangedHdl( const Link& rLnk )	{ maSelectionChangedHdl = rLnk; }
173*cdf0e10cSrcweir 	void			SetCallSelectionChangedHdl( sal_Bool bCall )	{ mbCallSelectionChangedHdl = bCall; }
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir 	void			SetMRUCount( sal_uInt16 n )	{ mnMRUCount = n; }
176*cdf0e10cSrcweir 	sal_uInt16			GetMRUCount() const		{ return mnMRUCount; }
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir 	void			SetMaxMRUCount( sal_uInt16 n )	{ mnMaxMRUCount = n; }
179*cdf0e10cSrcweir 	sal_uInt16			GetMaxMRUCount() const		{ return mnMaxMRUCount; }
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir 	/**	An Entry is selectable if its mnFlags does not have the
182*cdf0e10cSrcweir 		LISTBOX_ENTRY_FLAG_DISABLE_SELECTION flag set. */
183*cdf0e10cSrcweir 	bool			IsEntrySelectable( sal_uInt16 nPos ) const;
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir 	/** returns the first entry found from the given position nPos that is selectable
186*cdf0e10cSrcweir 		or LISTBOX_ENTRY_NOTFOUND if non is found. If the entry at nPos is not selectable,
187*cdf0e10cSrcweir 		it returns the first selectable entry after nPos if bForward is true and the
188*cdf0e10cSrcweir 		first selectable entry after nPos is bForward is false.
189*cdf0e10cSrcweir 		*/
190*cdf0e10cSrcweir 	sal_uInt16			FindFirstSelectable( sal_uInt16 nPos, bool bForward = true );
191*cdf0e10cSrcweir };
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir // ---------------------
194*cdf0e10cSrcweir // - ImplListBoxWindow -
195*cdf0e10cSrcweir // ---------------------
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir class ImplListBoxWindow : public Control, public ::vcl::ISearchableStringList
198*cdf0e10cSrcweir {
199*cdf0e10cSrcweir private:
200*cdf0e10cSrcweir 	ImplEntryList*	mpEntryList;	 // EntryListe
201*cdf0e10cSrcweir 	Rectangle		maFocusRect;
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir 	Size			maUserItemSize;
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir 	long			mnMaxTxtHeight;  // Maximale Hoehe eines Text-Items
206*cdf0e10cSrcweir 	long			mnMaxTxtWidth;	 // Maximale Breite eines Text-Items
207*cdf0e10cSrcweir 									 // Entry ohne Image
208*cdf0e10cSrcweir 	long			mnMaxImgTxtWidth;// Maximale Breite eines Text-Items
209*cdf0e10cSrcweir 									 // Entry UND Image
210*cdf0e10cSrcweir 	long			mnMaxImgWidth;	 // Maximale Breite eines Image-Items
211*cdf0e10cSrcweir 	long			mnMaxImgHeight;  // Maximale Hoehe eines Image-Items
212*cdf0e10cSrcweir 	long			mnMaxWidth; 	 // Maximale Breite eines Eintrags
213*cdf0e10cSrcweir 	long			mnMaxHeight;	 // Maximale Hoehe eines Eintrags
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir 	sal_uInt16			mnCurrentPos;	 // Position (Focus)
216*cdf0e10cSrcweir 	sal_uInt16			mnTrackingSaveSelection; // Selektion vor Tracking();
217*cdf0e10cSrcweir 
218*cdf0e10cSrcweir 	sal_uInt16			mnSeparatorPos;	// Separator
219*cdf0e10cSrcweir 
220*cdf0e10cSrcweir 	sal_uInt16			mnUserDrawEntry;
221*cdf0e10cSrcweir 
222*cdf0e10cSrcweir 	sal_uInt16			mnTop;			 // Ausgabe ab Zeile
223*cdf0e10cSrcweir 	long			mnLeft; 		 // Ausgabe ab Spalte
224*cdf0e10cSrcweir 	long			mnBorder;		 // Abstand Rahmen - Text
225*cdf0e10cSrcweir 	long			mnTextHeight;	 // Texthoehe
226*cdf0e10cSrcweir 	ProminentEntry  meProminentType; // where is the "prominent" entry
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir 	sal_uInt16			mnSelectModifier;	// Modifiers
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir     sal_Bool			mbHasFocusRect:         1,
231*cdf0e10cSrcweir                     mbSort: 				1,	// ListBox sortiert
232*cdf0e10cSrcweir 					mbTrack:				1,	// Tracking
233*cdf0e10cSrcweir 					mbMulti:				1,	// MultiListBox
234*cdf0e10cSrcweir 					mbStackMode:			1,	// StackSelection
235*cdf0e10cSrcweir 					mbSimpleMode:			1,	// SimpleMode fuer MultiListBox
236*cdf0e10cSrcweir 					mbImgsDiffSz:			1,	// Images haben verschiedene Groessen
237*cdf0e10cSrcweir 					mbTravelSelect: 		1,	// TravelSelect
238*cdf0e10cSrcweir 					mbTrackingSelect: 		1,	// Selektiert bei MouseMove
239*cdf0e10cSrcweir 					mbSelectionChanged:		1,	// Select() nicht zu oft rufen...
240*cdf0e10cSrcweir 					mbMouseMoveSelect:		1,  // Selektieren bei MouseMove
241*cdf0e10cSrcweir 					mbGrabFocus:			1,  // Focus bei MBDown grabben
242*cdf0e10cSrcweir 					mbUserDrawEnabled:		1,	// UserDraw possible
243*cdf0e10cSrcweir 					mbInUserDraw:			1,	// In UserDraw
244*cdf0e10cSrcweir 					mbReadOnly:				1,	// ReadOnly
245*cdf0e10cSrcweir 					mbMirroring:			1,	// pb: #106948# explicit mirroring for calc
246*cdf0e10cSrcweir                     mbRight:                1,  // right align Text output
247*cdf0e10cSrcweir                     mbCenter:               1;  // center Text output
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir 	Link			maScrollHdl;
250*cdf0e10cSrcweir 	Link			maSelectHdl;
251*cdf0e10cSrcweir 	Link			maCancelHdl;
252*cdf0e10cSrcweir 	Link			maDoubleClickHdl;
253*cdf0e10cSrcweir 	Link			maUserDrawHdl;
254*cdf0e10cSrcweir 	Link			maMRUChangedHdl;
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir     ::vcl::QuickSelectionEngine
257*cdf0e10cSrcweir                     maQuickSelectionEngine;
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir protected:
260*cdf0e10cSrcweir 	virtual void	KeyInput( const KeyEvent& rKEvt );
261*cdf0e10cSrcweir 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
262*cdf0e10cSrcweir 	virtual void	MouseMove( const MouseEvent& rMEvt );
263*cdf0e10cSrcweir 	virtual void	Tracking( const TrackingEvent& rTEvt );
264*cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& rRect );
265*cdf0e10cSrcweir 	virtual void	Resize();
266*cdf0e10cSrcweir 	virtual void	GetFocus();
267*cdf0e10cSrcweir 	virtual void	LoseFocus();
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir 	sal_Bool			SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False );
270*cdf0e10cSrcweir 	void			ImplPaint( sal_uInt16 nPos, sal_Bool bErase = sal_False, bool bLayout = false );
271*cdf0e10cSrcweir     void			ImplDoPaint( const Rectangle& rRect, bool bLayout = false );
272*cdf0e10cSrcweir 	void			ImplCalcMetrics();
273*cdf0e10cSrcweir 	void			ImplUpdateEntryMetrics( ImplEntryType& rEntry );
274*cdf0e10cSrcweir 	void			ImplCallSelect();
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir     void            ImplShowFocusRect();
277*cdf0e10cSrcweir     void            ImplHideFocusRect();
278*cdf0e10cSrcweir 
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir 	virtual void	StateChanged( StateChangedType nType );
281*cdf0e10cSrcweir 	virtual void	DataChanged( const DataChangedEvent& rDCEvt );
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir public:
284*cdf0e10cSrcweir     virtual void  FillLayoutData() const;
285*cdf0e10cSrcweir 
286*cdf0e10cSrcweir 					ImplListBoxWindow( Window* pParent, WinBits nWinStyle );
287*cdf0e10cSrcweir 					~ImplListBoxWindow();
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir 	ImplEntryList*	GetEntryList() const { return mpEntryList; }
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir 	sal_uInt16			InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry );
292*cdf0e10cSrcweir 	void			RemoveEntry( sal_uInt16 nPos );
293*cdf0e10cSrcweir 	void			Clear();
294*cdf0e10cSrcweir 	void			ResetCurrentPos()				{ mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; }
295*cdf0e10cSrcweir 	sal_uInt16			GetCurrentPos()	const			{ return mnCurrentPos; }
296*cdf0e10cSrcweir     sal_uInt16			GetDisplayLineCount() const;
297*cdf0e10cSrcweir     void            SetEntryFlags( sal_uInt16 nPos, long nFlags );
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir 	void 			DrawEntry( sal_uInt16 nPos, sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False, bool bLayout = false );
300*cdf0e10cSrcweir 
301*cdf0e10cSrcweir 	void			SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
302*cdf0e10cSrcweir 	void			DeselectAll();
303*cdf0e10cSrcweir     sal_uInt16			GetEntryPosForPoint( const Point& rPoint ) const;
304*cdf0e10cSrcweir     sal_uInt16          GetLastVisibleEntry() const;
305*cdf0e10cSrcweir 
306*cdf0e10cSrcweir 	sal_Bool			ProcessKeyInput( const KeyEvent& rKEvt );
307*cdf0e10cSrcweir 
308*cdf0e10cSrcweir 	void			SetTopEntry( sal_uInt16 nTop );
309*cdf0e10cSrcweir 	sal_uInt16			GetTopEntry() const 			{ return mnTop; }
310*cdf0e10cSrcweir 	// ShowProminentEntry will set the entry correspoding to nEntryPos
311*cdf0e10cSrcweir 	// either at top or in the middle depending on the chosen style
312*cdf0e10cSrcweir 	void            ShowProminentEntry( sal_uInt16 nEntryPos );
313*cdf0e10cSrcweir 	void            SetProminentEntryType( ProminentEntry eType ) { meProminentType = eType; }
314*cdf0e10cSrcweir 	ProminentEntry  GetProminentEntryType() const { return meProminentType; }
315*cdf0e10cSrcweir     using Window::IsVisible;
316*cdf0e10cSrcweir 	sal_Bool			IsVisible( sal_uInt16 nEntry ) const;
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir 	long			GetLeftIndent() const			{ return mnLeft; }
319*cdf0e10cSrcweir 	void			SetLeftIndent( long n );
320*cdf0e10cSrcweir 	void			ScrollHorz( long nDiff );
321*cdf0e10cSrcweir 
322*cdf0e10cSrcweir 	void			AllowGrabFocus( sal_Bool b )		{ mbGrabFocus = b; }
323*cdf0e10cSrcweir 	sal_Bool			IsGrabFocusAllowed() const		{ return mbGrabFocus; }
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir 	void			SetSeparatorPos( sal_uInt16 n )		{ mnSeparatorPos = n; }
326*cdf0e10cSrcweir 	sal_uInt16			GetSeparatorPos() const			{ return mnSeparatorPos; }
327*cdf0e10cSrcweir 
328*cdf0e10cSrcweir 	void            SetTravelSelect( sal_Bool bTravelSelect ) { mbTravelSelect = bTravelSelect; }
329*cdf0e10cSrcweir 	sal_Bool			IsTravelSelect() const			{ return mbTravelSelect; }
330*cdf0e10cSrcweir 	sal_Bool			IsTrackingSelect() const			{ return mbTrackingSelect; }
331*cdf0e10cSrcweir 
332*cdf0e10cSrcweir 	void			SetUserItemSize( const Size& rSz );
333*cdf0e10cSrcweir 	const Size&		GetUserItemSize() const				{ return maUserItemSize; }
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir 	void			EnableUserDraw( sal_Bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; }
336*cdf0e10cSrcweir 	sal_Bool			IsUserDrawEnabled() const 	{ return mbUserDrawEnabled; }
337*cdf0e10cSrcweir 
338*cdf0e10cSrcweir 	void			EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; }
339*cdf0e10cSrcweir 	sal_Bool			IsMultiSelectionEnabled() const 	{ return mbMulti; }
340*cdf0e10cSrcweir 
341*cdf0e10cSrcweir 	void			SetMultiSelectionSimpleMode( sal_Bool bSimple )	{ mbSimpleMode = bSimple; }
342*cdf0e10cSrcweir 	sal_Bool			IsMultiSelectionSimpleMode() const 			{ return mbSimpleMode; }
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir 	void			EnableMouseMoveSelect( sal_Bool bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; }
345*cdf0e10cSrcweir 	sal_Bool			IsMouseMoveSelectEnabled() const 	{ return mbMouseMoveSelect; }
346*cdf0e10cSrcweir 	sal_Bool			IsMouseMoveSelect() const 	{ return mbMouseMoveSelect||mbStackMode; }
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir 	Size			CalcSize( sal_uInt16 nMaxLines ) const;
349*cdf0e10cSrcweir     Rectangle       GetBoundingRectangle( sal_uInt16 nItem ) const;
350*cdf0e10cSrcweir 
351*cdf0e10cSrcweir     long			GetEntryHeight() const				{ return mnMaxHeight; }
352*cdf0e10cSrcweir 	long			GetMaxEntryWidth() const			{ return mnMaxWidth; }
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir 	void			SetScrollHdl( const Link& rLink )	{ maScrollHdl = rLink; }
355*cdf0e10cSrcweir 	const Link& 	GetScrollHdl() const				{ return maScrollHdl; }
356*cdf0e10cSrcweir 	void			SetSelectHdl( const Link& rLink )	{ maSelectHdl = rLink; }
357*cdf0e10cSrcweir 	const Link& 	GetSelectHdl() const				{ return maSelectHdl; }
358*cdf0e10cSrcweir 	void			SetCancelHdl( const Link& rLink )	{ maCancelHdl = rLink; }
359*cdf0e10cSrcweir 	const Link& 	GetCancelHdl() const				{ return maCancelHdl; }
360*cdf0e10cSrcweir 	void			SetDoubleClickHdl( const Link& rLink )	{ maDoubleClickHdl = rLink; }
361*cdf0e10cSrcweir 	const Link& 	GetDoubleClickHdl() const				{ return maDoubleClickHdl; }
362*cdf0e10cSrcweir 	void			SetUserDrawHdl( const Link& rLink )	{ maUserDrawHdl = rLink; }
363*cdf0e10cSrcweir 	const Link& 	GetUserDrawHdl() const				{ return maUserDrawHdl; }
364*cdf0e10cSrcweir 	void			SetMRUChangedHdl( const Link& rLink )	{ maMRUChangedHdl = rLink; }
365*cdf0e10cSrcweir 	const Link& 	GetMRUChangedHdl() const				{ return maMRUChangedHdl; }
366*cdf0e10cSrcweir 
367*cdf0e10cSrcweir 	sal_Bool			IsSelectionChanged() const { return mbSelectionChanged; }
368*cdf0e10cSrcweir 	sal_uInt16			GetSelectModifier() const { return mnSelectModifier; }
369*cdf0e10cSrcweir 
370*cdf0e10cSrcweir 	void			EnableSort( sal_Bool b ) { mbSort = b; }
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir 	void			SetReadOnly( sal_Bool bReadOnly ) 	{ mbReadOnly = bReadOnly; }
373*cdf0e10cSrcweir 	sal_Bool			IsReadOnly() const 				{ return mbReadOnly; }
374*cdf0e10cSrcweir 
375*cdf0e10cSrcweir     using Control::ImplInitSettings;
376*cdf0e10cSrcweir 	void			ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
377*cdf0e10cSrcweir     sal_uInt16          ImplGetTextStyle() const;
378*cdf0e10cSrcweir 
379*cdf0e10cSrcweir 	// pb: #106948# explicit mirroring for calc
380*cdf0e10cSrcweir 	inline void		EnableMirroring()		{ mbMirroring = sal_True; }
381*cdf0e10cSrcweir 	inline sal_Bool		IsMirroring() const { return mbMirroring; }
382*cdf0e10cSrcweir 
383*cdf0e10cSrcweir protected:
384*cdf0e10cSrcweir     // ISearchableStringList
385*cdf0e10cSrcweir     virtual ::vcl::StringEntryIdentifier    CurrentEntry( String& _out_entryText ) const;
386*cdf0e10cSrcweir     virtual ::vcl::StringEntryIdentifier    NextEntry( ::vcl::StringEntryIdentifier _currentEntry, String& _out_entryText ) const;
387*cdf0e10cSrcweir     virtual void                            SelectEntry( ::vcl::StringEntryIdentifier _entry );
388*cdf0e10cSrcweir };
389*cdf0e10cSrcweir 
390*cdf0e10cSrcweir // ---------------
391*cdf0e10cSrcweir // - ImplListBox -
392*cdf0e10cSrcweir // ---------------
393*cdf0e10cSrcweir 
394*cdf0e10cSrcweir class ImplListBox : public Control
395*cdf0e10cSrcweir {
396*cdf0e10cSrcweir private:
397*cdf0e10cSrcweir 	ImplListBoxWindow	maLBWindow;
398*cdf0e10cSrcweir 	ScrollBar*			mpHScrollBar;
399*cdf0e10cSrcweir 	ScrollBar*			mpVScrollBar;
400*cdf0e10cSrcweir 	ScrollBarBox*		mpScrollBarBox;
401*cdf0e10cSrcweir 	sal_Bool				mbVScroll		: 1,	// VScroll an oder aus
402*cdf0e10cSrcweir 						mbHScroll		: 1,	// HScroll an oder aus
403*cdf0e10cSrcweir 						mbAutoHScroll	: 1;	// AutoHScroll an oder aus
404*cdf0e10cSrcweir 	Link				maScrollHdl;	// Weil der vom ImplListBoxWindow selbst benoetigt wird.
405*cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
406*cdf0e10cSrcweir 
407*cdf0e10cSrcweir protected:
408*cdf0e10cSrcweir 	virtual void		GetFocus();
409*cdf0e10cSrcweir 	virtual void		StateChanged( StateChangedType nType );
410*cdf0e10cSrcweir 	virtual void		DataChanged( const DataChangedEvent& rDCEvt );
411*cdf0e10cSrcweir 
412*cdf0e10cSrcweir 	long 				Notify( NotifyEvent& rNEvt );
413*cdf0e10cSrcweir 
414*cdf0e10cSrcweir 	void				ImplResizeControls();
415*cdf0e10cSrcweir 	void				ImplCheckScrollBars();
416*cdf0e10cSrcweir 	void				ImplInitScrollBars();
417*cdf0e10cSrcweir 
418*cdf0e10cSrcweir 	DECL_LINK(			ScrollBarHdl, ScrollBar* );
419*cdf0e10cSrcweir 	DECL_LINK(			LBWindowScrolled, void* );
420*cdf0e10cSrcweir 	DECL_LINK(			MRUChanged, void* );
421*cdf0e10cSrcweir 
422*cdf0e10cSrcweir public:
423*cdf0e10cSrcweir 					ImplListBox( Window* pParent, WinBits nWinStyle );
424*cdf0e10cSrcweir 					~ImplListBox();
425*cdf0e10cSrcweir 
426*cdf0e10cSrcweir 	const ImplEntryList*	GetEntryList() const			{ return maLBWindow.GetEntryList(); }
427*cdf0e10cSrcweir 	ImplListBoxWindow* 		GetMainWindow() 				{ return &maLBWindow; }
428*cdf0e10cSrcweir 
429*cdf0e10cSrcweir 	virtual void	Resize();
430*cdf0e10cSrcweir     virtual const Wallpaper& GetDisplayBackground() const;
431*cdf0e10cSrcweir     virtual Window*     GetPreferredKeyInputWindow();
432*cdf0e10cSrcweir 
433*cdf0e10cSrcweir 	sal_uInt16			InsertEntry( sal_uInt16 nPos, const XubString& rStr );
434*cdf0e10cSrcweir 	sal_uInt16			InsertEntry( sal_uInt16 nPos, const Image& rImage );
435*cdf0e10cSrcweir 	sal_uInt16			InsertEntry( sal_uInt16 nPos, const XubString& rStr, const Image& rImage );
436*cdf0e10cSrcweir 	void			RemoveEntry( sal_uInt16 nPos );
437*cdf0e10cSrcweir 	void			SetEntryData( sal_uInt16 nPos, void* pNewData )	{ maLBWindow.GetEntryList()->SetEntryData( nPos, pNewData ); }
438*cdf0e10cSrcweir 	void			Clear();
439*cdf0e10cSrcweir 
440*cdf0e10cSrcweir 	void			SetEntryFlags( sal_uInt16 nPos, long nFlags );
441*cdf0e10cSrcweir 	long			GetEntryFlags( sal_uInt16 nPos ) const;
442*cdf0e10cSrcweir 
443*cdf0e10cSrcweir 	void			SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
444*cdf0e10cSrcweir 	void			SetNoSelection();
445*cdf0e10cSrcweir 	void			ResetCurrentPos()				{ maLBWindow.ResetCurrentPos(); }
446*cdf0e10cSrcweir 	sal_uInt16			GetCurrentPos()	const			{ return maLBWindow.GetCurrentPos(); }
447*cdf0e10cSrcweir 
448*cdf0e10cSrcweir 	sal_Bool			ProcessKeyInput( const KeyEvent& rKEvt )	{ return maLBWindow.ProcessKeyInput( rKEvt ); }
449*cdf0e10cSrcweir 	sal_Bool			HandleWheelAsCursorTravel( const CommandEvent& rCEvt );
450*cdf0e10cSrcweir 
451*cdf0e10cSrcweir 	void			SetSeparatorPos( sal_uInt16 n )		{ maLBWindow.SetSeparatorPos( n ); }
452*cdf0e10cSrcweir 	sal_uInt16			GetSeparatorPos() const			{ return maLBWindow.GetSeparatorPos(); }
453*cdf0e10cSrcweir 
454*cdf0e10cSrcweir 	void			SetTopEntry( sal_uInt16 nTop )		{ maLBWindow.SetTopEntry( nTop ); }
455*cdf0e10cSrcweir 	sal_uInt16			GetTopEntry() const 			{ return maLBWindow.GetTopEntry(); }
456*cdf0e10cSrcweir 	void            ShowProminentEntry( sal_uInt16 nPos ) { maLBWindow.ShowProminentEntry( nPos ); }
457*cdf0e10cSrcweir     using Window::IsVisible;
458*cdf0e10cSrcweir 	sal_Bool			IsVisible( sal_uInt16 nEntry ) const { return maLBWindow.IsVisible( nEntry ); }
459*cdf0e10cSrcweir 
460*cdf0e10cSrcweir 	void            SetProminentEntryType( ProminentEntry eType ) { maLBWindow.SetProminentEntryType( eType ); }
461*cdf0e10cSrcweir 	ProminentEntry  GetProminentEntryType() const { return maLBWindow.GetProminentEntryType(); }
462*cdf0e10cSrcweir 
463*cdf0e10cSrcweir 	long			GetLeftIndent() const			{ return maLBWindow.GetLeftIndent(); }
464*cdf0e10cSrcweir 	void			SetLeftIndent( sal_uInt16 n )		{ maLBWindow.SetLeftIndent( n ); }
465*cdf0e10cSrcweir 	void			ScrollHorz( short nDiff )		{ maLBWindow.ScrollHorz( nDiff ); }
466*cdf0e10cSrcweir 
467*cdf0e10cSrcweir 	void            SetTravelSelect( sal_Bool bTravelSelect ) { maLBWindow.SetTravelSelect( bTravelSelect ); }
468*cdf0e10cSrcweir 	sal_Bool			IsTravelSelect() const			{ return maLBWindow.IsTravelSelect(); }
469*cdf0e10cSrcweir 	sal_Bool			IsTrackingSelect() const			{ return maLBWindow.IsTrackingSelect(); }
470*cdf0e10cSrcweir 
471*cdf0e10cSrcweir 	void			EnableMultiSelection( sal_Bool bMulti, sal_Bool bStackMode ) { maLBWindow.EnableMultiSelection( bMulti, bStackMode ); }
472*cdf0e10cSrcweir 	sal_Bool			IsMultiSelectionEnabled() const 	{ return maLBWindow.IsMultiSelectionEnabled(); }
473*cdf0e10cSrcweir 
474*cdf0e10cSrcweir 	void			SetMultiSelectionSimpleMode( sal_Bool bSimple ) { maLBWindow.SetMultiSelectionSimpleMode( bSimple ); }
475*cdf0e10cSrcweir 	sal_Bool			IsMultiSelectionSimpleMode() const 	{ return maLBWindow.IsMultiSelectionSimpleMode(); }
476*cdf0e10cSrcweir 
477*cdf0e10cSrcweir 	void			SetReadOnly( sal_Bool b ) 			{ maLBWindow.SetReadOnly( b ); }
478*cdf0e10cSrcweir 	sal_Bool			IsReadOnly() const 				{ return maLBWindow.IsReadOnly(); }
479*cdf0e10cSrcweir 
480*cdf0e10cSrcweir 
481*cdf0e10cSrcweir 	Size			CalcSize( sal_uInt16 nMaxLines ) const				{ return maLBWindow.CalcSize( nMaxLines ); }
482*cdf0e10cSrcweir 	long			GetEntryHeight() const			{ return maLBWindow.GetEntryHeight(); }
483*cdf0e10cSrcweir 	long			GetMaxEntryWidth() const		{ return maLBWindow.GetMaxEntryWidth(); }
484*cdf0e10cSrcweir 
485*cdf0e10cSrcweir 	void			SetScrollHdl( const Link& rLink )	{ maScrollHdl = rLink; }
486*cdf0e10cSrcweir 	const Link& 	GetScrollHdl() const				{ return maScrollHdl; }
487*cdf0e10cSrcweir 	void			SetSelectHdl( const Link& rLink )	{ maLBWindow.SetSelectHdl( rLink ); }
488*cdf0e10cSrcweir 	const Link& 	GetSelectHdl() const				{ return maLBWindow.GetSelectHdl(); }
489*cdf0e10cSrcweir 	void			SetCancelHdl( const Link& rLink )	{ maLBWindow.SetCancelHdl( rLink ); }
490*cdf0e10cSrcweir 	const Link& 	GetCancelHdl() const				{ return maLBWindow.GetCancelHdl(); }
491*cdf0e10cSrcweir 	void			SetDoubleClickHdl( const Link& rLink )	{ maLBWindow.SetDoubleClickHdl( rLink ); }
492*cdf0e10cSrcweir 	const Link& 	GetDoubleClickHdl() const				{ return maLBWindow.GetDoubleClickHdl(); }
493*cdf0e10cSrcweir 	void			SetUserDrawHdl( const Link& rLink )	{ maLBWindow.SetUserDrawHdl( rLink ); }
494*cdf0e10cSrcweir 	const Link& 	GetUserDrawHdl() const				{ return maLBWindow.GetUserDrawHdl(); }
495*cdf0e10cSrcweir 
496*cdf0e10cSrcweir 	void			SetSelectionChangedHdl( const Link& rLnk )	{ maLBWindow.GetEntryList()->SetSelectionChangedHdl( rLnk ); }
497*cdf0e10cSrcweir 	void			SetCallSelectionChangedHdl( sal_Bool bCall )	{ maLBWindow.GetEntryList()->SetCallSelectionChangedHdl( bCall ); }
498*cdf0e10cSrcweir 	sal_Bool			IsSelectionChanged() const 					{ return maLBWindow.IsSelectionChanged(); }
499*cdf0e10cSrcweir 	sal_uInt16			GetSelectModifier() const 					{ return maLBWindow.GetSelectModifier(); }
500*cdf0e10cSrcweir 
501*cdf0e10cSrcweir 	void			SetMRUEntries( const XubString& rEntries, xub_Unicode cSep );
502*cdf0e10cSrcweir 	XubString		GetMRUEntries( xub_Unicode cSep ) const;
503*cdf0e10cSrcweir 	void			SetMaxMRUCount( sal_uInt16 n )					{ maLBWindow.GetEntryList()->SetMaxMRUCount( n ); }
504*cdf0e10cSrcweir 	sal_uInt16			GetMaxMRUCount() const						{ return maLBWindow.GetEntryList()->GetMaxMRUCount(); }
505*cdf0e10cSrcweir     sal_uInt16			GetDisplayLineCount() const
506*cdf0e10cSrcweir     { return maLBWindow.GetDisplayLineCount(); }
507*cdf0e10cSrcweir 
508*cdf0e10cSrcweir 	// pb: #106948# explicit mirroring for calc
509*cdf0e10cSrcweir 	inline void		EnableMirroring()	{ maLBWindow.EnableMirroring(); }
510*cdf0e10cSrcweir     inline void     SetDropTraget(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_xDNDListenerContainer){ mxDNDListenerContainer= i_xDNDListenerContainer; }
511*cdf0e10cSrcweir };
512*cdf0e10cSrcweir 
513*cdf0e10cSrcweir // -----------------------------
514*cdf0e10cSrcweir // - ImplListBoxFloatingWindow -
515*cdf0e10cSrcweir // -----------------------------
516*cdf0e10cSrcweir 
517*cdf0e10cSrcweir class ImplListBoxFloatingWindow : public FloatingWindow
518*cdf0e10cSrcweir {
519*cdf0e10cSrcweir private:
520*cdf0e10cSrcweir 	ImplListBox*	mpImplLB;
521*cdf0e10cSrcweir 	Size			maPrefSz;
522*cdf0e10cSrcweir 	sal_uInt16			mnDDLineCount;
523*cdf0e10cSrcweir     sal_uInt16          mnPopupModeStartSaveSelection;
524*cdf0e10cSrcweir 	sal_Bool			mbAutoWidth;
525*cdf0e10cSrcweir 
526*cdf0e10cSrcweir protected:
527*cdf0e10cSrcweir 	long			PreNotify( NotifyEvent& rNEvt );
528*cdf0e10cSrcweir 
529*cdf0e10cSrcweir public:
530*cdf0e10cSrcweir 					ImplListBoxFloatingWindow( Window* pParent );
531*cdf0e10cSrcweir 
532*cdf0e10cSrcweir 	void			SetImplListBox( ImplListBox* pLB )	{ mpImplLB = pLB; }
533*cdf0e10cSrcweir 
534*cdf0e10cSrcweir 	void			SetPrefSize( const Size& rSz )		{ maPrefSz = rSz; }
535*cdf0e10cSrcweir 	const Size& 	GetPrefSize() const 				{ return maPrefSz; }
536*cdf0e10cSrcweir 
537*cdf0e10cSrcweir 	void			SetAutoWidth( sal_Bool b )				{ mbAutoWidth = b; }
538*cdf0e10cSrcweir     sal_Bool            IsAutoWidth() const                 { return mbAutoWidth; }
539*cdf0e10cSrcweir 
540*cdf0e10cSrcweir 	Size			CalcFloatSize();
541*cdf0e10cSrcweir 	void			StartFloat( sal_Bool bStartTracking );
542*cdf0e10cSrcweir 
543*cdf0e10cSrcweir 	virtual void	SetPosSizePixel( long nX, long nY,
544*cdf0e10cSrcweir 									 long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
545*cdf0e10cSrcweir 	void			SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
546*cdf0e10cSrcweir 						{ FloatingWindow::SetPosSizePixel( rNewPos, rNewSize ); }
547*cdf0e10cSrcweir 
548*cdf0e10cSrcweir 	void			SetDropDownLineCount( sal_uInt16 n ) { mnDDLineCount = n; }
549*cdf0e10cSrcweir 	sal_uInt16			GetDropDownLineCount() const { return mnDDLineCount; }
550*cdf0e10cSrcweir 
551*cdf0e10cSrcweir     sal_uInt16          GetPopupModeStartSaveSelection() const { return mnPopupModeStartSaveSelection; }
552*cdf0e10cSrcweir 
553*cdf0e10cSrcweir     virtual void	Resize();
554*cdf0e10cSrcweir };
555*cdf0e10cSrcweir 
556*cdf0e10cSrcweir // -----------
557*cdf0e10cSrcweir // - ImplWin -
558*cdf0e10cSrcweir // -----------
559*cdf0e10cSrcweir 
560*cdf0e10cSrcweir class ImplWin : public Control
561*cdf0e10cSrcweir {
562*cdf0e10cSrcweir private:
563*cdf0e10cSrcweir 
564*cdf0e10cSrcweir 	sal_uInt16			mnItemPos;	// wegen UserDraw muss ich wissen, welches Item ich darstelle.
565*cdf0e10cSrcweir 	XubString		maString;
566*cdf0e10cSrcweir 	Image			maImage;
567*cdf0e10cSrcweir 	Image			maImageHC;
568*cdf0e10cSrcweir 
569*cdf0e10cSrcweir 	Rectangle		maFocusRect;
570*cdf0e10cSrcweir 	Size			maUserItemSize;
571*cdf0e10cSrcweir 
572*cdf0e10cSrcweir 	Link			maMBDownHdl;
573*cdf0e10cSrcweir 	Link			maUserDrawHdl;
574*cdf0e10cSrcweir 
575*cdf0e10cSrcweir 	sal_Bool			mbUserDrawEnabled	: 1,
576*cdf0e10cSrcweir 					mbInUserDraw		: 1;
577*cdf0e10cSrcweir 
578*cdf0e10cSrcweir 
579*cdf0e10cSrcweir     void ImplDraw( bool bLayout = false );
580*cdf0e10cSrcweir protected:
581*cdf0e10cSrcweir     virtual void  FillLayoutData() const;
582*cdf0e10cSrcweir public:
583*cdf0e10cSrcweir 
584*cdf0e10cSrcweir 					ImplWin( Window* pParent, WinBits nWinStyle = 0 );
585*cdf0e10cSrcweir 					~ImplWin() {};
586*cdf0e10cSrcweir 
587*cdf0e10cSrcweir 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
588*cdf0e10cSrcweir 	virtual void	Paint( const Rectangle& rRect );
589*cdf0e10cSrcweir 	virtual void	Resize();
590*cdf0e10cSrcweir 	virtual void	GetFocus();
591*cdf0e10cSrcweir 	virtual void	LoseFocus();
592*cdf0e10cSrcweir     virtual long    PreNotify( NotifyEvent& rNEvt );
593*cdf0e10cSrcweir 
594*cdf0e10cSrcweir 	sal_uInt16			GetItemPos() const { return mnItemPos; }
595*cdf0e10cSrcweir 	void			SetItemPos( sal_uInt16 n ) { mnItemPos = n; }
596*cdf0e10cSrcweir 
597*cdf0e10cSrcweir 	const XubString& GetString() const { return maString; }
598*cdf0e10cSrcweir 	void			SetString( const XubString& rStr ) { maString = rStr; }
599*cdf0e10cSrcweir 
600*cdf0e10cSrcweir 	const Image&	GetImage() const { return maImage; }
601*cdf0e10cSrcweir 	void			SetImage( const Image& rImg ) { maImage = rImg; }
602*cdf0e10cSrcweir 
603*cdf0e10cSrcweir     sal_Bool            SetModeImage( const Image& rImage, BmpColorMode eMode = BMP_COLOR_NORMAL );
604*cdf0e10cSrcweir     const Image&    GetModeImage( BmpColorMode eMode = BMP_COLOR_NORMAL ) const;
605*cdf0e10cSrcweir 
606*cdf0e10cSrcweir 
607*cdf0e10cSrcweir 	virtual void	MBDown();
608*cdf0e10cSrcweir 	void			SetMBDownHdl( const Link& rLink ) { maMBDownHdl = rLink; }
609*cdf0e10cSrcweir 	const Link& 	GetMBDownHdl() const { return maMBDownHdl; }
610*cdf0e10cSrcweir 
611*cdf0e10cSrcweir 	void			SetUserDrawHdl( const Link& rLink )	{ maUserDrawHdl = rLink; }
612*cdf0e10cSrcweir 	const Link& 	GetUserDrawHdl() const				{ return maUserDrawHdl; }
613*cdf0e10cSrcweir 
614*cdf0e10cSrcweir 	void			SetUserItemSize( const Size& rSz )	{ maUserItemSize = rSz; }
615*cdf0e10cSrcweir 	const Size&		GetUserItemSize() const				{ return maUserItemSize; }
616*cdf0e10cSrcweir 
617*cdf0e10cSrcweir 	void			EnableUserDraw( sal_Bool bUserDraw ) 	{ mbUserDrawEnabled = bUserDraw; }
618*cdf0e10cSrcweir 	sal_Bool			IsUserDrawEnabled() const 			{ return mbUserDrawEnabled; }
619*cdf0e10cSrcweir 
620*cdf0e10cSrcweir 	void 			DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDrawTextAtImagePos = sal_False, bool bLayout = false );
621*cdf0e10cSrcweir };
622*cdf0e10cSrcweir 
623*cdf0e10cSrcweir // -----------
624*cdf0e10cSrcweir // - ImplBtn -
625*cdf0e10cSrcweir // -----------
626*cdf0e10cSrcweir 
627*cdf0e10cSrcweir class ImplBtn : public PushButton
628*cdf0e10cSrcweir {
629*cdf0e10cSrcweir private:
630*cdf0e10cSrcweir 	sal_Bool			mbDown;
631*cdf0e10cSrcweir 
632*cdf0e10cSrcweir 	Link			maMBDownHdl;
633*cdf0e10cSrcweir 
634*cdf0e10cSrcweir public:
635*cdf0e10cSrcweir 					ImplBtn( Window* pParent, WinBits nWinStyle = 0 );
636*cdf0e10cSrcweir 					~ImplBtn() {};
637*cdf0e10cSrcweir 
638*cdf0e10cSrcweir 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
639*cdf0e10cSrcweir 
640*cdf0e10cSrcweir 	virtual void	MBDown();
641*cdf0e10cSrcweir 	void			SetMBDownHdl( const Link& rLink ) { maMBDownHdl = rLink; }
642*cdf0e10cSrcweir 	const Link& 	GetMBDownHdl() const { return maMBDownHdl; }
643*cdf0e10cSrcweir };
644*cdf0e10cSrcweir 
645*cdf0e10cSrcweir 
646*cdf0e10cSrcweir void ImplInitFieldSettings( Window* pWin, sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
647*cdf0e10cSrcweir void ImplInitDropDownButton( PushButton* pButton );
648*cdf0e10cSrcweir 
649*cdf0e10cSrcweir #endif	// _SV_ILSTBOX_HXX
650