1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: imivctl.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
35 #include <vcl/virdev.hxx>
38 #include <vcl/scrbar.hxx>
40 #include <vcl/timer.hxx>
41 #include <vcl/seleng.hxx>
42 #include <tools/debug.hxx>
43 #include "svtaccessiblefactory.hxx"
48 #include <svtools/svarray.hxx>
51 class SvtIconChoiceCtrl
;
52 class SvxIconChoiceCtrlEntry
;
53 class IcnViewEdit_Impl
;
54 class IcnGridMap_Impl
;
56 ///////////////////////////////////////////////////////////////////////////////
60 #define PAINTFLAG_HOR_CENTERED 0x0001
61 #define PAINTFLAG_VER_CENTERED 0x0002
63 #define F_VER_SBARSIZE_WITH_HBAR 0x0001
64 #define F_HOR_SBARSIZE_WITH_VBAR 0x0002
65 #define F_PAINTED 0x0004 // TRUE nach erstem Paint
66 #define F_ADD_MODE 0x0008
67 #define F_SELECTING_RECT 0x0020
68 #define F_DOWN_CTRL 0x0080
69 #define F_DOWN_DESELECT 0x0100
70 #define F_START_EDITTIMER_IN_MOUSEUP 0x0400
71 #define F_MOVED_ENTRIES 0x0800
72 #define F_ENTRYLISTPOS_VALID 0x1000
73 #define F_CLEARING_SELECTION 0x2000
74 #define F_ARRANGING 0x4000
76 // alle Angaben in Pixel
77 // Abstaende von Fensterraendern
78 #define LROFFS_WINBORDER 4
79 #define TBOFFS_WINBORDER 4
80 // fuer das Bounding-Rectangle
81 #define LROFFS_BOUND 2
82 #define TBOFFS_BOUND 2
83 // Abstand Fokusrechteck - Icon
86 // Abstaende Icon - Text
87 #define HOR_DIST_BMP_STRING 3
88 #define VER_DIST_BMP_STRING 3
89 // Breitenoffset Highlight-Rect bei Text
92 #define DEFAULT_MAX_VIRT_WIDTH 200
93 #define DEFAULT_MAX_VIRT_HEIGHT 200
95 #define VIEWMODE_MASK (WB_ICON | WB_SMALLICON | WB_DETAILS)
97 ///////////////////////////////////////////////////////////////////////////////
101 enum IcnViewFieldType
103 IcnViewFieldTypeDontknow
= 0,
104 IcnViewFieldTypeImage
= 1,
105 IcnViewFieldTypeText
= 2
108 ///////////////////////////////////////////////////////////////////////////////
110 // Data about the focus of entries
118 LocalFocus() { bOn
= FALSE
; }
121 ///////////////////////////////////////////////////////////////////////////////
125 class EntryList_Impl
: public List
131 SvxIconChoiceCtrl_Impl
* _pOwner
;
133 void Removed_Impl( SvxIconChoiceCtrlEntry
* pEntry
);
137 SvxIconChoiceCtrl_Impl
*,
138 USHORT _nInitSize
= 1024,
139 USHORT _nReSize
= 1024 );
141 SvxIconChoiceCtrl_Impl
*,
148 void Insert( SvxIconChoiceCtrlEntry
* pEntry
, ULONG nPos
);
149 SvxIconChoiceCtrlEntry
* Remove( ULONG nPos
);
150 void Remove( SvxIconChoiceCtrlEntry
* pEntry
);
154 ///////////////////////////////////////////////////////////////////////////////
156 // Implementation-class of IconChoiceCtrl
158 class SvxIconChoiceCtrl_Impl
160 friend class IcnCursor_Impl
;
161 friend class EntryList_Impl
;
162 friend class IcnGridMap_Impl
;
164 BOOL bChooseWithCursor
;
165 EntryList_Impl aEntries
;
168 ScrollBarBox aScrBarBox
;
169 Rectangle aCurSelectionRect
;
170 SvPtrarr aSelectedRectList
;
171 Timer aEditTimer
; // fuer Inplace-Editieren
172 Timer aAutoArrangeTimer
;
173 Timer aDocRectChangedTimer
;
174 Timer aVisRectChangedTimer
;
175 Timer aCallSelectHdlTimer
;
176 Size aVirtOutputSize
;
178 Size aDefaultTextSize
;
179 Size aOutputSize
; // Pixel
180 Point aDDLastEntryPos
;
181 Point aDDLastRectPos
;
184 SvtIconChoiceCtrl
* pView
;
185 IcnCursor_Impl
* pImpCursor
;
186 IcnGridMap_Impl
* pGridMap
;
187 long nMaxVirtWidth
; // max. Breite aVirtOutputSize bei ALIGN_TOP
188 long nMaxVirtHeight
; // max. Hoehe aVirtOutputSize bei ALIGN_LEFT
191 IcnViewEdit_Impl
* pEdit
;
193 long nMaxBoundHeight
; // Hoehe des hoechsten BoundRects
195 USHORT nCurTextDrawFlags
;
196 ULONG nUserEventAdjustScrBars
;
197 ULONG nUserEventShowCursor
;
198 SvxIconChoiceCtrlEntry
* pCurHighlightFrame
;
199 BOOL bHighlightFramePressed
;
200 SvxIconChoiceCtrlEntry
* pHead
; // Eintrag oben links
201 SvxIconChoiceCtrlEntry
* pCursor
;
202 SvxIconChoiceCtrlEntry
* pPrevDropTarget
;
203 SvxIconChoiceCtrlEntry
* pHdlEntry
;
204 SvxIconChoiceCtrlEntry
* pDDRefEntry
;
205 VirtualDevice
* pDDDev
;
206 VirtualDevice
* pDDBufDev
;
207 VirtualDevice
* pDDTempDev
;
208 VirtualDevice
* pEntryPaintDev
;
209 SvxIconChoiceCtrlEntry
* pAnchor
; // fuer Selektion
210 LocalFocus aFocus
; // Data for focusrect
211 ::svt::AccessibleFactoryAccess aAccFactory
;
213 List
* pDraggedSelection
;
214 SvxIconChoiceCtrlEntry
* pCurEditedEntry
;
215 SvxIconChoiceCtrlTextMode eTextMode
;
216 SelectionMode eSelectionMode
;
217 ULONG nSelectionCount
;
218 SvxIconChoiceCtrlPositionMode ePositionMode
;
219 BOOL bBoundRectsDirty
;
221 BOOL bEntryEditingEnabled
;
224 void ShowCursor( BOOL bShow
);
226 void ImpArrange( BOOL bKeepPredecessors
= FALSE
);
227 void AdjustVirtSize( const Rectangle
& );
228 void ResetVirtSize();
229 void CheckScrollBars();
231 DECL_LINK( ScrollUpDownHdl
, ScrollBar
* );
232 DECL_LINK( ScrollLeftRightHdl
, ScrollBar
* );
233 DECL_LINK( EditTimeoutHdl
, Timer
* );
234 DECL_LINK( UserEventHdl
, void* );
235 DECL_LINK( EndScrollHdl
, void* );
236 DECL_LINK( AutoArrangeHdl
, void* );
237 DECL_LINK( DocRectChangedHdl
, void* );
238 DECL_LINK( VisRectChangedHdl
, void* );
239 DECL_LINK( CallSelectHdlHdl
, void* );
241 void AdjustScrollBars( BOOL bVirtSizeGrowedOnly
= FALSE
);
242 void PositionScrollBars( long nRealWidth
, long nRealHeight
);
243 long GetScrollBarPageSize( long nVisibleRange
) const { return ((nVisibleRange
*75)/100); }
244 long GetScrollBarLineSize() const { return nMaxBoundHeight
/ 2; }
245 BOOL
HandleScrollCommand( const CommandEvent
& rCmd
);
246 void ToDocPos( Point
& rPosPixel
) { rPosPixel
-= pView
->GetMapMode().GetOrigin(); }
247 void InitScrollBarBox();
248 SvxIconChoiceCtrlEntry
* FindNewCursor();
249 void ToggleSelection( SvxIconChoiceCtrlEntry
* );
250 void DeselectAllBut( SvxIconChoiceCtrlEntry
*, BOOL bPaintSync
=FALSE
);
251 void Center( SvxIconChoiceCtrlEntry
* pEntry
) const;
252 void StopEditTimer() { aEditTimer
.Stop(); }
253 void StartEditTimer() { aEditTimer
.Start(); }
254 void ImpHideDDIcon();
255 void CallSelectHandler( SvxIconChoiceCtrlEntry
* );
257 SvxIconChoiceCtrlEntry
* pEntry1
,
258 SvxIconChoiceCtrlEntry
* pEntry2
,
260 SvPtrarr
* pOtherRects
= 0 );
263 SvxIconChoiceCtrlEntry
* pStart
,
264 SvxIconChoiceCtrlEntry
* pEnd
,
267 void AddSelectedRect( const Rectangle
& );
268 void AddSelectedRect(
269 SvxIconChoiceCtrlEntry
* pEntry1
,
270 SvxIconChoiceCtrlEntry
* pEntry2
);
272 void ClearSelectedRectList();
273 void ClearColumnList();
274 Rectangle
CalcMaxTextRect( const SvxIconChoiceCtrlEntry
* pEntry
) const;
276 void ClipAtVirtOutRect( Rectangle
& rRect
) const;
277 void AdjustAtGrid( const SvPtrarr
& rRow
, SvxIconChoiceCtrlEntry
* pStart
=0 );
279 const Rectangle
& rCenterRect
, // "Schwerpunkt" des Objekts (typ. Bmp-Rect)
280 const Rectangle
& rBoundRect
) const;
281 ULONG
GetPredecessorGrid( const Point
& rDocPos
) const;
283 void InitPredecessors();
284 void ClearPredecessors();
286 BOOL
CheckVerScrollBar();
287 BOOL
CheckHorScrollBar();
288 void CancelUserEvents();
289 void EntrySelected( SvxIconChoiceCtrlEntry
* pEntry
, BOOL bSelect
,
291 void SaveSelection( List
** );
292 void RepaintEntries( USHORT nEntryFlagsMask
);
293 void SetListPositions();
294 void SetDefaultTextSize();
295 BOOL
IsAutoArrange() const {
296 return (BOOL
)(ePositionMode
== IcnViewPositionModeAutoArrange
); }
297 BOOL
IsAutoAdjust() const {
298 return (BOOL
)(ePositionMode
== IcnViewPositionModeAutoAdjust
); }
299 void DocRectChanged() { aDocRectChangedTimer
.Start(); }
300 void VisRectChanged() { aVisRectChangedTimer
.Start(); }
301 void SetOrigin( const Point
&, BOOL bDoNotUpdateWallpaper
= FALSE
);
303 DECL_LINK( TextEditEndedHdl
, IcnViewEdit_Impl
* );
305 void ShowFocus ( Rectangle
& rRect
);
307 void DrawFocusRect ( OutputDevice
* pOut
);
309 BOOL
IsMnemonicChar( sal_Unicode cChar
, ULONG
& rPos
) const;
318 SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl
* pView
, WinBits nWinStyle
);
319 ~SvxIconChoiceCtrl_Impl();
321 BOOL
SetChoiceWithCursor ( BOOL bDo
= TRUE
) { BOOL bOld
=bChooseWithCursor
; bChooseWithCursor
= bDo
; return bOld
; }
322 void Clear( BOOL bInCtor
= FALSE
);
323 void SetStyle( WinBits nWinStyle
);
324 WinBits
GetStyle() const { return nWinBits
; }
325 void InsertEntry( SvxIconChoiceCtrlEntry
*, ULONG nPos
, const Point
* pPos
=0 );
326 void CreateAutoMnemonics( MnemonicGenerator
* _pGenerator
= NULL
);
327 void RemoveEntry( SvxIconChoiceCtrlEntry
* pEntry
);
329 void SelectAll( BOOL bSelect
= TRUE
, BOOL bPaint
= TRUE
);
331 SvxIconChoiceCtrlEntry
*,
333 BOOL bCallHdl
= TRUE
,
334 BOOL bAddToSelection
= FALSE
,
335 BOOL bSyncPaint
= FALSE
);
336 void Paint( const Rectangle
& rRect
);
337 BOOL
MouseButtonDown( const MouseEvent
& );
338 BOOL
MouseButtonUp( const MouseEvent
& );
339 BOOL
MouseMove( const MouseEvent
&);
340 BOOL
RequestHelp( const HelpEvent
& rHEvt
);
342 SvxIconChoiceCtrlEntry
* pOldCursor
,
343 SvxIconChoiceCtrlEntry
* pNewCursor
,
346 BOOL bPaintSync
= FALSE
);
347 BOOL
KeyInput( const KeyEvent
& );
351 void SetUpdateMode( BOOL bUpdate
);
352 BOOL
GetUpdateMode() const { return bUpdateMode
; }
353 void PaintEntry( SvxIconChoiceCtrlEntry
* pEntry
, BOOL bIsBackgroundPainted
=FALSE
);
355 SvxIconChoiceCtrlEntry
*,
357 OutputDevice
* pOut
= 0,
358 BOOL bIsBackgroundPainted
= FALSE
);
359 void PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry
* );
362 SvxIconChoiceCtrlEntry
* pEntry
,
364 BOOL bAdjustRow
= FALSE
,
365 BOOL bCheckScrollBars
= FALSE
,
366 BOOL bKeepGridMap
= FALSE
);
368 void InvalidateEntry( SvxIconChoiceCtrlEntry
* );
369 IcnViewFieldType
GetItem( SvxIconChoiceCtrlEntry
*, const Point
& rAbsPos
);
371 void SetNoSelection();
373 SvxIconChoiceCtrlEntry
* GetCurEntry() const { return pCursor
; }
375 SvxIconChoiceCtrlEntry
*,
376 // TRUE == bei Single-Selection die Sel. mitfuehren
377 BOOL bSyncSingleSelection
= TRUE
,
378 BOOL bShowFocusAsync
= FALSE
);
380 SvxIconChoiceCtrlEntry
* GetEntry( const Point
& rDocPos
, BOOL bHit
= FALSE
);
381 SvxIconChoiceCtrlEntry
* GetNextEntry( const Point
& rDocPos
, SvxIconChoiceCtrlEntry
* pCurEntry
);
382 SvxIconChoiceCtrlEntry
* GetPrevEntry( const Point
& rDocPos
, SvxIconChoiceCtrlEntry
* pCurEntry
);
384 Point
GetEntryPos( SvxIconChoiceCtrlEntry
* );
385 void MakeEntryVisible( SvxIconChoiceCtrlEntry
* pEntry
, BOOL bBound
= TRUE
);
387 void Arrange(BOOL bKeepPredecessors
= FALSE
, long nSetMaxVirtWidth
=0, long nSetMaxVirtHeight
=0 );
389 Rectangle
CalcFocusRect( SvxIconChoiceCtrlEntry
* );
390 Rectangle
CalcBmpRect( SvxIconChoiceCtrlEntry
*, const Point
* pPos
= 0 );
391 Rectangle
CalcTextRect(
392 SvxIconChoiceCtrlEntry
*,
393 const Point
* pPos
= 0,
394 BOOL bForInplaceEdit
= FALSE
,
395 const String
* pStr
= 0 );
397 long CalcBoundingWidth( SvxIconChoiceCtrlEntry
* ) const;
398 long CalcBoundingHeight( SvxIconChoiceCtrlEntry
* ) const;
399 Size
CalcBoundingSize( SvxIconChoiceCtrlEntry
* ) const;
400 void FindBoundingRect( SvxIconChoiceCtrlEntry
* pEntry
);
401 void SetBoundingRect_Impl(
402 SvxIconChoiceCtrlEntry
* pEntry
,
404 const Size
& rBoundingSize
);
405 // berechnet alle BoundRects neu
406 void RecalcAllBoundingRects();
407 // berechnet alle ungueltigen BoundRects neu
408 void RecalcAllBoundingRectsSmart();
409 const Rectangle
& GetEntryBoundRect( SvxIconChoiceCtrlEntry
* );
410 void InvalidateBoundingRect( SvxIconChoiceCtrlEntry
* );
411 void InvalidateBoundingRect( Rectangle
& rRect
) { rRect
.Right() = LONG_MAX
; bBoundRectsDirty
= TRUE
; }
412 BOOL
IsBoundingRectValid( const Rectangle
& rRect
) const { return (BOOL
)( rRect
.Right() != LONG_MAX
); }
415 const Rectangle
& rRect1
,
416 const Rectangle
& rRect2
,
421 BOOL bIsBackgroundPainted
= FALSE
);
424 const Rectangle
& rRect
,
425 IcnViewFieldType eItem
,
426 SvxIconChoiceCtrlEntry
* pEntry
,
429 const String
* pStr
= 0,
430 ::vcl::ControlLayoutData
* _pLayoutData
= NULL
);
432 // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE
433 void CheckBoundingRects() { if (bBoundRectsDirty
) RecalcAllBoundingRectsSmart(); }
434 // berechnet alle invalidierten BoundingRects neu
435 void UpdateBoundingRects();
436 void ShowTargetEmphasis( SvxIconChoiceCtrlEntry
* pEntry
, BOOL bShow
);
437 void PrepareCommandEvent( const CommandEvent
& );
438 void Command( const CommandEvent
& rCEvt
);
439 void ToTop( SvxIconChoiceCtrlEntry
* );
441 ULONG
GetSelectionCount() const;
442 void SetGrid( const Size
& );
443 Size
GetMinGrid() const;
447 BOOL bSmartScrBar
) const;
448 void Scroll( long nDeltaX
, long nDeltaY
, BOOL bScrollBar
= FALSE
);
449 const Size
& GetItemSize( SvxIconChoiceCtrlEntry
*, IcnViewFieldType
) const;
452 void ShowDDIcon( SvxIconChoiceCtrlEntry
* pRefEntry
, const Point
& rPos
);
454 SvxIconChoiceCtrlEntry
* pRefEntry
,
458 SvPtrarr
* pSelectedRectList
,
459 const Rectangle
& rEntryBoundRect
) const;
464 SvPtrarr
* pOtherRects
= 0 );
466 void CalcScrollOffsets(
467 const Point
& rRefPosPixel
,
470 BOOL bDragDrop
= FALSE
,
471 USHORT nBorderWidth
= 10 );
473 BOOL
IsTextHit( SvxIconChoiceCtrlEntry
* pEntry
, const Point
& rDocPos
);
475 const Rectangle
& rDocPos
,
476 BOOL bInScrollBarEvent
=FALSE
,
477 BOOL bCallRectChangedHdl
= TRUE
);
479 void AdjustEntryAtGrid( SvxIconChoiceCtrlEntry
* pStart
= 0 );
480 void SetEntryTextMode( SvxIconChoiceCtrlTextMode
, SvxIconChoiceCtrlEntry
* pEntry
= 0 );
481 SvxIconChoiceCtrlTextMode
GetTextMode( const SvxIconChoiceCtrlEntry
* pEntry
= 0 ) const;
482 void ShowEntryFocusRect( const SvxIconChoiceCtrlEntry
* pEntry
);
483 void EnableEntryEditing( BOOL bEnable
) { bEntryEditingEnabled
= bEnable
; }
484 BOOL
IsEntryEditingEnabled() const { return bEntryEditingEnabled
; }
485 BOOL
IsEntryEditing() const { return (BOOL
)(pCurEditedEntry
!=0); }
486 void EditEntry( SvxIconChoiceCtrlEntry
* pEntry
);
487 void StopEntryEditing( BOOL bCancel
);
488 void LockEntryPos( SvxIconChoiceCtrlEntry
* pEntry
, BOOL bLock
);
489 ULONG
GetEntryCount() const { return aEntries
.Count(); }
490 SvxIconChoiceCtrlEntry
* GetEntry( ULONG nPos
) const { return (SvxIconChoiceCtrlEntry
*)aEntries
.GetObject(nPos
); }
491 SvxIconChoiceCtrlEntry
* GetFirstSelectedEntry( ULONG
& ) const;
492 SvxIconChoiceCtrlEntry
* GetNextSelectedEntry( ULONG
& ) const;
493 SvxIconChoiceCtrlEntry
* GetHdlEntry() const { return pHdlEntry
; }
494 void SetHdlEntry( SvxIconChoiceCtrlEntry
* pEntry
) { pHdlEntry
= pEntry
; }
496 SvxIconChoiceCtrlTextMode
GetEntryTextModeSmart( const SvxIconChoiceCtrlEntry
* pEntry
) const;
497 void SetSelectionMode( SelectionMode eMode
) { eSelectionMode
=eMode
; }
498 SelectionMode
GetSelectionMode() const { return eSelectionMode
; }
499 BOOL
AreEntriesMoved() const { return (BOOL
)((nFlags
& F_MOVED_ENTRIES
)!=0); }
500 void SetEntriesMoved( BOOL bMoved
)
502 if( bMoved
) nFlags
|= F_MOVED_ENTRIES
;
503 else nFlags
&= ~(F_MOVED_ENTRIES
);
505 ULONG
GetEntryListPos( SvxIconChoiceCtrlEntry
* ) const;
506 void SetEntryListPos( SvxIconChoiceCtrlEntry
* pEntry
, ULONG nNewPos
);
507 void SetEntryImageSize( const Size
& rSize
) { aImageSize
= rSize
; }
508 void SetEntryFlags( SvxIconChoiceCtrlEntry
* pEntry
, USHORT nFlags
);
509 SvxIconChoiceCtrlEntry
* GoLeftRight( SvxIconChoiceCtrlEntry
*, BOOL bRight
);
510 SvxIconChoiceCtrlEntry
* GoUpDown( SvxIconChoiceCtrlEntry
*, BOOL bDown
);
512 Rectangle
GetOutputRect() const;
514 BOOL
ArePredecessorsSet() const { return (BOOL
)(pHead
!= 0); }
515 SvxIconChoiceCtrlEntry
* GetPredecessorHead() const { return pHead
; }
516 void SetEntryPredecessor(SvxIconChoiceCtrlEntry
* pEntry
,SvxIconChoiceCtrlEntry
* pPredecessor
);
517 BOOL
GetEntryPredecessor(SvxIconChoiceCtrlEntry
* pEntry
,SvxIconChoiceCtrlEntry
** ppPredecessor
);
518 // liefert gueltige Ergebnisse nur im AutoArrange-Modus!
519 SvxIconChoiceCtrlEntry
* FindEntryPredecessor( SvxIconChoiceCtrlEntry
* pEntry
, const Point
& );
521 void SetPositionMode( SvxIconChoiceCtrlPositionMode
);
522 SvxIconChoiceCtrlPositionMode
GetPositionMode() const { return ePositionMode
;}
525 void SetColumn( USHORT nIndex
, const SvxIconChoiceCtrlColumnInfo
& );
526 const SvxIconChoiceCtrlColumnInfo
* GetColumn( USHORT nIndex
) const;
527 const SvxIconChoiceCtrlColumnInfo
* GetItemColumn( USHORT nSubItem
, long& rLeft
) const;
529 Rectangle
GetDocumentRect() const { return Rectangle( Point(), aVirtOutputSize
); }
530 Rectangle
GetVisibleRect() const { return GetOutputRect(); }
532 void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry
* pEntry
,BOOL bKeepHighlightFlags
=FALSE
);
533 void HideEntryHighlightFrame();
534 void DrawHighlightFrame( OutputDevice
* pOut
,
535 const Rectangle
& rBmpRect
, BOOL bHide
);
536 void StopSelectTimer() { aCallSelectHdlTimer
.Stop(); }
537 void Tracking( const TrackingEvent
& rTEvt
);
538 Point
GetPopupMenuPosPixel() const;
540 BOOL
HandleShortCutKey( const KeyEvent
& rKeyEvent
);
542 void CallEventListeners( ULONG nEvent
, void* pData
= NULL
);
544 inline ::svt::IAccessibleFactory
&
545 GetAccessibleFactory() { return aAccFactory
.getFactory(); }
548 // ----------------------------------------------------------------------------------------------
552 SvxIconChoiceCtrl_Impl
* pView
;
559 SvxIconChoiceCtrlEntry
* pCurEntry
;
562 void Create() { if( !pColumns
) ImplCreate(); }
564 USHORT
GetSortListPos( SvPtrarr
* pList
, long nValue
, int bVertical
);
565 SvxIconChoiceCtrlEntry
* SearchCol(USHORT nCol
,USHORT nTop
,USHORT nBottom
,USHORT nPref
,
566 BOOL bDown
, BOOL bSimple
);
568 SvxIconChoiceCtrlEntry
* SearchRow(USHORT nRow
,USHORT nRight
,USHORT nLeft
,USHORT nPref
,
569 BOOL bRight
, BOOL bSimple
);
572 IcnCursor_Impl( SvxIconChoiceCtrl_Impl
* pOwner
);
576 // fuer Cursortravelling usw.
577 SvxIconChoiceCtrlEntry
* GoLeftRight( SvxIconChoiceCtrlEntry
*, BOOL bRight
);
578 SvxIconChoiceCtrlEntry
* GoUpDown( SvxIconChoiceCtrlEntry
*, BOOL bDown
);
579 SvxIconChoiceCtrlEntry
* GoPageUpDown( SvxIconChoiceCtrlEntry
*, BOOL bDown
);
581 // Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left()
582 // sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann
583 // leer sein. Die Listen gehen in das Eigentum des Rufenden ueber und
584 // muessen mit DestroyGridAdjustData geloescht werden
585 void CreateGridAjustData( SvPtrarr
& pLists
, SvxIconChoiceCtrlEntry
* pRow
=0);
586 static void DestroyGridAdjustData( SvPtrarr
& rLists
);
589 // ----------------------------------------------------------------------------------------------
591 typedef ULONG GridId
;
593 #define GRID_NOT_FOUND ((GridId)ULONG_MAX)
595 class IcnGridMap_Impl
597 Rectangle _aLastOccupiedGrid
;
598 SvxIconChoiceCtrl_Impl
* _pView
;
600 USHORT _nGridCols
, _nGridRows
;
604 void Create() { if(!_pGridMap
) Create_Impl(); }
606 void GetMinMapSize( USHORT
& rDX
, USHORT
& rDY
) const;
609 IcnGridMap_Impl(SvxIconChoiceCtrl_Impl
* pView
);
614 GridId
GetGrid( const Point
& rDocPos
, BOOL
* pbClipped
= 0 );
615 GridId
GetGrid( USHORT nGridX
, USHORT nGridY
);
616 GridId
GetUnoccupiedGrid( BOOL bOccupyFound
=TRUE
);
618 void OccupyGrids( const Rectangle
&, BOOL bOccupy
= TRUE
);
619 void OccupyGrids( const SvxIconChoiceCtrlEntry
*, BOOL bOccupy
= TRUE
);
620 void OccupyGrid( GridId nId
, BOOL bOccupy
= TRUE
)
622 DBG_ASSERT(!_pGridMap
|| nId
<(ULONG
)(_nGridCols
*_nGridRows
),"OccupyGrid: Bad GridId");
623 if(_pGridMap
&& nId
< (ULONG
)(_nGridCols
*_nGridRows
) )
624 _pGridMap
[ nId
] = bOccupy
;
627 Rectangle
GetGridRect( GridId
);
628 void GetGridCoord( GridId
, USHORT
& rGridX
, USHORT
& rGridY
);
629 static ULONG
GetGridCount( const Size
& rSizePixel
, USHORT nGridWidth
, USHORT nGridHeight
);
631 void OutputSizeChanged();