scim::PanelClient Class Reference
Panel

PanelClient is used by FrontEnd to communicate with Panel daemon. More...

`#include <scim_panel_client.h>`

## Public Member Functions

| PanelClient ()
| ~PanelClient ()
int | open_connection (const String &config, const String &display)
| Open socket connection to the Panel.
void | close_connection ()
| Close the connection to Panel.
int | get_connection_number () const
| Return the connection id, which was returned by PanelClient::open_connection().
bool | is_connected () const
| Return whether this PanelClient has been connected to a Panel.
bool | has_pending_event () const
| Check if there are any events available to be processed.
bool | filter_event ()
| Filter the events sent from Panel daemon.
bool | prepare (int icid)
| Prepare the send transation for an IC.
bool | send ()
| Send the transaction to Panel.
Action methods to send events to Panel.
void | turn_on (int icid)
void | turn_off (int icid)
void | update_screen (int icid, int screen)
void | show_help (int icid, const String &help)
void | show_factory_menu (int icid, const std::vector< PanelFactoryInfo > &menu)
void | focus_in (int icid, const String &uuid)
void | focus_out (int icid)
void | update_factory_info (int icid, const PanelFactoryInfo &info)
void | update_spot_location (int icid, int x, int y)
void | show_preedit_string (int icid)
void | show_aux_string (int icid)
void | show_lookup_table (int icid)
void | hide_preedit_string (int icid)
void | hide_aux_string (int icid)
void | hide_lookup_table (int icid)
void | update_preedit_string (int icid, const WideString &str, const AttributeList &attrs)
void | update_preedit_caret (int icid, int caret)
void | update_aux_string (int icid, const WideString &str, const AttributeList &attrs)
void | update_lookup_table (int icid, const LookupTable &table)
void | register_properties (int icid, const PropertyList &properties)
void | update_property (int icid, const Property &property)
void | start_helper (int icid, const String &helper_uuid)
void | stop_helper (int icid, const String &helper_uuid)
void | send_helper_event (int icid, const String &helper_uuid, const Transaction &trans)
void | register_input_context (int icid, const String &uuid)
void | remove_input_context (int icid)
Signal connection functions.
These functions are used by FrontEnds to connect their corresponding slots to this PanelClient's signals. The first parameter of each slot method is always "int context", which is the id of the input method context.
Connection | signal_connect_reload_config (PanelClientSlotVoid *slot)
| Signal: reload configuration.
Connection | signal_connect_exit (PanelClientSlotVoid *slot)
| Signal: exit the FrontEnd.
Connection | signal_connect_update_lookup_table_page_size (PanelClientSlotInt *slot)
| Signal: update lookup table page size.
Connection | signal_connect_lookup_table_page_up (PanelClientSlotVoid *slot)
| Signal: lookup table page up.
Connection | signal_connect_lookup_table_page_down (PanelClientSlotVoid *slot)
| Signal: lookup table page down.
Connection | signal_connect_trigger_property (PanelClientSlotString *slot)
| Signal: trigger property.
Connection | signal_connect_process_helper_event (PanelClientSlotStringStringTransaction *slot)
| Signal: process helper event.
Connection | signal_connect_move_preedit_caret (PanelClientSlotInt *slot)
| Signal: move preedit caret.
Connection | signal_connect_select_candidate (PanelClientSlotInt *slot)
| Signal: select candidate.
Connection | signal_connect_process_key_event (PanelClientSlotKeyEvent *slot)
| Signal: process key event.
Connection | signal_connect_commit_string (PanelClientSlotWideString *slot)
| Signal: commit string.
Connection | signal_connect_forward_key_event (PanelClientSlotKeyEvent *slot)
| Signal: forward key event.
Connection | signal_connect_request_help (PanelClientSlotVoid *slot)
| Signal: request help.
Connection | signal_connect_request_factory_menu (PanelClientSlotVoid *slot)
| Signal: request factory menu.
Connection | signal_connect_change_factory (PanelClientSlotString *slot)
| Signal: change factory.

## Detailed Description

PanelClient is used by FrontEnd to communicate with Panel daemon.

All socket communication between FrontEnd and Panel is handled by this class. FrontEnd may just register some slots to the corresponding signals to handle the events sent from Panel.

## Constructor & Destructor Documentation

## PanelClient()

scim::PanelClient::PanelClient | ( |  | ) |

## ~PanelClient()

scim::PanelClient::~PanelClient | ( |  | ) |

## Member Function Documentation

## open_connection()

int scim::PanelClient::open_connection | ( | const String & | config,
|  | const String & | display )

Open socket connection to the Panel.

FrontEnd and Panel communicate with each other via the Socket created by Panel.

FrontEnd can select/poll on the connection id returned by this method to see if there are any data available to be read. If any data are available, PanelClient::filter_event() should be called to process the data.

If PanelClient::filter_event() returns false, then it means that the connection is broken and should be re-established by calling PanelClient::close_connection() and PanelClient::open_connection() again.

This method would try to launch the panel daemon and make connection again, if the connection could not be established successfully. So this method should always success, unless the panel could not be started on the certain display.

Parameters

  config | The config module name which should be used by launching the panel daemon.
  display | The display name which the panel daemon should run on.

Returns
  The id of the socket connection, -1 means connection is failed.

## close_connection()

void scim::PanelClient::close_connection | ( |  | ) |

Close the connection to Panel.

## get_connection_number()

int scim::PanelClient::get_connection_number | ( |  | ) | const

Return the connection id, which was returned by PanelClient::open_connection().

## is_connected()

bool scim::PanelClient::is_connected | ( |  | ) | const

Return whether this PanelClient has been connected to a Panel.

## has_pending_event()

bool scim::PanelClient::has_pending_event | ( |  | ) | const

Check if there are any events available to be processed.

If it returns true then FrontEnd should call PanelClient::filter_event() to process them.

Returns
  true if there are any events available.

## filter_event()

bool scim::PanelClient::filter_event | ( |  | ) |

Filter the events sent from Panel daemon.

Corresponding signal will be emitted in this method.

Returns
  false if the connection is broken, otherwise return true.

## prepare()

bool scim::PanelClient::prepare | ( | int | icid | ) |

Prepare the send transation for an IC.

This method should be called before any events would be sent to Panel.

Parameters

  icid | The id of the IC which has events to be sent to Panel.

Returns
  true if the preparation is ok.

## send()

bool scim::PanelClient::send | ( |  | ) |

Send the transaction to Panel.

Returns
  true if sent successfully.

## turn_on()

void scim::PanelClient::turn_on | ( | int | icid | ) |

## turn_off()

void scim::PanelClient::turn_off | ( | int | icid | ) |

## update_screen()

void scim::PanelClient::update_screen | ( | int | icid,
|  | int | screen )

## show_help()

void scim::PanelClient::show_help | ( | int | icid,
|  | const String & | help )

## show_factory_menu()

void scim::PanelClient::show_factory_menu | ( | int | icid,
|  | const std::vector< PanelFactoryInfo > & | menu )

## focus_in()

void scim::PanelClient::focus_in | ( | int | icid,
|  | const String & | uuid )

## focus_out()

void scim::PanelClient::focus_out | ( | int | icid | ) |

## update_factory_info()

void scim::PanelClient::update_factory_info | ( | int | icid,
|  | const PanelFactoryInfo & | info )

## update_spot_location()

void scim::PanelClient::update_spot_location | ( | int | icid,
|  | int | x,
|  | int | y )

## show_preedit_string()

void scim::PanelClient::show_preedit_string | ( | int | icid | ) |

## show_aux_string()

void scim::PanelClient::show_aux_string | ( | int | icid | ) |

## show_lookup_table()

void scim::PanelClient::show_lookup_table | ( | int | icid | ) |

## hide_preedit_string()

void scim::PanelClient::hide_preedit_string | ( | int | icid | ) |

## hide_aux_string()

void scim::PanelClient::hide_aux_string | ( | int | icid | ) |

## hide_lookup_table()

void scim::PanelClient::hide_lookup_table | ( | int | icid | ) |

## update_preedit_string()

void scim::PanelClient::update_preedit_string | ( | int | icid,
|  | const WideString & | str,
|  | const AttributeList & | attrs )

## update_preedit_caret()

void scim::PanelClient::update_preedit_caret | ( | int | icid,
|  | int | caret )

## update_aux_string()

void scim::PanelClient::update_aux_string | ( | int | icid,
|  | const WideString & | str,
|  | const AttributeList & | attrs )

## update_lookup_table()

void scim::PanelClient::update_lookup_table | ( | int | icid,
|  | const LookupTable & | table )

## register_properties()

void scim::PanelClient::register_properties | ( | int | icid,
|  | const PropertyList & | properties )

## update_property()

void scim::PanelClient::update_property | ( | int | icid,
|  | const Property & | property )

## start_helper()

void scim::PanelClient::start_helper | ( | int | icid,
|  | const String & | helper_uuid )

## stop_helper()

void scim::PanelClient::stop_helper | ( | int | icid,
|  | const String & | helper_uuid )

