scim  1.4.13
scim::CommonLookupTable Class Reference

A common lookup table class. More...

#include <scim_lookup_table.h>

List of all members.

Public Member Functions

 CommonLookupTable (int page_size=10)
 CommonLookupTable (int page_size, const std::vector< WideString > &labels)
 Constructor.
 ~CommonLookupTable ()
virtual WideString get_candidate (int index) const
 Get a candidate.
virtual AttributeList get_attributes (int index) const
 Get the attributes of a candidate.
virtual uint32 number_of_candidates () const
 Return the number of candidates in this table.
virtual void clear ()
 Clear the table.
bool append_candidate (const WideString &cand, const AttributeList &attrs=AttributeList())
 Append a candidate string into the table.
bool append_candidate (ucs4_t cand, const AttributeList &attrs=AttributeList())
 Append a candidate char into the table.
- Public Member Functions inherited from scim::LookupTable
 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.

Detailed Description

A common lookup table class.

This class implements the LookupTable interface in a common way.


Constructor & Destructor Documentation

scim::CommonLookupTable::CommonLookupTable ( int  page_size = 10)
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.
scim::CommonLookupTable::~CommonLookupTable ( )

Member Function Documentation

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.

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.

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.

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

Clear the table.

Implements scim::LookupTable.

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.
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: