LibreOffice Module vcl (master) 1
|
#include <listbox.hxx>
Public Member Functions | |
ImplEntryList (vcl::Window *pWindow) | |
~ImplEntryList () | |
sal_Int32 | InsertEntry (sal_Int32 nPos, ImplEntryType *pNewEntry, bool bSort) |
void | RemoveEntry (sal_Int32 nPos) |
const ImplEntryType * | GetEntryPtr (sal_Int32 nPos) const |
ImplEntryType * | GetMutableEntryPtr (sal_Int32 nPos) const |
void | Clear () |
void | dispose () |
sal_Int32 | FindMatchingEntry (const OUString &rStr, sal_Int32 nStart, bool bLazy) const |
sal_Int32 | FindEntry (std::u16string_view rStr, bool bSearchMRUArea=false) const |
tools::Long | GetAddedHeight (sal_Int32 nEndIndex, sal_Int32 nBeginIndex) const |
helper: add up heights up to index nEndIndex. More... | |
tools::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) |
void * | GetEntryData (sal_Int32 nPos) const |
void | SetEntryFlags (sal_Int32 nPos, ListBoxEntryFlags nFlags) |
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) const |
Private Member Functions | |
ImplEntryType * | GetEntry (sal_Int32 nPos) const |
Private Attributes | |
VclPtr< vcl::Window > | mpWindow |
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, void > | maSelectionChangedHdl |
bool | mbCallSelectionChangedHdl |
std::vector< std::unique_ptr< ImplEntryType > > | maEntries |
Definition at line 87 of file listbox.hxx.
ImplEntryList::ImplEntryList | ( | vcl::Window * | pWindow | ) |
Definition at line 60 of file imp_listbox.cxx.
References LISTBOX_ENTRY_NOTFOUND, mbCallSelectionChangedHdl, mnImages, mnLastSelected, mnMaxMRUCount, mnMRUCount, mnSelectionAnchor, and mpWindow.
ImplEntryList::~ImplEntryList | ( | ) |
Definition at line 72 of file imp_listbox.cxx.
References Clear().
void ImplEntryList::Clear | ( | ) |
Definition at line 77 of file imp_listbox.cxx.
References maEntries, and mnImages.
Referenced by ImplListBoxWindow::Clear(), dispose(), and ~ImplEntryList().
void ImplEntryList::dispose | ( | void | ) |
Definition at line 83 of file imp_listbox.cxx.
References VclPtr< reference_type >::clear(), Clear(), and mpWindow.
Referenced by ImplListBoxWindow::dispose().
sal_Int32 ImplEntryList::FindEntry | ( | std::u16string_view | rStr, |
bool | bSearchMRUArea = false |
||
) | const |
Definition at line 239 of file imp_listbox.cxx.
References vcl::I18nHelper::filterFormattingChars(), GetMRUCount(), LISTBOX_ENTRY_NOTFOUND, maEntries, and n.
Referenced by ListBox::GetEntryPos(), ListBox::GetSelectedEntryPos(), IMPL_LINK(), ImplListBoxWindow::ImplCallSelect(), ImplListBoxWindow::ImplPaint(), and lcl_GetSelectedEntries().
sal_Int32 ImplEntryList::FindFirstSelectable | ( | sal_Int32 | nPos, |
bool | bForward = true |
||
) | const |
Definition at line 420 of file imp_listbox.cxx.
References GetEntryCount(), IsEntrySelectable(), LISTBOX_ENTRY_NOTFOUND, and nPos.
Referenced by ImplListBoxWindow::ProcessKeyInput().
sal_Int32 ImplEntryList::FindMatchingEntry | ( | const OUString & | rStr, |
sal_Int32 | nStart, | ||
bool | bLazy | ||
) | const |
Definition at line 251 of file imp_listbox.cxx.
References GetEntry(), GetEntryCount(), AllSettings::GetLocaleI18nHelper(), vcl::Window::GetSettings(), LISTBOX_ENTRY_NOTFOUND, ImplEntryType::maStr, vcl::I18nHelper::MatchString(), mpWindow, n, and nPos.
tools::Long ImplEntryList::GetAddedHeight | ( | sal_Int32 | nEndIndex, |
sal_Int32 | nBeginIndex | ||
) | const |
helper: add up heights up to index nEndIndex.
GetAddedHeight( 0 )
Definition at line 281 of file imp_listbox.cxx.
References GetEntryCount(), GetEntryPtr(), ImplEntryType::getHeightWithMargin(), LISTBOX_ENTRY_NOTFOUND, nIndex, and SAL_WARN.
Referenced by ImplListBoxWindow::DrawEntry(), ImplListBoxWindow::GetBoundingRectangle(), ImplListBoxWindow::GetFocus(), ImplListBoxWindow::GetLastVisibleEntry(), ImplListBoxWindow::ImplDoPaint(), ImplListBoxWindow::ImplPaint(), ImplListBoxWindow::IsVisible(), ImplListBoxWindow::SelectEntries(), ImplListBoxWindow::SetTopEntry(), ImplListBoxWindow::ShowProminentEntry(), and ImplListBoxWindow::Tracking().
|
inlineprivate |
Definition at line 102 of file listbox.hxx.
References maEntries, o3tl::make_unsigned(), and nPos.
Referenced by FindMatchingEntry(), GetEntryData(), GetEntryHeight(), GetEntryImage(), GetEntryPtr(), GetEntryText(), GetMutableEntryPtr(), GetSelectedEntryCount(), GetSelectedEntryPos(), HasEntryImage(), InsertEntry(), IsEntryPosSelected(), IsEntrySelectable(), SetEntryData(), and SetEntryFlags().
|
inline |
Definition at line 130 of file listbox.hxx.
References maEntries.
Referenced by ImplListBoxFloatingWindow::CalcFloatSize(), ListBox::CalcSubEditSize(), FindFirstSelectable(), FindMatchingEntry(), GetAddedHeight(), ImplListBoxWindow::GetDisplayLineCount(), ListBox::GetEntryCount(), ImplListBoxWindow::GetLastVisibleEntry(), GetSelectedEntryCount(), GetSelectedEntryPos(), ImplListBoxWindow::ImplCalcMetrics(), ImplListBox::ImplCheckScrollBars(), ImplListBoxWindow::ImplDoPaint(), ImplListBox::ImplInitScrollBars(), ImplListBoxWindow::InsertEntry(), ImplListBoxWindow::MouseMove(), ImplListBoxWindow::ProcessKeyInput(), ImplListBoxWindow::RemoveEntry(), ImplListBoxWindow::SelectEntries(), ListBox::SelectEntriesPos(), ImplListBoxWindow::SelectEntry(), ImplListBoxWindow::SetTopEntry(), and ImplListBoxWindow::Tracking().
void * ImplEntryList::GetEntryData | ( | sal_Int32 | nPos | ) | const |
Definition at line 355 of file imp_listbox.cxx.
References GetEntry(), ImplEntryType::mpUserData, and nPos.
Referenced by ListBox::GetEntryData().
tools::Long ImplEntryList::GetEntryHeight | ( | sal_Int32 | nPos | ) | const |
Definition at line 315 of file imp_listbox.cxx.
References GetEntry(), ImplEntryType::getHeightWithMargin(), and nPos.
Referenced by ImplListBoxWindow::GetFocus(), ImplListBoxWindow::ImplDoPaint(), ImplListBoxWindow::Resize(), ImplListBoxWindow::SelectEntries(), and ImplListBoxWindow::Tracking().
Image ImplEntryList::GetEntryImage | ( | sal_Int32 | nPos | ) | const |
Definition at line 339 of file imp_listbox.cxx.
References GetEntry(), ImplEntryType::maImage, and nPos.
Referenced by ImplListBoxWindow::DrawEntry(), ListBox::GetEntryImage(), and IMPL_LINK().
|
inline |
Definition at line 115 of file listbox.hxx.
References GetEntry(), and nPos.
Referenced by ImplListBoxWindow::DrawEntry(), GetAddedHeight(), ImplListBoxWindow::GetBoundingRectangle(), ImplListBoxWindow::GetEntryPosForPoint(), ImplListBoxWindow::ImplCalcMetrics(), ImplListBoxWindow::ImplDoPaint(), ImplListBoxWindow::ImplPaint(), and ImplListBoxWindow::SetTopEntry().
OUString ImplEntryList::GetEntryText | ( | sal_Int32 | nPos | ) | const |
Definition at line 321 of file imp_listbox.cxx.
References GetEntry(), ImplEntryType::maStr, and nPos.
Referenced by ListBox::Draw(), ImplListBoxWindow::DrawEntry(), ListBox::GetEntry(), ImplListBox::GetMRUEntries(), GetSelectedEntry(), ListBox::GetSelectedEntryPos(), IMPL_LINK(), and ImplListBoxWindow::ImplCallSelect().
|
inline |
Definition at line 151 of file listbox.hxx.
References mnLastSelected.
Referenced by ImplListBoxWindow::SelectEntries().
|
inline |
Definition at line 163 of file listbox.hxx.
References mnMaxMRUCount.
Referenced by ImplListBox::GetMaxMRUCount().
|
inline |
Definition at line 160 of file listbox.hxx.
References mnMRUCount.
Referenced by FindEntry(), ImplListBoxWindow::GetBoundingRectangle(), ListBox::GetEntry(), ListBox::GetEntryCount(), ListBox::GetEntryData(), ListBox::GetEntryPos(), ImplListBox::GetMRUEntries(), ListBox::GetSelectedEntryPos(), IMPL_LINK(), ImplListBoxWindow::ImplCallSelect(), ImplListBoxWindow::ImplPaint(), ListBox::InsertEntry(), ListBox::IsEntryPosSelected(), ListBox::RemoveEntry(), ListBox::SelectEntriesPos(), ListBox::SelectEntryPos(), ListBox::SetEntryData(), ListBox::SetEntryFlags(), ImplListBox::SetMRUEntries(), and ListBox::SetTopEntry().
|
inline |
Definition at line 116 of file listbox.hxx.
References GetEntry(), and nPos.
Referenced by ImplListBoxWindow::ImplCalcMetrics(), and ImplListBoxWindow::SetEntryFlags().
OUString ImplEntryList::GetSelectedEntry | ( | sal_Int32 | nIndex | ) | const |
Definition at line 380 of file imp_listbox.cxx.
References GetEntryText(), GetSelectedEntryPos(), and nIndex.
sal_Int32 ImplEntryList::GetSelectedEntryCount | ( | ) | const |
Definition at line 368 of file imp_listbox.cxx.
References GetEntry(), GetEntryCount(), ImplEntryType::mbIsSelected, and n.
Referenced by ListBox::GetSelectedEntryCount(), ImplListBox::ImplCheckScrollBars(), and ImplListBoxWindow::SelectEntries().
sal_Int32 ImplEntryList::GetSelectedEntryPos | ( | sal_Int32 | nIndex | ) | const |
Definition at line 385 of file imp_listbox.cxx.
References GetEntry(), GetEntryCount(), LISTBOX_ENTRY_NOTFOUND, ImplEntryType::mbIsSelected, n, and nIndex.
Referenced by ImplListBoxWindow::DeselectAll(), GetSelectedEntry(), ListBox::GetSelectedEntryPos(), ImplListBoxWindow::ImplCallSelect(), ImplListBox::ImplCheckScrollBars(), ImplListBoxWindow::MouseButtonDown(), ImplListBoxWindow::MouseMove(), ImplListBoxWindow::SelectEntries(), ImplListBoxWindow::SelectEntry(), and ImplListBoxFloatingWindow::StartFloat().
|
inline |
Definition at line 154 of file listbox.hxx.
References mnSelectionAnchor.
Referenced by ImplListBoxWindow::SelectEntries().
bool ImplEntryList::HasEntryImage | ( | sal_Int32 | nPos | ) | const |
Definition at line 330 of file imp_listbox.cxx.
References GetEntry(), ImplEntryType::maImage, and nPos.
Referenced by ImplListBoxWindow::DrawEntry(), and ListBox::GetEntryImage().
|
inline |
Definition at line 131 of file listbox.hxx.
References mnImages.
Referenced by ImplListBoxWindow::DrawEntry(), IMPL_LINK(), and ImplListBoxWindow::ImplGetTextStyle().
sal_Int32 ImplEntryList::InsertEntry | ( | sal_Int32 | nPos, |
ImplEntryType * | pNewEntry, | ||
bool | bSort | ||
) |
Definition at line 125 of file imp_listbox.cxx.
References comphelper::string::NaturalStringSorter::compare(), GetEntry(), LISTBOX_MAX_ENTRIES, maEntries, ImplEntryType::maImage, ImplEntryType::maStr, mnImages, mnMRUCount, and nPos.
Referenced by ImplListBoxWindow::ImplCallSelect(), and ImplListBoxWindow::InsertEntry().
bool ImplEntryList::IsEntryPosSelected | ( | sal_Int32 | nIndex | ) | const |
Definition at line 408 of file imp_listbox.cxx.
References GetEntry(), ImplEntryType::mbIsSelected, and nIndex.
Referenced by ListBox::Draw(), IMPL_LINK(), ImplListBoxWindow::ImplPaint(), ListBox::IsEntryPosSelected(), ImplListBoxWindow::ProcessKeyInput(), ImplListBoxWindow::SelectEntries(), and ImplListBoxWindow::SelectEntry().
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 414 of file imp_listbox.cxx.
References DisableSelection, GetEntry(), ImplEntryType::mnFlags, NONE, and nPos.
Referenced by FindFirstSelectable(), ImplListBoxWindow::MouseMove(), ImplListBoxWindow::SelectEntries(), and ImplListBoxWindow::SelectEntry().
void ImplEntryList::RemoveEntry | ( | sal_Int32 | nPos | ) |
Definition at line 226 of file imp_listbox.cxx.
References maEntries, o3tl::make_unsigned(), mnImages, and nPos.
Referenced by ImplListBoxWindow::RemoveEntry().
void ImplEntryList::SelectEntry | ( | sal_Int32 | nPos, |
bool | bSelect | ||
) |
Definition at line 89 of file imp_listbox.cxx.
References Link< typename Arg, typename Ret >::Call(), DisableSelection, maEntries, o3tl::make_unsigned(), maSelectionChangedHdl, mbCallSelectionChangedHdl, NONE, and nPos.
Referenced by ImplListBoxWindow::SelectEntry().
|
inline |
Definition at line 157 of file listbox.hxx.
References mbCallSelectionChangedHdl.
Referenced by ImplListBox::SetCallSelectionChangedHdl().
void ImplEntryList::SetEntryData | ( | sal_Int32 | nPos, |
void * | pNewData | ||
) |
Definition at line 348 of file imp_listbox.cxx.
References GetEntry(), ImplEntryType::mpUserData, and nPos.
Referenced by ImplListBox::SetEntryData().
void ImplEntryList::SetEntryFlags | ( | sal_Int32 | nPos, |
ListBoxEntryFlags | nFlags | ||
) |
Definition at line 361 of file imp_listbox.cxx.
References GetEntry(), ImplEntryType::mnFlags, and nPos.
Referenced by ImplListBoxWindow::SetEntryFlags().
|
inline |
Definition at line 150 of file listbox.hxx.
References mnLastSelected, and nPos.
Referenced by ImplListBoxWindow::SelectEntries().
|
inline |
Definition at line 162 of file listbox.hxx.
References mnMaxMRUCount, and n.
Referenced by ImplListBox::SetMaxMRUCount().
|
inline |
Definition at line 159 of file listbox.hxx.
References mnMRUCount, and n.
Referenced by ImplListBox::Clear(), ImplListBoxWindow::ImplCallSelect(), and ImplListBox::SetMRUEntries().
|
inline |
Definition at line 153 of file listbox.hxx.
References mnSelectionAnchor, and nPos.
Referenced by ImplListBoxWindow::SelectEntries().
|
inline |
Definition at line 156 of file listbox.hxx.
References maSelectionChangedHdl.
Referenced by ImplListBox::SetSelectionChangedHdl().
|
private |
Definition at line 100 of file listbox.hxx.
Referenced by Clear(), FindEntry(), GetEntry(), GetEntryCount(), InsertEntry(), RemoveEntry(), and SelectEntry().
|
private |
Definition at line 98 of file listbox.hxx.
Referenced by SelectEntry(), and SetSelectionChangedHdl().
|
private |
Definition at line 99 of file listbox.hxx.
Referenced by ImplEntryList(), SelectEntry(), and SetCallSelectionChangedHdl().
|
private |
Definition at line 93 of file listbox.hxx.
Referenced by Clear(), HasImages(), ImplEntryList(), InsertEntry(), and RemoveEntry().
|
private |
Definition at line 91 of file listbox.hxx.
Referenced by GetLastSelected(), ImplEntryList(), and SetLastSelected().
|
private |
Definition at line 96 of file listbox.hxx.
Referenced by GetMaxMRUCount(), ImplEntryList(), and SetMaxMRUCount().
|
private |
Definition at line 95 of file listbox.hxx.
Referenced by GetMRUCount(), ImplEntryList(), InsertEntry(), and SetMRUCount().
|
private |
Definition at line 92 of file listbox.hxx.
Referenced by GetSelectionAnchor(), ImplEntryList(), and SetSelectionAnchor().
|
private |
For getting the current locale when matching strings.
Definition at line 90 of file listbox.hxx.
Referenced by dispose(), FindMatchingEntry(), and ImplEntryList().