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