~ubuntu-branches/ubuntu/trusty/scim-bridge/trusty

« back to all changes in this revision

Viewing changes to agent/scim-bridge-agent-messenger.h

  • Committer: Bazaar Package Importer
  • Author(s): Hou ZhengPeng
  • Date: 2006-04-02 18:07:30 UTC
  • Revision ID: james.westby@ubuntu.com-20060402180730-x4zlfe8odh4yzcld
Tags: upstream-0.1.3
ImportĀ upstreamĀ versionĀ 0.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SCIMBRIDGEAGENTMESSENGER_H_
 
2
#define SCIMBRIDGEAGENTMESSENGER_H_
 
3
 
 
4
#include "scim-bridge-agent-imcontext.h"
 
5
 
 
6
class ScimBridgeAgentClientPeerProtected;
 
7
 
 
8
class ScimBridgeAgentMessenger
 
9
{
 
10
 
 
11
    public:
 
12
 
 
13
        ScimBridgeAgentMessenger (ScimBridgeAgentClientPeerProtected &client_peer);
 
14
        ~ScimBridgeAgentMessenger ();
 
15
 
 
16
        bool is_thread_running ();
 
17
 
 
18
        void open_connection (int input_fd, int output_fd) throw (ScimBridgeAgentException);
 
19
        void close_connection ();
 
20
 
 
21
        void connection_closed ();
 
22
 
 
23
        ScimBridgeMessengerID get_id ();
 
24
 
 
25
        /* Calls from the client */
 
26
        void received_message_unknown (ScimBridgeMessageCode code) throw (ScimBridgeAgentException);
 
27
        void received_message_alloc_imcontext () throw (ScimBridgeAgentException);
 
28
        void received_message_free_imcontext () throw (ScimBridgeAgentException);
 
29
        void received_message_reset_imcontext () throw (ScimBridgeAgentException);
 
30
        void received_message_focus_changed () throw (ScimBridgeAgentException);
 
31
        void received_message_keyevent_occured () throw (ScimBridgeAgentException);
 
32
        void received_message_cursor_location_changed () throw (ScimBridgeAgentException);
 
33
 
 
34
        /* Remote function */
 
35
        void call_commit (const ScimBridgeAgentIMContext &ic) throw (ScimBridgeAgentException);
 
36
 
 
37
        void call_set_preedit_string (const ScimBridgeAgentIMContext &ic, const scim::WideString &string) throw (ScimBridgeAgentException);
 
38
        void call_set_preedit_attributes (const ScimBridgeAgentIMContext &ic, const scim::AttributeList &attributes) throw (ScimBridgeAgentException);
 
39
        void call_set_preedit_cursor_position (const ScimBridgeAgentIMContext &ic, int cursor_position) throw (ScimBridgeAgentException);
 
40
        void call_set_preedit_shown (const ScimBridgeAgentIMContext &ic, bool shown) throw (ScimBridgeAgentException);
 
41
        void call_update_preedit (const ScimBridgeAgentIMContext &ic) throw (ScimBridgeAgentException);
 
42
 
 
43
        void call_forward_keyevent (const ScimBridgeAgentIMContext &ic, const scim::KeyEvent &keyevent) throw (ScimBridgeAgentException);
 
44
        void call_beep (const ScimBridgeAgentIMContext &ic) throw (ScimBridgeAgentException);
 
45
 
 
46
        bool call_get_surrounding_string (const ScimBridgeAgentIMContext &ic, scim::WideString &surrounding, size_t max_length, int &cursor_pos) throw (ScimBridgeAgentException);
 
47
        bool call_delete_surrounding_string (const ScimBridgeAgentIMContext &ic, size_t offset, size_t len) throw (ScimBridgeAgentException);
 
48
 
 
49
    private:
 
50
 
 
51
        bool thread_running;
 
52
 
 
53
        pthread_t thread;
 
54
 
 
55
        ScimBridgeMessengerID id;
 
56
 
 
57
        ScimBridgeAgentClientPeerProtected &client_peer;
 
58
 
 
59
        int input_fd;
 
60
        int output_fd;
 
61
 
 
62
};
 
63
#endif                                            /*SCIMBRIDGEAGENTMESSENGER_H_*/