Fcitx
Public Member Functions | List of all members
fcitx::CommonCandidateList Class Reference

A common simple candidate list that serves most of the purpose. More...

#include <fcitx/candidatelist.h>

Inheritance diagram for fcitx::CommonCandidateList:
Inheritance graph
[legend]
Collaboration diagram for fcitx::CommonCandidateList:
Collaboration graph
[legend]

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::Textlabel (int idx) const override
 
const CandidateWordcandidate (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 CandidateWordcandidateFromAll (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 implemenation of actionable candidate list. More...
 
- Public Member Functions inherited from fcitx::CandidateList
bool empty () const
 
PageableCandidateListtoPageable () const
 
BulkCandidateListtoBulk () const
 
ModifiableCandidateListtoModifiable () const
 
CursorMovableCandidateListtoCursorMovable () const
 
CursorModifiableCandidateListtoCursorModifiable () const
 
BulkCursorCandidateListtoBulkCursor () const
 
ActionableCandidateListtoActionable () const
 
- 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)
 

Detailed Description

A common simple candidate list that serves most of the purpose.

Definition at line 264 of file candidatelist.h.

Member Function Documentation

◆ candidateFromAll()

const CandidateWord & fcitx::CommonCandidateList::candidateFromAll ( int  idx) const
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 620 of file candidatelist.cpp.

◆ globalCursorIndex()

int fcitx::CommonCandidateList::globalCursorIndex ( ) const

Return Global cursor index.

-1 means it is not selected.

Returns
cursor index.
Since
5.0.4

Definition at line 610 of file candidatelist.cpp.

◆ setActionableImpl()

void fcitx::CommonCandidateList::setActionableImpl ( std::unique_ptr< ActionableCandidateList actionable)

Set an optional implemenation of actionable candidate list.

Since
5.1.10

Definition at line 748 of file candidatelist.cpp.

◆ setCursorIndex()

void fcitx::CommonCandidateList::setCursorIndex ( int  index)

Set cursor index on current page.

Parameters
indexindex on current page;
Since
5.1.9

Definition at line 603 of file candidatelist.cpp.

◆ setLabels()

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.

Parameters
labelslist of labels.
Since
5.0.4

Definition at line 460 of file candidatelist.cpp.

◆ setSelectionKey()

void fcitx::CommonCandidateList::setSelectionKey ( const KeyList &  keyList)

Set the label of candidate list by key.

Parameters
keyListlist of selection key

Definition at line 465 of file candidatelist.cpp.


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