83 while ( pSearchEntry )
85 if ( rI18nHelper.
MatchString( _searchString, sEntryText ) )
89 if ( pSearchEntry == pStartedWith )
90 pSearchEntry =
nullptr;
111 m_pData->sCurrentSearchString += OUStringChar(c);
112 SAL_INFO(
"vcl",
"QuickSelectionEngine::HandleKeyEvent: searching for " <<
m_pData->sCurrentSearchString );
114 if (
m_pData->sCurrentSearchString.getLength() == 1 )
116 m_pData->aSingleSearchChar = c;
118 else if (
m_pData->sCurrentSearchString.getLength() > 1 )
120 if ( !!
m_pData->aSingleSearchChar && ( *
m_pData->aSingleSearchChar != c ) )
122 m_pData->aSingleSearchChar.reset();
125 OUString aSearchTemp(
m_pData->sCurrentSearchString );
128 SAL_INFO(
"vcl",
"QuickSelectionEngine::HandleKeyEvent: found " << pMatchingEntry );
129 if ( !pMatchingEntry && (aSearchTemp.getLength() > 1) && !!
m_pData->aSingleSearchChar )
132 aSearchTemp = OUString(*
m_pData->aSingleSearchChar);
136 if ( pMatchingEntry )
138 m_pData->rEntryList.SelectEntry( pMatchingEntry );
139 m_pData->aSearchTimeout.Start();
const vcl::I18nHelper & GetLocaleI18nHelper() const
static const AllSettings & GetSettings()
Gets the application's settings.
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
bool MatchString(const OUString &rStr1, const OUString &rStr2) const
virtual StringEntryIdentifier CurrentEntry(OUString &_out_entryText) const =0
returns the current entry in the list of searchable strings.
virtual StringEntryIdentifier NextEntry(StringEntryIdentifier _currentEntry, OUString &_out_entryText) const =0
returns the next entry in the list.
QuickSelectionEngine(ISearchableStringList &_entryList)
::std::unique_ptr< QuickSelectionEngine_Data > m_pData
bool HandleKeyEvent(const KeyEvent &_rKEvt)
#define LINK(Instance, Class, Member)
#define SAL_INFO(area, stream)
const void * StringEntryIdentifier
IMPL_LINK_NOARG(QuickSelectionEngine_Data, SearchStringTimeout, Timer *, void)
static StringEntryIdentifier findMatchingEntry(const OUString &_searchString, QuickSelectionEngine_Data const &_engineData)
ISearchableStringList & rEntryList
::std::optional< sal_Unicode > aSingleSearchChar
QuickSelectionEngine_Data(ISearchableStringList &_entryList)
DECL_LINK(SearchStringTimeout, Timer *, void)
OUString sCurrentSearchString
~QuickSelectionEngine_Data()