xref: /AOO42X/main/svtools/source/contnr/imivctl.hxx (revision 9bce9b0d387299c68bd81d539e1478357a103de5)
1*01aa44aaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*01aa44aaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*01aa44aaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*01aa44aaSAndrew Rist  * distributed with this work for additional information
6*01aa44aaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*01aa44aaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*01aa44aaSAndrew Rist  * "License"); you may not use this file except in compliance
9*01aa44aaSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*01aa44aaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*01aa44aaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*01aa44aaSAndrew Rist  * software distributed under the License is distributed on an
15*01aa44aaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*01aa44aaSAndrew Rist  * KIND, either express or implied.  See the License for the
17*01aa44aaSAndrew Rist  * specific language governing permissions and limitations
18*01aa44aaSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*01aa44aaSAndrew Rist  *************************************************************/
21*01aa44aaSAndrew Rist 
22*01aa44aaSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _IMPICNVW_HXX
25cdf0e10cSrcweir #define _IMPICNVW_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _VIRDEV_HXX
28cdf0e10cSrcweir #include <vcl/virdev.hxx>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _SCRBAR_HXX
31cdf0e10cSrcweir #include <vcl/scrbar.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #include <vcl/timer.hxx>
34cdf0e10cSrcweir #include <vcl/seleng.hxx>
35cdf0e10cSrcweir #include <tools/debug.hxx>
36cdf0e10cSrcweir #include "svtaccessiblefactory.hxx"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #include <limits.h>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #include <svtools/ivctrl.hxx>
41cdf0e10cSrcweir #include <svl/svarray.hxx>
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class IcnCursor_Impl;
44cdf0e10cSrcweir class SvtIconChoiceCtrl;
45cdf0e10cSrcweir class SvxIconChoiceCtrlEntry;
46cdf0e10cSrcweir class IcnViewEdit_Impl;
47cdf0e10cSrcweir class IcnGridMap_Impl;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////////////
50cdf0e10cSrcweir //
51cdf0e10cSrcweir // some defines
52cdf0e10cSrcweir //
53cdf0e10cSrcweir #define PAINTFLAG_HOR_CENTERED  0x0001
54cdf0e10cSrcweir #define PAINTFLAG_VER_CENTERED  0x0002
55cdf0e10cSrcweir 
56cdf0e10cSrcweir #define F_VER_SBARSIZE_WITH_HBAR        0x0001
57cdf0e10cSrcweir #define F_HOR_SBARSIZE_WITH_VBAR        0x0002
58cdf0e10cSrcweir #define F_PAINTED                       0x0004  // sal_True nach erstem Paint
59cdf0e10cSrcweir #define F_ADD_MODE                      0x0008
60cdf0e10cSrcweir #define F_SELECTING_RECT                0x0020
61cdf0e10cSrcweir #define F_DOWN_CTRL                     0x0080
62cdf0e10cSrcweir #define F_DOWN_DESELECT                 0x0100
63cdf0e10cSrcweir #define F_START_EDITTIMER_IN_MOUSEUP    0x0400
64cdf0e10cSrcweir #define F_MOVED_ENTRIES                 0x0800
65cdf0e10cSrcweir #define F_ENTRYLISTPOS_VALID            0x1000
66cdf0e10cSrcweir #define F_CLEARING_SELECTION            0x2000
67cdf0e10cSrcweir #define F_ARRANGING                     0x4000
68cdf0e10cSrcweir 
69cdf0e10cSrcweir // alle Angaben in Pixel
70cdf0e10cSrcweir // Abstaende von Fensterraendern
71cdf0e10cSrcweir #define LROFFS_WINBORDER            4
72cdf0e10cSrcweir #define TBOFFS_WINBORDER            4
73cdf0e10cSrcweir // fuer das Bounding-Rectangle
74cdf0e10cSrcweir #define LROFFS_BOUND                2
75cdf0e10cSrcweir #define TBOFFS_BOUND                2
76cdf0e10cSrcweir // Abstand Fokusrechteck - Icon
77cdf0e10cSrcweir #define LROFFS_ICON                 2
78cdf0e10cSrcweir #define TBOFFS_ICON                 2
79cdf0e10cSrcweir // Abstaende Icon - Text
80cdf0e10cSrcweir #define HOR_DIST_BMP_STRING         3
81cdf0e10cSrcweir #define VER_DIST_BMP_STRING         3
82cdf0e10cSrcweir // Breitenoffset Highlight-Rect bei Text
83cdf0e10cSrcweir #define LROFFS_TEXT                 2
84cdf0e10cSrcweir 
85cdf0e10cSrcweir #define DEFAULT_MAX_VIRT_WIDTH  200
86cdf0e10cSrcweir #define DEFAULT_MAX_VIRT_HEIGHT 200
87cdf0e10cSrcweir 
88cdf0e10cSrcweir #define VIEWMODE_MASK   (WB_ICON | WB_SMALLICON | WB_DETAILS)
89cdf0e10cSrcweir 
90cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////////////
91cdf0e10cSrcweir //
92cdf0e10cSrcweir //
93cdf0e10cSrcweir //
94cdf0e10cSrcweir enum IcnViewFieldType
95cdf0e10cSrcweir {
96cdf0e10cSrcweir     IcnViewFieldTypeDontknow = 0,
97cdf0e10cSrcweir     IcnViewFieldTypeImage = 1,
98cdf0e10cSrcweir     IcnViewFieldTypeText = 2
99cdf0e10cSrcweir };
100cdf0e10cSrcweir 
101cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////////////
102cdf0e10cSrcweir //
103cdf0e10cSrcweir // Data about the focus of entries
104cdf0e10cSrcweir //
105cdf0e10cSrcweir struct LocalFocus
106cdf0e10cSrcweir {
107cdf0e10cSrcweir     sal_Bool        bOn;
108cdf0e10cSrcweir     Rectangle   aRect;
109cdf0e10cSrcweir     Color       aPenColor;
110cdf0e10cSrcweir 
LocalFocusLocalFocus111cdf0e10cSrcweir     LocalFocus() { bOn = sal_False; }
112cdf0e10cSrcweir };
113cdf0e10cSrcweir 
114cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////////////
115cdf0e10cSrcweir //
116cdf0e10cSrcweir // Entry-List
117cdf0e10cSrcweir //
118cdf0e10cSrcweir class EntryList_Impl : public List
119cdf0e10cSrcweir {
120cdf0e10cSrcweir private:
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     using List::Replace;
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     SvxIconChoiceCtrl_Impl*         _pOwner;
125cdf0e10cSrcweir 
126cdf0e10cSrcweir     void                    Removed_Impl( SvxIconChoiceCtrlEntry* pEntry );
127cdf0e10cSrcweir 
128cdf0e10cSrcweir public:
129cdf0e10cSrcweir                             EntryList_Impl(
130cdf0e10cSrcweir                                 SvxIconChoiceCtrl_Impl*,
131cdf0e10cSrcweir                                 sal_uInt16 _nInitSize = 1024,
132cdf0e10cSrcweir                                 sal_uInt16 _nReSize = 1024 );
133cdf0e10cSrcweir                             EntryList_Impl(
134cdf0e10cSrcweir                                 SvxIconChoiceCtrl_Impl*,
135cdf0e10cSrcweir                                 sal_uInt16 _nBlockSize,
136cdf0e10cSrcweir                                 sal_uInt16 _nInitSize,
137cdf0e10cSrcweir                                 sal_uInt16 _nReSize );
138cdf0e10cSrcweir                             ~EntryList_Impl();
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     void                    Clear();
141cdf0e10cSrcweir     void                    Insert( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos );
142cdf0e10cSrcweir     SvxIconChoiceCtrlEntry*         Remove( sal_uLong nPos );
143cdf0e10cSrcweir     void                    Remove( SvxIconChoiceCtrlEntry* pEntry );
144cdf0e10cSrcweir };
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 
147cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////////////
148cdf0e10cSrcweir //
149cdf0e10cSrcweir // Implementation-class of IconChoiceCtrl
150cdf0e10cSrcweir //
151cdf0e10cSrcweir class SvxIconChoiceCtrl_Impl
152cdf0e10cSrcweir {
153cdf0e10cSrcweir     friend class IcnCursor_Impl;
154cdf0e10cSrcweir     friend class EntryList_Impl;
155cdf0e10cSrcweir     friend class IcnGridMap_Impl;
156cdf0e10cSrcweir 
157cdf0e10cSrcweir     sal_Bool            bChooseWithCursor;
158cdf0e10cSrcweir     EntryList_Impl  aEntries;
159cdf0e10cSrcweir     ScrollBar       aVerSBar;
160cdf0e10cSrcweir     ScrollBar       aHorSBar;
161cdf0e10cSrcweir     ScrollBarBox    aScrBarBox;
162cdf0e10cSrcweir     Rectangle       aCurSelectionRect;
163cdf0e10cSrcweir     SvPtrarr        aSelectedRectList;
164cdf0e10cSrcweir     Timer           aEditTimer;                 // fuer Inplace-Editieren
165cdf0e10cSrcweir     Timer           aAutoArrangeTimer;
166cdf0e10cSrcweir     Timer           aDocRectChangedTimer;
167cdf0e10cSrcweir     Timer           aVisRectChangedTimer;
168cdf0e10cSrcweir     Timer           aCallSelectHdlTimer;
169cdf0e10cSrcweir     Size            aVirtOutputSize;
170cdf0e10cSrcweir     Size            aImageSize;
171cdf0e10cSrcweir     Size            aDefaultTextSize;
172cdf0e10cSrcweir     Size            aOutputSize; // Pixel
173cdf0e10cSrcweir     Point           aDDLastEntryPos;
174cdf0e10cSrcweir     Point           aDDLastRectPos;
175cdf0e10cSrcweir     Point           aDDPaintOffs;
176cdf0e10cSrcweir     Point           aDDStartPos;
177cdf0e10cSrcweir     SvtIconChoiceCtrl*      pView;
178cdf0e10cSrcweir     IcnCursor_Impl* pImpCursor;
179cdf0e10cSrcweir     IcnGridMap_Impl* pGridMap;
180cdf0e10cSrcweir     long            nMaxVirtWidth;  // max. Breite aVirtOutputSize bei ALIGN_TOP
181cdf0e10cSrcweir     long            nMaxVirtHeight; // max. Hoehe aVirtOutputSize bei ALIGN_LEFT
182cdf0e10cSrcweir     List*           pZOrderList;
183cdf0e10cSrcweir     SvPtrarr*       pColumns;
184cdf0e10cSrcweir     IcnViewEdit_Impl* pEdit;
185cdf0e10cSrcweir     WinBits         nWinBits;
186cdf0e10cSrcweir     long            nMaxBoundHeight;            // Hoehe des hoechsten BoundRects
187cdf0e10cSrcweir     sal_uInt16          nFlags;
188cdf0e10cSrcweir     sal_uInt16          nCurTextDrawFlags;
189cdf0e10cSrcweir     sal_uLong           nUserEventAdjustScrBars;
190cdf0e10cSrcweir     sal_uLong           nUserEventShowCursor;
191cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* pCurHighlightFrame;
192cdf0e10cSrcweir     sal_Bool            bHighlightFramePressed;
193cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* pHead;                      // Eintrag oben links
194cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* pCursor;
195cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* pPrevDropTarget;
196cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* pHdlEntry;
197cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* pDDRefEntry;
198cdf0e10cSrcweir     VirtualDevice*  pDDDev;
199cdf0e10cSrcweir     VirtualDevice*  pDDBufDev;
200cdf0e10cSrcweir     VirtualDevice*  pDDTempDev;
201cdf0e10cSrcweir     VirtualDevice*  pEntryPaintDev;
202cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* pAnchor;                    // fuer Selektion
203cdf0e10cSrcweir     LocalFocus      aFocus;                             // Data for focusrect
204cdf0e10cSrcweir     ::svt::AccessibleFactoryAccess aAccFactory;
205cdf0e10cSrcweir 
206cdf0e10cSrcweir     List*           pDraggedSelection;
207cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* pCurEditedEntry;
208cdf0e10cSrcweir     SvxIconChoiceCtrlTextMode eTextMode;
209cdf0e10cSrcweir     SelectionMode   eSelectionMode;
210cdf0e10cSrcweir     sal_uLong           nSelectionCount;
211cdf0e10cSrcweir     SvxIconChoiceCtrlPositionMode ePositionMode;
212cdf0e10cSrcweir     sal_Bool            bBoundRectsDirty;
213cdf0e10cSrcweir     sal_Bool            bUpdateMode;
214cdf0e10cSrcweir     sal_Bool            bEntryEditingEnabled;
215cdf0e10cSrcweir     sal_Bool            bInDragDrop;
216cdf0e10cSrcweir 
217cdf0e10cSrcweir     void            ShowCursor( sal_Bool bShow );
218cdf0e10cSrcweir 
219cdf0e10cSrcweir     void            ImpArrange( sal_Bool bKeepPredecessors = sal_False );
220cdf0e10cSrcweir     void            AdjustVirtSize( const Rectangle& );
221cdf0e10cSrcweir     void            ResetVirtSize();
222cdf0e10cSrcweir     void            CheckScrollBars();
223cdf0e10cSrcweir 
224cdf0e10cSrcweir                     DECL_LINK( ScrollUpDownHdl, ScrollBar * );
225cdf0e10cSrcweir                     DECL_LINK( ScrollLeftRightHdl, ScrollBar * );
226cdf0e10cSrcweir                     DECL_LINK( EditTimeoutHdl, Timer* );
227cdf0e10cSrcweir                     DECL_LINK( UserEventHdl, void* );
228cdf0e10cSrcweir                     DECL_LINK( EndScrollHdl, void* );
229cdf0e10cSrcweir                     DECL_LINK( AutoArrangeHdl, void* );
230cdf0e10cSrcweir                     DECL_LINK( DocRectChangedHdl, void* );
231cdf0e10cSrcweir                     DECL_LINK( VisRectChangedHdl, void* );
232cdf0e10cSrcweir                     DECL_LINK( CallSelectHdlHdl, void* );
233cdf0e10cSrcweir 
234cdf0e10cSrcweir     void            AdjustScrollBars( sal_Bool bVirtSizeGrowedOnly = sal_False);
235cdf0e10cSrcweir     void            PositionScrollBars( long nRealWidth, long nRealHeight );
GetScrollBarPageSize(long nVisibleRange) const236cdf0e10cSrcweir     long            GetScrollBarPageSize( long nVisibleRange ) const { return ((nVisibleRange*75)/100); }
GetScrollBarLineSize() const237cdf0e10cSrcweir     long            GetScrollBarLineSize() const { return nMaxBoundHeight / 2; }
238cdf0e10cSrcweir     sal_Bool            HandleScrollCommand( const CommandEvent& rCmd );
ToDocPos(Point & rPosPixel)239cdf0e10cSrcweir     void            ToDocPos( Point& rPosPixel ) { rPosPixel -= pView->GetMapMode().GetOrigin(); }
240cdf0e10cSrcweir     void            InitScrollBarBox();
241cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* FindNewCursor();
242cdf0e10cSrcweir     void            ToggleSelection( SvxIconChoiceCtrlEntry* );
243cdf0e10cSrcweir     void            DeselectAllBut( SvxIconChoiceCtrlEntry*, sal_Bool bPaintSync=sal_False );
244cdf0e10cSrcweir     void            Center( SvxIconChoiceCtrlEntry* pEntry ) const;
StopEditTimer()245cdf0e10cSrcweir     void            StopEditTimer() { aEditTimer.Stop(); }
StartEditTimer()246cdf0e10cSrcweir     void            StartEditTimer() { aEditTimer.Start(); }
247cdf0e10cSrcweir     void            ImpHideDDIcon();
248cdf0e10cSrcweir     void            CallSelectHandler( SvxIconChoiceCtrlEntry* );
249cdf0e10cSrcweir     void            SelectRect(
250cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pEntry1,
251cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pEntry2,
252cdf0e10cSrcweir                         sal_Bool bAdd = sal_True,
253cdf0e10cSrcweir                         SvPtrarr* pOtherRects = 0 );
254cdf0e10cSrcweir 
255cdf0e10cSrcweir     void            SelectRange(
256cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pStart,
257cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pEnd,
258cdf0e10cSrcweir                         sal_Bool bAdd = sal_True );
259cdf0e10cSrcweir 
260cdf0e10cSrcweir     void            AddSelectedRect( const Rectangle& );
261cdf0e10cSrcweir     void            AddSelectedRect(
262cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pEntry1,
263cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pEntry2 );
264cdf0e10cSrcweir 
265cdf0e10cSrcweir     void            ClearSelectedRectList();
266cdf0e10cSrcweir     void            ClearColumnList();
267cdf0e10cSrcweir     Rectangle       CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry ) const;
268cdf0e10cSrcweir 
269cdf0e10cSrcweir     void            ClipAtVirtOutRect( Rectangle& rRect ) const;
270cdf0e10cSrcweir     void            AdjustAtGrid( const SvPtrarr& rRow, SvxIconChoiceCtrlEntry* pStart=0 );
271cdf0e10cSrcweir     Point           AdjustAtGrid(
272cdf0e10cSrcweir                         const Rectangle& rCenterRect, // "Schwerpunkt" des Objekts (typ. Bmp-Rect)
273cdf0e10cSrcweir                         const Rectangle& rBoundRect ) const;
274cdf0e10cSrcweir     sal_uLong           GetPredecessorGrid( const Point& rDocPos) const;
275cdf0e10cSrcweir 
276cdf0e10cSrcweir     void            InitPredecessors();
277cdf0e10cSrcweir     void            ClearPredecessors();
278cdf0e10cSrcweir 
279cdf0e10cSrcweir     sal_Bool            CheckVerScrollBar();
280cdf0e10cSrcweir     sal_Bool            CheckHorScrollBar();
281cdf0e10cSrcweir     void            CancelUserEvents();
282cdf0e10cSrcweir     void            EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect,
283cdf0e10cSrcweir                         sal_Bool bSyncPaint );
284cdf0e10cSrcweir     void            SaveSelection( List** );
285cdf0e10cSrcweir     void            RepaintEntries( sal_uInt16 nEntryFlagsMask );
286cdf0e10cSrcweir     void            SetListPositions();
287cdf0e10cSrcweir     void            SetDefaultTextSize();
IsAutoArrange() const288cdf0e10cSrcweir     sal_Bool            IsAutoArrange() const {
289cdf0e10cSrcweir                         return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoArrange); }
IsAutoAdjust() const290cdf0e10cSrcweir     sal_Bool            IsAutoAdjust() const {
291cdf0e10cSrcweir                         return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoAdjust); }
DocRectChanged()292cdf0e10cSrcweir     void            DocRectChanged() { aDocRectChangedTimer.Start(); }
VisRectChanged()293cdf0e10cSrcweir     void            VisRectChanged() { aVisRectChangedTimer.Start(); }
294cdf0e10cSrcweir     void            SetOrigin( const Point&, sal_Bool bDoNotUpdateWallpaper = sal_False );
295cdf0e10cSrcweir 
296cdf0e10cSrcweir                     DECL_LINK( TextEditEndedHdl, IcnViewEdit_Impl* );
297cdf0e10cSrcweir 
298cdf0e10cSrcweir     void ShowFocus ( Rectangle& rRect );
299cdf0e10cSrcweir     void HideFocus ();
300cdf0e10cSrcweir     void DrawFocusRect ( OutputDevice* pOut );
301cdf0e10cSrcweir 
302cdf0e10cSrcweir     sal_Bool            IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const;
303cdf0e10cSrcweir 
304cdf0e10cSrcweir public:
305cdf0e10cSrcweir 
306cdf0e10cSrcweir     long            nGridDX,
307cdf0e10cSrcweir                     nGridDY;
308cdf0e10cSrcweir     long            nHorSBarHeight,
309cdf0e10cSrcweir                     nVerSBarWidth;
310cdf0e10cSrcweir 
311cdf0e10cSrcweir                     SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pView, WinBits nWinStyle );
312cdf0e10cSrcweir                     ~SvxIconChoiceCtrl_Impl();
313cdf0e10cSrcweir 
SetChoiceWithCursor(sal_Bool bDo=sal_True)314cdf0e10cSrcweir     sal_Bool            SetChoiceWithCursor ( sal_Bool bDo = sal_True ) { sal_Bool bOld=bChooseWithCursor; bChooseWithCursor = bDo; return bOld; }
315cdf0e10cSrcweir     void            Clear( sal_Bool bInCtor = sal_False );
316cdf0e10cSrcweir     void            SetStyle( WinBits nWinStyle );
GetStyle() const317cdf0e10cSrcweir     WinBits         GetStyle() const { return nWinBits; }
318cdf0e10cSrcweir     void            InsertEntry( SvxIconChoiceCtrlEntry*, sal_uLong nPos, const Point* pPos=0 );
319cdf0e10cSrcweir     void            CreateAutoMnemonics( MnemonicGenerator* _pGenerator = NULL );
320cdf0e10cSrcweir     void            RemoveEntry( SvxIconChoiceCtrlEntry* pEntry );
321cdf0e10cSrcweir     void            FontModified();
322cdf0e10cSrcweir     void            SelectAll( sal_Bool bSelect = sal_True, sal_Bool bPaint = sal_True );
323cdf0e10cSrcweir     void            SelectEntry(
324cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry*,
325cdf0e10cSrcweir                         sal_Bool bSelect,
326cdf0e10cSrcweir                         sal_Bool bCallHdl = sal_True,
327cdf0e10cSrcweir                         sal_Bool bAddToSelection = sal_False,
328cdf0e10cSrcweir                         sal_Bool bSyncPaint = sal_False );
329cdf0e10cSrcweir     void            Paint( const Rectangle& rRect );
330cdf0e10cSrcweir     sal_Bool            MouseButtonDown( const MouseEvent& );
331cdf0e10cSrcweir     sal_Bool            MouseButtonUp( const MouseEvent& );
332cdf0e10cSrcweir     sal_Bool            MouseMove( const MouseEvent&);
333cdf0e10cSrcweir     sal_Bool            RequestHelp( const HelpEvent& rHEvt );
334cdf0e10cSrcweir     void            SetCursor_Impl(
335cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pOldCursor,
336cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pNewCursor,
337cdf0e10cSrcweir                         sal_Bool bMod1,
338cdf0e10cSrcweir                         sal_Bool bShift,
339cdf0e10cSrcweir                         sal_Bool bPaintSync = sal_False);
340cdf0e10cSrcweir     sal_Bool            KeyInput( const KeyEvent& );
341cdf0e10cSrcweir     void            Resize();
342cdf0e10cSrcweir     void            GetFocus();
343cdf0e10cSrcweir     void            LoseFocus();
344cdf0e10cSrcweir     void            SetUpdateMode( sal_Bool bUpdate );
GetUpdateMode() const345cdf0e10cSrcweir     sal_Bool            GetUpdateMode() const { return bUpdateMode; }
346cdf0e10cSrcweir     void            PaintEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bIsBackgroundPainted=sal_False );
347cdf0e10cSrcweir     void            PaintEntry(
348cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry*,
349cdf0e10cSrcweir                         const Point&,
350cdf0e10cSrcweir                         OutputDevice* pOut = 0,
351cdf0e10cSrcweir                         sal_Bool bIsBackgroundPainted = sal_False);
352cdf0e10cSrcweir     void            PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* );
353cdf0e10cSrcweir 
354cdf0e10cSrcweir     void            SetEntryPos(
355cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pEntry,
356cdf0e10cSrcweir                         const Point& rPos,
357cdf0e10cSrcweir                         sal_Bool bAdjustRow = sal_False,
358cdf0e10cSrcweir                         sal_Bool bCheckScrollBars = sal_False,
359cdf0e10cSrcweir                         sal_Bool bKeepGridMap = sal_False );
360cdf0e10cSrcweir 
361cdf0e10cSrcweir     void            InvalidateEntry( SvxIconChoiceCtrlEntry* );
362cdf0e10cSrcweir     IcnViewFieldType    GetItem( SvxIconChoiceCtrlEntry*, const Point& rAbsPos );
363cdf0e10cSrcweir 
364cdf0e10cSrcweir     void            SetNoSelection();
365cdf0e10cSrcweir 
GetCurEntry() const366cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GetCurEntry() const { return pCursor; }
367cdf0e10cSrcweir     void            SetCursor(
368cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry*,
369cdf0e10cSrcweir                         // sal_True == bei Single-Selection die Sel. mitfuehren
370cdf0e10cSrcweir                         sal_Bool bSyncSingleSelection = sal_True,
371cdf0e10cSrcweir                         sal_Bool bShowFocusAsync = sal_False );
372cdf0e10cSrcweir 
373cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos, sal_Bool bHit = sal_False );
374cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GetNextEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry );
375cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GetPrevEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry  );
376cdf0e10cSrcweir 
377cdf0e10cSrcweir     Point           GetEntryPos( SvxIconChoiceCtrlEntry* );
378cdf0e10cSrcweir     void            MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound = sal_True );
379cdf0e10cSrcweir 
380cdf0e10cSrcweir     void            Arrange(sal_Bool bKeepPredecessors = sal_False, long nSetMaxVirtWidth =0, long nSetMaxVirtHeight =0 );
381cdf0e10cSrcweir 
382cdf0e10cSrcweir     Rectangle       CalcFocusRect( SvxIconChoiceCtrlEntry* );
383cdf0e10cSrcweir     Rectangle       CalcBmpRect( SvxIconChoiceCtrlEntry*, const Point* pPos = 0 );
384cdf0e10cSrcweir     Rectangle       CalcTextRect(
385cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry*,
386cdf0e10cSrcweir                         const Point* pPos = 0,
387cdf0e10cSrcweir                         sal_Bool bForInplaceEdit = sal_False,
388cdf0e10cSrcweir                         const String* pStr = 0 );
389cdf0e10cSrcweir 
390cdf0e10cSrcweir     long            CalcBoundingWidth( SvxIconChoiceCtrlEntry* ) const;
391cdf0e10cSrcweir     long            CalcBoundingHeight( SvxIconChoiceCtrlEntry* ) const;
392cdf0e10cSrcweir     Size            CalcBoundingSize( SvxIconChoiceCtrlEntry* ) const;
393cdf0e10cSrcweir     void            FindBoundingRect( SvxIconChoiceCtrlEntry* pEntry );
394cdf0e10cSrcweir     void            SetBoundingRect_Impl(
395cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pEntry,
396cdf0e10cSrcweir                         const Point& rPos,
397cdf0e10cSrcweir                         const Size& rBoundingSize );
398cdf0e10cSrcweir     // berechnet alle BoundRects neu
399cdf0e10cSrcweir     void            RecalcAllBoundingRects();
400cdf0e10cSrcweir     // berechnet alle ungueltigen BoundRects neu
401cdf0e10cSrcweir     void            RecalcAllBoundingRectsSmart();
402cdf0e10cSrcweir     const Rectangle&  GetEntryBoundRect( SvxIconChoiceCtrlEntry* );
403cdf0e10cSrcweir     void            InvalidateBoundingRect( SvxIconChoiceCtrlEntry* );
InvalidateBoundingRect(Rectangle & rRect)404cdf0e10cSrcweir     void            InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; bBoundRectsDirty = sal_True; }
IsBoundingRectValid(const Rectangle & rRect) const405cdf0e10cSrcweir     sal_Bool            IsBoundingRectValid( const Rectangle& rRect ) const { return (sal_Bool)( rRect.Right() != LONG_MAX ); }
406cdf0e10cSrcweir 
407cdf0e10cSrcweir     void            PaintEmphasis(
408cdf0e10cSrcweir                         const Rectangle& rRect1,
409cdf0e10cSrcweir                         const Rectangle& rRect2,
410cdf0e10cSrcweir                         sal_Bool bSelected,
411cdf0e10cSrcweir                         sal_Bool bDropTarget,
412cdf0e10cSrcweir                         sal_Bool bCursored,
413cdf0e10cSrcweir                         OutputDevice* pOut,
414cdf0e10cSrcweir                         sal_Bool bIsBackgroundPainted = sal_False);
415cdf0e10cSrcweir 
416cdf0e10cSrcweir     void            PaintItem(
417cdf0e10cSrcweir                         const Rectangle& rRect,
418cdf0e10cSrcweir                         IcnViewFieldType eItem,
419cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pEntry,
420cdf0e10cSrcweir                         sal_uInt16 nPaintFlags,
421cdf0e10cSrcweir                         OutputDevice* pOut,
422cdf0e10cSrcweir                         const String* pStr = 0,
423cdf0e10cSrcweir                         ::vcl::ControlLayoutData* _pLayoutData = NULL );
424cdf0e10cSrcweir 
425cdf0e10cSrcweir     // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == sal_True
CheckBoundingRects()426cdf0e10cSrcweir     void            CheckBoundingRects() { if (bBoundRectsDirty) RecalcAllBoundingRectsSmart(); }
427cdf0e10cSrcweir     // berechnet alle invalidierten BoundingRects neu
428cdf0e10cSrcweir     void            UpdateBoundingRects();
429cdf0e10cSrcweir     void            ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bShow );
430cdf0e10cSrcweir     void            PrepareCommandEvent( const CommandEvent& );
431cdf0e10cSrcweir     void            Command( const CommandEvent& rCEvt );
432cdf0e10cSrcweir     void            ToTop( SvxIconChoiceCtrlEntry* );
433cdf0e10cSrcweir 
434cdf0e10cSrcweir     sal_uLong           GetSelectionCount() const;
435cdf0e10cSrcweir     void            SetGrid( const Size& );
436cdf0e10cSrcweir     Size            GetMinGrid() const;
437cdf0e10cSrcweir     sal_uLong           GetGridCount(
438cdf0e10cSrcweir                         const Size& rSize,
439cdf0e10cSrcweir                         sal_Bool bCheckScrBars,
440cdf0e10cSrcweir                         sal_Bool bSmartScrBar ) const;
441cdf0e10cSrcweir     void            Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar = sal_False );
442cdf0e10cSrcweir     const Size&     GetItemSize( SvxIconChoiceCtrlEntry*, IcnViewFieldType ) const;
443cdf0e10cSrcweir 
444cdf0e10cSrcweir     void            HideDDIcon();
445cdf0e10cSrcweir     void            ShowDDIcon( SvxIconChoiceCtrlEntry* pRefEntry, const Point& rPos );
446cdf0e10cSrcweir     void            HideShowDDIcon(
447cdf0e10cSrcweir                         SvxIconChoiceCtrlEntry* pRefEntry,
448cdf0e10cSrcweir                         const Point& rPos );
449cdf0e10cSrcweir 
450cdf0e10cSrcweir     sal_Bool            IsOver(
451cdf0e10cSrcweir                         SvPtrarr* pSelectedRectList,
452cdf0e10cSrcweir                         const Rectangle& rEntryBoundRect ) const;
453cdf0e10cSrcweir 
454cdf0e10cSrcweir     void            SelectRect(
455cdf0e10cSrcweir                         const Rectangle&,
456cdf0e10cSrcweir                         sal_Bool bAdd = sal_True,
457cdf0e10cSrcweir                         SvPtrarr* pOtherRects = 0 );
458cdf0e10cSrcweir 
459cdf0e10cSrcweir     void            CalcScrollOffsets(
460cdf0e10cSrcweir                         const Point& rRefPosPixel,
461cdf0e10cSrcweir                         long& rX,
462cdf0e10cSrcweir                         long& rY,
463cdf0e10cSrcweir                         sal_Bool bDragDrop = sal_False,
464cdf0e10cSrcweir                         sal_uInt16 nBorderWidth = 10 );
465cdf0e10cSrcweir 
466cdf0e10cSrcweir     sal_Bool            IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos );
467cdf0e10cSrcweir     void            MakeVisible(
468cdf0e10cSrcweir                         const Rectangle& rDocPos,
469cdf0e10cSrcweir                         sal_Bool bInScrollBarEvent=sal_False,
470cdf0e10cSrcweir                         sal_Bool bCallRectChangedHdl = sal_True );
471cdf0e10cSrcweir 
472cdf0e10cSrcweir     void            AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart = 0 );
473cdf0e10cSrcweir     void            SetEntryTextMode( SvxIconChoiceCtrlTextMode, SvxIconChoiceCtrlEntry* pEntry = 0 );
474cdf0e10cSrcweir     SvxIconChoiceCtrlTextMode GetTextMode( const SvxIconChoiceCtrlEntry* pEntry = 0 ) const;
475cdf0e10cSrcweir     void            ShowEntryFocusRect( const SvxIconChoiceCtrlEntry* pEntry );
EnableEntryEditing(sal_Bool bEnable)476cdf0e10cSrcweir     void            EnableEntryEditing( sal_Bool bEnable ) { bEntryEditingEnabled = bEnable; }
IsEntryEditingEnabled() const477cdf0e10cSrcweir     sal_Bool            IsEntryEditingEnabled() const { return bEntryEditingEnabled; }
IsEntryEditing() const478cdf0e10cSrcweir     sal_Bool            IsEntryEditing() const { return (sal_Bool)(pCurEditedEntry!=0); }
479cdf0e10cSrcweir     void            EditEntry( SvxIconChoiceCtrlEntry* pEntry );
480cdf0e10cSrcweir     void            StopEntryEditing( sal_Bool bCancel );
481cdf0e10cSrcweir     void            LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bLock );
GetEntryCount() const482cdf0e10cSrcweir     sal_uLong           GetEntryCount() const { return aEntries.Count(); }
GetEntry(sal_uLong nPos) const483cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return (SvxIconChoiceCtrlEntry*)aEntries.GetObject(nPos); }
484cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GetFirstSelectedEntry( sal_uLong& ) const;
485cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GetNextSelectedEntry( sal_uLong& ) const;
GetHdlEntry() const486cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GetHdlEntry() const { return pHdlEntry; }
SetHdlEntry(SvxIconChoiceCtrlEntry * pEntry)487cdf0e10cSrcweir     void            SetHdlEntry( SvxIconChoiceCtrlEntry* pEntry ) { pHdlEntry = pEntry; }
488cdf0e10cSrcweir 
489cdf0e10cSrcweir     SvxIconChoiceCtrlTextMode GetEntryTextModeSmart( const SvxIconChoiceCtrlEntry* pEntry ) const;
SetSelectionMode(SelectionMode eMode)490cdf0e10cSrcweir     void            SetSelectionMode( SelectionMode eMode ) { eSelectionMode=eMode; }
GetSelectionMode() const491cdf0e10cSrcweir     SelectionMode   GetSelectionMode() const { return eSelectionMode; }
AreEntriesMoved() const492cdf0e10cSrcweir     sal_Bool            AreEntriesMoved() const { return (sal_Bool)((nFlags & F_MOVED_ENTRIES)!=0); }
SetEntriesMoved(sal_Bool bMoved)493cdf0e10cSrcweir     void            SetEntriesMoved( sal_Bool bMoved )
494cdf0e10cSrcweir                     {
495cdf0e10cSrcweir                         if( bMoved ) nFlags |= F_MOVED_ENTRIES;
496cdf0e10cSrcweir                         else nFlags &= ~(F_MOVED_ENTRIES);
497cdf0e10cSrcweir                     }
498cdf0e10cSrcweir     sal_uLong           GetEntryListPos( SvxIconChoiceCtrlEntry* ) const;
499cdf0e10cSrcweir     void            SetEntryListPos( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nNewPos );
SetEntryImageSize(const Size & rSize)500cdf0e10cSrcweir     void            SetEntryImageSize( const Size& rSize ) { aImageSize = rSize; }
501cdf0e10cSrcweir     void            SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nFlags );
502cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight );
503cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown );
504cdf0e10cSrcweir     void            InitSettings();
505cdf0e10cSrcweir     Rectangle       GetOutputRect() const;
506cdf0e10cSrcweir 
ArePredecessorsSet() const507cdf0e10cSrcweir     sal_Bool            ArePredecessorsSet() const { return (sal_Bool)(pHead != 0); }
GetPredecessorHead() const508cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GetPredecessorHead() const { return pHead; }
509cdf0e10cSrcweir     void            SetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry* pPredecessor);
510cdf0e10cSrcweir     sal_Bool            GetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry** ppPredecessor);
511cdf0e10cSrcweir     // liefert gueltige Ergebnisse nur im AutoArrange-Modus!
512cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, const Point& );
513cdf0e10cSrcweir 
514cdf0e10cSrcweir     void            SetPositionMode( SvxIconChoiceCtrlPositionMode );
GetPositionMode() const515cdf0e10cSrcweir     SvxIconChoiceCtrlPositionMode GetPositionMode() const { return ePositionMode;}
516cdf0e10cSrcweir 
517cdf0e10cSrcweir     void            Flush();
518cdf0e10cSrcweir     void            SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& );
519cdf0e10cSrcweir     const SvxIconChoiceCtrlColumnInfo* GetColumn( sal_uInt16 nIndex ) const;
520cdf0e10cSrcweir     const SvxIconChoiceCtrlColumnInfo* GetItemColumn( sal_uInt16 nSubItem, long& rLeft ) const;
521cdf0e10cSrcweir 
GetDocumentRect() const522cdf0e10cSrcweir     Rectangle       GetDocumentRect() const { return Rectangle( Point(), aVirtOutputSize ); }
GetVisibleRect() const523cdf0e10cSrcweir     Rectangle       GetVisibleRect() const { return GetOutputRect(); }
524cdf0e10cSrcweir 
525cdf0e10cSrcweir     void            SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,sal_Bool bKeepHighlightFlags=sal_False );
526cdf0e10cSrcweir     void            HideEntryHighlightFrame();
527cdf0e10cSrcweir     void            DrawHighlightFrame( OutputDevice* pOut,
528cdf0e10cSrcweir                         const Rectangle& rBmpRect, sal_Bool bHide );
StopSelectTimer()529cdf0e10cSrcweir     void            StopSelectTimer() { aCallSelectHdlTimer.Stop(); }
530cdf0e10cSrcweir     void            Tracking( const TrackingEvent& rTEvt );
531cdf0e10cSrcweir     Point           GetPopupMenuPosPixel() const;
532cdf0e10cSrcweir 
533cdf0e10cSrcweir     sal_Bool            HandleShortCutKey( const KeyEvent& rKeyEvent );
534cdf0e10cSrcweir 
535cdf0e10cSrcweir     void            CallEventListeners( sal_uLong nEvent, void* pData = NULL );
536cdf0e10cSrcweir 
537cdf0e10cSrcweir     inline ::svt::IAccessibleFactory&
GetAccessibleFactory()538cdf0e10cSrcweir         GetAccessibleFactory() { return aAccFactory.getFactory(); }
539cdf0e10cSrcweir };
540cdf0e10cSrcweir 
541cdf0e10cSrcweir // ----------------------------------------------------------------------------------------------
542cdf0e10cSrcweir 
543cdf0e10cSrcweir class IcnCursor_Impl
544cdf0e10cSrcweir {
545cdf0e10cSrcweir     SvxIconChoiceCtrl_Impl* pView;
546cdf0e10cSrcweir     SvPtrarr*       pColumns;
547cdf0e10cSrcweir     SvPtrarr*       pRows;
548cdf0e10cSrcweir     long            nCols;
549cdf0e10cSrcweir     long            nRows;
550cdf0e10cSrcweir     short           nDeltaWidth;
551cdf0e10cSrcweir     short           nDeltaHeight;
552cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* pCurEntry;
553cdf0e10cSrcweir     void            SetDeltas();
554cdf0e10cSrcweir     void            ImplCreate();
Create()555cdf0e10cSrcweir     void            Create() {  if( !pColumns ) ImplCreate(); }
556cdf0e10cSrcweir 
557cdf0e10cSrcweir     sal_uInt16          GetSortListPos( SvPtrarr* pList, long nValue, int bVertical);
558cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,sal_uInt16 nPref,
559cdf0e10cSrcweir                         sal_Bool bDown, sal_Bool bSimple );
560cdf0e10cSrcweir 
561cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* SearchRow(sal_uInt16 nRow,sal_uInt16 nRight,sal_uInt16 nLeft,sal_uInt16 nPref,
562cdf0e10cSrcweir                         sal_Bool bRight, sal_Bool bSimple );
563cdf0e10cSrcweir 
564cdf0e10cSrcweir public:
565cdf0e10cSrcweir                     IcnCursor_Impl( SvxIconChoiceCtrl_Impl* pOwner );
566cdf0e10cSrcweir                     ~IcnCursor_Impl();
567cdf0e10cSrcweir     void            Clear();
568cdf0e10cSrcweir 
569cdf0e10cSrcweir     // fuer Cursortravelling usw.
570cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight );
571cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown );
572cdf0e10cSrcweir     SvxIconChoiceCtrlEntry* GoPageUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown );
573cdf0e10cSrcweir 
574cdf0e10cSrcweir     // Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left()
575cdf0e10cSrcweir     // sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann
576cdf0e10cSrcweir     // leer sein. Die Listen gehen in das Eigentum des Rufenden ueber und
577cdf0e10cSrcweir     // muessen mit DestroyGridAdjustData geloescht werden
578cdf0e10cSrcweir     void            CreateGridAjustData( SvPtrarr& pLists, SvxIconChoiceCtrlEntry* pRow=0);
579cdf0e10cSrcweir     static void     DestroyGridAdjustData( SvPtrarr& rLists );
580cdf0e10cSrcweir };
581cdf0e10cSrcweir 
582cdf0e10cSrcweir // ----------------------------------------------------------------------------------------------
583cdf0e10cSrcweir 
584cdf0e10cSrcweir typedef sal_uLong GridId;
585cdf0e10cSrcweir 
586cdf0e10cSrcweir #define GRID_NOT_FOUND  ((GridId)ULONG_MAX)
587cdf0e10cSrcweir 
588cdf0e10cSrcweir class IcnGridMap_Impl
589cdf0e10cSrcweir {
590cdf0e10cSrcweir     Rectangle       _aLastOccupiedGrid;
591cdf0e10cSrcweir     SvxIconChoiceCtrl_Impl* _pView;
592cdf0e10cSrcweir     sal_Bool*           _pGridMap;
593cdf0e10cSrcweir     sal_uInt16          _nGridCols, _nGridRows;
594cdf0e10cSrcweir 
595cdf0e10cSrcweir     void            Expand();
596cdf0e10cSrcweir     void            Create_Impl();
Create()597cdf0e10cSrcweir     void            Create() { if(!_pGridMap) Create_Impl(); }
598cdf0e10cSrcweir 
599cdf0e10cSrcweir     void            GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const;
600cdf0e10cSrcweir 
601cdf0e10cSrcweir public:
602cdf0e10cSrcweir                     IcnGridMap_Impl(SvxIconChoiceCtrl_Impl* pView);
603cdf0e10cSrcweir                     ~IcnGridMap_Impl();
604cdf0e10cSrcweir 
605cdf0e10cSrcweir     void            Clear();
606cdf0e10cSrcweir 
607cdf0e10cSrcweir     GridId          GetGrid( const Point& rDocPos, sal_Bool* pbClipped = 0 );
608cdf0e10cSrcweir     GridId          GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY );
609cdf0e10cSrcweir     GridId          GetUnoccupiedGrid( sal_Bool bOccupyFound=sal_True );
610cdf0e10cSrcweir 
611cdf0e10cSrcweir     void            OccupyGrids( const Rectangle&, sal_Bool bOccupy = sal_True );
612cdf0e10cSrcweir     void            OccupyGrids( const SvxIconChoiceCtrlEntry*, sal_Bool bOccupy = sal_True );
OccupyGrid(GridId nId,sal_Bool bOccupy=sal_True)613cdf0e10cSrcweir     void            OccupyGrid( GridId nId, sal_Bool bOccupy = sal_True )
614cdf0e10cSrcweir                     {
615cdf0e10cSrcweir                         DBG_ASSERT(!_pGridMap || nId<(sal_uLong)(_nGridCols*_nGridRows),"OccupyGrid: Bad GridId");
616cdf0e10cSrcweir                         if(_pGridMap && nId < (sal_uLong)(_nGridCols *_nGridRows) )
617cdf0e10cSrcweir                             _pGridMap[ nId ] = bOccupy;
618cdf0e10cSrcweir                     }
619cdf0e10cSrcweir 
620cdf0e10cSrcweir     Rectangle       GetGridRect( GridId );
621cdf0e10cSrcweir     void            GetGridCoord( GridId, sal_uInt16& rGridX, sal_uInt16& rGridY );
622cdf0e10cSrcweir     static sal_uLong    GetGridCount( const Size& rSizePixel, sal_uInt16 nGridWidth, sal_uInt16 nGridHeight );
623cdf0e10cSrcweir 
624cdf0e10cSrcweir     void            OutputSizeChanged();
625cdf0e10cSrcweir };
626cdf0e10cSrcweir 
627cdf0e10cSrcweir 
628cdf0e10cSrcweir 
629cdf0e10cSrcweir 
630cdf0e10cSrcweir 
631cdf0e10cSrcweir #endif
632