xref: /aoo41x/main/svtools/source/contnr/svicnvw.cxx (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 // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_svtools.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <svtools/svlbox.hxx>
32*cdf0e10cSrcweir #include <svtools/svicnvw.hxx>
33*cdf0e10cSrcweir #include <svimpicn.hxx>
34*cdf0e10cSrcweir #include <svtools/svlbitm.hxx>
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir #ifndef GCC
37*cdf0e10cSrcweir #endif
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir #define ICNVW_BLOCK_ENTRYINS	0x0001
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir SvIcnVwDataEntry::SvIcnVwDataEntry()
42*cdf0e10cSrcweir 	: nIcnVwFlags(0),eTextMode(ShowTextDontKnow)
43*cdf0e10cSrcweir {
44*cdf0e10cSrcweir }
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir SvIcnVwDataEntry::~SvIcnVwDataEntry()
47*cdf0e10cSrcweir {
48*cdf0e10cSrcweir }
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir SvIconView::SvIconView( Window* pParent, WinBits nWinStyle ) :
51*cdf0e10cSrcweir 	SvLBox( pParent, nWinStyle | WB_BORDER )
52*cdf0e10cSrcweir {
53*cdf0e10cSrcweir 	nIcnVwFlags = 0;
54*cdf0e10cSrcweir 	pImp = new SvImpIconView( this, GetModel(), nWinStyle | WB_ICON );
55*cdf0e10cSrcweir 	pImp->mpViewData = 0;
56*cdf0e10cSrcweir 	SetSelectionMode( SINGLE_SELECTION );
57*cdf0e10cSrcweir 	SetLineColor();
58*cdf0e10cSrcweir 	const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
59*cdf0e10cSrcweir 	SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) );
60*cdf0e10cSrcweir 	SetDefaultFont();
61*cdf0e10cSrcweir }
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir SvIconView::SvIconView( Window* pParent , const ResId& rResId ) :
64*cdf0e10cSrcweir 	SvLBox( pParent, rResId )
65*cdf0e10cSrcweir {
66*cdf0e10cSrcweir 	pImp = new SvImpIconView( this, GetModel(), WB_BORDER | WB_ICON );
67*cdf0e10cSrcweir 	nIcnVwFlags = 0;
68*cdf0e10cSrcweir 	pImp->mpViewData = 0;
69*cdf0e10cSrcweir 	SetLineColor();
70*cdf0e10cSrcweir 	const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
71*cdf0e10cSrcweir 	SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) );
72*cdf0e10cSrcweir 	SetDefaultFont();
73*cdf0e10cSrcweir 	pImp->SetSelectionMode( GetSelectionMode() );
74*cdf0e10cSrcweir }
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir SvIconView::~SvIconView()
77*cdf0e10cSrcweir {
78*cdf0e10cSrcweir 	delete pImp;
79*cdf0e10cSrcweir }
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir void SvIconView::SetDefaultFont()
82*cdf0e10cSrcweir {
83*cdf0e10cSrcweir 	SetFont( GetFont() );
84*cdf0e10cSrcweir }
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir SvLBoxEntry* SvIconView::CreateEntry( const XubString& rStr,
87*cdf0e10cSrcweir 	const Image& rCollEntryBmp, const Image& rExpEntryBmp )
88*cdf0e10cSrcweir {
89*cdf0e10cSrcweir 	SvLBoxEntry* pEntry = new SvLBoxEntry;
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir 	SvLBoxContextBmp* pContextBmp =
92*cdf0e10cSrcweir 	  new SvLBoxContextBmp( pEntry,0, rCollEntryBmp,rExpEntryBmp, 0xffff );
93*cdf0e10cSrcweir 	pEntry->AddItem( pContextBmp );
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir 	SvLBoxString* pString = new SvLBoxString( pEntry, 0, rStr );
96*cdf0e10cSrcweir 	pEntry->AddItem( pString );
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir 	return pEntry;
99*cdf0e10cSrcweir }
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir void SvIconView::DisconnectFromModel()
102*cdf0e10cSrcweir {
103*cdf0e10cSrcweir 	SvLBox::DisconnectFromModel();
104*cdf0e10cSrcweir 	pImp->SetModel( GetModel(), 0 );
105*cdf0e10cSrcweir }
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
109*cdf0e10cSrcweir 	SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos )
110*cdf0e10cSrcweir {
111*cdf0e10cSrcweir 	SvLBoxEntry* pEntry = CreateEntry(
112*cdf0e10cSrcweir 		rText, aCollapsedEntryBmp, aExpandedEntryBmp );
113*cdf0e10cSrcweir 	pEntry->EnableChildsOnDemand( bChildsOnDemand );
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir 	if ( !pParent )
116*cdf0e10cSrcweir 		SvLBox::Insert( pEntry, nPos );
117*cdf0e10cSrcweir 	else
118*cdf0e10cSrcweir 		SvLBox::Insert( pEntry, pParent, nPos );
119*cdf0e10cSrcweir 	return pEntry;
120*cdf0e10cSrcweir }
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
123*cdf0e10cSrcweir 	const Image& rExpEntryBmp,
124*cdf0e10cSrcweir 	const Image& rCollEntryBmp,
125*cdf0e10cSrcweir 	SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos)
126*cdf0e10cSrcweir {
127*cdf0e10cSrcweir 	SvLBoxEntry* pEntry = CreateEntry(
128*cdf0e10cSrcweir 		rText, rCollEntryBmp, rExpEntryBmp );
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir 	pEntry->EnableChildsOnDemand( bChildsOnDemand );
131*cdf0e10cSrcweir 	if ( !pParent )
132*cdf0e10cSrcweir 		SvLBox::Insert( pEntry, nPos );
133*cdf0e10cSrcweir 	else
134*cdf0e10cSrcweir 		SvLBox::Insert( pEntry, pParent, nPos );
135*cdf0e10cSrcweir 	return pEntry;
136*cdf0e10cSrcweir }
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir void SvIconView::SetEntryText(SvLBoxEntry* pEntry, const XubString& rStr)
140*cdf0e10cSrcweir {
141*cdf0e10cSrcweir 	SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
142*cdf0e10cSrcweir 	if ( pItem )
143*cdf0e10cSrcweir 	{
144*cdf0e10cSrcweir 		pItem->SetText( pEntry, rStr );
145*cdf0e10cSrcweir 		GetModel()->InvalidateEntry( pEntry );
146*cdf0e10cSrcweir 	}
147*cdf0e10cSrcweir }
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir void SvIconView::SetExpandedEntryBmp(SvLBoxEntry* pEntry, const Image& rBmp)
150*cdf0e10cSrcweir {
151*cdf0e10cSrcweir 	SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
152*cdf0e10cSrcweir 	if ( pItem )
153*cdf0e10cSrcweir 	{
154*cdf0e10cSrcweir 		pItem->SetBitmap2( rBmp );
155*cdf0e10cSrcweir 		GetModel()->InvalidateEntry( pEntry );
156*cdf0e10cSrcweir 	}
157*cdf0e10cSrcweir }
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir void SvIconView::SetCollapsedEntryBmp(SvLBoxEntry* pEntry,
160*cdf0e10cSrcweir 	const Image& rBmp )
161*cdf0e10cSrcweir {
162*cdf0e10cSrcweir 	SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
163*cdf0e10cSrcweir 	if ( pItem )
164*cdf0e10cSrcweir 	{
165*cdf0e10cSrcweir 		pItem->SetBitmap1( rBmp );
166*cdf0e10cSrcweir 		GetModel()->InvalidateEntry( pEntry );
167*cdf0e10cSrcweir 	}
168*cdf0e10cSrcweir }
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir XubString SvIconView::GetEntryText(SvLBoxEntry* pEntry ) const
171*cdf0e10cSrcweir {
172*cdf0e10cSrcweir 	XubString aStr;
173*cdf0e10cSrcweir 	SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
174*cdf0e10cSrcweir 	if ( pItem )
175*cdf0e10cSrcweir 		aStr = pItem->GetText();
176*cdf0e10cSrcweir 	return aStr;
177*cdf0e10cSrcweir }
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir Image SvIconView::GetExpandedEntryBmp(SvLBoxEntry* pEntry) const
180*cdf0e10cSrcweir {
181*cdf0e10cSrcweir 	Image aBmp;
182*cdf0e10cSrcweir 	SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
183*cdf0e10cSrcweir 	if ( pItem )
184*cdf0e10cSrcweir 		aBmp = pItem->GetBitmap2();
185*cdf0e10cSrcweir 	return aBmp;
186*cdf0e10cSrcweir }
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir Image SvIconView::GetCollapsedEntryBmp(SvLBoxEntry* pEntry) const
189*cdf0e10cSrcweir {
190*cdf0e10cSrcweir 	Image aBmp;
191*cdf0e10cSrcweir 	SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
192*cdf0e10cSrcweir 	if ( pItem )
193*cdf0e10cSrcweir 		aBmp = pItem->GetBitmap1();
194*cdf0e10cSrcweir 	return aBmp;
195*cdf0e10cSrcweir }
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir SvLBoxEntry* SvIconView::CloneEntry( SvLBoxEntry* pSource )
199*cdf0e10cSrcweir {
200*cdf0e10cSrcweir 	XubString aStr;
201*cdf0e10cSrcweir 	Image aCollEntryBmp;
202*cdf0e10cSrcweir 	Image aExpEntryBmp;
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir 	SvLBoxString* pStringItem = (SvLBoxString*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
205*cdf0e10cSrcweir 	if ( pStringItem )
206*cdf0e10cSrcweir 		aStr = pStringItem->GetText();
207*cdf0e10cSrcweir 	SvLBoxContextBmp* pBmpItem =(SvLBoxContextBmp*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
208*cdf0e10cSrcweir 	if ( pBmpItem )
209*cdf0e10cSrcweir 	{
210*cdf0e10cSrcweir 		aCollEntryBmp = pBmpItem->GetBitmap1();
211*cdf0e10cSrcweir 		aExpEntryBmp  = pBmpItem->GetBitmap2();
212*cdf0e10cSrcweir 	}
213*cdf0e10cSrcweir 	SvLBoxEntry* pEntry = CreateEntry( aStr, aCollEntryBmp, aExpEntryBmp );
214*cdf0e10cSrcweir 	pEntry->SvListEntry::Clone( pSource );
215*cdf0e10cSrcweir 	pEntry->EnableChildsOnDemand( pSource->HasChildsOnDemand() );
216*cdf0e10cSrcweir 	pEntry->SetUserData( pSource->GetUserData() );
217*cdf0e10cSrcweir 	return pEntry;
218*cdf0e10cSrcweir }
219*cdf0e10cSrcweir 
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir sal_uInt16 SvIconView::IsA()
222*cdf0e10cSrcweir {
223*cdf0e10cSrcweir 	return SV_LISTBOX_ID_ICONVIEW;
224*cdf0e10cSrcweir }
225*cdf0e10cSrcweir 
226*cdf0e10cSrcweir void SvIconView::RequestingChilds( SvLBoxEntry* pParent )
227*cdf0e10cSrcweir {
228*cdf0e10cSrcweir 	if ( !pParent->HasChilds() )
229*cdf0e10cSrcweir 		InsertEntry( String::CreateFromAscii("<dummy>"), pParent, sal_False, LIST_APPEND );
230*cdf0e10cSrcweir }
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir void __EXPORT SvIconView::Paint( const Rectangle& rRect )
233*cdf0e10cSrcweir {
234*cdf0e10cSrcweir 	pImp->Paint( rRect );
235*cdf0e10cSrcweir }
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir void __EXPORT SvIconView::MouseButtonDown( const MouseEvent& rMEvt )
238*cdf0e10cSrcweir {
239*cdf0e10cSrcweir 	pImp->MouseButtonDown( rMEvt );
240*cdf0e10cSrcweir }
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir void __EXPORT SvIconView::MouseButtonUp( const MouseEvent& rMEvt )
243*cdf0e10cSrcweir {
244*cdf0e10cSrcweir 	pImp->MouseButtonUp( rMEvt );
245*cdf0e10cSrcweir }
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir void __EXPORT SvIconView::MouseMove( const MouseEvent& rMEvt )
248*cdf0e10cSrcweir {
249*cdf0e10cSrcweir 	pImp->MouseMove( rMEvt );
250*cdf0e10cSrcweir }
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir void __EXPORT SvIconView::KeyInput( const KeyEvent& rKEvt )
253*cdf0e10cSrcweir {
254*cdf0e10cSrcweir 	// unter OS/2 bekommen wir auch beim Editieren Key-Up/Down
255*cdf0e10cSrcweir 	if( IsEditingActive() )
256*cdf0e10cSrcweir 		return;
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir 	nImpFlags |= SVLBOX_IS_TRAVELSELECT;
259*cdf0e10cSrcweir 	sal_Bool bKeyUsed = pImp->KeyInput( rKEvt );
260*cdf0e10cSrcweir 	if ( !bKeyUsed )
261*cdf0e10cSrcweir 		SvLBox::KeyInput( rKEvt );
262*cdf0e10cSrcweir 	nImpFlags &= ~SVLBOX_IS_TRAVELSELECT;
263*cdf0e10cSrcweir }
264*cdf0e10cSrcweir 
265*cdf0e10cSrcweir void __EXPORT SvIconView::Resize()
266*cdf0e10cSrcweir {
267*cdf0e10cSrcweir 	pImp->Resize();
268*cdf0e10cSrcweir 	SvLBox::Resize();
269*cdf0e10cSrcweir }
270*cdf0e10cSrcweir 
271*cdf0e10cSrcweir void __EXPORT SvIconView::GetFocus()
272*cdf0e10cSrcweir {
273*cdf0e10cSrcweir 	pImp->GetFocus();
274*cdf0e10cSrcweir 	SvLBox::GetFocus();
275*cdf0e10cSrcweir }
276*cdf0e10cSrcweir 
277*cdf0e10cSrcweir void __EXPORT SvIconView::LoseFocus()
278*cdf0e10cSrcweir {
279*cdf0e10cSrcweir 	pImp->LoseFocus();
280*cdf0e10cSrcweir 	SvLBox::LoseFocus();
281*cdf0e10cSrcweir }
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir void SvIconView::SetUpdateMode( sal_Bool bUpdate )
284*cdf0e10cSrcweir {
285*cdf0e10cSrcweir 	Control::SetUpdateMode( bUpdate );
286*cdf0e10cSrcweir 	if ( bUpdate )
287*cdf0e10cSrcweir 		pImp->UpdateAll();
288*cdf0e10cSrcweir }
289*cdf0e10cSrcweir 
290*cdf0e10cSrcweir void SvIconView::SetModel( SvLBoxTreeList* )
291*cdf0e10cSrcweir {
292*cdf0e10cSrcweir }
293*cdf0e10cSrcweir 
294*cdf0e10cSrcweir void SvIconView::SetModel( SvLBoxTreeList* pNewModel, SvLBoxEntry* pParent )
295*cdf0e10cSrcweir {
296*cdf0e10cSrcweir 	nIcnVwFlags |= ICNVW_BLOCK_ENTRYINS;
297*cdf0e10cSrcweir 	SvLBox::SetModel( pNewModel );
298*cdf0e10cSrcweir 	nIcnVwFlags &= (~ICNVW_BLOCK_ENTRYINS);
299*cdf0e10cSrcweir 	if ( pParent && pParent->HasChildsOnDemand() )
300*cdf0e10cSrcweir 		RequestingChilds( pParent );
301*cdf0e10cSrcweir 	pImp->SetModel( pNewModel, pParent );
302*cdf0e10cSrcweir }
303*cdf0e10cSrcweir 
304*cdf0e10cSrcweir void __EXPORT SvIconView::ModelHasCleared()
305*cdf0e10cSrcweir {
306*cdf0e10cSrcweir 	SvLBox::ModelHasCleared();
307*cdf0e10cSrcweir 	pImp->Clear();
308*cdf0e10cSrcweir }
309*cdf0e10cSrcweir 
310*cdf0e10cSrcweir void __EXPORT SvIconView::ModelHasInserted( SvListEntry* pEntry )
311*cdf0e10cSrcweir {
312*cdf0e10cSrcweir 	if( !(nIcnVwFlags & ICNVW_BLOCK_ENTRYINS ) )
313*cdf0e10cSrcweir 		pImp->EntryInserted( (SvLBoxEntry*)pEntry );
314*cdf0e10cSrcweir }
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir void __EXPORT SvIconView::ModelHasInsertedTree( SvListEntry* pEntry )
317*cdf0e10cSrcweir {
318*cdf0e10cSrcweir 	pImp->TreeInserted( (SvLBoxEntry*)pEntry );
319*cdf0e10cSrcweir }
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir void __EXPORT SvIconView::ModelIsMoving(SvListEntry* pSource,
322*cdf0e10cSrcweir 		SvListEntry* /* pTargetParent */ , sal_uLong /* nChildPos */ )
323*cdf0e10cSrcweir {
324*cdf0e10cSrcweir 	pImp->MovingEntry( (SvLBoxEntry*)pSource );
325*cdf0e10cSrcweir }
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir void __EXPORT SvIconView::ModelHasMoved(SvListEntry* pSource )
328*cdf0e10cSrcweir {
329*cdf0e10cSrcweir 	pImp->EntryMoved( (SvLBoxEntry*)pSource );
330*cdf0e10cSrcweir }
331*cdf0e10cSrcweir 
332*cdf0e10cSrcweir void __EXPORT SvIconView::ModelIsRemoving( SvListEntry* pEntry )
333*cdf0e10cSrcweir {
334*cdf0e10cSrcweir 	pImp->RemovingEntry( (SvLBoxEntry*)pEntry );
335*cdf0e10cSrcweir 	NotifyRemoving( (SvLBoxEntry*)pEntry );
336*cdf0e10cSrcweir }
337*cdf0e10cSrcweir 
338*cdf0e10cSrcweir void __EXPORT SvIconView::ModelHasRemoved( SvListEntry* /* pEntry */ )
339*cdf0e10cSrcweir {
340*cdf0e10cSrcweir 	pImp->EntryRemoved();
341*cdf0e10cSrcweir }
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir void __EXPORT SvIconView::ModelHasEntryInvalidated( SvListEntry* pEntry )
344*cdf0e10cSrcweir {
345*cdf0e10cSrcweir 	// die einzelnen Items des Entries reinitialisieren
346*cdf0e10cSrcweir 	SvLBox::ModelHasEntryInvalidated( pEntry );
347*cdf0e10cSrcweir 	// painten
348*cdf0e10cSrcweir 	pImp->ModelHasEntryInvalidated( pEntry );
349*cdf0e10cSrcweir }
350*cdf0e10cSrcweir 
351*cdf0e10cSrcweir void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow )
352*cdf0e10cSrcweir {
353*cdf0e10cSrcweir 	pImp->ShowTargetEmphasis( pEntry, bShow );
354*cdf0e10cSrcweir }
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir Point SvIconView::GetEntryPosition( SvLBoxEntry* pEntry ) const
357*cdf0e10cSrcweir {
358*cdf0e10cSrcweir 	return ((SvIconView*)this)->pImp->GetEntryPosition( pEntry );
359*cdf0e10cSrcweir }
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos)
362*cdf0e10cSrcweir {
363*cdf0e10cSrcweir 	pImp->SetEntryPosition( pEntry, rPos, sal_False, sal_True );
364*cdf0e10cSrcweir }
365*cdf0e10cSrcweir 
366*cdf0e10cSrcweir void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, sal_Bool bAdjustAtGrid )
367*cdf0e10cSrcweir {
368*cdf0e10cSrcweir 	pImp->SetEntryPosition( pEntry, rPos, bAdjustAtGrid );
369*cdf0e10cSrcweir }
370*cdf0e10cSrcweir 
371*cdf0e10cSrcweir void SvIconView::SetFont( const Font& rFont )
372*cdf0e10cSrcweir {
373*cdf0e10cSrcweir 	Font aTempFont( rFont );
374*cdf0e10cSrcweir 	aTempFont.SetTransparent( sal_True );
375*cdf0e10cSrcweir 	SvLBox::SetFont( aTempFont );
376*cdf0e10cSrcweir 	RecalcViewData();
377*cdf0e10cSrcweir 	pImp->ChangedFont();
378*cdf0e10cSrcweir }
379*cdf0e10cSrcweir 
380*cdf0e10cSrcweir void SvIconView::ViewDataInitialized( SvLBoxEntry* pEntry )
381*cdf0e10cSrcweir {
382*cdf0e10cSrcweir 	pImp->ViewDataInitialized( pEntry );
383*cdf0e10cSrcweir }
384*cdf0e10cSrcweir 
385*cdf0e10cSrcweir SvLBoxEntry* SvIconView::GetDropTarget( const Point& rPos )
386*cdf0e10cSrcweir {
387*cdf0e10cSrcweir 	return pImp->GetDropTarget( rPos );
388*cdf0e10cSrcweir }
389*cdf0e10cSrcweir 
390*cdf0e10cSrcweir SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, sal_Bool ) const
391*cdf0e10cSrcweir {
392*cdf0e10cSrcweir 	Point aPos( rPixPos );
393*cdf0e10cSrcweir 	aPos -= GetMapMode().GetOrigin();
394*cdf0e10cSrcweir 	return ((SvIconView*)this)->pImp->GetEntry( aPos );
395*cdf0e10cSrcweir }
396*cdf0e10cSrcweir 
397*cdf0e10cSrcweir SvLBoxEntry* SvIconView::GetEntryFromLogicPos( const Point& rDocPos ) const
398*cdf0e10cSrcweir {
399*cdf0e10cSrcweir 	return ((SvIconView*)this)->pImp->GetEntry( rDocPos );
400*cdf0e10cSrcweir }
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir 
403*cdf0e10cSrcweir void SvIconView::StateChanged( StateChangedType i_nStateChange )
404*cdf0e10cSrcweir {
405*cdf0e10cSrcweir     SvLBox::StateChanged( i_nStateChange );
406*cdf0e10cSrcweir     if ( i_nStateChange == STATE_CHANGE_STYLE )
407*cdf0e10cSrcweir 	    pImp->SetStyle( GetStyle() );
408*cdf0e10cSrcweir }
409*cdf0e10cSrcweir 
410*cdf0e10cSrcweir void SvIconView::PaintEntry( SvLBoxEntry* pEntry )
411*cdf0e10cSrcweir {
412*cdf0e10cSrcweir 	pImp->PaintEntry( pEntry );
413*cdf0e10cSrcweir }
414*cdf0e10cSrcweir 
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir void SvIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos )
417*cdf0e10cSrcweir {
418*cdf0e10cSrcweir 	pImp->PaintEntry( pEntry, rPos );
419*cdf0e10cSrcweir }
420*cdf0e10cSrcweir 
421*cdf0e10cSrcweir Rectangle SvIconView::GetFocusRect( SvLBoxEntry* pEntry )
422*cdf0e10cSrcweir {
423*cdf0e10cSrcweir 	return pImp->CalcFocusRect( pEntry );
424*cdf0e10cSrcweir }
425*cdf0e10cSrcweir 
426*cdf0e10cSrcweir void SvIconView::InvalidateEntry( SvLBoxEntry* pEntry )
427*cdf0e10cSrcweir {
428*cdf0e10cSrcweir 	pImp->InvalidateEntry( pEntry );
429*cdf0e10cSrcweir }
430*cdf0e10cSrcweir 
431*cdf0e10cSrcweir void SvIconView::SetDragDropMode( DragDropMode nDDMode )
432*cdf0e10cSrcweir {
433*cdf0e10cSrcweir 	SvLBox::SetDragDropMode( nDDMode );
434*cdf0e10cSrcweir 	pImp->SetDragDropMode( nDDMode );
435*cdf0e10cSrcweir }
436*cdf0e10cSrcweir 
437*cdf0e10cSrcweir void SvIconView::SetSelectionMode( SelectionMode eSelectMode )
438*cdf0e10cSrcweir {
439*cdf0e10cSrcweir 	SvLBox::SetSelectionMode( eSelectMode );
440*cdf0e10cSrcweir 	pImp->SetSelectionMode( eSelectMode );
441*cdf0e10cSrcweir }
442*cdf0e10cSrcweir 
443*cdf0e10cSrcweir sal_Bool SvIconView::Select( SvLBoxEntry* pEntry, sal_Bool bSelect )
444*cdf0e10cSrcweir {
445*cdf0e10cSrcweir 	EndEditing();
446*cdf0e10cSrcweir 	sal_Bool bRetVal = SvListView::Select( pEntry, bSelect );
447*cdf0e10cSrcweir 	if( bRetVal )
448*cdf0e10cSrcweir 	{
449*cdf0e10cSrcweir 		pImp->EntrySelected( pEntry, bSelect );
450*cdf0e10cSrcweir 		pHdlEntry = pEntry;
451*cdf0e10cSrcweir 		SelectHdl();
452*cdf0e10cSrcweir 	}
453*cdf0e10cSrcweir 	return bRetVal;
454*cdf0e10cSrcweir }
455*cdf0e10cSrcweir 
456*cdf0e10cSrcweir void SvIconView::SelectAll( sal_Bool bSelect, sal_Bool )
457*cdf0e10cSrcweir {
458*cdf0e10cSrcweir 	SvLBoxEntry* pEntry = pImp->GetCurParent();
459*cdf0e10cSrcweir 	pEntry = FirstChild( pEntry );
460*cdf0e10cSrcweir 	while( pEntry )
461*cdf0e10cSrcweir 	{
462*cdf0e10cSrcweir 		Select( pEntry, bSelect );
463*cdf0e10cSrcweir 		pEntry = NextSibling( pEntry );
464*cdf0e10cSrcweir 	}
465*cdf0e10cSrcweir }
466*cdf0e10cSrcweir 
467*cdf0e10cSrcweir void SvIconView::SetCurEntry( SvLBoxEntry* _pEntry )
468*cdf0e10cSrcweir {
469*cdf0e10cSrcweir     pImp->SetCursor( _pEntry );
470*cdf0e10cSrcweir     OnCurrentEntryChanged();
471*cdf0e10cSrcweir }
472*cdf0e10cSrcweir 
473*cdf0e10cSrcweir SvLBoxEntry* SvIconView::GetCurEntry() const
474*cdf0e10cSrcweir {
475*cdf0e10cSrcweir 	return pImp->GetCurEntry();
476*cdf0e10cSrcweir }
477*cdf0e10cSrcweir 
478*cdf0e10cSrcweir void SvIconView::Arrange()
479*cdf0e10cSrcweir {
480*cdf0e10cSrcweir #ifdef DBG_UTIL
481*cdf0e10cSrcweir 	sal_uInt16 n=1;
482*cdf0e10cSrcweir 	if( n == 1 && n-1 == 0 )
483*cdf0e10cSrcweir 	{
484*cdf0e10cSrcweir 		pImp->Arrange();
485*cdf0e10cSrcweir 	}
486*cdf0e10cSrcweir 	else
487*cdf0e10cSrcweir 	{
488*cdf0e10cSrcweir 		pImp->AdjustAtGrid();
489*cdf0e10cSrcweir 	}
490*cdf0e10cSrcweir #else
491*cdf0e10cSrcweir 	pImp->Arrange();
492*cdf0e10cSrcweir #endif
493*cdf0e10cSrcweir }
494*cdf0e10cSrcweir 
495*cdf0e10cSrcweir 
496*cdf0e10cSrcweir void SvIconView::SetSpaceBetweenEntries( long nX, long nY )
497*cdf0e10cSrcweir {
498*cdf0e10cSrcweir 	pImp->SetSpaceBetweenEntries( nX, nY );
499*cdf0e10cSrcweir }
500*cdf0e10cSrcweir 
501*cdf0e10cSrcweir sal_Bool SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
502*cdf0e10cSrcweir 	SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos )
503*cdf0e10cSrcweir {
504*cdf0e10cSrcweir 	return pImp->NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos);
505*cdf0e10cSrcweir }
506*cdf0e10cSrcweir 
507*cdf0e10cSrcweir sal_Bool SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
508*cdf0e10cSrcweir 	SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos )
509*cdf0e10cSrcweir {
510*cdf0e10cSrcweir 	return pImp->NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos);
511*cdf0e10cSrcweir }
512*cdf0e10cSrcweir 
513*cdf0e10cSrcweir 
514*cdf0e10cSrcweir void SvIconView::EnableInplaceEditing( sal_Bool bEnable )
515*cdf0e10cSrcweir {
516*cdf0e10cSrcweir 	SvLBox::EnableInplaceEditing( bEnable );
517*cdf0e10cSrcweir }
518*cdf0e10cSrcweir 
519*cdf0e10cSrcweir void SvIconView::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
520*cdf0e10cSrcweir 								 const Point& )
521*cdf0e10cSrcweir {
522*cdf0e10cSrcweir 	if ( pItem->IsA() == SV_ITEM_ID_LBOXSTRING )
523*cdf0e10cSrcweir 	{
524*cdf0e10cSrcweir 		Selection aSel( SELECTION_MIN, SELECTION_MAX );
525*cdf0e10cSrcweir 		if ( EditingEntry( pEntry, aSel ) )
526*cdf0e10cSrcweir 		{
527*cdf0e10cSrcweir 			SelectAll( sal_False );
528*cdf0e10cSrcweir 			EditItemText( pEntry, (SvLBoxString*)pItem, aSel );
529*cdf0e10cSrcweir 		}
530*cdf0e10cSrcweir 	}
531*cdf0e10cSrcweir }
532*cdf0e10cSrcweir 
533*cdf0e10cSrcweir 
534*cdf0e10cSrcweir void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
535*cdf0e10cSrcweir 	const Selection& rSel )
536*cdf0e10cSrcweir {
537*cdf0e10cSrcweir 	DBG_ASSERT(pEntry&&pItem,"EditItemText:Params?");
538*cdf0e10cSrcweir 	pCurEdEntry = pEntry;
539*cdf0e10cSrcweir 	pCurEdItem = pItem;
540*cdf0e10cSrcweir 	Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,sal_True ));
541*cdf0e10cSrcweir 
542*cdf0e10cSrcweir 	aRect.Bottom() += 4;
543*cdf0e10cSrcweir 	pImp->MakeVisible( aRect ); // vor der Umrechnung in Pixel-Koord. rufen!
544*cdf0e10cSrcweir 	aRect.Bottom() -= 4;
545*cdf0e10cSrcweir 
546*cdf0e10cSrcweir 	Point aPos( aRect.TopLeft() );
547*cdf0e10cSrcweir 	aPos += GetMapMode().GetOrigin(); // Dok-Koord. -> Window-Koord.
548*cdf0e10cSrcweir 	aRect.SetPos( aPos );
549*cdf0e10cSrcweir 
550*cdf0e10cSrcweir 	aRect.Bottom() += 2; // sieht huebscher aus
551*cdf0e10cSrcweir 
552*cdf0e10cSrcweir #ifdef OS2
553*cdf0e10cSrcweir 
554*cdf0e10cSrcweir #if OS2_SINGLE_LINE_EDIT
555*cdf0e10cSrcweir 	aRect.Left() -= 3;
556*cdf0e10cSrcweir 	aRect.Right() += 3;
557*cdf0e10cSrcweir 	aRect.Top() -= 3;
558*cdf0e10cSrcweir 	aRect.Bottom() += 3;
559*cdf0e10cSrcweir #else
560*cdf0e10cSrcweir 	aRect.Left() -= 10;
561*cdf0e10cSrcweir 	aRect.Right() += 10;
562*cdf0e10cSrcweir 	aRect.Top() -= 5;
563*cdf0e10cSrcweir 	aRect.Bottom() += 5;
564*cdf0e10cSrcweir #endif
565*cdf0e10cSrcweir 
566*cdf0e10cSrcweir #endif // OS2
567*cdf0e10cSrcweir 	EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, sal_True );
568*cdf0e10cSrcweir }
569*cdf0e10cSrcweir 
570*cdf0e10cSrcweir void SvIconView::EditEntry( SvLBoxEntry* pEntry )
571*cdf0e10cSrcweir {
572*cdf0e10cSrcweir 	if( !pEntry )
573*cdf0e10cSrcweir 		pEntry = pImp->GetCurEntry();
574*cdf0e10cSrcweir 	if( pEntry )
575*cdf0e10cSrcweir 	{
576*cdf0e10cSrcweir 		SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
577*cdf0e10cSrcweir 		if( pItem )
578*cdf0e10cSrcweir 		{
579*cdf0e10cSrcweir 			Selection aSel( SELECTION_MIN, SELECTION_MAX );
580*cdf0e10cSrcweir 			if( EditingEntry( pEntry, aSel ) )
581*cdf0e10cSrcweir 			{
582*cdf0e10cSrcweir 				SelectAll( sal_False );
583*cdf0e10cSrcweir 				EditItemText( pEntry, pItem, aSel );
584*cdf0e10cSrcweir 			}
585*cdf0e10cSrcweir 		}
586*cdf0e10cSrcweir 	}
587*cdf0e10cSrcweir }
588*cdf0e10cSrcweir 
589*cdf0e10cSrcweir void SvIconView::EditedText( const XubString& rStr )
590*cdf0e10cSrcweir {
591*cdf0e10cSrcweir 	XubString aRefStr( ((SvLBoxString*)pCurEdItem)->GetText() );
592*cdf0e10cSrcweir 	if ( EditedEntry( pCurEdEntry, rStr ) )
593*cdf0e10cSrcweir 	{
594*cdf0e10cSrcweir 		((SvLBoxString*)pCurEdItem)->SetText( pCurEdEntry, rStr );
595*cdf0e10cSrcweir 		pModel->InvalidateEntry( pCurEdEntry );
596*cdf0e10cSrcweir 	}
597*cdf0e10cSrcweir 	if( GetSelectionMode()==SINGLE_SELECTION && !GetSelectionCount())
598*cdf0e10cSrcweir 		Select( pCurEdEntry );
599*cdf0e10cSrcweir }
600*cdf0e10cSrcweir 
601*cdf0e10cSrcweir 
602*cdf0e10cSrcweir sal_Bool SvIconView::EditingEntry( SvLBoxEntry*, Selection& )
603*cdf0e10cSrcweir {
604*cdf0e10cSrcweir 	return sal_True;
605*cdf0e10cSrcweir }
606*cdf0e10cSrcweir 
607*cdf0e10cSrcweir sal_Bool SvIconView::EditedEntry( SvLBoxEntry*, const XubString& )
608*cdf0e10cSrcweir {
609*cdf0e10cSrcweir 	return sal_True;
610*cdf0e10cSrcweir }
611*cdf0e10cSrcweir 
612*cdf0e10cSrcweir 
613*cdf0e10cSrcweir void SvIconView::WriteDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo)
614*cdf0e10cSrcweir {
615*cdf0e10cSrcweir 	pImp->WriteDragServerInfo( rPos, pInfo );
616*cdf0e10cSrcweir }
617*cdf0e10cSrcweir 
618*cdf0e10cSrcweir void SvIconView::ReadDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo )
619*cdf0e10cSrcweir {
620*cdf0e10cSrcweir 	pImp->ReadDragServerInfo( rPos, pInfo );
621*cdf0e10cSrcweir }
622*cdf0e10cSrcweir 
623*cdf0e10cSrcweir void SvIconView::Command( const CommandEvent& rCEvt )
624*cdf0e10cSrcweir {
625*cdf0e10cSrcweir 	pImp->PrepareCommandEvent( rCEvt.GetMousePosPixel() );
626*cdf0e10cSrcweir }
627*cdf0e10cSrcweir 
628*cdf0e10cSrcweir void SvIconView::SetCurParent( SvLBoxEntry* pNewParent )
629*cdf0e10cSrcweir {
630*cdf0e10cSrcweir 	if ( pNewParent && pNewParent->HasChildsOnDemand() )
631*cdf0e10cSrcweir 		RequestingChilds( pNewParent );
632*cdf0e10cSrcweir 	pImp->SetCurParent( pNewParent );
633*cdf0e10cSrcweir }
634*cdf0e10cSrcweir 
635*cdf0e10cSrcweir SvLBoxEntry* SvIconView::GetCurParent() const
636*cdf0e10cSrcweir {
637*cdf0e10cSrcweir 	return pImp->GetCurParent();
638*cdf0e10cSrcweir }
639*cdf0e10cSrcweir 
640*cdf0e10cSrcweir SvViewData* SvIconView::CreateViewData( SvListEntry* )
641*cdf0e10cSrcweir {
642*cdf0e10cSrcweir 	SvIcnVwDataEntry* pEntryData = new SvIcnVwDataEntry;
643*cdf0e10cSrcweir 	return (SvViewData*)pEntryData;
644*cdf0e10cSrcweir }
645*cdf0e10cSrcweir 
646*cdf0e10cSrcweir void SvIconView::InitViewData( SvViewData* pData, SvListEntry* pEntry )
647*cdf0e10cSrcweir {
648*cdf0e10cSrcweir 	SvLBox::InitViewData( pData, pEntry );
649*cdf0e10cSrcweir 	pImp->InvalidateBoundingRect( ((SvIcnVwDataEntry*)pData)->aRect );
650*cdf0e10cSrcweir }
651*cdf0e10cSrcweir 
652*cdf0e10cSrcweir Region SvIconView::GetDragRegion() const
653*cdf0e10cSrcweir {
654*cdf0e10cSrcweir 	Rectangle aRect;
655*cdf0e10cSrcweir 	SvLBoxEntry* pEntry = GetCurEntry();
656*cdf0e10cSrcweir 	if( pEntry )
657*cdf0e10cSrcweir 		aRect = pImp->GetBoundingRect( pEntry );
658*cdf0e10cSrcweir 	Region aRegion( aRect );
659*cdf0e10cSrcweir 	return aRegion;
660*cdf0e10cSrcweir }
661*cdf0e10cSrcweir 
662*cdf0e10cSrcweir sal_uLong SvIconView::GetSelectionCount() const
663*cdf0e10cSrcweir {
664*cdf0e10cSrcweir 	return (sal_uLong)(pImp->GetSelectionCount());
665*cdf0e10cSrcweir }
666*cdf0e10cSrcweir 
667*cdf0e10cSrcweir void SvIconView::SetGrid( long nDX, long nDY )
668*cdf0e10cSrcweir {
669*cdf0e10cSrcweir 	pImp->SetGrid( nDX, nDY );
670*cdf0e10cSrcweir }
671*cdf0e10cSrcweir 
672*cdf0e10cSrcweir void SvIconView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1,
673*cdf0e10cSrcweir 	SvListEntry* pEntry2, sal_uLong nPos )
674*cdf0e10cSrcweir {
675*cdf0e10cSrcweir 	SvLBox::ModelNotification( nActionId, pEntry1, pEntry2, nPos );
676*cdf0e10cSrcweir 	switch( nActionId )
677*cdf0e10cSrcweir 	{
678*cdf0e10cSrcweir 		case LISTACTION_RESORTING:
679*cdf0e10cSrcweir 			SetUpdateMode( sal_False );
680*cdf0e10cSrcweir 			break;
681*cdf0e10cSrcweir 
682*cdf0e10cSrcweir 		case LISTACTION_RESORTED:
683*cdf0e10cSrcweir 			SetUpdateMode( sal_True );
684*cdf0e10cSrcweir 			Arrange();
685*cdf0e10cSrcweir 			break;
686*cdf0e10cSrcweir 
687*cdf0e10cSrcweir 		case LISTACTION_CLEARED:
688*cdf0e10cSrcweir 			if( IsUpdateMode() )
689*cdf0e10cSrcweir 				Update();
690*cdf0e10cSrcweir 			break;
691*cdf0e10cSrcweir 	}
692*cdf0e10cSrcweir }
693*cdf0e10cSrcweir 
694*cdf0e10cSrcweir 
695*cdf0e10cSrcweir void SvIconView::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 )
696*cdf0e10cSrcweir {
697*cdf0e10cSrcweir 	pImp->Scroll( nDeltaX, nDeltaY, sal_False );
698*cdf0e10cSrcweir }
699*cdf0e10cSrcweir 
700*cdf0e10cSrcweir void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt )
701*cdf0e10cSrcweir {
702*cdf0e10cSrcweir 	pImp->PrepareCommandEvent( rCEvt.GetMousePosPixel() );
703*cdf0e10cSrcweir }
704*cdf0e10cSrcweir 
705*cdf0e10cSrcweir void SvIconView::StartDrag( sal_Int8 nAction, const Point& rPos )
706*cdf0e10cSrcweir {
707*cdf0e10cSrcweir 	pImp->SttDrag( rPos );
708*cdf0e10cSrcweir 	SvLBoxEntry* pEntry = GetEntry( rPos, sal_True );
709*cdf0e10cSrcweir 	pImp->mpViewData = pEntry;
710*cdf0e10cSrcweir 	SvLBox::StartDrag( nAction, rPos );
711*cdf0e10cSrcweir }
712*cdf0e10cSrcweir 
713*cdf0e10cSrcweir void SvIconView::DragFinished( sal_Int8 )
714*cdf0e10cSrcweir {
715*cdf0e10cSrcweir 	pImp->EndDrag();
716*cdf0e10cSrcweir }
717*cdf0e10cSrcweir 
718*cdf0e10cSrcweir sal_Int8 SvIconView::AcceptDrop( const AcceptDropEvent& rEvt )
719*cdf0e10cSrcweir {
720*cdf0e10cSrcweir 	if( pImp->mpViewData )
721*cdf0e10cSrcweir 		pImp->HideDDIcon();
722*cdf0e10cSrcweir 	sal_Int8 nRet = SvLBox::AcceptDrop( rEvt );
723*cdf0e10cSrcweir 	if( DND_ACTION_NONE != nRet )
724*cdf0e10cSrcweir 		pImp->ShowDDIcon( pImp->mpViewData, rEvt.maPosPixel );
725*cdf0e10cSrcweir 
726*cdf0e10cSrcweir 	return nRet;
727*cdf0e10cSrcweir }
728*cdf0e10cSrcweir 
729*cdf0e10cSrcweir sal_Int8 SvIconView::ExecuteDrop( const ExecuteDropEvent& rEvt )
730*cdf0e10cSrcweir {
731*cdf0e10cSrcweir 	if( pImp->mpViewData )
732*cdf0e10cSrcweir 	{
733*cdf0e10cSrcweir 		pImp->HideDDIcon();
734*cdf0e10cSrcweir 		pImp->mpViewData = 0;
735*cdf0e10cSrcweir 	}
736*cdf0e10cSrcweir 	return SvLBox::ExecuteDrop( rEvt );
737*cdf0e10cSrcweir }
738*cdf0e10cSrcweir 
739*cdf0e10cSrcweir void SvIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos )
740*cdf0e10cSrcweir {
741*cdf0e10cSrcweir 	pImp->ShowDDIcon( pRefEntry, rPos );
742*cdf0e10cSrcweir }
743*cdf0e10cSrcweir 
744*cdf0e10cSrcweir void SvIconView::HideDDIcon()
745*cdf0e10cSrcweir {
746*cdf0e10cSrcweir 	pImp->HideDDIcon();
747*cdf0e10cSrcweir }
748*cdf0e10cSrcweir 
749*cdf0e10cSrcweir void SvIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos )
750*cdf0e10cSrcweir {
751*cdf0e10cSrcweir 	pImp->HideShowDDIcon( pRefEntry, rPos );
752*cdf0e10cSrcweir }
753*cdf0e10cSrcweir 
754*cdf0e10cSrcweir void SvIconView::SelectRect( const Rectangle& rRect, sal_Bool bAdd,
755*cdf0e10cSrcweir 	SvPtrarr* pRects, short nOffs )
756*cdf0e10cSrcweir {
757*cdf0e10cSrcweir 	pImp->SelectRect( rRect, bAdd, pRects, nOffs );
758*cdf0e10cSrcweir }
759*cdf0e10cSrcweir 
760*cdf0e10cSrcweir void SvIconView::CalcScrollOffsets( const Point& rRefPosPixel, long& rX, long& rY,
761*cdf0e10cSrcweir 	sal_Bool b, sal_uInt16 nBorderWidth )
762*cdf0e10cSrcweir {
763*cdf0e10cSrcweir 	pImp->CalcScrollOffsets( rRefPosPixel, rX, rY, b, nBorderWidth );
764*cdf0e10cSrcweir }
765*cdf0e10cSrcweir 
766*cdf0e10cSrcweir void SvIconView::EndTracking()
767*cdf0e10cSrcweir {
768*cdf0e10cSrcweir 	pImp->EndTracking();
769*cdf0e10cSrcweir }
770*cdf0e10cSrcweir 
771*cdf0e10cSrcweir void SvIconView::MakeVisible( SvLBoxEntry* pEntry )
772*cdf0e10cSrcweir {
773*cdf0e10cSrcweir 	pImp->MakeVisible( pEntry );
774*cdf0e10cSrcweir }
775*cdf0e10cSrcweir 
776*cdf0e10cSrcweir void SvIconView::PreparePaint( SvLBoxEntry* )
777*cdf0e10cSrcweir {
778*cdf0e10cSrcweir }
779*cdf0e10cSrcweir 
780*cdf0e10cSrcweir void SvIconView::AdjustAtGrid( SvLBoxEntry* pEntry )
781*cdf0e10cSrcweir {
782*cdf0e10cSrcweir 	pImp->AdjustAtGrid( pEntry );
783*cdf0e10cSrcweir }
784*cdf0e10cSrcweir 
785*cdf0e10cSrcweir void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, sal_Bool bLock )
786*cdf0e10cSrcweir {
787*cdf0e10cSrcweir 	SvIcnVwDataEntry* pViewData = (SvIcnVwDataEntry*)GetViewData( pEntry );
788*cdf0e10cSrcweir 	if( bLock )
789*cdf0e10cSrcweir 		pViewData->SetVwFlags( ICNVW_FLAG_POS_LOCKED );
790*cdf0e10cSrcweir 	else
791*cdf0e10cSrcweir 		pViewData->ClearVwFlags( ICNVW_FLAG_POS_LOCKED );
792*cdf0e10cSrcweir }
793*cdf0e10cSrcweir 
794*cdf0e10cSrcweir sal_Bool SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const
795*cdf0e10cSrcweir {
796*cdf0e10cSrcweir 	const SvIcnVwDataEntry* pViewData = (const SvIcnVwDataEntry*)GetViewData( (SvListEntry*)pEntry );
797*cdf0e10cSrcweir 	return pViewData->IsEntryPosLocked();
798*cdf0e10cSrcweir }
799*cdf0e10cSrcweir 
800*cdf0e10cSrcweir void SvIconView::SetTextMode( SvIconViewTextMode eMode, SvLBoxEntry* pEntry )
801*cdf0e10cSrcweir {
802*cdf0e10cSrcweir 	pImp->SetTextMode( eMode, pEntry );
803*cdf0e10cSrcweir }
804*cdf0e10cSrcweir 
805*cdf0e10cSrcweir SvIconViewTextMode SvIconView::GetTextMode( const SvLBoxEntry* pEntry ) const
806*cdf0e10cSrcweir {
807*cdf0e10cSrcweir 	return pImp->GetTextMode( pEntry );
808*cdf0e10cSrcweir }
809*cdf0e10cSrcweir 
810*cdf0e10cSrcweir SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool  ) const
811*cdf0e10cSrcweir {
812*cdf0e10cSrcweir 	Point aPos( rPixPos );
813*cdf0e10cSrcweir 	aPos -= GetMapMode().GetOrigin();
814*cdf0e10cSrcweir 	return ((SvIconView*)this)->pImp->GetNextEntry( aPos, pCurEntry );
815*cdf0e10cSrcweir }
816*cdf0e10cSrcweir 
817*cdf0e10cSrcweir SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool  ) const
818*cdf0e10cSrcweir {
819*cdf0e10cSrcweir 	Point aPos( rPixPos );
820*cdf0e10cSrcweir 	aPos -= GetMapMode().GetOrigin();
821*cdf0e10cSrcweir 	return ((SvIconView*)this)->pImp->GetPrevEntry( aPos, pCurEntry );
822*cdf0e10cSrcweir }
823*cdf0e10cSrcweir 
824*cdf0e10cSrcweir void SvIconView::ShowFocusRect( const SvLBoxEntry* pEntry )
825*cdf0e10cSrcweir {
826*cdf0e10cSrcweir 	pImp->ShowFocusRect( pEntry );
827*cdf0e10cSrcweir }
828*cdf0e10cSrcweir 
829*cdf0e10cSrcweir 
830