diff options
Diffstat (limited to 'svtools/source/inc/svimpicn.hxx')
-rw-r--r-- | svtools/source/inc/svimpicn.hxx | 362 |
1 files changed, 181 insertions, 181 deletions
diff --git a/svtools/source/inc/svimpicn.hxx b/svtools/source/inc/svimpicn.hxx index 8d297e3476db..09427410d5c7 100644 --- a/svtools/source/inc/svimpicn.hxx +++ b/svtools/source/inc/svimpicn.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,272 +39,272 @@ class SvImpIconView; class ImpIcnCursor; class SvPtrarr; -#define PAINTFLAG_HOR_CENTERED 0x0001 -#define PAINTFLAG_VER_CENTERED 0x0002 +#define PAINTFLAG_HOR_CENTERED 0x0001 +#define PAINTFLAG_VER_CENTERED 0x0002 -#define SELRECT_BORDER_OFFS -7 +#define SELRECT_BORDER_OFFS -7 // Flags -#define F_VER_SBARSIZE_WITH_HBAR 0x00000001 -#define F_HOR_SBARSIZE_WITH_VBAR 0x00000002 -#define F_IGNORE_NEXT_MOUSEMOVE 0x00000004 // OS/2 only -#define F_ENTRY_REMOVED 0x00000008 +#define F_VER_SBARSIZE_WITH_HBAR 0x00000001 +#define F_HOR_SBARSIZE_WITH_VBAR 0x00000002 +#define F_IGNORE_NEXT_MOUSEMOVE 0x00000004 // OS/2 only +#define F_ENTRY_REMOVED 0x00000008 // ist gesetzt, wenn nach Clear oder Ctor mind. einmal gepaintet wurde -#define F_PAINTED 0x00000010 -#define F_ADD_MODE 0x00000020 -#define F_MOVING_SIBLING 0x00000040 -#define F_SELRECT_VISIBLE 0x00000080 -#define F_CMD_ARRIVED 0x00000100 -#define F_DRAG_SOURCE 0x00000200 -#define F_GRIDMODE 0x00000400 +#define F_PAINTED 0x00000010 +#define F_ADD_MODE 0x00000020 +#define F_MOVING_SIBLING 0x00000040 +#define F_SELRECT_VISIBLE 0x00000080 +#define F_CMD_ARRIVED 0x00000100 +#define F_DRAG_SOURCE 0x00000200 +#define F_GRIDMODE 0x00000400 // beim Einfuegen eines Eintrags ergibt sich dessen Position // durch simples Addieren auf die Position des zuletzt eingefuegten Eintrags -#define F_GRID_INSERT 0x00000800 -#define F_DOWN_CTRL 0x00001000 -#define F_DOWN_DESELECT 0x00002000 +#define F_GRID_INSERT 0x00000800 +#define F_DOWN_CTRL 0x00001000 +#define F_DOWN_DESELECT 0x00002000 // Hack fuer D&D: Hintergrund des Entries nicht painten -#define F_NO_EMPHASIS 0x00004000 +#define F_NO_EMPHASIS 0x00004000 // Selektion per Gummiband -#define F_RUBBERING 0x00008000 -#define F_START_EDITTIMER_IN_MOUSEUP 0x00010000 +#define F_RUBBERING 0x00008000 +#define F_START_EDITTIMER_IN_MOUSEUP 0x00010000 class SvImpIconView { friend class ImpIcnCursor; - ScrollBar aVerSBar; - ScrollBar aHorSBar; - Rectangle aCurSelectionRect; - SvPtrarr aSelectedRectList; - MouseEvent aMouseMoveEvent; - Timer aEditTimer; // fuer Inplace-Editieren - Timer aMouseMoveTimer; // generiert MouseMoves bei Gummibandselektion + ScrollBar aVerSBar; + ScrollBar aHorSBar; + Rectangle aCurSelectionRect; + SvPtrarr aSelectedRectList; + MouseEvent aMouseMoveEvent; + Timer aEditTimer; // fuer Inplace-Editieren + Timer aMouseMoveTimer; // generiert MouseMoves bei Gummibandselektion // Boundrect des zuletzt eingefuegten Entries - Rectangle aPrevBoundRect; - Size aOutputSize; // Pixel - Size aVirtOutputSize; // expandiert automatisch - Point aDDLastEntryPos; - Point aDDLastRectPos; + Rectangle aPrevBoundRect; + Size aOutputSize; // Pixel + Size aVirtOutputSize; // expandiert automatisch + Point aDDLastEntryPos; + Point aDDLastRectPos; SvLBoxTreeList* pModel; - SvIconView* pView; - ImpIcnCursor* pImpCursor; - long nMaxVirtWidth; // max.breite aVirtOutputSize - SvPtrarr* pZOrderList; - long nGridDX, + SvIconView* pView; + ImpIcnCursor* pImpCursor; + long nMaxVirtWidth; // max.breite aVirtOutputSize + SvPtrarr* pZOrderList; + long nGridDX, nGridDY; - long nHorSBarHeight, + long nHorSBarHeight, nVerSBarWidth; - WinBits nWinBits; - int nViewMode; - long nHorDist; - long nVerDist; - long nMaxBmpWidth; - long nMaxBmpHeight; - long nMaxTextWidth; - long nMaxBoundHeight; // Hoehe des hoechsten BoundRects - ULONG nFlags; - ULONG nCurUserEvent; - SvLBoxEntry* pCurParent; - SvLBoxEntry* pCursor; - SvLBoxEntry* pNextCursor; // wird in MovingEntry gesetzt und ist + WinBits nWinBits; + int nViewMode; + long nHorDist; + long nVerDist; + long nMaxBmpWidth; + long nMaxBmpHeight; + long nMaxTextWidth; + long nMaxBoundHeight; // Hoehe des hoechsten BoundRects + ULONG nFlags; + ULONG nCurUserEvent; + SvLBoxEntry* pCurParent; + SvLBoxEntry* pCursor; + SvLBoxEntry* pNextCursor; // wird in MovingEntry gesetzt und ist // nur in EntryMoved gueltig! - SvLBoxEntry* pDDRefEntry; - VirtualDevice* pDDDev; - VirtualDevice* pDDBufDev; + SvLBoxEntry* pDDRefEntry; + VirtualDevice* pDDDev; + VirtualDevice* pDDBufDev; VirtualDevice* pDDTempDev; SvIconViewTextMode eTextMode; - BOOL bMustRecalcBoundingRects; + BOOL bMustRecalcBoundingRects; - void CheckAllSizes(); - void CheckSizes( SvLBoxEntry* pEntry, + void CheckAllSizes(); + void CheckSizes( SvLBoxEntry* pEntry, const SvIcnVwDataEntry* pViewData = 0 ); - void ShowCursor( BOOL bShow ); + void ShowCursor( BOOL bShow ); - void SetNextEntryPos(const Point& rPos); - Point FindNextEntryPos( const Size& rBoundSize ); - void ImpArrange(); - void AdjustVirtSize( const Rectangle& ); - void ResetVirtSize(); - void CheckScrollBars(); + void SetNextEntryPos(const Point& rPos); + Point FindNextEntryPos( const Size& rBoundSize ); + void ImpArrange(); + void AdjustVirtSize( const Rectangle& ); + void ResetVirtSize(); + void CheckScrollBars(); DECL_LINK( ScrollUpDownHdl, ScrollBar * ); DECL_LINK( ScrollLeftRightHdl, ScrollBar * ); DECL_LINK( MouseMoveTimeoutHdl, Timer* ); DECL_LINK( EditTimeoutHdl, Timer* ); DECL_LINK( UserEventHdl, void* ); - void AdjustScrollBars(); - void PositionScrollBars( long nRealWidth, long nRealHeight ); - void CalcDocPos( Point& aMousePos ); - BOOL GetResizeRect( Rectangle& ); - void PaintResizeRect( const Rectangle& ); - SvLBoxEntry* GetNewCursor(); - void ToggleSelection( SvLBoxEntry* ); - void DeselectAllBut( SvLBoxEntry* ); - void Center( SvLBoxEntry* pEntry, SvIcnVwDataEntry* ) const; - void StopEditTimer() { aEditTimer.Stop(); } - void StartEditTimer() { aEditTimer.Start(); } - void ImpHideDDIcon(); - void ImpDrawXORRect( const Rectangle& rRect ); - void AddSelectedRect( const Rectangle&, short nOffset = SELRECT_BORDER_OFFS ); - void ClearSelectedRectList(); - Rectangle CalcMaxTextRect( const SvLBoxEntry* pEntry, + void AdjustScrollBars(); + void PositionScrollBars( long nRealWidth, long nRealHeight ); + void CalcDocPos( Point& aMousePos ); + BOOL GetResizeRect( Rectangle& ); + void PaintResizeRect( const Rectangle& ); + SvLBoxEntry* GetNewCursor(); + void ToggleSelection( SvLBoxEntry* ); + void DeselectAllBut( SvLBoxEntry* ); + void Center( SvLBoxEntry* pEntry, SvIcnVwDataEntry* ) const; + void StopEditTimer() { aEditTimer.Stop(); } + void StartEditTimer() { aEditTimer.Start(); } + void ImpHideDDIcon(); + void ImpDrawXORRect( const Rectangle& rRect ); + void AddSelectedRect( const Rectangle&, short nOffset = SELRECT_BORDER_OFFS ); + void ClearSelectedRectList(); + Rectangle CalcMaxTextRect( const SvLBoxEntry* pEntry, const SvIcnVwDataEntry* pViewData ) const; - void ClipAtVirtOutRect( Rectangle& rRect ) const; - void AdjustAtGrid( const SvPtrarr& rRow, SvLBoxEntry* pStart=0 ); - Point AdjustAtGrid( + void ClipAtVirtOutRect( Rectangle& rRect ) const; + void AdjustAtGrid( const SvPtrarr& rRow, SvLBoxEntry* pStart=0 ); + Point AdjustAtGrid( const Rectangle& rCenterRect, // "Schwerpunkt" des Objekts (typ. Bmp-Rect) const Rectangle& rBoundRect ) const; SvIconViewTextMode GetEntryTextModeSmart( const SvLBoxEntry* pEntry, const SvIcnVwDataEntry* pViewData ) const; - BOOL CheckVerScrollBar(); - BOOL CheckHorScrollBar(); - void CancelUserEvent(); + BOOL CheckVerScrollBar(); + BOOL CheckHorScrollBar(); + void CancelUserEvent(); public: SvImpIconView( SvIconView* pView, SvLBoxTreeList*, WinBits nWinStyle ); ~SvImpIconView(); - void Clear( BOOL bInCtor = FALSE ); - void SetWindowBits( WinBits nWinStyle ); - void SetModel( SvLBoxTreeList* pTree, SvLBoxEntry* pParent ) + void Clear( BOOL bInCtor = FALSE ); + void SetWindowBits( WinBits nWinStyle ); + void SetModel( SvLBoxTreeList* pTree, SvLBoxEntry* pParent ) { pModel = pTree; SetCurParent(pParent); } - void EntryInserted( SvLBoxEntry*); - void RemovingEntry( SvLBoxEntry* pEntry ); - void EntryRemoved(); - void MovingEntry( SvLBoxEntry* pEntry ); - void EntryMoved( SvLBoxEntry* pEntry ); - void TreeInserted( SvLBoxEntry* pEntry ); - void ChangedFont(); - void ModelHasEntryInvalidated( SvListEntry* ); - void EntryExpanded( SvLBoxEntry* pEntry ); - void EntryCollapsed( SvLBoxEntry* pEntry ); - void CollapsingEntry( SvLBoxEntry* pEntry ); - void EntrySelected( SvLBoxEntry*, BOOL bSelect ); - - void Paint( const Rectangle& rRect ); - void RepaintSelectionItems(); - void MouseButtonDown( const MouseEvent& ); - void MouseButtonUp( const MouseEvent& ); - void MouseMove( const MouseEvent&); - BOOL KeyInput( const KeyEvent& ); - void Resize(); - void GetFocus(); - void LoseFocus(); - void UpdateAll(); - void PaintEntry( SvLBoxEntry* pEntry, + void EntryInserted( SvLBoxEntry*); + void RemovingEntry( SvLBoxEntry* pEntry ); + void EntryRemoved(); + void MovingEntry( SvLBoxEntry* pEntry ); + void EntryMoved( SvLBoxEntry* pEntry ); + void TreeInserted( SvLBoxEntry* pEntry ); + void ChangedFont(); + void ModelHasEntryInvalidated( SvListEntry* ); + void EntryExpanded( SvLBoxEntry* pEntry ); + void EntryCollapsed( SvLBoxEntry* pEntry ); + void CollapsingEntry( SvLBoxEntry* pEntry ); + void EntrySelected( SvLBoxEntry*, BOOL bSelect ); + + void Paint( const Rectangle& rRect ); + void RepaintSelectionItems(); + void MouseButtonDown( const MouseEvent& ); + void MouseButtonUp( const MouseEvent& ); + void MouseMove( const MouseEvent&); + BOOL KeyInput( const KeyEvent& ); + void Resize(); + void GetFocus(); + void LoseFocus(); + void UpdateAll(); + void PaintEntry( SvLBoxEntry* pEntry, SvIcnVwDataEntry* pViewData = 0 ); - void PaintEntry( SvLBoxEntry*, const Point&, + void PaintEntry( SvLBoxEntry*, const Point&, SvIcnVwDataEntry* pViewData = 0, OutputDevice* pOut = 0); - void SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, + void SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, BOOL bAdjustRow = FALSE, BOOL bCheckScrollBars = FALSE ); - void InvalidateEntry( SvLBoxEntry* ); - void ViewDataInitialized( SvLBoxEntry* pEntry ); - SvLBoxItem* GetItem( SvLBoxEntry*, const Point& rAbsPos ); + void InvalidateEntry( SvLBoxEntry* ); + void ViewDataInitialized( SvLBoxEntry* pEntry ); + SvLBoxItem* GetItem( SvLBoxEntry*, const Point& rAbsPos ); - void SetNoSelection(); - void SetDragDropMode( DragDropMode eDDMode ); - void SetSelectionMode( SelectionMode eSelMode ); + void SetNoSelection(); + void SetDragDropMode( DragDropMode eDDMode ); + void SetSelectionMode( SelectionMode eSelMode ); - void SttDrag( const Point& rPos ); - void EndDrag(); + void SttDrag( const Point& rPos ); + void EndDrag(); - SvLBoxEntry* GetCurEntry() const { return pCursor; } - void SetCursor( SvLBoxEntry* ); + SvLBoxEntry* GetCurEntry() const { return pCursor; } + void SetCursor( SvLBoxEntry* ); - BOOL IsEntryInView( SvLBoxEntry* ); - SvLBoxEntry* GetEntry( const Point& rDocPos ); - SvLBoxEntry* GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ); - SvLBoxEntry* GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ); + BOOL IsEntryInView( SvLBoxEntry* ); + SvLBoxEntry* GetEntry( const Point& rDocPos ); + SvLBoxEntry* GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ); + SvLBoxEntry* GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ); - Point GetEntryPosition( SvLBoxEntry* ); - void MakeVisible( SvLBoxEntry* pEntry ); + Point GetEntryPosition( SvLBoxEntry* ); + void MakeVisible( SvLBoxEntry* pEntry ); - void Arrange(); + void Arrange(); - void SetSpaceBetweenEntries( long nHor, long Ver ); - long GetHorSpaceBetweenEntries() const { return nHorDist; } - long GetVerSpaceBetweenEntries() const { return nVerDist; } + void SetSpaceBetweenEntries( long nHor, long Ver ); + long GetHorSpaceBetweenEntries() const { return nHorDist; } + long GetVerSpaceBetweenEntries() const { return nVerDist; } - Rectangle CalcFocusRect( SvLBoxEntry* ); + Rectangle CalcFocusRect( SvLBoxEntry* ); - Rectangle CalcBmpRect( SvLBoxEntry*, const Point* pPos = 0, + Rectangle CalcBmpRect( SvLBoxEntry*, const Point* pPos = 0, SvIcnVwDataEntry* pViewData=0 ); - Rectangle CalcTextRect( SvLBoxEntry*, SvLBoxString* pItem = 0, + Rectangle CalcTextRect( SvLBoxEntry*, SvLBoxString* pItem = 0, const Point* pPos = 0, BOOL bForInplaceEdit = FALSE, SvIcnVwDataEntry* pViewData = 0 ); - long CalcBoundingWidth( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData = 0) const; - long CalcBoundingHeight( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData= 0 ) const; - Size CalcBoundingSize( SvLBoxEntry*, + long CalcBoundingWidth( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData = 0) const; + long CalcBoundingHeight( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData= 0 ) const; + Size CalcBoundingSize( SvLBoxEntry*, SvIcnVwDataEntry* pViewData = 0 ) const; - void FindBoundingRect( SvLBoxEntry* pEntry, + void FindBoundingRect( SvLBoxEntry* pEntry, SvIcnVwDataEntry* pViewData = 0 ); // berechnet alle BoundRects neu - void RecalcAllBoundingRects(); + void RecalcAllBoundingRects(); // berechnet alle ungueltigen BoundRects neu - void RecalcAllBoundingRectsSmart(); + void RecalcAllBoundingRectsSmart(); const Rectangle& GetBoundingRect( SvLBoxEntry*, SvIcnVwDataEntry* pViewData=0); - void InvalidateBoundingRect( SvLBoxEntry* ); - void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; } - BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); } + void InvalidateBoundingRect( SvLBoxEntry* ); + void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; } + BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); } - void PaintEmphasis( const Rectangle&, BOOL bSelected, + void PaintEmphasis( const Rectangle&, BOOL bSelected, BOOL bCursored, OutputDevice* pOut = 0 ); - void PaintItem( const Rectangle& rRect, SvLBoxItem* pItem, + void PaintItem( const Rectangle& rRect, SvLBoxItem* pItem, SvLBoxEntry* pEntry, USHORT nPaintFlags, OutputDevice* pOut = 0 ); // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE - void CheckBoundingRects() { if (bMustRecalcBoundingRects) RecalcAllBoundingRects(); } + void CheckBoundingRects() { if (bMustRecalcBoundingRects) RecalcAllBoundingRects(); } // berechnet alle invalidierten BoundingRects neu - void UpdateBoundingRects(); - void ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow ); - SvLBoxEntry* GetDropTarget( const Point& rPosPixel ); - BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + void UpdateBoundingRects(); + void ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow ); + SvLBoxEntry* GetDropTarget( const Point& rPosPixel ); + BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); - BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); - void WriteDragServerInfo( const Point&, SvLBoxDDInfo* ); - void ReadDragServerInfo( const Point&, SvLBoxDDInfo* ); - void ToTop( SvLBoxEntry* ); + void WriteDragServerInfo( const Point&, SvLBoxDDInfo* ); + void ReadDragServerInfo( const Point&, SvLBoxDDInfo* ); + void ToTop( SvLBoxEntry* ); - void SetCurParent( SvLBoxEntry* pNewParent ); - SvLBoxEntry* GetCurParent() const { return pCurParent; } - USHORT GetSelectionCount() const; - void SetGrid( long nDX, long nDY ); - void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE ); - const Size& GetItemSize( SvIconView* pView, SvLBoxEntry*, SvLBoxItem*, + void SetCurParent( SvLBoxEntry* pNewParent ); + SvLBoxEntry* GetCurParent() const { return pCurParent; } + USHORT GetSelectionCount() const; + void SetGrid( long nDX, long nDY ); + void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE ); + const Size& GetItemSize( SvIconView* pView, SvLBoxEntry*, SvLBoxItem*, const SvIcnVwDataEntry* pViewData = 0 ) const; - void PrepareCommandEvent( const Point& rPt ); + void PrepareCommandEvent( const Point& rPt ); - void HideDDIcon(); - void ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ); - void HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ); + void HideDDIcon(); + void ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ); + void HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ); - SvLBoxEntry* mpViewData; + SvLBoxEntry* mpViewData; - BOOL IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const; - void SelectRect( const Rectangle&, BOOL bAdd = TRUE, + BOOL IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const; + void SelectRect( const Rectangle&, BOOL bAdd = TRUE, SvPtrarr* pOtherRects = 0, short nOffs = SELRECT_BORDER_OFFS ); - void DrawSelectionRect( const Rectangle& ); - void HideSelectionRect(); - void CalcScrollOffsets( const Point& rRefPosPixel, + void DrawSelectionRect( const Rectangle& ); + void HideSelectionRect(); + void CalcScrollOffsets( const Point& rRefPosPixel, long& rX, long& rY, BOOL bDragDrop = FALSE, USHORT nBorderWidth = 10 ); - void EndTracking(); - BOOL IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ); - void MakeVisible( const Rectangle& rDocPos,BOOL bInScrollBarEvent=FALSE); - void AdjustAtGrid( SvLBoxEntry* pStart = 0 ); - void SetTextMode( SvIconViewTextMode, SvLBoxEntry* pEntry = 0 ); + void EndTracking(); + BOOL IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ); + void MakeVisible( const Rectangle& rDocPos,BOOL bInScrollBarEvent=FALSE); + void AdjustAtGrid( SvLBoxEntry* pStart = 0 ); + void SetTextMode( SvIconViewTextMode, SvLBoxEntry* pEntry = 0 ); SvIconViewTextMode GetTextMode( const SvLBoxEntry* pEntry = 0, const SvIcnVwDataEntry* pViewData = 0 ) const; - void ShowFocusRect( const SvLBoxEntry* pEntry ); + void ShowFocusRect( const SvLBoxEntry* pEntry ); }; inline void SvImpIconView::MakeVisible( SvLBoxEntry* pEntry ) |