11055
|
1 /**
|
|
2 * @file dbus-server.h Gaim DBUS Server
|
|
3 * @ingroup core
|
|
4 *
|
|
5 * gaim
|
|
6 *
|
|
7 * Gaim is the legal property of its developers, whose names are too numerous
|
|
8 * to list here. Please refer to the COPYRIGHT file distributed with this
|
|
9 * source distribution.
|
|
10 *
|
|
11 * This program is free software; you can redistribute it and/or modify
|
|
12 * it under the terms of the GNU General Public License as published by
|
|
13 * the Free Software Foundation; either version 2 of the License, or
|
|
14 * (at your option) any later version.
|
|
15 *
|
|
16 * This program is distributed in the hope that it will be useful,
|
|
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19 * GNU General Public License for more details.
|
|
20 *
|
|
21 * You should have received a copy of the GNU General Public License
|
|
22 * along with this program; if not, write to the Free Software
|
|
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
24 *
|
|
25 */
|
|
26
|
|
27 #ifndef _GAIM_DBUS_SERVER_H_
|
|
28 #define _GAIM_DBUS_SERVER_H_
|
|
29
|
11067
|
30
|
11055
|
31 G_BEGIN_DECLS
|
|
32
|
11067
|
33 /* These are the categories of codes used by gaim dbus implementation
|
|
34 for remote calls. In practice, they don't matter
|
|
35 */
|
|
36 typedef enum {
|
|
37 DBUS_ERROR_NONE = 0,
|
|
38 DBUS_ERROR_NOT_FOUND = 1
|
|
39 } DbusErrorCodes;
|
|
40
|
|
41 /* Types of pointers that can be registered with the gaim dbus pointer
|
|
42 registration engine. See below */
|
|
43 typedef enum {
|
|
44 DBUS_POINTER_GROUP,
|
|
45 DBUS_POINTER_CONTACT,
|
|
46 DBUS_POINTER_BUDDY,
|
|
47 DBUS_POINTER_CHAT,
|
|
48 DBUS_POINTER_ACCOUNT
|
|
49 } GaimDBusPointerType;
|
|
50
|
|
51
|
11055
|
52 /**
|
|
53 * Starts the gaim DBUS server. It is responsible for handling DBUS
|
|
54 * requests from other applications.
|
|
55 *
|
|
56 * @return TRUE if successful, FALSE otherwise.
|
|
57 */
|
|
58 gboolean dbus_server_init(void);
|
|
59
|
11067
|
60 /**
|
|
61 Initializes gaim dbus pointer registration engine.
|
|
62
|
|
63 Remote dbus applications need a way of addressing objects exposed
|
|
64 by gaim to the outside world. In gaim itself, these objects (such
|
|
65 as GaimBuddy and company) are identified by pointers. The gaim
|
|
66 dbus pointer registration engine converts pointers to handles and
|
|
67 back.
|
|
68
|
|
69 In order for an object to participate in the scheme, it must
|
|
70 register itself and its type with the engine. This registration
|
|
71 allocates an integer id which can be resolved to the pointer and
|
|
72 back.
|
|
73
|
|
74 Handles are not persistent. They are reissued every time gaim is
|
|
75 started. This is not good; external applications that use gaim
|
|
76 should work even whether gaim was restarted in the middle of the
|
|
77 interaction.
|
|
78
|
|
79 Pointer registration is only a temporary solution. When GaimBuddy
|
|
80 and similar structures have been converted into gobjects, this
|
|
81 registration will be done automatically by objects themselves.
|
|
82
|
|
83 By the way, this kind of object-handle translation should be so
|
|
84 common that there must be a library (maybe even glib) that
|
|
85 implements it. I feel a bit like reinventing the wheel here.
|
|
86 */
|
|
87 void gaim_dbus_init_ids(void);
|
|
88
|
|
89 /**
|
|
90 Registers a typed pointer.
|
|
91
|
|
92 @node The pointer to register.
|
|
93 @type Type of that pointer.
|
|
94 */
|
|
95 void gaim_dbus_register_pointer(gpointer node, GaimDBusPointerType type);
|
|
96
|
|
97 /**
|
|
98 Unregisters a pointer previously registered with
|
|
99 gaim_dbus_register_pointer.
|
|
100
|
|
101 @node The pointer to register.
|
|
102 */
|
|
103 void gaim_dbus_unregister_pointer(gpointer node);
|
|
104
|
|
105
|
11055
|
106 G_END_DECLS
|
|
107
|
|
108 #endif /* _GAIM_DBUS_SERVER_H_ */
|