#include <scim_lookup_table.h>
Inherited by scim::CommonLookupTable.
Public Member Functions | |
LookupTable (int page_size=10) | |
Constructor. | |
virtual | ~LookupTable () |
Virtual destructor. | |
void | set_candidate_labels (const std::vector< WideString > &labels) |
Set the strings to label the candidates in one page. | |
WideString | get_candidate_label (int page_index) const |
Get the label string of a candidate in a page. | |
void | set_page_size (int page_size) |
Set the maximum page size. | |
int | get_page_size () const |
Get the maximum page size. | |
int | get_current_page_size () const |
Get current page size,. | |
int | get_current_page_start () const |
Get the start index of current page. | |
bool | is_cursor_visible () const |
Check if the cursor is visible. | |
bool | is_page_size_fixed () const |
Check if the page size is fixed, aka. couldn't reduced by FrontEnd. | |
int | get_cursor_pos () const |
Get current cursor position. | |
int | get_cursor_pos_in_current_page () const |
Get the cursor position in current page. | |
bool | page_up () |
Flip to the previous page. | |
bool | page_down () |
Flip to the next page. | |
bool | cursor_up () |
Move cursor position to the previous entry. | |
bool | cursor_down () |
Move cursor position to the next entry. | |
void | show_cursor (bool show=true) |
Set the cursor visibility. | |
void | fix_page_size (bool fixed=true) |
Set the page size to be fixed, aka. prevent from being changed by FrontEnd. | |
void | set_cursor_pos (int pos) |
Set the cursor position. | |
void | set_cursor_pos_in_current_page (int pos) |
Set the cursor position in current page. | |
WideString | get_candidate_in_current_page (int page_index) const |
Get a candidate in current page. | |
AttributeList | get_attributes_in_current_page (int page_index) const |
Get the display attributes of a candidate in current page. | |
Pure Virtual functions. | |
These functions should be implemented in derivation classes. | |
virtual WideString | get_candidate (int index) const =0 |
Get a candidate. | |
virtual AttributeList | get_attributes (int index) const =0 |
Get the attributes of a candidate. | |
virtual uint32 | number_of_candidates () const =0 |
Return the number of candidates in this table. | |
virtual void | clear ()=0 |
Clear the table. |
LookupTable is used to store the candidate phrases, it provides a easy way to manage the content of candidates and flip between multiple pages.
It also can manage the attributes for each candidate string.
This is abstract class and cannot store data. IMEngine should use its derivation class. This class is the interface that uses within FrontEnd class.
scim::LookupTable::LookupTable | ( | int | page_size = 10 |
) |
virtual scim::LookupTable::~LookupTable | ( | ) | [virtual] |
Virtual destructor.
void scim::LookupTable::set_candidate_labels | ( | const std::vector< WideString > & | labels | ) |
Set the strings to label the candidates in one page.
labels | - the strings to label the candidates in one page. |
WideString scim::LookupTable::get_candidate_label | ( | int | page_index | ) | const |
Get the label string of a candidate in a page.
page_index | - the index in a page, 0 to (max page size - 1). |
void scim::LookupTable::set_page_size | ( | int | page_size | ) |
Set the maximum page size.
page_size | - the max page size of the table. |
int scim::LookupTable::get_page_size | ( | ) | const |
Get the maximum page size.
int scim::LookupTable::get_current_page_size | ( | ) | const |
Get current page size,.
int scim::LookupTable::get_current_page_start | ( | ) | const |
Get the start index of current page.
bool scim::LookupTable::is_cursor_visible | ( | ) | const |
Check if the cursor is visible.
bool scim::LookupTable::is_page_size_fixed | ( | ) | const |
Check if the page size is fixed, aka. couldn't reduced by FrontEnd.
int scim::LookupTable::get_cursor_pos | ( | ) | const |
Get current cursor position.
int scim::LookupTable::get_cursor_pos_in_current_page | ( | ) | const |
Get the cursor position in current page.
bool scim::LookupTable::page_up | ( | ) |
Flip to the previous page.
bool scim::LookupTable::page_down | ( | ) |
Flip to the next page.
bool scim::LookupTable::cursor_up | ( | ) |
Move cursor position to the previous entry.
bool scim::LookupTable::cursor_down | ( | ) |
Move cursor position to the next entry.
void scim::LookupTable::show_cursor | ( | bool | show = true |
) |
Set the cursor visibility.
show | - true to show the cursor. |
void scim::LookupTable::fix_page_size | ( | bool | fixed = true |
) |
Set the page size to be fixed, aka. prevent from being changed by FrontEnd.
void scim::LookupTable::set_cursor_pos | ( | int | pos | ) |
Set the cursor position.
pos | - the absolute position of the cursor. |
void scim::LookupTable::set_cursor_pos_in_current_page | ( | int | pos | ) |
Set the cursor position in current page.
pos | - the relative position of the cursor in current page. |
WideString scim::LookupTable::get_candidate_in_current_page | ( | int | page_index | ) | const |
Get a candidate in current page.
page_index | - the candidate index in current page. |
AttributeList scim::LookupTable::get_attributes_in_current_page | ( | int | page_index | ) | const |
Get the display attributes of a candidate in current page.
page_index | - the index in current page. |
virtual WideString scim::LookupTable::get_candidate | ( | int | index | ) | const [pure virtual] |
Get a candidate.
index | - the candidate index in the lookup table. |
Implemented in scim::CommonLookupTable.
virtual AttributeList scim::LookupTable::get_attributes | ( | int | index | ) | const [pure virtual] |
Get the attributes of a candidate.
index | - the index in the lookup table. |
Implemented in scim::CommonLookupTable.
virtual uint32 scim::LookupTable::number_of_candidates | ( | ) | const [pure virtual] |
Return the number of candidates in this table.
Implemented in scim::CommonLookupTable.
virtual void scim::LookupTable::clear | ( | ) | [pure virtual] |