1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef _SVIMPLBOX_HXX 29*cdf0e10cSrcweir #define _SVIMPLBOX_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #ifndef _SELENG_HXX 32*cdf0e10cSrcweir #include <vcl/seleng.hxx> 33*cdf0e10cSrcweir #endif 34*cdf0e10cSrcweir #ifndef _SCRBAR_HXX 35*cdf0e10cSrcweir #include <vcl/scrbar.hxx> 36*cdf0e10cSrcweir #endif 37*cdf0e10cSrcweir #include <vcl/vclevent.hxx> 38*cdf0e10cSrcweir // #102891# ---------------- 39*cdf0e10cSrcweir #include <unotools/intlwrapper.hxx> 40*cdf0e10cSrcweir // #97680# ----------------- 41*cdf0e10cSrcweir #include <vector> 42*cdf0e10cSrcweir #include "svtaccessiblefactory.hxx" 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir class SvTreeListBox; 45*cdf0e10cSrcweir class Point; 46*cdf0e10cSrcweir class DropEvent; 47*cdf0e10cSrcweir class SvLBoxTreeList; 48*cdf0e10cSrcweir class SvImpLBox; 49*cdf0e10cSrcweir class SvLBoxEntry; 50*cdf0e10cSrcweir class SvLBoxItem; 51*cdf0e10cSrcweir class SvLBoxTab; 52*cdf0e10cSrcweir class TabBar; 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir class ImpLBSelEng : public FunctionSet 55*cdf0e10cSrcweir { 56*cdf0e10cSrcweir SvImpLBox* pImp; 57*cdf0e10cSrcweir SelectionEngine* pSelEng; 58*cdf0e10cSrcweir SvTreeListBox* pView; 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir public: 61*cdf0e10cSrcweir ImpLBSelEng( SvImpLBox* pImp, SelectionEngine* pSelEng, 62*cdf0e10cSrcweir SvTreeListBox* pView ); 63*cdf0e10cSrcweir virtual ~ImpLBSelEng(); 64*cdf0e10cSrcweir void BeginDrag(); 65*cdf0e10cSrcweir void CreateAnchor(); 66*cdf0e10cSrcweir void DestroyAnchor(); 67*cdf0e10cSrcweir sal_Bool SetCursorAtPoint( const Point& rPoint, 68*cdf0e10cSrcweir sal_Bool bDontSelectAtCursor=sal_False ); 69*cdf0e10cSrcweir sal_Bool IsSelectionAtPoint( const Point& rPoint ); 70*cdf0e10cSrcweir void DeselectAtPoint( const Point& rPoint ); 71*cdf0e10cSrcweir void DeselectAll(); 72*cdf0e10cSrcweir }; 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir // Flags fuer nFlag 75*cdf0e10cSrcweir #define F_VER_SBARSIZE_WITH_HBAR 0x0001 76*cdf0e10cSrcweir #define F_HOR_SBARSIZE_WITH_VBAR 0x0002 77*cdf0e10cSrcweir #define F_IGNORE_NEXT_MOUSEMOVE 0x0004 // OS/2 only 78*cdf0e10cSrcweir #define F_IN_SCROLLING 0x0008 79*cdf0e10cSrcweir #define F_DESEL_ALL 0x0010 80*cdf0e10cSrcweir #define F_START_EDITTIMER 0x0020 // MAC only 81*cdf0e10cSrcweir #define F_IGNORE_SELECT 0x0040 82*cdf0e10cSrcweir #define F_IN_RESIZE 0x0080 83*cdf0e10cSrcweir #define F_REMOVED_ENTRY_INVISIBLE 0x0100 84*cdf0e10cSrcweir #define F_REMOVED_RECALC_MOST_RIGHT 0x0200 85*cdf0e10cSrcweir #define F_IGNORE_CHANGED_TABS 0x0400 86*cdf0e10cSrcweir #define F_PAINTED 0x0800 87*cdf0e10cSrcweir #define F_IN_PAINT 0x1000 88*cdf0e10cSrcweir #define F_ENDSCROLL_SET_VIS_SIZE 0x2000 89*cdf0e10cSrcweir #define F_FILLING 0x4000 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir class SvImpLBox 93*cdf0e10cSrcweir { 94*cdf0e10cSrcweir friend class ImpLBSelEng; 95*cdf0e10cSrcweir friend class SvTreeListBox; 96*cdf0e10cSrcweir private: 97*cdf0e10cSrcweir SvTreeListBox* pView; 98*cdf0e10cSrcweir SvLBoxTreeList* pTree; 99*cdf0e10cSrcweir SvLBoxEntry* pCursor; 100*cdf0e10cSrcweir SvLBoxEntry* pStartEntry; 101*cdf0e10cSrcweir SvLBoxEntry* pAnchor; 102*cdf0e10cSrcweir SvLBoxEntry* pMostRightEntry; 103*cdf0e10cSrcweir SvLBoxButton* pActiveButton; 104*cdf0e10cSrcweir SvLBoxEntry* pActiveEntry; 105*cdf0e10cSrcweir SvLBoxTab* pActiveTab; 106*cdf0e10cSrcweir TabBar* pTabBar; 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir ScrollBar aVerSBar; 109*cdf0e10cSrcweir ScrollBar aHorSBar; 110*cdf0e10cSrcweir ScrollBarBox aScrBarBox; 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir ::svt::AccessibleFactoryAccess 113*cdf0e10cSrcweir m_aFactoryAccess; 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir static Image* s_pDefCollapsed; 116*cdf0e10cSrcweir static Image* s_pDefExpanded; 117*cdf0e10cSrcweir static Image* s_pDefCollapsedHC; 118*cdf0e10cSrcweir static Image* s_pDefExpandedHC; 119*cdf0e10cSrcweir static oslInterlockedCount s_nImageRefCount; /// When 0 all static images will be destroyed 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir // Node Bitmaps 122*cdf0e10cSrcweir enum ImageType 123*cdf0e10cSrcweir { 124*cdf0e10cSrcweir itNodeExpanded = 0, // node is expanded ( usually a bitmap showing a minus ) 125*cdf0e10cSrcweir itNodeCollapsed, // node is collapsed ( usually a bitmap showing a plus ) 126*cdf0e10cSrcweir itNodeDontKnow, // don't know the node state 127*cdf0e10cSrcweir itEntryDefExpanded, // default for expanded entries 128*cdf0e10cSrcweir itEntryDefCollapsed, // default for collapsed entries 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir IT_IMAGE_COUNT 131*cdf0e10cSrcweir }; 132*cdf0e10cSrcweir 133*cdf0e10cSrcweir // all our images 134*cdf0e10cSrcweir Image m_aNodeAndEntryImages[ IT_IMAGE_COUNT ]; 135*cdf0e10cSrcweir // plus the high contrast versions 136*cdf0e10cSrcweir Image m_aNodeAndEntryImages_HC[ IT_IMAGE_COUNT ]; 137*cdf0e10cSrcweir 138*cdf0e10cSrcweir // wg. kompat. hier 139*cdf0e10cSrcweir Size aOutputSize; 140*cdf0e10cSrcweir SelectionEngine aSelEng; 141*cdf0e10cSrcweir ImpLBSelEng aFctSet; 142*cdf0e10cSrcweir Timer aAsyncBeginDragTimer; 143*cdf0e10cSrcweir Point aAsyncBeginDragPos; 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir long nYoffsNodeBmp; 146*cdf0e10cSrcweir long nNodeBmpTabDistance; // typisch kleiner 0 147*cdf0e10cSrcweir long nNodeBmpWidth; 148*cdf0e10cSrcweir long nNextVerVisSize; 149*cdf0e10cSrcweir long nMostRight; 150*cdf0e10cSrcweir sal_uLong nVisibleCount; // Anzahl Zeilen im Control 151*cdf0e10cSrcweir sal_uLong nCurUserEvent; //-1 == kein Userevent amn Laufen 152*cdf0e10cSrcweir short nHorSBarHeight, nVerSBarWidth; 153*cdf0e10cSrcweir sal_uInt16 nFlags; 154*cdf0e10cSrcweir sal_uInt16 nCurTabPos; 155*cdf0e10cSrcweir 156*cdf0e10cSrcweir WinBits m_nStyle; 157*cdf0e10cSrcweir ExtendedWinBits nExtendedWinBits; 158*cdf0e10cSrcweir sal_Bool bSimpleTravel : 1; // ist sal_True bei SINGLE_SELECTION 159*cdf0e10cSrcweir sal_Bool bUpdateMode : 1; 160*cdf0e10cSrcweir sal_Bool bInVScrollHdl : 1; 161*cdf0e10cSrcweir sal_Bool bAsyncBeginDrag : 1; 162*cdf0e10cSrcweir sal_Bool bSubLstOpRet : 1; // open/close sublist with return/enter, defaulted with sal_False 163*cdf0e10cSrcweir sal_Bool bSubLstOpLR : 1; // open/close sublist with cursor left/right, defaulted with sal_False 164*cdf0e10cSrcweir sal_Bool bContextMenuHandling : 1; 165*cdf0e10cSrcweir sal_Bool bIsCellFocusEnabled : 1; 166*cdf0e10cSrcweir 167*cdf0e10cSrcweir sal_Bool bAreChildrenTransient; 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir Point aEditClickPos; 170*cdf0e10cSrcweir Timer aEditTimer; 171*cdf0e10cSrcweir 172*cdf0e10cSrcweir // #102891# ------------------- 173*cdf0e10cSrcweir IntlWrapper * pIntlWrapper; 174*cdf0e10cSrcweir 175*cdf0e10cSrcweir // #97680# -------------------- 176*cdf0e10cSrcweir std::vector< short > aContextBmpWidthVector; 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir DECL_LINK( EditTimerCall, Timer * ); 179*cdf0e10cSrcweir 180*cdf0e10cSrcweir DECL_LINK( BeginDragHdl, void* ); 181*cdf0e10cSrcweir DECL_LINK( MyUserEvent,void*); 182*cdf0e10cSrcweir void StopUserEvent(); 183*cdf0e10cSrcweir 184*cdf0e10cSrcweir void InvalidateEntriesFrom( long nY ) const; 185*cdf0e10cSrcweir void InvalidateEntry( long nY ) const; 186*cdf0e10cSrcweir void ShowVerSBar(); 187*cdf0e10cSrcweir // setzt Thumb auf FirstEntryToDraw 188*cdf0e10cSrcweir void SyncVerThumb(); 189*cdf0e10cSrcweir sal_Bool IsLineVisible( long nY ) const; 190*cdf0e10cSrcweir long GetEntryLine( SvLBoxEntry* pEntry ) const; 191*cdf0e10cSrcweir void FillView(); 192*cdf0e10cSrcweir void CursorDown(); 193*cdf0e10cSrcweir void CursorUp(); 194*cdf0e10cSrcweir void KeyLeftRight( long nDiff ); 195*cdf0e10cSrcweir void PageDown( sal_uInt16 nDelta ); 196*cdf0e10cSrcweir void PageUp( sal_uInt16 nDelta ); 197*cdf0e10cSrcweir 198*cdf0e10cSrcweir void SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect = sal_False ); 199*cdf0e10cSrcweir 200*cdf0e10cSrcweir void DrawNet(); 201*cdf0e10cSrcweir 202*cdf0e10cSrcweir // ScrollBar-Handler 203*cdf0e10cSrcweir DECL_LINK( ScrollUpDownHdl, ScrollBar * ); 204*cdf0e10cSrcweir DECL_LINK( ScrollLeftRightHdl, ScrollBar * ); 205*cdf0e10cSrcweir DECL_LINK( EndScrollHdl, ScrollBar * ); 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir void SetNodeBmpYOffset( const Image& ); 208*cdf0e10cSrcweir void SetNodeBmpTabDistance(); 209*cdf0e10cSrcweir 210*cdf0e10cSrcweir // Selection-Engine 211*cdf0e10cSrcweir SvLBoxEntry* MakePointVisible( const Point& rPoint, 212*cdf0e10cSrcweir sal_Bool bNotifyScroll=sal_True ); 213*cdf0e10cSrcweir 214*cdf0e10cSrcweir void SetAnchorSelection( SvLBoxEntry* pOld, 215*cdf0e10cSrcweir SvLBoxEntry* pNewCursor ); 216*cdf0e10cSrcweir void BeginDrag(); 217*cdf0e10cSrcweir sal_Bool ButtonDownCheckCtrl( const MouseEvent& rMEvt, 218*cdf0e10cSrcweir SvLBoxEntry* pEntry, long nY ); 219*cdf0e10cSrcweir sal_Bool MouseMoveCheckCtrl( const MouseEvent& rMEvt, 220*cdf0e10cSrcweir SvLBoxEntry* pEntry ); 221*cdf0e10cSrcweir sal_Bool ButtonUpCheckCtrl( const MouseEvent& rMEvt ); 222*cdf0e10cSrcweir sal_Bool ButtonDownCheckExpand( const MouseEvent&, 223*cdf0e10cSrcweir SvLBoxEntry*,long nY ); 224*cdf0e10cSrcweir 225*cdf0e10cSrcweir void PositionScrollBars( Size& rOSize, sal_uInt16 nMask ); 226*cdf0e10cSrcweir sal_uInt16 AdjustScrollBars( Size& rSize ); 227*cdf0e10cSrcweir 228*cdf0e10cSrcweir void BeginScroll(); 229*cdf0e10cSrcweir void EndScroll(); 230*cdf0e10cSrcweir sal_Bool InScroll() const { return (sal_Bool)(nFlags & F_IN_SCROLLING)!=0;} 231*cdf0e10cSrcweir Rectangle GetVisibleArea() const; 232*cdf0e10cSrcweir sal_Bool EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPos,long nLine); 233*cdf0e10cSrcweir void InitScrollBarBox(); 234*cdf0e10cSrcweir SvLBoxTab* NextTab( SvLBoxTab* ); 235*cdf0e10cSrcweir 236*cdf0e10cSrcweir sal_Bool SetMostRight( SvLBoxEntry* pEntry ); 237*cdf0e10cSrcweir void FindMostRight( SvLBoxEntry* EntryToIgnore ); 238*cdf0e10cSrcweir void FindMostRight( SvLBoxEntry* pParent, SvLBoxEntry* EntryToIgnore ); 239*cdf0e10cSrcweir void FindMostRight_Impl( SvLBoxEntry* pParent,SvLBoxEntry* EntryToIgnore ); 240*cdf0e10cSrcweir void NotifyTabsChanged(); 241*cdf0e10cSrcweir 242*cdf0e10cSrcweir inline sal_Bool IsExpandable() const // if element at cursor can be expanded in general 243*cdf0e10cSrcweir { return pCursor->HasChilds() || pCursor->HasChildsOnDemand(); } 244*cdf0e10cSrcweir inline sal_Bool IsNowExpandable() const // if element at cursor can be expanded at this moment 245*cdf0e10cSrcweir { return IsExpandable() && !pView->IsExpanded( pCursor ); } 246*cdf0e10cSrcweir 247*cdf0e10cSrcweir static void implInitDefaultNodeImages(); 248*cdf0e10cSrcweir 249*cdf0e10cSrcweir // #102891# ------------------- 250*cdf0e10cSrcweir void UpdateIntlWrapper(); 251*cdf0e10cSrcweir 252*cdf0e10cSrcweir // #97680# -------------------- 253*cdf0e10cSrcweir short UpdateContextBmpWidthVector( SvLBoxEntry* pEntry, short nWidth ); 254*cdf0e10cSrcweir void UpdateContextBmpWidthMax( SvLBoxEntry* pEntry ); 255*cdf0e10cSrcweir void UpdateContextBmpWidthVectorFromMovedEntry( SvLBoxEntry* pEntry ); 256*cdf0e10cSrcweir 257*cdf0e10cSrcweir void CalcCellFocusRect( SvLBoxEntry* pEntry, Rectangle& rRect ); 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir inline sal_Bool AreChildrenTransient() const { return bAreChildrenTransient; } 260*cdf0e10cSrcweir inline void SetChildrenNotTransient() { bAreChildrenTransient = sal_False; } 261*cdf0e10cSrcweir 262*cdf0e10cSrcweir public: 263*cdf0e10cSrcweir SvImpLBox( SvTreeListBox* pView, SvLBoxTreeList*, WinBits nWinStyle ); 264*cdf0e10cSrcweir ~SvImpLBox(); 265*cdf0e10cSrcweir 266*cdf0e10cSrcweir void Clear(); 267*cdf0e10cSrcweir void SetStyle( WinBits i_nWinStyle ); 268*cdf0e10cSrcweir void SetExtendedWindowBits( ExtendedWinBits _nBits ); 269*cdf0e10cSrcweir ExtendedWinBits GetExtendedWindowBits() const { return nExtendedWinBits; } 270*cdf0e10cSrcweir void SetModel( SvLBoxTreeList* pModel ) { pTree = pModel;} 271*cdf0e10cSrcweir 272*cdf0e10cSrcweir void EntryInserted( SvLBoxEntry*); 273*cdf0e10cSrcweir void RemovingEntry( SvLBoxEntry* pEntry ); 274*cdf0e10cSrcweir void EntryRemoved(); 275*cdf0e10cSrcweir void MovingEntry( SvLBoxEntry* pEntry ); 276*cdf0e10cSrcweir void EntryMoved( SvLBoxEntry* pEntry ); 277*cdf0e10cSrcweir void TreeInserted( SvLBoxEntry* pEntry ); 278*cdf0e10cSrcweir 279*cdf0e10cSrcweir void IndentChanged( short nIndentPixel ); 280*cdf0e10cSrcweir void EntryExpanded( SvLBoxEntry* pEntry ); 281*cdf0e10cSrcweir void EntryCollapsed( SvLBoxEntry* pEntry ); 282*cdf0e10cSrcweir void CollapsingEntry( SvLBoxEntry* pEntry ); 283*cdf0e10cSrcweir void EntrySelected( SvLBoxEntry*, sal_Bool bSelect ); 284*cdf0e10cSrcweir 285*cdf0e10cSrcweir void Paint( const Rectangle& rRect ); 286*cdf0e10cSrcweir void RepaintSelectionItems(); 287*cdf0e10cSrcweir void MouseButtonDown( const MouseEvent& ); 288*cdf0e10cSrcweir void MouseButtonUp( const MouseEvent& ); 289*cdf0e10cSrcweir void MouseMove( const MouseEvent&); 290*cdf0e10cSrcweir sal_Bool KeyInput( const KeyEvent& ); 291*cdf0e10cSrcweir void Resize(); 292*cdf0e10cSrcweir void GetFocus(); 293*cdf0e10cSrcweir void LoseFocus(); 294*cdf0e10cSrcweir void UpdateAll( 295*cdf0e10cSrcweir sal_Bool bInvalidateCompleteView= sal_True, 296*cdf0e10cSrcweir sal_Bool bUpdateVerSBar = sal_True ); 297*cdf0e10cSrcweir void SetEntryHeight( short nHeight ); 298*cdf0e10cSrcweir void PaintEntry( SvLBoxEntry* pEntry ); 299*cdf0e10cSrcweir void InvalidateEntry( SvLBoxEntry* ); 300*cdf0e10cSrcweir void RecalcFocusRect(); 301*cdf0e10cSrcweir 302*cdf0e10cSrcweir inline void SelectEntry( SvLBoxEntry* pEntry, sal_Bool bSelect ); 303*cdf0e10cSrcweir void SetDragDropMode( DragDropMode eDDMode ); 304*cdf0e10cSrcweir void SetSelectionMode( SelectionMode eSelMode ); 305*cdf0e10cSrcweir void SetAddMode( sal_Bool ) { aSelEng.AddAlways(sal_False); } 306*cdf0e10cSrcweir sal_Bool IsAddMode() const { return aSelEng.IsAlwaysAdding(); } 307*cdf0e10cSrcweir 308*cdf0e10cSrcweir SvLBoxEntry* GetCurrentEntry() const { return pCursor; } 309*cdf0e10cSrcweir sal_Bool IsEntryInView( SvLBoxEntry* ) const; 310*cdf0e10cSrcweir SvLBoxEntry* GetEntry( const Point& rPos ) const; 311*cdf0e10cSrcweir // gibt letzten Eintrag zurueck, falls Pos unter letztem Eintrag 312*cdf0e10cSrcweir SvLBoxEntry* GetClickedEntry( const Point& ) const; 313*cdf0e10cSrcweir SvLBoxEntry* GetCurEntry() const { return pCursor; } 314*cdf0e10cSrcweir void SetCurEntry( SvLBoxEntry* ); 315*cdf0e10cSrcweir Point GetEntryPosition( SvLBoxEntry* ) const; 316*cdf0e10cSrcweir void MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop=sal_False ); 317*cdf0e10cSrcweir 318*cdf0e10cSrcweir void PaintDDCursor( SvLBoxEntry* ); 319*cdf0e10cSrcweir 320*cdf0e10cSrcweir // Images 321*cdf0e10cSrcweir inline Image& implGetImageLocation( const ImageType _eType, BmpColorMode _eMode ); 322*cdf0e10cSrcweir inline Image& implGetImageLocationWithFallback( const ImageType _eType, BmpColorMode _eMode ) const; 323*cdf0e10cSrcweir 324*cdf0e10cSrcweir inline void SetExpandedNodeBmp( const Image& _rImg, BmpColorMode _eMode = BMP_COLOR_NORMAL ); 325*cdf0e10cSrcweir inline void SetCollapsedNodeBmp( const Image& _rImg, BmpColorMode _eMode = BMP_COLOR_NORMAL ); 326*cdf0e10cSrcweir inline void SetDontKnowNodeBmp( const Image& rImg, BmpColorMode _eMode = BMP_COLOR_NORMAL ); 327*cdf0e10cSrcweir 328*cdf0e10cSrcweir inline const Image& GetExpandedNodeBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const; 329*cdf0e10cSrcweir inline const Image& GetCollapsedNodeBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const; 330*cdf0e10cSrcweir inline const Image& GetDontKnowNodeBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const; 331*cdf0e10cSrcweir 332*cdf0e10cSrcweir inline void SetDefaultEntryExpBmp( const Image& _rImg, BmpColorMode _eMode = BMP_COLOR_NORMAL ); 333*cdf0e10cSrcweir inline void SetDefaultEntryColBmp( const Image& _rImg, BmpColorMode _eMode = BMP_COLOR_NORMAL ); 334*cdf0e10cSrcweir inline const Image& GetDefaultEntryExpBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ); 335*cdf0e10cSrcweir inline const Image& GetDefaultEntryColBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ); 336*cdf0e10cSrcweir 337*cdf0e10cSrcweir static const Image& GetDefaultExpandedNodeImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ); 338*cdf0e10cSrcweir static const Image& GetDefaultCollapsedNodeImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ); 339*cdf0e10cSrcweir 340*cdf0e10cSrcweir const Size& GetOutputSize() const { return aOutputSize;} 341*cdf0e10cSrcweir void KeyUp( sal_Bool bPageUp, sal_Bool bNotifyScroll = sal_True ); 342*cdf0e10cSrcweir void KeyDown( sal_Bool bPageDown, sal_Bool bNotifyScroll = sal_True ); 343*cdf0e10cSrcweir void Command( const CommandEvent& rCEvt ); 344*cdf0e10cSrcweir 345*cdf0e10cSrcweir void Invalidate(); 346*cdf0e10cSrcweir void DestroyAnchor() { pAnchor=0; aSelEng.Reset(); } 347*cdf0e10cSrcweir void SelAllDestrAnch( sal_Bool bSelect, 348*cdf0e10cSrcweir sal_Bool bDestroyAnchor = sal_True, 349*cdf0e10cSrcweir sal_Bool bSingleSelToo = sal_False ); 350*cdf0e10cSrcweir void ShowCursor( sal_Bool bShow ); 351*cdf0e10cSrcweir 352*cdf0e10cSrcweir sal_Bool RequestHelp( const HelpEvent& rHEvt ); 353*cdf0e10cSrcweir void EndSelection(); 354*cdf0e10cSrcweir sal_Bool IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const; 355*cdf0e10cSrcweir void RepaintScrollBars(); 356*cdf0e10cSrcweir void EnableAsyncDrag( sal_Bool b) { bAsyncBeginDrag = b; } 357*cdf0e10cSrcweir void SetUpdateMode( sal_Bool ); 358*cdf0e10cSrcweir void SetUpdateModeFast( sal_Bool ); 359*cdf0e10cSrcweir sal_Bool GetUpdateMode() const { return bUpdateMode; } 360*cdf0e10cSrcweir Rectangle GetClipRegionRect() const; 361*cdf0e10cSrcweir sal_Bool HasHorScrollBar() const { return aHorSBar.IsVisible(); } 362*cdf0e10cSrcweir void ShowFocusRect( const SvLBoxEntry* pEntry ); 363*cdf0e10cSrcweir void SetTabBar( TabBar* pTabBar ); 364*cdf0e10cSrcweir void CancelPendingEdit(); 365*cdf0e10cSrcweir 366*cdf0e10cSrcweir void CallEventListeners( sal_uLong nEvent, void* pData = NULL ); 367*cdf0e10cSrcweir 368*cdf0e10cSrcweir /** Enables, that one cell of a tablistbox entry can be focused */ 369*cdf0e10cSrcweir inline sal_Bool IsCellFocusEnabled() const { return bIsCellFocusEnabled; } 370*cdf0e10cSrcweir inline void EnableCellFocus() { bIsCellFocusEnabled = sal_True; } 371*cdf0e10cSrcweir bool SetCurrentTabPos( sal_uInt16 _nNewPos ); 372*cdf0e10cSrcweir inline sal_uInt16 GetCurrentTabPos() const { return nCurTabPos; } 373*cdf0e10cSrcweir 374*cdf0e10cSrcweir bool IsSelectable( const SvLBoxEntry* pEntry ); 375*cdf0e10cSrcweir }; 376*cdf0e10cSrcweir 377*cdf0e10cSrcweir inline Image& SvImpLBox::implGetImageLocation( const ImageType _eType, BmpColorMode _eMode ) 378*cdf0e10cSrcweir { 379*cdf0e10cSrcweir DBG_ASSERT( ( BMP_COLOR_HIGHCONTRAST == _eMode ) || ( BMP_COLOR_NORMAL == _eMode ), 380*cdf0e10cSrcweir "SvImpLBox::implGetImageLocation: invalid mode!" ); 381*cdf0e10cSrcweir DBG_ASSERT( ( _eType >= 0 ) && ( _eType < IT_IMAGE_COUNT ), 382*cdf0e10cSrcweir "SvImpLBox::implGetImageLocation: invalid image index (will crash)!" ); 383*cdf0e10cSrcweir 384*cdf0e10cSrcweir Image* _pSet = ( BMP_COLOR_HIGHCONTRAST == _eMode ) ? m_aNodeAndEntryImages_HC : m_aNodeAndEntryImages; 385*cdf0e10cSrcweir return *( _pSet + (sal_Int32)_eType ); 386*cdf0e10cSrcweir } 387*cdf0e10cSrcweir 388*cdf0e10cSrcweir inline Image& SvImpLBox::implGetImageLocationWithFallback( const ImageType _eType, BmpColorMode _eMode ) const 389*cdf0e10cSrcweir { 390*cdf0e10cSrcweir Image& rImage = const_cast< SvImpLBox* >( this )->implGetImageLocation( _eType, _eMode ); 391*cdf0e10cSrcweir if ( !rImage ) 392*cdf0e10cSrcweir // fallback to normal images in case the one for the special mode has not been set 393*cdf0e10cSrcweir rImage = const_cast< SvImpLBox* >( this )->implGetImageLocation( _eType, BMP_COLOR_NORMAL ); 394*cdf0e10cSrcweir return rImage; 395*cdf0e10cSrcweir } 396*cdf0e10cSrcweir 397*cdf0e10cSrcweir inline void SvImpLBox::SetDontKnowNodeBmp( const Image& rImg, BmpColorMode _eMode ) 398*cdf0e10cSrcweir { 399*cdf0e10cSrcweir implGetImageLocation( itNodeDontKnow, _eMode ) = rImg; 400*cdf0e10cSrcweir } 401*cdf0e10cSrcweir 402*cdf0e10cSrcweir inline void SvImpLBox::SetExpandedNodeBmp( const Image& rImg, BmpColorMode _eMode ) 403*cdf0e10cSrcweir { 404*cdf0e10cSrcweir implGetImageLocation( itNodeExpanded, _eMode ) = rImg; 405*cdf0e10cSrcweir SetNodeBmpYOffset( rImg ); 406*cdf0e10cSrcweir } 407*cdf0e10cSrcweir 408*cdf0e10cSrcweir inline void SvImpLBox::SetCollapsedNodeBmp( const Image& rImg, BmpColorMode _eMode ) 409*cdf0e10cSrcweir { 410*cdf0e10cSrcweir implGetImageLocation( itNodeCollapsed, _eMode ) = rImg; 411*cdf0e10cSrcweir SetNodeBmpYOffset( rImg ); 412*cdf0e10cSrcweir } 413*cdf0e10cSrcweir 414*cdf0e10cSrcweir inline const Image& SvImpLBox::GetDontKnowNodeBmp( BmpColorMode _eMode ) const 415*cdf0e10cSrcweir { 416*cdf0e10cSrcweir return implGetImageLocationWithFallback( itNodeDontKnow, _eMode ); 417*cdf0e10cSrcweir } 418*cdf0e10cSrcweir 419*cdf0e10cSrcweir inline const Image& SvImpLBox::GetExpandedNodeBmp( BmpColorMode _eMode ) const 420*cdf0e10cSrcweir { 421*cdf0e10cSrcweir return implGetImageLocationWithFallback( itNodeExpanded, _eMode ); 422*cdf0e10cSrcweir } 423*cdf0e10cSrcweir 424*cdf0e10cSrcweir inline const Image& SvImpLBox::GetCollapsedNodeBmp( BmpColorMode _eMode ) const 425*cdf0e10cSrcweir { 426*cdf0e10cSrcweir return implGetImageLocationWithFallback( itNodeCollapsed, _eMode ); 427*cdf0e10cSrcweir } 428*cdf0e10cSrcweir 429*cdf0e10cSrcweir inline void SvImpLBox::SetDefaultEntryExpBmp( const Image& _rImg, BmpColorMode _eMode ) 430*cdf0e10cSrcweir { 431*cdf0e10cSrcweir implGetImageLocation( itEntryDefExpanded, _eMode ) = _rImg; 432*cdf0e10cSrcweir } 433*cdf0e10cSrcweir 434*cdf0e10cSrcweir inline void SvImpLBox::SetDefaultEntryColBmp( const Image& _rImg, BmpColorMode _eMode ) 435*cdf0e10cSrcweir { 436*cdf0e10cSrcweir implGetImageLocation( itEntryDefCollapsed, _eMode ) = _rImg; 437*cdf0e10cSrcweir } 438*cdf0e10cSrcweir 439*cdf0e10cSrcweir inline const Image& SvImpLBox::GetDefaultEntryExpBmp( BmpColorMode _eMode ) 440*cdf0e10cSrcweir { 441*cdf0e10cSrcweir return implGetImageLocationWithFallback( itEntryDefExpanded, _eMode ); 442*cdf0e10cSrcweir } 443*cdf0e10cSrcweir 444*cdf0e10cSrcweir inline const Image& SvImpLBox::GetDefaultEntryColBmp( BmpColorMode _eMode ) 445*cdf0e10cSrcweir { 446*cdf0e10cSrcweir return implGetImageLocationWithFallback( itEntryDefCollapsed, _eMode ); 447*cdf0e10cSrcweir } 448*cdf0e10cSrcweir 449*cdf0e10cSrcweir inline Point SvImpLBox::GetEntryPosition( SvLBoxEntry* pEntry ) const 450*cdf0e10cSrcweir { 451*cdf0e10cSrcweir return Point( 0, GetEntryLine( pEntry ) ); 452*cdf0e10cSrcweir } 453*cdf0e10cSrcweir 454*cdf0e10cSrcweir inline void SvImpLBox::PaintEntry( SvLBoxEntry* pEntry ) 455*cdf0e10cSrcweir { 456*cdf0e10cSrcweir long nY = GetEntryLine( pEntry ); 457*cdf0e10cSrcweir pView->PaintEntry( pEntry, nY ); 458*cdf0e10cSrcweir } 459*cdf0e10cSrcweir 460*cdf0e10cSrcweir inline sal_Bool SvImpLBox::IsLineVisible( long nY ) const 461*cdf0e10cSrcweir { 462*cdf0e10cSrcweir sal_Bool bRet = sal_True; 463*cdf0e10cSrcweir if ( nY < 0 || nY >= aOutputSize.Height() ) 464*cdf0e10cSrcweir bRet = sal_False; 465*cdf0e10cSrcweir return bRet; 466*cdf0e10cSrcweir } 467*cdf0e10cSrcweir 468*cdf0e10cSrcweir inline void SvImpLBox::TreeInserted( SvLBoxEntry* pInsTree ) 469*cdf0e10cSrcweir { 470*cdf0e10cSrcweir EntryInserted( pInsTree ); 471*cdf0e10cSrcweir } 472*cdf0e10cSrcweir 473*cdf0e10cSrcweir #endif // #ifndef _SVIMPLBOX_HXX 474*cdf0e10cSrcweir 475