Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

scim::LookupTable Class Reference
[Helper]

The base class of lookup table. More...

#include <scim_lookup_table.h>

Inheritance diagram for scim::LookupTable:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 LookupTable (int page_size, const KeyEvent &page_up_key, const KeyEvent &page_down_key, const std::vector< KeyEvent > &page_index_keys)
 Constructor.

virtual ~LookupTable ()
 Virtual destructor.

void set_page_index_keys (const std::vector< KeyEvent > &page_index_keys)
 Set the key events of page indexes.

void set_page_updown_keys (const KeyEvent &page_up, const KeyEvent &page_down)
 Set the key events of page up and down.

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.

int get_cursor_pos () const
 Get current cursor position.

int get_cursor_pos_in_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.

bool is_cursor_visible () const
 Check if the cursor is visible.

KeyEvent get_page_index_key (int page_index) const
 Get the key event of a page index.

KeyEvent get_page_up_key () const
 Get the key event of page up.

KeyEvent get_page_down_key () const
 Get key event of page down.

WideString get_content_in_page (int page_index) const
 Get the content of an entry in current page.

Pure Virtual functions.
These functions should be implemented in derivation classes.

virtual WideString get_content (int index) const=0
 Get the content of an entry.

virtual uint32 number_of_entries () const=0
 Return the number of entries in this table.

virtual void clear ()=0
 Clear the table.


Detailed Description

The base class of lookup table.

This is abstract class and cannot store data. Server should use its derivation class. This class is the interface that uses within FrontEnd class.

Definition at line 49 of file scim_lookup_table.h.


Constructor & Destructor Documentation

scim::LookupTable::LookupTable int  page_size,
const KeyEvent page_up_key,
const KeyEvent page_down_key,
const std::vector< KeyEvent > &  page_index_keys
 

Constructor.

Parameters:
page_size - the maximum page size, can be set by set_page_size() later.
page_up_key - the key event to page up.
page_down_key - the key event to page down.
page_index_keys - the key events to select items in current page directly.

virtual scim::LookupTable::~LookupTable  )  [virtual]
 

Virtual destructor.


Member Function Documentation

void scim::LookupTable::set_page_index_keys const std::vector< KeyEvent > &  page_index_keys  ) 
 

Set the key events of page indexes.

Parameters:
page_index_keys - the key events to select items in current page directly.

void scim::LookupTable::set_page_updown_keys const KeyEvent page_up,
const KeyEvent page_down
 

Set the key events of page up and down.

Parameters:
page_up - the key event to page up.
page_down - the key event to page down.

void scim::LookupTable::set_page_size int  page_size  ) 
 

Set the maximum page size.

Parameters:
page_size - the max page size of the table.

int scim::LookupTable::get_page_size  )  const
 

Get the maximum page size.

Returns:
the max page size of the table.

int scim::LookupTable::get_current_page_size  )  const
 

Get current page size,.

Returns:
the page size of current page.It can be less than the max page size.

int scim::LookupTable::get_current_page_start  )  const
 

Get the start index of current page.

Returns:
the start item index of current page, starting from 0.

int scim::LookupTable::get_cursor_pos  )  const
 

Get current cursor position.

Returns:
the cursor position in the table, starting from 0.

int scim::LookupTable::get_cursor_pos_in_page  )  const
 

Get the cursor position in current page.

Returns:
the cursor position in current page, equals to get_cursor_pos () - get_current_page_start ().

bool scim::LookupTable::page_up  ) 
 

Flip to the previous page.

Returns:
true if success, false if it's already in the first page.

bool scim::LookupTable::page_down  ) 
 

Flip to the next page.

Returns:
true if success, false if it's already in the last page.

bool scim::LookupTable::cursor_up  ) 
 

Move cursor position to the previous entry.

Returns:
true if success, false if it's already at the first entry.

bool scim::LookupTable::cursor_down  ) 
 

Move cursor position to the next entry.

Returns:
true if success. false if it's already at the last entry.

void scim::LookupTable::show_cursor bool  show = true  ) 
 

Set the cursor visibility.

Parameters:
show - true to show the cursor.

bool scim::LookupTable::is_cursor_visible  )  const
 

Check if the cursor is visible.

Returns:
true if the cursor should be shown.

KeyEvent scim::LookupTable::get_page_index_key int  page_index  )  const
 

Get the key event of a page index.

Parameters:
page_index - the page index, 0 to (max page size - 1).
Returns:
the corresponding key event of page_index.

KeyEvent scim::LookupTable::get_page_up_key  )  const
 

Get the key event of page up.

Returns:
the page up key event.

KeyEvent scim::LookupTable::get_page_down_key  )  const
 

Get key event of page down.

Returns:
the page down key event.

WideString scim::LookupTable::get_content_in_page int  page_index  )  const
 

Get the content of an entry in current page.

Parameters:
page_index - the index in current page.
Returns:
the content.
See also:
get_content

virtual WideString scim::LookupTable::get_content int  index  )  const [pure virtual]
 

Get the content of an entry.

Parameters:
index - the index in the lookup table.
Returns:
the content.

Implemented in scim::CommonLookupTable.

virtual uint32 scim::LookupTable::number_of_entries  )  const [pure virtual]
 

Return the number of entries in this table.

Returns:
the number of entries currently in this table.

Implemented in scim::CommonLookupTable.

virtual void scim::LookupTable::clear  )  [pure virtual]
 

Clear the table.

Implemented in scim::CommonLookupTable.


The documentation for this class was generated from the following file:
Generated on Fri May 7 17:27:28 2004 for scim by doxygen 1.3.6