LibreOffice Module vcl (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ImplEntryList Class Reference

#include <listbox.hxx>

Collaboration diagram for ImplEntryList:
[legend]

Public Member Functions

 ImplEntryList (vcl::Window *pWindow)
 
 ~ImplEntryList ()
 
sal_Int32 InsertEntry (sal_Int32 nPos, ImplEntryType *pNewEntry, bool bSort)
 
void RemoveEntry (sal_Int32 nPos)
 
const ImplEntryTypeGetEntryPtr (sal_Int32 nPos) const
 
ImplEntryTypeGetMutableEntryPtr (sal_Int32 nPos) const
 
void Clear ()
 
sal_Int32 FindMatchingEntry (const OUString &rStr, sal_Int32 nStart, bool bLazy) const
 
sal_Int32 FindEntry (const OUString &rStr, bool bSearchMRUArea=false) const
 
sal_Int32 FindEntry (const void *pData) const
 
long GetAddedHeight (sal_Int32 nEndIndex, sal_Int32 nBeginIndex) const
 helper: add up heights up to index nEndIndex. More...
 
long GetEntryHeight (sal_Int32 nPos) const
 
sal_Int32 GetEntryCount () const
 
bool HasImages () const
 
OUString GetEntryText (sal_Int32 nPos) const
 
bool HasEntryImage (sal_Int32 nPos) const
 
Image GetEntryImage (sal_Int32 nPos) const
 
void SetEntryData (sal_Int32 nPos, void *pNewData)
 
voidGetEntryData (sal_Int32 nPos) const
 
void SetEntryFlags (sal_Int32 nPos, ListBoxEntryFlags nFlags)
 
ListBoxEntryFlags GetEntryFlags (sal_Int32 nPos) const
 
void SelectEntry (sal_Int32 nPos, bool bSelect)
 
sal_Int32 GetSelectedEntryCount () const
 
OUString GetSelectedEntry (sal_Int32 nIndex) const
 
sal_Int32 GetSelectedEntryPos (sal_Int32 nIndex) const
 
bool IsEntryPosSelected (sal_Int32 nIndex) const
 
void SetLastSelected (sal_Int32 nPos)
 
sal_Int32 GetLastSelected () const
 
void SetSelectionAnchor (sal_Int32 nPos)
 
sal_Int32 GetSelectionAnchor () const
 
void SetSelectionChangedHdl (const Link< sal_Int32, void > &rLnk)
 
void SetCallSelectionChangedHdl (bool bCall)
 
void SetMRUCount (sal_Int32 n)
 
sal_Int32 GetMRUCount () const
 
void SetMaxMRUCount (sal_Int32 n)
 
sal_Int32 GetMaxMRUCount () const
 
bool IsEntrySelectable (sal_Int32 nPos) const
 An Entry is selectable if its mnFlags does not have the ListBoxEntryFlags::DisableSelection flag set. More...
 
sal_Int32 FindFirstSelectable (sal_Int32 nPos, bool bForward=true)
 

Private Member Functions

ImplEntryTypeGetEntry (sal_Int32 nPos) const
 

Private Attributes

VclPtr< vcl::WindowmpWindow
 For getting the current locale when matching strings. More...
 
sal_Int32 mnLastSelected
 
sal_Int32 mnSelectionAnchor
 
sal_Int32 mnImages
 
sal_Int32 mnMRUCount
 
sal_Int32 mnMaxMRUCount
 
Link< sal_Int32, voidmaSelectionChangedHdl
 
bool mbCallSelectionChangedHdl
 
std::vector< std::unique_ptr< ImplEntryType > > maEntries
 

Detailed Description

Definition at line 82 of file listbox.hxx.

Constructor & Destructor Documentation

ImplEntryList::ImplEntryList ( vcl::Window pWindow)
ImplEntryList::~ImplEntryList ( )

Definition at line 71 of file imp_listbox.cxx.

References Clear().

Member Function Documentation

void ImplEntryList::Clear ( )

Definition at line 76 of file imp_listbox.cxx.

References maEntries, and mnImages.

Referenced by ~ImplEntryList().

sal_Int32 ImplEntryList::FindEntry ( const OUString &  rStr,
bool  bSearchMRUArea = false 
) const
sal_Int32 ImplEntryList::FindEntry ( const void pData) const
sal_Int32 ImplEntryList::FindFirstSelectable ( sal_Int32  nPos,
bool  bForward = true 
)
Returns
the first entry found from the given position nPos that is selectable or LISTBOX_ENTRY_NOTFOUND if non is found. If the entry at nPos is not selectable, it returns the first selectable entry after nPos if bForward is true and the first selectable entry after nPos is bForward is false.

Definition at line 434 of file imp_listbox.cxx.

References GetEntryCount(), IsEntrySelectable(), and LISTBOX_ENTRY_NOTFOUND.

sal_Int32 ImplEntryList::FindMatchingEntry ( const OUString &  rStr,
sal_Int32  nStart,
bool  bLazy 
) const
long ImplEntryList::GetAddedHeight ( sal_Int32  nEndIndex,
sal_Int32  nBeginIndex 
) const

helper: add up heights up to index nEndIndex.

GetAddedHeight( 0 )

Returns
0 GetAddedHeight( LISTBOX_ENTRY_NOTFOUND )
0 GetAddedHeight( i, k ) with k > i is equivalent -GetAddedHeight( k, i )

Definition at line 289 of file imp_listbox.cxx.

References GetEntryCount(), GetEntryPtr(), ImplEntryType::getHeightWithMargin(), LISTBOX_ENTRY_NOTFOUND, and SAL_WARN.

ImplEntryType* ImplEntryList::GetEntry ( sal_Int32  nPos) const
inlineprivate
sal_Int32 ImplEntryList::GetEntryCount ( ) const
inline
void * ImplEntryList::GetEntryData ( sal_Int32  nPos) const

Definition at line 363 of file imp_listbox.cxx.

References GetEntry(), and ImplEntryType::mpUserData.

Referenced by ListBox::GetEntryData().

ListBoxEntryFlags ImplEntryList::GetEntryFlags ( sal_Int32  nPos) const

Definition at line 376 of file imp_listbox.cxx.

References GetEntry(), ImplEntryType::mnFlags, and NONE.

Referenced by ListBox::GetEntryFlags().

long ImplEntryList::GetEntryHeight ( sal_Int32  nPos) const

Definition at line 323 of file imp_listbox.cxx.

References GetEntry(), and ImplEntryType::getHeightWithMargin().

Image ImplEntryList::GetEntryImage ( sal_Int32  nPos) const

Definition at line 347 of file imp_listbox.cxx.

References GetEntry(), and ImplEntryType::maImage.

Referenced by ListBox::GetEntryImage().

const ImplEntryType* ImplEntryList::GetEntryPtr ( sal_Int32  nPos) const
inline

Definition at line 110 of file listbox.hxx.

References GetEntry().

Referenced by GetAddedHeight().

OUString ImplEntryList::GetEntryText ( sal_Int32  nPos) const
sal_Int32 ImplEntryList::GetLastSelected ( ) const
inline

Definition at line 147 of file listbox.hxx.

References mnLastSelected.

sal_Int32 ImplEntryList::GetMaxMRUCount ( ) const
inline

Definition at line 159 of file listbox.hxx.

References mnMaxMRUCount.

Referenced by ImplListBox::GetMaxMRUCount().

sal_Int32 ImplEntryList::GetMRUCount ( ) const
inline
ImplEntryType* ImplEntryList::GetMutableEntryPtr ( sal_Int32  nPos) const
inline

Definition at line 111 of file listbox.hxx.

References GetEntry().

OUString ImplEntryList::GetSelectedEntry ( sal_Int32  nIndex) const

Definition at line 394 of file imp_listbox.cxx.

References GetEntryText(), and GetSelectedEntryPos().

sal_Int32 ImplEntryList::GetSelectedEntryCount ( ) const
sal_Int32 ImplEntryList::GetSelectedEntryPos ( sal_Int32  nIndex) const
sal_Int32 ImplEntryList::GetSelectionAnchor ( ) const
inline

Definition at line 150 of file listbox.hxx.

References mnSelectionAnchor.

bool ImplEntryList::HasEntryImage ( sal_Int32  nPos) const

Definition at line 338 of file imp_listbox.cxx.

References GetEntry(), and ImplEntryType::maImage.

Referenced by ListBox::GetEntryImage().

bool ImplEntryList::HasImages ( ) const
inline

Definition at line 126 of file listbox.hxx.

sal_Int32 ImplEntryList::InsertEntry ( sal_Int32  nPos,
ImplEntryType pNewEntry,
bool  bSort 
)
bool ImplEntryList::IsEntryPosSelected ( sal_Int32  nIndex) const

Definition at line 422 of file imp_listbox.cxx.

References GetEntry(), and ImplEntryType::mbIsSelected.

Referenced by ListBox::Draw(), IMPL_LINK(), and ListBox::IsEntryPosSelected().

bool ImplEntryList::IsEntrySelectable ( sal_Int32  nPos) const

An Entry is selectable if its mnFlags does not have the ListBoxEntryFlags::DisableSelection flag set.

Definition at line 428 of file imp_listbox.cxx.

References DisableSelection, GetEntry(), ImplEntryType::mnFlags, and NONE.

Referenced by FindFirstSelectable().

void ImplEntryList::RemoveEntry ( sal_Int32  nPos)

Definition at line 219 of file imp_listbox.cxx.

References maEntries, and mnImages.

void ImplEntryList::SelectEntry ( sal_Int32  nPos,
bool  bSelect 
)
void ImplEntryList::SetCallSelectionChangedHdl ( bool  bCall)
inline

Definition at line 153 of file listbox.hxx.

Referenced by ImplListBox::SetCallSelectionChangedHdl().

void ImplEntryList::SetEntryData ( sal_Int32  nPos,
void pNewData 
)

Definition at line 356 of file imp_listbox.cxx.

References GetEntry(), and ImplEntryType::mpUserData.

Referenced by ImplListBox::SetEntryData().

void ImplEntryList::SetEntryFlags ( sal_Int32  nPos,
ListBoxEntryFlags  nFlags 
)

Definition at line 369 of file imp_listbox.cxx.

References GetEntry(), and ImplEntryType::mnFlags.

void ImplEntryList::SetLastSelected ( sal_Int32  nPos)
inline

Definition at line 146 of file listbox.hxx.

void ImplEntryList::SetMaxMRUCount ( sal_Int32  n)
inline

Definition at line 158 of file listbox.hxx.

Referenced by ImplListBox::SetMaxMRUCount().

void ImplEntryList::SetMRUCount ( sal_Int32  n)
inline
void ImplEntryList::SetSelectionAnchor ( sal_Int32  nPos)
inline

Definition at line 149 of file listbox.hxx.

void ImplEntryList::SetSelectionChangedHdl ( const Link< sal_Int32, void > &  rLnk)
inline

Definition at line 152 of file listbox.hxx.

Referenced by ImplListBox::SetSelectionChangedHdl().

Member Data Documentation

std::vector<std::unique_ptr<ImplEntryType> > ImplEntryList::maEntries
private

Definition at line 95 of file listbox.hxx.

Referenced by Clear(), FindEntry(), InsertEntry(), RemoveEntry(), and SelectEntry().

Link<sal_Int32,void> ImplEntryList::maSelectionChangedHdl
private

Definition at line 93 of file listbox.hxx.

Referenced by SelectEntry().

bool ImplEntryList::mbCallSelectionChangedHdl
private

Definition at line 94 of file listbox.hxx.

Referenced by ImplEntryList(), and SelectEntry().

sal_Int32 ImplEntryList::mnImages
private

Definition at line 88 of file listbox.hxx.

Referenced by Clear(), ImplEntryList(), InsertEntry(), and RemoveEntry().

sal_Int32 ImplEntryList::mnLastSelected
private

Definition at line 86 of file listbox.hxx.

Referenced by GetLastSelected(), and ImplEntryList().

sal_Int32 ImplEntryList::mnMaxMRUCount
private

Definition at line 91 of file listbox.hxx.

Referenced by GetMaxMRUCount(), and ImplEntryList().

sal_Int32 ImplEntryList::mnMRUCount
private

Definition at line 90 of file listbox.hxx.

Referenced by GetMRUCount(), ImplEntryList(), and InsertEntry().

sal_Int32 ImplEntryList::mnSelectionAnchor
private

Definition at line 87 of file listbox.hxx.

Referenced by GetSelectionAnchor(), and ImplEntryList().

VclPtr<vcl::Window> ImplEntryList::mpWindow
private

For getting the current locale when matching strings.

Definition at line 85 of file listbox.hxx.

Referenced by FindMatchingEntry(), and ImplEntryList().


The documentation for this class was generated from the following files: