SCIMBridge 0.4.x

agent/scim-bridge-agent-imcontext.h

Go to the documentation of this file.
00001 /*
00002  * SCIM Bridge
00003  *
00004  * Copyright (c) 2006 Ryo Dairiki <ryo-dairiki@users.sourceforge.net>
00005  *
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation and 
00010  * appearing in the file LICENSE.LGPL included in the package of this file.
00011  * You can also redistribute it and/or modify it under the terms of 
00012  * the GNU General Public License as published by the Free Software Foundation and 
00013  * appearing in the file LICENSE.GPL included in the package of this file.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00018  */
00019 
00026 #ifndef SCIMBRIDGEAGENTIMCONTEXT_H_
00027 #define SCIMBRIDGEAGENTIMCONTEXT_H_
00028 
00029 #define Uses_SCIM_ATTRIBUTE
00030 #define Uses_SCIM_BACKEND
00031 #define Uses_SCIM_IMENGINE
00032 #define Uses_SCIM_IMENGINE_MODULE
00033 #define Uses_SCIM_LOOKUP_TABLE
00034 
00035 #include <scim.h>
00036 
00037 #include "scim-bridge.h"
00038 #include "scim-bridge-imcontext.h"
00039 
00040 #include "scim-bridge-agent-panel-listener-protected.h"
00041 
00042 class ScimBridgeAgentClientListener;
00043 class ScimBridgeAgentPanelListenerProtected;
00044 
00048 class ScimBridgeAgentIMContext
00049 {
00050 
00051     public:
00052 
00059         static ScimBridgeAgentIMContext *alloc (ScimBridgeAgentClientListener *client_listener);
00060 
00066         static void free_by_client (const ScimBridgeAgentClientListener *client_listener);
00067 
00074         static ScimBridgeAgentIMContext *find (scim_bridge_imcontext_id_t imcontext_id);
00075 
00083         static void static_initialize (ScimBridgeAgentPanelListenerProtected *panel_listener, const scim::String &scim_language, scim::BackEndPointer scim_backend);
00084 
00088         static void static_finalize ();
00089 
00095         static bool is_imengine_shared ();
00096 
00102         static void set_imengine_shared (bool shared);
00103 
00109         static bool is_on_the_spot_enabled ();
00110 
00116         static void set_on_the_spot_enabled (bool enabled);
00117 
00123         static bool is_enabled_by_default ();
00124 
00130         static void set_enabled_by_default (bool enabled);
00131 
00135         virtual ~ScimBridgeAgentIMContext () {}
00136 
00142         virtual bool is_enabled () = 0;
00143 
00149         virtual void set_enabled (bool new_state) = 0;
00150 
00156         virtual scim_bridge_preedit_mode_t get_preedit_mode () const = 0;
00157 
00163         virtual void set_preedit_mode (scim_bridge_preedit_mode_t new_preedit_mode) = 0;
00164 
00170         virtual scim_bridge_imcontext_id_t get_id () = 0;
00171 
00177         virtual ScimBridgeAgentClientListener *get_client_listener () = 0;
00178 
00185         virtual bool filter_key_event (const scim::KeyEvent &key_event) = 0;
00186 
00192         virtual void forward_key_event (const scim::KeyEvent &key_event) = 0;
00193 
00197         virtual void focus_in () = 0;
00198 
00202         virtual void focus_out () = 0;
00203 
00207         virtual void reset () = 0;
00208 
00215         virtual void set_cursor_location (int x, int y) = 0;
00216 
00220         virtual void open_next_imengine () = 0;
00221 
00225         virtual void open_previous_imengine () = 0;
00226 
00230         virtual void open_imengine_by_uuid (const scim::String &uuid) = 0;
00231 
00235         virtual void open_imengine (scim::IMEngineFactoryPointer factory) = 0;
00236 
00242         virtual void update_lookup_table_page_size (int page_size) = 0;
00243 
00247         virtual void lookup_table_page_up () = 0;
00248 
00252         virtual void lookup_table_page_down () = 0;
00253 
00259         virtual void lookup_table_select_candidate (int candidate_index) = 0;
00260 
00266         virtual void trigger_property (const scim::String &property) = 0;
00267 
00275         virtual void process_helper_event (const scim::String &target_uuid, const scim::String &helper_uuid, const scim::Transaction &trans) = 0;
00276 
00282         virtual void panel_move_preedit_caret (int caret_pos) = 0;
00283 
00289         virtual void panel_commit_string (const scim::WideString &wstr) = 0;
00290 
00294         virtual void panel_request_help () = 0;
00295 
00301         virtual void panel_change_factory (const scim::String &uuid) = 0;
00302 
00303     protected:
00304 
00308         ScimBridgeAgentIMContext () {}
00309 
00310 };
00311 #endif                                            /*SCIMBRIDGEAGENTIMCONTEXT_H_*/