scim  1.4.18
scim::CommonLookupTable Class Reference

A common lookup table class. More...

#include <scim_lookup_table.h>

Public Member Functions

 CommonLookupTable (int page_size=10)
 
 CommonLookupTable (int page_size, const std::vector< WideString > &labels)
 Constructor. More...
 
 ~CommonLookupTable ()
 
virtual WideString get_candidate (int index) const
 Get a candidate. More...
 
virtual AttributeList get_attributes (int index) const
 Get the attributes of a candidate. More...
 
virtual uint32 number_of_candidates () const
 Return the number of candidates in this table. More...
 
virtual void clear ()
 Clear the table. More...
 
bool append_candidate (const WideString &cand, const AttributeList &attrs=AttributeList())
 Append a candidate string into the table. More...
 
bool append_candidate (ucs4_t cand, const AttributeList &attrs=AttributeList())
 Append a candidate char into the table. More...
 
- Public Member Functions inherited from scim::LookupTable
 LookupTable (int page_size=10)
 Constructor. More...
 
virtual ~LookupTable ()
 Virtual destructor. More...
 
void set_candidate_labels (const std::vector< WideString > &labels)
 Set the strings to label the candidates in one page. More...
 
WideString get_candidate_label (int page_index) const
 Get the label string of a candidate in a page. More...
 
void set_page_size (int page_size)
 Set the maximum page size. More...
 
int get_page_size () const
 Get the maximum page size. More...
 
int get_current_page_size () const
 Get current page size,. More...
 
int get_current_page_start () const
 Get the start index of current page. More...
 
bool is_cursor_visible () const
 Check if the cursor is visible. More...
 
bool is_page_size_fixed () const
 Check if the page size is fixed, aka. couldn't reduced by FrontEnd. More...
 
int get_cursor_pos () const
 Get current cursor position. More...
 
int get_cursor_pos_in_current_page () const
 Get the cursor position in current page. More...
 
bool page_up ()
 Flip to the previous page. More...
 
bool page_down ()
 Flip to the next page. More...
 
bool cursor_up ()
 Move cursor position to the previous entry. More...
 
bool cursor_down ()
 Move cursor position to the next entry. More...
 
void show_cursor (bool show=true)
 Set the cursor visibility. More...
 
void fix_page_size (bool fixed=true)
 Set the page size to be fixed, aka. prevent from being changed by FrontEnd. More...
 
void set_cursor_pos (int pos)
 Set the cursor position. More...
 
void set_cursor_pos_in_current_page (int pos)
 Set the cursor position in current page. More...
 
WideString get_candidate_in_current_page (int page_index) const
 Get a candidate in current page. More...
 
AttributeList get_attributes_in_current_page (int page_index) const
 Get the display attributes of a candidate in current page. More...
 

Detailed Description

A common lookup table class.

This class implements the LookupTable interface in a common way.

Constructor & Destructor Documentation

◆ CommonLookupTable() [1/2]

scim::CommonLookupTable::CommonLookupTable ( int  page_size = 10)

◆ CommonLookupTable() [2/2]

scim::CommonLookupTable::CommonLookupTable ( int  page_size,
const std::vector< WideString > &  labels 
)

Constructor.

Parameters
page_size- the maximum page size, can be set by set_page_size () later.
labels- the strings to label the candidates in one page.

◆ ~CommonLookupTable()

scim::CommonLookupTable::~CommonLookupTable ( )

Member Function Documentation

◆ get_candidate()

virtual WideString scim::CommonLookupTable::get_candidate ( int  index) const
virtual

Get a candidate.

Parameters
index- the candidate index in the lookup table.
Returns
the content of this candidate.

Implements scim::LookupTable.

◆ get_attributes()

virtual AttributeList scim::CommonLookupTable::get_attributes ( int  index) const
virtual

Get the attributes of a candidate.

Parameters
index- the index in the lookup table.
Returns
the AttributeList object holding the attributes of this candidate.

Implements scim::LookupTable.

◆ number_of_candidates()

virtual uint32 scim::CommonLookupTable::number_of_candidates ( ) const
virtual

Return the number of candidates in this table.

Returns
the number of entries currently in this table.

Implements scim::LookupTable.

◆ clear()

virtual void scim::CommonLookupTable::clear ( )
virtual

Clear the table.

Implements scim::LookupTable.

◆ append_candidate() [1/2]

bool scim::CommonLookupTable::append_candidate ( const WideString cand,
const AttributeList attrs = AttributeList() 
)

Append a candidate string into the table.

Parameters
cand- a candidate string to be added into the table.
attrs- the attributes to control the display effect of this entry. It can be omitted if no attribute.
Returns
true if success.

◆ append_candidate() [2/2]

bool scim::CommonLookupTable::append_candidate ( ucs4_t  cand,
const AttributeList attrs = AttributeList() 
)

Append a candidate char into the table.

Parameters
cand- a candidate char to be added into the table.
attrs- the attributes to control the display effect of this entry. It can be omitted if no attribute.
Returns
true if success.

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