IBus.LookupTable

g GObject.InitiallyUnowned GObject.InitiallyUnowned IBus.Object IBus.Object GObject.InitiallyUnowned->IBus.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned IBus.LookupTable IBus.LookupTable IBus.Serializable IBus.Serializable IBus.Object->IBus.Serializable IBus.Serializable->IBus.LookupTable

Subclasses:

None

Methods

Inherited:

IBus.Serializable (7), IBus.Object (2), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (page_size, cursor_pos, cursor_visible, round)

append_candidate (text)

append_label (text)

clear ()

cursor_down ()

cursor_up ()

get_candidate (index)

get_cursor_in_page ()

get_cursor_pos ()

get_label (index)

get_number_of_candidates ()

get_orientation ()

get_page_size ()

is_cursor_visible ()

is_round ()

page_down ()

page_up ()

set_cursor_pos (cursor_pos)

set_cursor_visible (visible)

set_label (index, text)

set_orientation (orientation)

set_page_size (page_size)

set_round (round)

Virtual Methods

Inherited:

IBus.Serializable (3), IBus.Object (1), GObject.Object (7)

Properties

None

Signals

Inherited:

IBus.Object (1), GObject.Object (1)

Fields

Inherited:

IBus.Object (1), GObject.Object (1)

Name

Type

Access

Description

candidates

[object]

r

Candidate words/phrases.

cursor_pos

int

r

position index of cursor.

cursor_visible

bool

r

whether the cursor is visible.

labels

[object]

r

Candidate labels which identify individual candidates in the same page. Default is 1, 2, 3, 4 …

orientation

int

r

orientation of the table.

page_size

int

r

number of candidate shown per page.

parent

IBus.Serializable

r

round

bool

r

True for lookup table wrap around.

Class Details

class IBus.LookupTable(**kwargs)
Bases:

IBus.Serializable

Abstract:

No

Structure:

IBus.LookupTableClass

An IBusLookuptable stores the candidate words or phrases for users to choose from.

Use IBus.Engine.update_lookup_table(), IBus.Engine.show_lookup_table(), and IBus.Engine.hide_lookup_table() to update, show and hide the lookup table.

see_also: IBus.Engine

classmethod new(page_size, cursor_pos, cursor_visible, round)
Parameters:
  • page_size (int) – number of candidate shown per page, the max value is 16.

  • cursor_pos (int) – position index of cursor.

  • cursor_visible (bool) – whether the cursor is visible.

  • round (bool) – True for lookup table wrap around.

Returns:

A newly allocated IBus.LookupTable.

Return type:

IBus.LookupTable

Craetes a new IBus.LookupTable.

append_candidate(text)
Parameters:

text (IBus.Text) – candidate word/phrase to be appended (in IBus.Text format).

Append a candidate word/phrase to IBus.LookupTable, and increase reference.

append_label(text)
Parameters:

text (IBus.Text) – A candidate label to be appended (in IBus.Text format).

Append a candidate word/phrase to IBus.LookupTable, and increase reference. This function is needed if the input method select candidate with non-numeric keys such as “asdfghjkl;”.

clear()

Clear and remove all candidate from an IBus.LookupTable.

cursor_down()
Returns:

True if succeed.

Return type:

bool

Go to next candidate of an IBus.LookupTable.

It returns False if it is already at the last candidate, unless table>-round==:obj:True, where it will go to the first candidate.

cursor_up()
Returns:

True if succeed.

Return type:

bool

Go to previous candidate of an IBus.LookupTable.

It returns False if it is already at the first candidate, unless table>-round==:obj:True, where it will go to the last candidate.

get_candidate(index)
Parameters:

index (int) – Index in the Lookup table.

Returns:

IBus.Text at the given index; None if no such IBus.Text.

Return type:

IBus.Text

Return IBus.Text at the given index. Borrowed reference.

get_cursor_in_page()
Returns:

The position of cursor in current page.

Return type:

int

Gets the cursor position in current page of IBus.LookupTable.

get_cursor_pos()
Returns:

The position of cursor.

Return type:

int

Gets the cursor position of IBus.LookupTable.

get_label(index)
Parameters:

index (int) – Index in the Lookup table.

Returns:

IBus.Text at the given index; None if no such IBus.Text.

Return type:

IBus.Text

Return IBus.Text at the given index. Borrowed reference.

get_number_of_candidates()
Returns:

The number of candidates in the table

Return type:

int

Return the number of candidate in the table.

get_orientation()
Returns:

The orientation of the self.

Return type:

int

Returns the orientation of the IBus.LookupTable.

get_page_size()
Returns:

Page size, i.e., number of candidate shown per page. dd

Return type:

int

Gets the number of candidate shown per page.

is_cursor_visible()
Returns:

Whether the cursor of self is visible.

Return type:

bool

Returns whether the cursor of an IBus.LookupTable is visible.

is_round()
Returns:

Whether the self is round.

Return type:

bool

Returns whether the IBus.LookupTable is round.

page_down()
Returns:

True if succeed.

Return type:

bool

Go to next page of an IBus.LookupTable.

It returns False if it is already at the last page, unless table>-round==:obj:True, where it will go to the first page.

page_up()
Returns:

True if succeed.

Return type:

bool

Go to previous page of an IBus.LookupTable.

It returns False if it is already at the first page, unless table>-round==:obj:True, where it will go to the last page.

set_cursor_pos(cursor_pos)
Parameters:

cursor_pos (int) – The position of cursor.

Set the cursor position of IBus.LookupTable.

set_cursor_visible(visible)
Parameters:

visible (bool) – Whether to make the cursor of self visible.

Set whether to make the cursor of an IBus.LookupTable visible or not.

set_label(index, text)
Parameters:
  • index (int) – Intex in the Lookup table.

  • text (IBus.Text) – A candidate label to be appended (in IBus.Text format).

Append a candidate word/phrase to IBus.LookupTable, and increase reference. This function is needed if the input method select candidate with non-numeric keys such as “asdfghjkl;”.

set_orientation(orientation)
Parameters:

orientation (int) –

.

Set the orientation.

set_page_size(page_size)
Parameters:

page_size (int) – number of candidate shown per page.

Set the number of candidate shown per page.

set_round(round)
Parameters:

round (bool) – Whether to make self round.

Set whether to make the IBus.LookupTable round or not.