Fcitx
Public Member Functions | Protected Member Functions | List of all members
fcitx::CandidateWord Class Referenceabstract

Base class of candidate word. More...

#include <fcitx/candidatelist.h>

Inheritance diagram for fcitx::CandidateWord:
Inheritance graph
[legend]

Public Member Functions

 CandidateWord (Text text={})
 
virtual void select (InputContext *inputContext) const =0
 Called when candidate is selected by user. More...
 
const Texttext () const
 
bool isPlaceHolder () const
 Whether the candidate is only a place holder. More...
 
bool hasCustomLabel () const
 
const TextcustomLabel () const
 
const Textcomment () const
 Return comment corresponding to the candidate. More...
 
Text textWithComment (std::string separator=" ") const
 Return text with comment. More...
 
bool spaceBetweenComment () const
 Whether there should be no space between text and comment. More...
 

Protected Member Functions

void setText (Text text)
 
void setPlaceHolder (bool placeHolder)
 
void resetCustomLabel ()
 
void setCustomLabel (Text text)
 
void setComment (Text comment)
 
void setSpaceBetweenComment (bool space)
 

Detailed Description

Base class of candidate word.

Definition at line 38 of file candidatelist.h.

Member Function Documentation

◆ comment()

const Text & fcitx::CandidateWord::comment ( ) const

Return comment corresponding to the candidate.

Returns
value of comment.
Since
5.1.9

Definition at line 205 of file candidatelist.cpp.

◆ isPlaceHolder()

bool fcitx::CandidateWord::isPlaceHolder ( ) const

Whether the candidate is only a place holder.

If candidate is a place holder, it will not be displayed by UI, but it will still take one place in the candidate list.

Definition at line 225 of file candidatelist.cpp.

◆ select()

virtual void fcitx::CandidateWord::select ( InputContext inputContext) const
pure virtual

Called when candidate is selected by user.

Parameters
inputContextthe associated input context for the candidate.

Implemented in fcitx::DisplayOnlyCandidateWord.

◆ spaceBetweenComment()

bool fcitx::CandidateWord::spaceBetweenComment ( ) const

Whether there should be no space between text and comment.

This is optional and may not be used if UI doesn't support it. By default the value is true.

This doesn't change the behavior of textWithComment. The caller of textWithComment should check this function and decide whether to add space or not.

Returns
true if there should be space, false otherwise.
Since
5.1.20

Definition at line 257 of file candidatelist.cpp.

◆ textWithComment()

Text fcitx::CandidateWord::textWithComment ( std::string  separator = " ") const

Return text with comment.

Parameters
separatorseparator between text and comment.
Returns
value of comment.
Since
5.1.9

Definition at line 215 of file candidatelist.cpp.


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