## send_helper_event()

void scim::PanelClient::send_helper_event | ( | int | icid,
|  | const String & | helper_uuid,
|  | const Transaction & | trans )

## register_input_context()

void scim::PanelClient::register_input_context | ( | int | icid,
|  | const String & | uuid )

## remove_input_context()

void scim::PanelClient::remove_input_context | ( | int | icid | ) |

## signal_connect_reload_config()

Connection scim::PanelClient::signal_connect_reload_config | ( | PanelClientSlotVoid * | slot | ) |

Signal: reload configuration.

slot prototype: void reload_config (int context);

The context parameter is useless here.

References scim::slot().

## signal_connect_exit()

Connection scim::PanelClient::signal_connect_exit | ( | PanelClientSlotVoid * | slot | ) |

Signal: exit the FrontEnd.

slot prototype: void exit (int context);

The context parameter is useless here.

References scim::slot().

## signal_connect_update_lookup_table_page_size()

Connection scim::PanelClient::signal_connect_update_lookup_table_page_size | ( | PanelClientSlotInt * | slot | ) |

Signal: update lookup table page size.

slot prototype: void update_lookup_table_page_size (int context, int page_size);

References scim::slot().

## signal_connect_lookup_table_page_up()

Connection scim::PanelClient::signal_connect_lookup_table_page_up | ( | PanelClientSlotVoid * | slot | ) |

Signal: lookup table page up.

slot prototype: void lookup_table_page_up (int context);

References scim::slot().

## signal_connect_lookup_table_page_down()

Connection scim::PanelClient::signal_connect_lookup_table_page_down | ( | PanelClientSlotVoid * | slot | ) |

Signal: lookup table page down.

slot prototype: void lookup_table_page_down (int context);

References scim::slot().

## signal_connect_trigger_property()

Connection scim::PanelClient::signal_connect_trigger_property | ( | PanelClientSlotString * | slot | ) |

Signal: trigger property.

slot prototype: void trigger_property (int context, const String &property);

References scim::slot().

## signal_connect_process_helper_event()

Connection scim::PanelClient::signal_connect_process_helper_event | ( | PanelClientSlotStringStringTransaction * | slot | ) |

Signal: process helper event.

slot prototype: void process_helper_event (int context, const String &target_uuid, const String &helper_uuid, const Transaction &trans);

- target_uuid is UUID of the IMEngineInstance object which should handle the events.
- helper_uuid is UUID of the Helper which sent the events.
- trans contains the events.

References scim::slot().

## signal_connect_move_preedit_caret()

Connection scim::PanelClient::signal_connect_move_preedit_caret | ( | PanelClientSlotInt * | slot | ) |

Signal: move preedit caret.

slot prototype: void move_preedit_caret (int context, int caret_pos);

References scim::slot().

## signal_connect_select_candidate()

Connection scim::PanelClient::signal_connect_select_candidate | ( | PanelClientSlotInt * | slot | ) |

Signal: select candidate.

slot prototype: void select_candidate (int context, int cand_index);

References scim::slot().

## signal_connect_process_key_event()

Connection scim::PanelClient::signal_connect_process_key_event | ( | PanelClientSlotKeyEvent * | slot | ) |

Signal: process key event.

slot prototype: void process_key_event (int context, const KeyEvent &key);

References scim::slot().

## signal_connect_commit_string()

Connection scim::PanelClient::signal_connect_commit_string | ( | PanelClientSlotWideString * | slot | ) |

Signal: commit string.

slot prototype: void commit_string (int context, const WideString &wstr);

References scim::slot().

## signal_connect_forward_key_event()

Connection scim::PanelClient::signal_connect_forward_key_event | ( | PanelClientSlotKeyEvent * | slot | ) |

Signal: forward key event.

slot prototype: void forward_key_event (int context, const KeyEvent &key);

References scim::slot().

## signal_connect_request_help()

Connection scim::PanelClient::signal_connect_request_help | ( | PanelClientSlotVoid * | slot | ) |

Signal: request help.

slot prototype: void request_help (int context);

References scim::slot().

## signal_connect_request_factory_menu()

Connection scim::PanelClient::signal_connect_request_factory_menu | ( | PanelClientSlotVoid * | slot | ) |

Signal: request factory menu.

slot prototype: void request_factory_menu (int context);

References scim::slot().

## signal_connect_change_factory()

Connection scim::PanelClient::signal_connect_change_factory | ( | PanelClientSlotString * | slot | ) |

Signal: change factory.

slot prototype: void change_factory (int context, const String &uuid);

References scim::slot().

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

- scim_panel_client.h