|
Fcitx
|
A common simple candidate list that serves most of the purpose. More...
#include <fcitx/candidatelist.h>


Public Member Functions | |
| void | clear () |
| void | setLabels (const std::vector< std::string > &labels={}) |
| Set the label of candidate list. More... | |
| void | setSelectionKey (const KeyList &keyList) |
| Set the label of candidate list by key. More... | |
| void | setPageSize (int size) |
| int | pageSize () const |
| void | setLayoutHint (CandidateLayoutHint hint) |
| void | setGlobalCursorIndex (int index) |
| int | globalCursorIndex () const |
| Return Global cursor index. More... | |
| void | setCursorIndex (int index) |
| Set cursor index on current page. More... | |
| const fcitx::Text & | label (int idx) const override |
| const CandidateWord & | candidate (int idx) const override |
| int | cursorIndex () const override |
| int | size () const override |
| bool | hasPrev () const override |
| bool | hasNext () const override |
| void | prev () override |
| void | next () override |
| bool | usedNextBefore () const override |
| int | totalPages () const override |
| int | currentPage () const override |
| void | setPage (int page) override |
| CandidateLayoutHint | layoutHint () const override |
| const CandidateWord & | candidateFromAll (int idx) const override |
| If idx is out of range, it may raise exception. More... | |
| int | totalSize () const override |
| It's possible for this function to return -1 if the implement has no clear number how many candidates are available. | |
| void | insert (int idx, std::unique_ptr< CandidateWord > word) override |
| void | remove (int idx) override |
| void | replace (int idx, std::unique_ptr< CandidateWord > word) override |
| void | move (int from, int to) override |
| void | prevCandidate () override |
| void | nextCandidate () override |
| void | setCursorIncludeUnselected (bool) |
| void | setCursorKeepInSamePage (bool) |
| void | setCursorPositionAfterPaging (CursorPositionAfterPaging afterPaging) |
| void | setActionableImpl (std::unique_ptr< ActionableCandidateList > actionable) |
| Set an optional implementation of actionable candidate list. More... | |
| void | setTabbedImpl (std::unique_ptr< TabbedCandidateList > tabbed) |
| Set an optional implementation of tabbed candidate list. More... | |
| void | setFilter (const std::function< bool(const CandidateWord &)> &filterFunc) |
| Set a filter function for the candidate list. More... | |
| void | clearFilter () |
| Clear the filter function for the candidate list. More... | |
| const CandidateWord & | originCandidate (size_t idx) const |
| Return the candidate at the specified index, ignore filter. More... | |
| size_t | originSize () const |
| Return the total number of candidates, ignore filter. More... | |
Public Member Functions inherited from fcitx::CandidateList | |
| bool | empty () const |
| PageableCandidateList * | toPageable () const |
| BulkCandidateList * | toBulk () const |
| ModifiableCandidateList * | toModifiable () const |
| CursorMovableCandidateList * | toCursorMovable () const |
| CursorModifiableCandidateList * | toCursorModifiable () const |
| BulkCursorCandidateList * | toBulkCursor () const |
| ActionableCandidateList * | toActionable () const |
| TabbedCandidateList * | toTabbed () const |
| Cast to TabbedCandidateList if available. More... | |
Public Member Functions inherited from fcitx::ModifiableCandidateList | |
| void | append (std::unique_ptr< CandidateWord > word) |
| template<typename CandidateWordType , typename... Args> | |
| void | append (Args &&...args) |
Additional Inherited Members | |
Protected Member Functions inherited from fcitx::CandidateList | |
| void | setPageable (PageableCandidateList *list) |
| void | setBulk (BulkCandidateList *list) |
| void | setModifiable (ModifiableCandidateList *list) |
| void | setCursorMovable (CursorMovableCandidateList *list) |
| void | setCursorModifiable (CursorModifiableCandidateList *list) |
| void | setBulkCursor (BulkCursorCandidateList *list) |
| void | setActionable (ActionableCandidateList *list) |
| void | setTabbed (TabbedCandidateList *list) |
| Set the TabbedCandidateList implementation. More... | |
A common simple candidate list that serves most of the purpose.
Definition at line 336 of file candidatelist.h.
|
overridevirtual |
If idx is out of range, it may raise exception.
Catching the exception is useful to iterate over all candidate list for candidate list has no total size.
Implements fcitx::BulkCandidateList.
Definition at line 676 of file candidatelist.cpp.
| void fcitx::CommonCandidateList::clearFilter | ( | ) |
Clear the filter function for the candidate list.
Definition at line 841 of file candidatelist.cpp.
| int fcitx::CommonCandidateList::globalCursorIndex | ( | ) | const |
Return Global cursor index.
-1 means it is not selected.
Definition at line 666 of file candidatelist.cpp.
| const CandidateWord & fcitx::CommonCandidateList::originCandidate | ( | size_t | idx | ) | const |
Return the candidate at the specified index, ignore filter.
| idx | Index of the candidate. |
Definition at line 851 of file candidatelist.cpp.
| size_t fcitx::CommonCandidateList::originSize | ( | ) | const |
Return the total number of candidates, ignore filter.
Definition at line 856 of file candidatelist.cpp.
| void fcitx::CommonCandidateList::setActionableImpl | ( | std::unique_ptr< ActionableCandidateList > | actionable | ) |
Set an optional implementation of actionable candidate list.
Definition at line 807 of file candidatelist.cpp.
| void fcitx::CommonCandidateList::setCursorIndex | ( | int | index | ) |
Set cursor index on current page.
| index | index on current page; |
Definition at line 659 of file candidatelist.cpp.
| void fcitx::CommonCandidateList::setFilter | ( | const std::function< bool(const CandidateWord &)> & | filterFunc | ) |
Set a filter function for the candidate list.
Any modification to the candidate list may clear the filter, so it's better to set filter after all modification is done.
| filterFunc | A function that takes a CandidateWord and returns a boolean. Only candidates for which the function returns true will be included. |
Definition at line 821 of file candidatelist.cpp.
| void fcitx::CommonCandidateList::setLabels | ( | const std::vector< std::string > & | labels = {} | ) |
Set the label of candidate list.
The labels less than 10 will be automatically filled with to empty ones up to 10 to be more error prone.
| labels | list of labels. |
Definition at line 513 of file candidatelist.cpp.
| void fcitx::CommonCandidateList::setSelectionKey | ( | const KeyList & | keyList | ) |
Set the label of candidate list by key.
| keyList | list of selection key |
Definition at line 518 of file candidatelist.cpp.
| void fcitx::CommonCandidateList::setTabbedImpl | ( | std::unique_ptr< TabbedCandidateList > | tabbed | ) |
Set an optional implementation of tabbed candidate list.
| tabbed | pointer to TabbedCandidateList. |
Definition at line 814 of file candidatelist.cpp.
1.8.13