xref: /trunk/main/svtools/inc/svtools/svtreebx.hxx (revision 4d7c9de0)
101aa44aaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
301aa44aaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
401aa44aaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
501aa44aaSAndrew Rist  * distributed with this work for additional information
601aa44aaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
701aa44aaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
801aa44aaSAndrew Rist  * "License"); you may not use this file except in compliance
901aa44aaSAndrew Rist  * with the License.  You may obtain a copy of the License at
1001aa44aaSAndrew Rist  *
1101aa44aaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1201aa44aaSAndrew Rist  *
1301aa44aaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1401aa44aaSAndrew Rist  * software distributed under the License is distributed on an
1501aa44aaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1601aa44aaSAndrew Rist  * KIND, either express or implied.  See the License for the
1701aa44aaSAndrew Rist  * specific language governing permissions and limitations
1801aa44aaSAndrew Rist  * under the License.
1901aa44aaSAndrew Rist  *
2001aa44aaSAndrew Rist  *************************************************************/
2101aa44aaSAndrew Rist 
2201aa44aaSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SVTREEBOX_HXX
24cdf0e10cSrcweir #define _SVTREEBOX_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "svtools/svtdllapi.h"
27cdf0e10cSrcweir #include <svtools/svlbox.hxx>
28cdf0e10cSrcweir #include <svtools/svlbitm.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir // forward and defines ---------------------------------------------------
31cdf0e10cSrcweir 
32cdf0e10cSrcweir class SvImpLBox;
33cdf0e10cSrcweir class SvInplaceEdit;
34cdf0e10cSrcweir class TabBar;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #define SV_TAB_BORDER 8
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #define SV_LISTBOX_ID_TREEBOX 1   // fuer SvLBox::IsA()
39cdf0e10cSrcweir #define SV_ENTRYHEIGHTOFFS_PIXEL 2
40cdf0e10cSrcweir 
41cdf0e10cSrcweir #define TREEFLAG_CHKBTN			0x0001
42cdf0e10cSrcweir #define TREEFLAG_USESEL			0x0002
43cdf0e10cSrcweir #define TREEFLAG_MANINS			0x0004
44cdf0e10cSrcweir #define TREEFLAG_RECALCTABS		0x0008
45cdf0e10cSrcweir 
46*2bfcd321SSteve Yin #define TREEBOX_ALLITEM_ACCROLE_TYPE_NOTSET	0x00
47*2bfcd321SSteve Yin #define TREEBOX_ALLITEM_ACCROLE_TYPE_LIST	0x01
48*2bfcd321SSteve Yin #define TREEBOX_ALLITEM_ACCROLE_TYPE_TREE	0x02
49*2bfcd321SSteve Yin 
50*2bfcd321SSteve Yin 
51cdf0e10cSrcweir typedef sal_Int64   ExtendedWinBits;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir // disable the behavior of automatically selecting a "CurEntry" upon painting the control
54cdf0e10cSrcweir #define EWB_NO_AUTO_CURENTRY        0x00000001
55cdf0e10cSrcweir 
56cdf0e10cSrcweir // class SvTreeListBox ---------------------------------------------------
57cdf0e10cSrcweir 
58cdf0e10cSrcweir class SVT_DLLPUBLIC SvTreeListBox : public SvLBox
59cdf0e10cSrcweir {
60cdf0e10cSrcweir 	friend class SvImpLBox;
61cdf0e10cSrcweir 	friend class ImpLBSelEng;
62cdf0e10cSrcweir 	friend class TreeControlPeer;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	SvImpLBox*		pImp;
65cdf0e10cSrcweir 	Link			aCheckButtonHdl;
66cdf0e10cSrcweir 	Link			aScrolledHdl;
67cdf0e10cSrcweir 	Accelerator		aInpEditAcc;
68cdf0e10cSrcweir 	Image			aPrevInsertedExpBmp;
69cdf0e10cSrcweir 	Image			aPrevInsertedColBmp;
70cdf0e10cSrcweir 	Image			aCurInsertedExpBmp;
71cdf0e10cSrcweir 	Image			aCurInsertedColBmp;
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	short			nContextBmpWidthMax;
74cdf0e10cSrcweir 	sal_uInt16			nFirstSelTab, nLastSelTab;
75cdf0e10cSrcweir 	short			nEntryHeight;
76cdf0e10cSrcweir 	short			nEntryHeightOffs;
77cdf0e10cSrcweir 	short  			nIndent;
78cdf0e10cSrcweir 	short			nFocusWidth;
79*2bfcd321SSteve Yin 	sal_uInt16		aContextBmpMode;
80*2bfcd321SSteve Yin 
81*2bfcd321SSteve Yin 	short			nAllItemAccRoleType;
82cdf0e10cSrcweir 
83cdf0e10cSrcweir #ifdef _SVTREEBX_CXX
84cdf0e10cSrcweir 	DECL_DLLPRIVATE_LINK( CheckButtonClick, SvLBoxButtonData * );
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 	SVT_DLLPRIVATE short 			GetHeightOffset( const Image& rBmp, Size& rLogicSize);
87cdf0e10cSrcweir 	SVT_DLLPRIVATE short 			GetHeightOffset( const Font& rFont, Size& rLogicSize);
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 	SVT_DLLPRIVATE void			SetEntryHeight( SvLBoxEntry* pEntry );
90cdf0e10cSrcweir 	SVT_DLLPRIVATE void			AdjustEntryHeight( const Image& rBmp );
91cdf0e10cSrcweir 	SVT_DLLPRIVATE void 			AdjustEntryHeight( const Font& rFont );
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 	SVT_DLLPRIVATE void			ImpEntryInserted( SvLBoxEntry* pEntry );
94cdf0e10cSrcweir 	SVT_DLLPRIVATE long			PaintEntry1( SvLBoxEntry*, long nLine,
95cdf0e10cSrcweir 								sal_uInt16 nTabFlagMask=0xffff,
96cdf0e10cSrcweir 								sal_Bool bHasClipRegion=sal_False );
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	SVT_DLLPRIVATE void			InitTreeView();
99cdf0e10cSrcweir 	SVT_DLLPRIVATE SvLBoxItem*		GetItem_Impl( SvLBoxEntry*, long nX, SvLBoxTab** ppTab,
100cdf0e10cSrcweir 						sal_uInt16 nEmptyWidth );
101cdf0e10cSrcweir     SVT_DLLPRIVATE void         ImplInitStyle();
102cdf0e10cSrcweir 
103cdf0e10cSrcweir #endif
104cdf0e10cSrcweir 
105cdf0e10cSrcweir protected:
106cdf0e10cSrcweir 	SvLBoxButtonData*	pCheckButtonData;
107cdf0e10cSrcweir 	sal_uInt16				nTreeFlags;
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 	SvLBoxEntry*		pEdEntry;
110cdf0e10cSrcweir 	SvLBoxItem*			pEdItem;
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 	void			EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem,
113cdf0e10cSrcweir 						const Selection& );
114cdf0e10cSrcweir 	void			EditedText( const XubString& );
115cdf0e10cSrcweir 	void			EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
116cdf0e10cSrcweir 						const Point& rMousePos );
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 	SvPtrarr 			aTabs;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	// berechnet abhaengig von TreeList-Style & Bitmap-Groessen
121cdf0e10cSrcweir 	// alle Tabulatoren neu; wird beim Einfuegen/Austauschen von
122cdf0e10cSrcweir 	// Bitmaps, beim Wechsel des Models usw. automatisch gerufen
123cdf0e10cSrcweir 	virtual void	SetTabs();
124cdf0e10cSrcweir 	void			SetTabs_Impl();
125cdf0e10cSrcweir 	void 			AddTab( long nPos,sal_uInt16 nFlags=SV_LBOXTAB_ADJUST_LEFT,
126cdf0e10cSrcweir 						void* pUserData = 0 );
TabCount() const127cdf0e10cSrcweir 	sal_uInt16			TabCount() const { return aTabs.Count(); }
128cdf0e10cSrcweir 	SvLBoxTab*		GetFirstDynamicTab() const;
129cdf0e10cSrcweir 	SvLBoxTab*		GetFirstDynamicTab( sal_uInt16& rTabPos ) const;
130cdf0e10cSrcweir 	SvLBoxTab*		GetFirstTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
131cdf0e10cSrcweir 	SvLBoxTab*		GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
132cdf0e10cSrcweir 	SvLBoxTab*		GetTab( SvLBoxEntry*, SvLBoxItem* ) const;
133cdf0e10cSrcweir 	void			ClearTabList();
134cdf0e10cSrcweir 
135cdf0e10cSrcweir 	virtual void InitEntry(SvLBoxEntry*,const XubString&,const Image&,const Image&,SvLBoxButtonKind);
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 	virtual void	NotifyBeginScroll();
138cdf0e10cSrcweir 	virtual void	NotifyEndScroll();
139cdf0e10cSrcweir 	// nLines == 0 => horizontales Scrolling
140cdf0e10cSrcweir 	virtual void	NotifyScrolling( long nLines );
141cdf0e10cSrcweir 	virtual	void	NotifyScrolled();
SetScrolledHdl(const Link & rLink)142cdf0e10cSrcweir 	void			SetScrolledHdl( const Link& rLink ) { aScrolledHdl = rLink; }
GetScrolledHdl() const143cdf0e10cSrcweir 	const Link&		GetScrolledHdl() const { return aScrolledHdl; }
GetXOffset() const144cdf0e10cSrcweir 	long			GetXOffset() const { return GetMapMode().GetOrigin().X(); }
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 	// wird aufgerufen, _bevor_ Bereiche im Control invalidiert werden,
147cdf0e10cSrcweir 	// kann zum Hiden von Elementen benutzt werden, die von aussen
148cdf0e10cSrcweir 	// in das Control hineingezeichnet werden
149cdf0e10cSrcweir 	virtual void	NotifyInvalidating();
150cdf0e10cSrcweir 
151cdf0e10cSrcweir 	virtual sal_uLong	GetAscInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
152cdf0e10cSrcweir 	virtual sal_uLong	GetDescInsertionPos( SvLBoxEntry*, SvLBoxEntry* pParent );
153cdf0e10cSrcweir 	virtual void    Command( const CommandEvent& rCEvt );
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 	virtual void    RequestHelp( const HelpEvent& rHEvt );
156cdf0e10cSrcweir 	virtual void	CursorMoved( SvLBoxEntry* pNewCursor );
157cdf0e10cSrcweir 	virtual void	PreparePaint( SvLBoxEntry* );
158cdf0e10cSrcweir 	virtual void	DataChanged( const DataChangedEvent& rDCEvt );
159cdf0e10cSrcweir     virtual void    StateChanged( StateChangedType nStateChange );
160cdf0e10cSrcweir 
161cdf0e10cSrcweir 	void 			InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground);
162cdf0e10cSrcweir 	sal_Bool			IsCellFocusEnabled() const;
163cdf0e10cSrcweir 	bool			SetCurrentTabPos( sal_uInt16 _nNewPos );
164cdf0e10cSrcweir 	sal_uInt16			GetCurrentTabPos() const;
165cdf0e10cSrcweir 	void			CallImplEventListeners(sal_uLong nEvent, void* pData);
166cdf0e10cSrcweir 
167cdf0e10cSrcweir 	void			ImplEditEntry( SvLBoxEntry* pEntry );
168cdf0e10cSrcweir 
169cdf0e10cSrcweir     sal_Bool        AreChildrenTransient() const;
170cdf0e10cSrcweir     void            SetChildrenNotTransient();
171cdf0e10cSrcweir 
172cdf0e10cSrcweir public:
173cdf0e10cSrcweir 	SvTreeListBox( Window* pParent, WinBits nWinStyle=0 );
174cdf0e10cSrcweir 	SvTreeListBox( Window* pParent, const ResId& rResId );
175cdf0e10cSrcweir 	~SvTreeListBox();
176cdf0e10cSrcweir 
177cdf0e10cSrcweir     void                SetExtendedWinBits( ExtendedWinBits _nBits );
178cdf0e10cSrcweir     ExtendedWinBits     GetExtendedWinBits() const;
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 	void			DisconnectFromModel();
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 	void 			EnableCheckButton( SvLBoxButtonData* );
183cdf0e10cSrcweir 	void 			SetCheckButtonData( SvLBoxButtonData* );
184cdf0e10cSrcweir 	void 			SetNodeBitmaps( const Image& rCollapsedNodeBmp, const Image& rExpandedNodeBmp, BmpColorMode _eMode = BMP_COLOR_NORMAL );
185cdf0e10cSrcweir 	void			SetDontKnowNodeBitmap( const Image& rDontKnowBmp, BmpColorMode _eMode = BMP_COLOR_NORMAL );
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 	/** returns the default image which clients should use for expanded nodes, to have a consistent user
188cdf0e10cSrcweir 		interface experience in the whole product.
189cdf0e10cSrcweir 	*/
190cdf0e10cSrcweir 	static const Image&	GetDefaultExpandedNodeImage( BmpColorMode _eMode = BMP_COLOR_NORMAL );
191cdf0e10cSrcweir 
192cdf0e10cSrcweir 	/** returns the default image which clients should use for expanded nodes, to have a consistent user
193cdf0e10cSrcweir 		interface experience in the whole product.
194cdf0e10cSrcweir 	*/
195cdf0e10cSrcweir 	static const Image&	GetDefaultCollapsedNodeImage( BmpColorMode _eMode = BMP_COLOR_NORMAL );
196cdf0e10cSrcweir 
197cdf0e10cSrcweir 	/** sets default bitmaps for collapsed and expanded nodes.
198cdf0e10cSrcweir 	*/
SetNodeDefaultImages()199cdf0e10cSrcweir 	inline	void	SetNodeDefaultImages( )
200cdf0e10cSrcweir 	{
201cdf0e10cSrcweir 		SetNodeBitmaps( GetDefaultCollapsedNodeImage( BMP_COLOR_NORMAL ), GetDefaultExpandedNodeImage( BMP_COLOR_NORMAL ), BMP_COLOR_NORMAL );
202cdf0e10cSrcweir 		SetNodeBitmaps( GetDefaultCollapsedNodeImage( BMP_COLOR_HIGHCONTRAST ), GetDefaultExpandedNodeImage( BMP_COLOR_HIGHCONTRAST ), BMP_COLOR_HIGHCONTRAST );
203cdf0e10cSrcweir 	}
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 	virtual SvLBoxEntry*	InsertEntry( const XubString& rText, SvLBoxEntry* pParent = 0,
206cdf0e10cSrcweir 						                 sal_Bool bChildsOnDemand = sal_False,
207cdf0e10cSrcweir                                          sal_uLong nPos=LIST_APPEND, void* pUserData = 0,
208cdf0e10cSrcweir                                          SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
209cdf0e10cSrcweir 
210cdf0e10cSrcweir 	virtual SvLBoxEntry*	InsertEntry( const XubString& rText,
211cdf0e10cSrcweir 						                 const Image& rExpandedEntryBmp,
212cdf0e10cSrcweir                                          const Image& rCollapsedEntryBmp,
213cdf0e10cSrcweir                                          SvLBoxEntry* pParent = 0,
214cdf0e10cSrcweir                                          sal_Bool bChildsOnDemand = sal_False,
215cdf0e10cSrcweir                                          sal_uLong nPos = LIST_APPEND, void* pUserData = 0,
216cdf0e10cSrcweir                                          SvLBoxButtonKind eButtonKind = SvLBoxButtonKind_enabledCheckbox );
217cdf0e10cSrcweir 
218cdf0e10cSrcweir 	const Image&    GetDefaultExpandedEntryBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
219cdf0e10cSrcweir 	const Image&	GetDefaultCollapsedEntryBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 	void			SetDefaultExpandedEntryBmp( const Image& rBmp, BmpColorMode _eMode = BMP_COLOR_NORMAL );
222cdf0e10cSrcweir 	void          	SetDefaultCollapsedEntryBmp( const Image& rBmp, BmpColorMode _eMode = BMP_COLOR_NORMAL );
223cdf0e10cSrcweir 
224cdf0e10cSrcweir 	void			SetCheckButtonState( SvLBoxEntry*, SvButtonState );
225cdf0e10cSrcweir 	SvButtonState 	GetCheckButtonState( SvLBoxEntry* ) const;
226cdf0e10cSrcweir 
227cdf0e10cSrcweir 	void            ShowExpandBitmapOnCursor( sal_Bool );
IsExpandBitmapOnCursor() const228cdf0e10cSrcweir 	sal_Bool            IsExpandBitmapOnCursor() const 	{ return (sal_Bool)(aContextBmpMode & SVLISTENTRYFLAG_FOCUSED)!=0; }
229cdf0e10cSrcweir 
230cdf0e10cSrcweir 	void			SetEntryText(SvLBoxEntry*, const XubString& );
231cdf0e10cSrcweir 	void			SetExpandedEntryBmp( SvLBoxEntry* _pEntry, const Image& _rImage, BmpColorMode _eMode = BMP_COLOR_NORMAL );
232cdf0e10cSrcweir 	void			SetCollapsedEntryBmp( SvLBoxEntry* _pEntry, const Image& _rImage, BmpColorMode _eMode = BMP_COLOR_NORMAL );
233cdf0e10cSrcweir 
234cdf0e10cSrcweir 	virtual	String	GetEntryText( SvLBoxEntry* pEntry ) const;
235cdf0e10cSrcweir 	String			SearchEntryText( SvLBoxEntry* pEntry ) const;
236cdf0e10cSrcweir 	const Image&	GetExpandedEntryBmp(SvLBoxEntry* _pEntry, BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
237cdf0e10cSrcweir 	const Image&	GetCollapsedEntryBmp(SvLBoxEntry* _pEntry, BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
238cdf0e10cSrcweir 
SetCheckButtonHdl(const Link & rLink)239cdf0e10cSrcweir 	void			SetCheckButtonHdl( const Link& rLink )	{ aCheckButtonHdl=rLink; }
GetCheckButtonHdl() const240cdf0e10cSrcweir 	Link			GetCheckButtonHdl() const { return aCheckButtonHdl; }
241cdf0e10cSrcweir 	virtual void	CheckButtonHdl();
242cdf0e10cSrcweir 
243cdf0e10cSrcweir 	virtual SvLBoxEntry*	CloneEntry( SvLBoxEntry* pSource );
244cdf0e10cSrcweir 
245cdf0e10cSrcweir 	virtual sal_uInt16	IsA();
246cdf0e10cSrcweir 
247cdf0e10cSrcweir 	void			SetSublistOpenWithReturn( sal_Bool bMode = sal_True );		// open/close sublist with return/enter
248cdf0e10cSrcweir 	sal_Bool			IsSublistOpenWithReturn() const;
249cdf0e10cSrcweir 	void			SetSublistOpenWithLeftRight( sal_Bool bMode = sal_True );	// open/close sublist with cursor left/right
250cdf0e10cSrcweir 	sal_Bool			IsSublistOpenWithLeftRight() const;
251cdf0e10cSrcweir 
252cdf0e10cSrcweir 	void			EnableInplaceEditing( sal_Bool bEnable );
IsInplaceEditingEnabled() const253cdf0e10cSrcweir 	sal_Bool			IsInplaceEditingEnabled() const { return SvLBox::IsInplaceEditingEnabled(); }
ForbidEmptyText()254cdf0e10cSrcweir     inline void     ForbidEmptyText() { SvLBox::ForbidEmptyText(); }
255cdf0e10cSrcweir 	// Editiert das erste StringItem des Entries, 0==Cursor
256cdf0e10cSrcweir 	void			EditEntry( SvLBoxEntry* pEntry = NULL );
257cdf0e10cSrcweir 	void			CancelEditing();
258cdf0e10cSrcweir 	virtual sal_Bool	EditingEntry( SvLBoxEntry* pEntry, Selection& );
259cdf0e10cSrcweir 	virtual sal_Bool	EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText );
IsEditingActive() const260cdf0e10cSrcweir 	sal_Bool			IsEditingActive() const { return SvLBox::IsEditingActive(); }
EndEditing(sal_Bool bCancel=sal_False)261cdf0e10cSrcweir 	void			EndEditing( sal_Bool bCancel = sal_False ) { SvLBox::EndEditing( bCancel ); }
EditingCanceled() const262cdf0e10cSrcweir 	sal_Bool			EditingCanceled() const { return SvLBox::EditingCanceled(); }
263cdf0e10cSrcweir 
264cdf0e10cSrcweir 	virtual void	RequestingChilds( SvLBoxEntry* pParent );
265cdf0e10cSrcweir 
266cdf0e10cSrcweir 	virtual void    Paint( const Rectangle& rRect );
267cdf0e10cSrcweir 	virtual void    MouseButtonDown( const MouseEvent& rMEvt );
268cdf0e10cSrcweir 	virtual void    MouseButtonUp( const MouseEvent& rMEvt );
269cdf0e10cSrcweir 	virtual void    MouseMove( const MouseEvent& rMEvt );
270cdf0e10cSrcweir 	virtual void    KeyInput( const KeyEvent& rKEvt );
271cdf0e10cSrcweir 	virtual void    Resize();
272cdf0e10cSrcweir 	virtual void    GetFocus();
273cdf0e10cSrcweir 	virtual void    LoseFocus();
274cdf0e10cSrcweir 	void 			SetUpdateMode( sal_Bool );
275cdf0e10cSrcweir 	// aktualisiert nicht die vertikale ScrollBar
276cdf0e10cSrcweir 	void 			SetUpdateModeFast( sal_Bool );
277cdf0e10cSrcweir 
278cdf0e10cSrcweir     using SvListView::SetModel;
279cdf0e10cSrcweir 	void			SetModel( SvLBoxTreeList* );
280cdf0e10cSrcweir 	virtual void 	ModelHasCleared();
281cdf0e10cSrcweir 	virtual void 	ModelHasInserted( SvListEntry* pEntry );
282cdf0e10cSrcweir 	virtual void 	ModelHasInsertedTree( SvListEntry* pEntry );
283cdf0e10cSrcweir 	virtual void 	ModelIsMoving(SvListEntry* pSource,
284cdf0e10cSrcweir 						SvListEntry* pTargetParent, sal_uLong nChildPos );
285cdf0e10cSrcweir 	virtual void 	ModelHasMoved(SvListEntry* pSource );
286cdf0e10cSrcweir 	virtual void 	ModelIsRemoving( SvListEntry* pEntry );
287cdf0e10cSrcweir 	virtual void 	ModelHasRemoved( SvListEntry* pEntry );
288cdf0e10cSrcweir 	virtual void 	ModelHasEntryInvalidated( SvListEntry* pEntry );
289cdf0e10cSrcweir 
290cdf0e10cSrcweir 	void			ShowTargetEmphasis( SvLBoxEntry*, sal_Bool bShow );
291cdf0e10cSrcweir     using Window::GetDropTarget;
292cdf0e10cSrcweir 	SvLBoxEntry*	GetDropTarget( const Point& );
293cdf0e10cSrcweir 	void			ScrollOutputArea( short nDeltaEntries );
294cdf0e10cSrcweir 
GetEntryHeight() const295cdf0e10cSrcweir 	short			GetEntryHeight() const 	{ return nEntryHeight; }
296cdf0e10cSrcweir 	void			SetEntryHeight( short nHeight, sal_Bool bAlways = sal_False );
297cdf0e10cSrcweir 	Size			GetOutputSizePixel() const;
GetIndent() const298cdf0e10cSrcweir 	short			GetIndent() const { return nIndent; }
299cdf0e10cSrcweir 	void			SetIndent( short nIndent );
300cdf0e10cSrcweir 	void			SetSpaceBetweenEntries( short nSpace );
GetSpaceBetweenEntries() const301cdf0e10cSrcweir 	short			GetSpaceBetweenEntries() const {return nEntryHeightOffs;}
302cdf0e10cSrcweir 	Point			GetEntryPosition( SvLBoxEntry* ) const;
303cdf0e10cSrcweir 	void			ShowEntry( SvLBoxEntry* );  // !!!OBSOLETE, use MakeVisible
304cdf0e10cSrcweir 	virtual void	MakeVisible( SvLBoxEntry* );
305cdf0e10cSrcweir 	void			MakeVisible( SvLBoxEntry*, sal_Bool bMoveToTop );
306cdf0e10cSrcweir 
307cdf0e10cSrcweir 	void          	SetCollapsedNodeBmp( const Image&, BmpColorMode _eMode = BMP_COLOR_NORMAL );
308cdf0e10cSrcweir 	void          	SetExpandedNodeBmp( const Image&, BmpColorMode _eMode = BMP_COLOR_NORMAL  );
309cdf0e10cSrcweir 	Image          	GetCollapsedNodeBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
310cdf0e10cSrcweir 	Image          	GetExpandedNodeBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
311cdf0e10cSrcweir 
312cdf0e10cSrcweir 	void			SetFont( const Font& rFont );
313cdf0e10cSrcweir 
314cdf0e10cSrcweir     using Window::SetCursor;
315cdf0e10cSrcweir 	void			SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect = sal_False );
316cdf0e10cSrcweir 
317cdf0e10cSrcweir 	SvLBoxEntry*	GetEntry( const Point& rPos, sal_Bool bHit = sal_False ) const;
GetEntry(SvLBoxEntry * pParent,sal_uLong nPos) const318cdf0e10cSrcweir 	SvLBoxEntry*	GetEntry( SvLBoxEntry* pParent, sal_uLong nPos ) const { return SvLBox::GetEntry(pParent,nPos); }
GetEntry(sal_uLong nRootPos) const319cdf0e10cSrcweir 	SvLBoxEntry*	GetEntry( sal_uLong nRootPos ) const { return SvLBox::GetEntry(nRootPos);}
320cdf0e10cSrcweir 
321cdf0e10cSrcweir 	void			PaintEntry( SvLBoxEntry* );
322cdf0e10cSrcweir 	long			PaintEntry( SvLBoxEntry*, long nLine,
323cdf0e10cSrcweir 								sal_uInt16 nTabFlagMask=0xffff );
324cdf0e10cSrcweir 	virtual Rectangle GetFocusRect( SvLBoxEntry*, long nLine );
325cdf0e10cSrcweir 	// Beruecksichtigt Einrueckung
326cdf0e10cSrcweir 	virtual long	GetTabPos( SvLBoxEntry*, SvLBoxTab* );
327cdf0e10cSrcweir 	void			InvalidateEntry( SvLBoxEntry* );
328cdf0e10cSrcweir 	SvLBoxItem*		GetItem( SvLBoxEntry*, long nX, SvLBoxTab** ppTab);
329cdf0e10cSrcweir 	SvLBoxItem*		GetItem( SvLBoxEntry*, long nX );
330cdf0e10cSrcweir 	SvLBoxItem*		GetFirstDynamicItem( SvLBoxEntry* pEntry );
331cdf0e10cSrcweir 
332cdf0e10cSrcweir 	void			SetDragDropMode( DragDropMode );
333cdf0e10cSrcweir 	void 			SetSelectionMode( SelectionMode );
334cdf0e10cSrcweir 	void			SetAddMode( sal_Bool bAdd );
335cdf0e10cSrcweir 	sal_Bool			IsAddMode() const;
336cdf0e10cSrcweir 
337cdf0e10cSrcweir 	virtual sal_Bool    Expand( SvLBoxEntry* pParent );
338cdf0e10cSrcweir 	virtual sal_Bool    Collapse( SvLBoxEntry* pParent );
339cdf0e10cSrcweir 	virtual sal_Bool    Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True );
340cdf0e10cSrcweir 	virtual sal_uLong	SelectChilds( SvLBoxEntry* pParent, sal_Bool bSelect );
341cdf0e10cSrcweir 	virtual void	SelectAll( sal_Bool bSelect, sal_Bool bPaint = sal_True );
342cdf0e10cSrcweir     virtual void    SetCurEntry( SvLBoxEntry* _pEntry );
343cdf0e10cSrcweir     virtual SvLBoxEntry*
344cdf0e10cSrcweir                     GetCurEntry() const;
345cdf0e10cSrcweir 
346cdf0e10cSrcweir     using Window::Invalidate;
347cdf0e10cSrcweir 	virtual void	Invalidate( sal_uInt16 nFlags = 0);
348cdf0e10cSrcweir 	virtual void	Invalidate( const Rectangle&, sal_uInt16 nFlags = 0 );
349cdf0e10cSrcweir 
350cdf0e10cSrcweir 	void			SetHighlightRange(sal_uInt16 nFirstTab=0,sal_uInt16 nLastTab=0xffff);
351cdf0e10cSrcweir 	void			RemoveHighlightRange();
352cdf0e10cSrcweir 
353cdf0e10cSrcweir 	virtual Region	GetDragRegion() const;
354cdf0e10cSrcweir 
355cdf0e10cSrcweir 	// Childs des Parents werden Childs des naechstoberen Parents
356cdf0e10cSrcweir 	void			RemoveParentKeepChilds( SvLBoxEntry* pParent );
357cdf0e10cSrcweir 
358cdf0e10cSrcweir 	DECL_LINK( DefaultCompare, SvSortData* );
359cdf0e10cSrcweir 	virtual void	ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
360cdf0e10cSrcweir 						SvListEntry* pEntry2, sal_uLong nPos );
361cdf0e10cSrcweir 
362cdf0e10cSrcweir 	long			GetTextOffset() const;
363cdf0e10cSrcweir 	void			EndSelection();
364cdf0e10cSrcweir 	sal_Bool			IsNodeButton( const Point& rPos ) const;
365cdf0e10cSrcweir 	void			RepaintScrollBars() const;
366cdf0e10cSrcweir 	ScrollBar*		GetVScroll();
367cdf0e10cSrcweir 	ScrollBar*		GetHScroll();
368cdf0e10cSrcweir 	void			EnableAsyncDrag( sal_Bool b );
369cdf0e10cSrcweir 
370cdf0e10cSrcweir 	SvLBoxEntry*	GetFirstEntryInView() const;
371cdf0e10cSrcweir 	SvLBoxEntry*	GetNextEntryInView(SvLBoxEntry*) const;
372cdf0e10cSrcweir 
373cdf0e10cSrcweir 	void			ShowFocusRect( const SvLBoxEntry* pEntry );
374cdf0e10cSrcweir 	void			SetTabBar( TabBar* pTabBar );
375cdf0e10cSrcweir 	void			InitStartEntry();
376cdf0e10cSrcweir 
377cdf0e10cSrcweir 	// reset all what could lead to editingText in e.g. a contextmenu call
378cdf0e10cSrcweir 	void			CancelPendingEdit();
379cdf0e10cSrcweir 
380cdf0e10cSrcweir 	virtual PopupMenu* CreateContextMenu( void );
381cdf0e10cSrcweir 	virtual void	ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry );
382cdf0e10cSrcweir 
383cdf0e10cSrcweir 	void			EnableContextMenuHandling( void );
384cdf0e10cSrcweir 	void			EnableContextMenuHandling( sal_Bool bEnable );
385cdf0e10cSrcweir 	sal_Bool			IsContextMenuHandlingEnabled( void ) const;
386cdf0e10cSrcweir 
387cdf0e10cSrcweir     void            EnableList( bool _bEnable );
388cdf0e10cSrcweir 
389cdf0e10cSrcweir     // ACCESSIBILITY ==========================================================
390cdf0e10cSrcweir 
391cdf0e10cSrcweir     /** Creates and returns the accessible object of the Box. */
392cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
393cdf0e10cSrcweir 		::com::sun::star::accessibility::XAccessible > CreateAccessible();
394cdf0e10cSrcweir 
395cdf0e10cSrcweir     /** Fills the StateSet with all states (except DEFUNC, done by the accessible object). */
396cdf0e10cSrcweir     virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& rStateSet ) const;
397cdf0e10cSrcweir 
398cdf0e10cSrcweir     /** Fills the StateSet of one entry. */
399cdf0e10cSrcweir     virtual void FillAccessibleEntryStateSet( SvLBoxEntry* pEntry, ::utl::AccessibleStateSetHelper& rStateSet ) const;
400cdf0e10cSrcweir 
401cdf0e10cSrcweir     /** Calculate and returns the bounding rectangle of an entry.
402cdf0e10cSrcweir 		@param pEntry
403cdf0e10cSrcweir 			The entry.
404cdf0e10cSrcweir         @return  The bounding rectangle of an entry. */
405cdf0e10cSrcweir 	virtual Rectangle	GetBoundingRect( SvLBoxEntry* pEntry );
406cdf0e10cSrcweir 
407cdf0e10cSrcweir 	/** Enables, that one cell of a tablistbox entry can be focused */
408cdf0e10cSrcweir 	void				EnableCellFocus();
409cdf0e10cSrcweir 
410*2bfcd321SSteve Yin 						// For overwriting accessible role for all entries - normally 0, so each entry can be different
SetAllEntriesAccessibleRoleType(short n)411*2bfcd321SSteve Yin 	void				SetAllEntriesAccessibleRoleType( short n ) { nAllItemAccRoleType = n; }
GetAllEntriesAccessibleRoleType() const412*2bfcd321SSteve Yin 	short				GetAllEntriesAccessibleRoleType() const { return nAllItemAccRoleType; }
413*2bfcd321SSteve Yin 
GetTreeFlags() const414*2bfcd321SSteve Yin 	sal_uInt16 			GetTreeFlags() const {return nTreeFlags;}
415*2bfcd321SSteve Yin 
416*2bfcd321SSteve Yin 	XubString			headString ;
417*2bfcd321SSteve Yin 	String				SearchEntryTextWithHeadTitle( SvLBoxEntry* pEntry ) ;
418*2bfcd321SSteve Yin 	virtual	String		GetEntryAltText( SvLBoxEntry* pEntry) const;
419*2bfcd321SSteve Yin 	virtual	String		GetEntryLongDescription( SvLBoxEntry* pEntry) const;
420*2bfcd321SSteve Yin 
421cdf0e10cSrcweir protected:
422cdf0e10cSrcweir     using SvListView::Expand;
423cdf0e10cSrcweir     using SvListView::Collapse;
424cdf0e10cSrcweir     using SvListView::Select;
425cdf0e10cSrcweir     using SvListView::SelectChilds;
426cdf0e10cSrcweir     using SvListView::SelectAll;
427cdf0e10cSrcweir };
428cdf0e10cSrcweir 
429cdf0e10cSrcweir #endif
430cdf0e10cSrcweir 
431