~joel-auterson/ubuntu/maverick/ibus/newmenuname

« back to all changes in this revision

Viewing changes to src/ibusserver.h

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing
  • Date: 2009-10-05 20:45:18 UTC
  • mfrom: (1.1.5 upstream) (6.1.15 sid)
  • Revision ID: james.westby@ubuntu.com-20091005204518-069vlwrl3r8v7bbr
Tags: 1.2.0.20090927-2
* create po template when build (LP: #188690)
  - debian/rules: updated.
  - debian/clean: remove pot file when clean.
* debian/control: build depends on python-rsvg (LP: #432375)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
18
 * Boston, MA 02111-1307, USA.
19
19
 */
 
20
/**
 
21
 * SECTION: ibusserver
 
22
 * @short_description: Server that listen on a socket and wait for connection requests.
 
23
 * @stability: Stable
 
24
 *
 
25
 * An IBusServer listen on a socket and wait for connections requests,
 
26
 * just like DBusServer.
 
27
 */
20
28
#ifndef __IBUS_SERVER_H_
21
29
#define __IBUS_SERVER_H_
22
30
 
47
55
typedef struct _IBusServer IBusServer;
48
56
typedef struct _IBusServerClass IBusServerClass;
49
57
 
 
58
/**
 
59
 * IBusNewConnectionFunc:
 
60
 * @server: An IBusServer.
 
61
 * @connection: The corresponding IBusConnection.
 
62
 *
 
63
 * Prototype of new connection callback function.
 
64
 *
 
65
 * This callback should be connected to signal ::new-connection
 
66
 * to handle the event that a new connection is coming in.
 
67
 * In this handler, IBus could add a reference and continue processing the connection.
 
68
 * If no reference is added, the new connection will be released and closed after this signal.
 
69
 *
 
70
 * @see_also: ::new-connection
 
71
 */
 
72
 
50
73
typedef void (* IBusNewConnectionFunc) (IBusServer *server, IBusConnection *connection);
51
74
 
 
75
/**
 
76
 * IBusServer:
 
77
 *
 
78
 * An opaque object representing an IBusServer.
 
79
 */
52
80
struct _IBusServer {
53
81
    IBusObject parent;
54
82
    /* instance members */
66
94
};
67
95
 
68
96
GType            ibus_server_get_type           (void);
 
97
 
 
98
/**
 
99
 * ibus_server_new:
 
100
 * @returns: A newly allocated IBusServer instance.
 
101
 *
 
102
 * New an IBusServer.
 
103
 */
69
104
IBusServer      *ibus_server_new                (void);
 
105
 
 
106
/**
 
107
 * ibus_server_listen:
 
108
 * @server: An IBusServer.
 
109
 * @address: Address of this server.
 
110
 * @returns: TRUE if succeed ; FALSE otherwise.
 
111
 *
 
112
 * Listens for new connections on the given address.
 
113
 *
 
114
 * If there are multiple semicolon-separated address entries in the address,
 
115
 * tries each one and listens on the first one that works.
 
116
 *
 
117
 * Returns FALSE if listening fails for any reason.
 
118
 *
 
119
 * To free the server, applications must call first ibus_server_disconnect() and then dbus_server_unref().
 
120
 */
70
121
gboolean         ibus_server_listen             (IBusServer     *server,
71
122
                                                 const gchar    *address);
 
123
 
 
124
/**
 
125
 * ibus_server_disconnect:
 
126
 * @server: An IBusServer.
 
127
 *
 
128
 * Releases the server's address and stops listening for new clients.
 
129
 *
 
130
 * If called more than once, only the first call has an effect. Does not modify the server's reference count.
 
131
 */
72
132
void             ibus_server_disconnect         (IBusServer     *server);
 
133
 
 
134
/**
 
135
 * ibus_server_get_address:
 
136
 * @server: An IBusServer.
 
137
 * @returns: A newly allocated string which contain address.
 
138
 *
 
139
 * Returns the address of the server, as a newly-allocated string which must be freed by the caller.
 
140
 */
73
141
const gchar     *ibus_server_get_address        (IBusServer     *server);
 
142
 
 
143
/**
 
144
 * ibus_server_get_id:
 
145
 * @server: An IBusServer.
 
146
 * @returns: A newly allocated string which contain address.
 
147
 *
 
148
 * Returns the unique ID of the server, as a newly-allocated string which must be freed by the caller.
 
149
 *
 
150
 * This ID is normally used by clients to tell when two IBusConnection would be equivalent
 
151
 * (because the server address passed to ibus_connection_open() will have the same guid in the two cases).
 
152
 * ibus_connection_open() can re-use an existing connection with the same ID instead of opening a new connection.
 
153
 *
 
154
 * This is an ID unique to each IBusServer. Remember that an IBusServer represents only one mode of connecting,
 
155
 * so e.g. a bus daemon can listen on multiple addresses which will mean it has multiple IBusServer each with
 
156
 * their own ID.
 
157
 *
 
158
 * The ID is not a UUID in the sense of RFC4122; the details are explained in the D-Bus specification.
 
159
 * Returns the address of the server, as a newly-allocated string which must be freed by the caller.
 
160
 */
74
161
const gchar     *ibus_server_get_id             (IBusServer     *server);
 
162
 
 
163
/**
 
164
 * ibus_server_is_connected:
 
165
 * @server: An IBusServer.
 
166
 * @returns: TRUE if the server is still listening for new connections; FALSE otherwise.
 
167
 *
 
168
 * Returns TRUE if the server is still listening for new connections.
 
169
 */
75
170
gboolean         ibus_server_is_connected       (IBusServer     *server);
 
171
 
 
172
/**
 
173
 * ibus_server_set_auth_mechanisms:
 
174
 * @server: An IBusServer.
 
175
 * @mechanisms: NULL-terminated array of mechanisms.
 
176
 * @returns:  TRUE if succeed; FALSE if insufficient memory.
 
177
 *
 
178
 * Sets the authentication mechanisms that this server offers to clients,
 
179
 * as a NULL-terminated array of mechanism names.
 
180
 *
 
181
 * This function only affects connections created after it is called.
 
182
 * Pass NULL instead of an array to use all available mechanisms (this is the default behavior).
 
183
 *
 
184
 * The D-Bus specification describes some of the supported mechanisms.
 
185
 */
76
186
gboolean         ibus_server_set_auth_mechanisms(IBusServer     *server,
77
187
                                                 const gchar   **mechanisms);
78
188