1 /*
2  * channel-dispatch-operation.h - proxy for channels awaiting approval
3  *
4  * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
5  * Copyright (C) 2009 Nokia Corporation
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21 
22 #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION)
23 #error "Only <telepathy-glib/telepathy-glib.h> and <telepathy-glib/telepathy-glib-dbus.h> can be included directly."
24 #endif
25 
26 #ifndef TP_CHANNEL_DISPATCH_OPERATION_H
27 #define TP_CHANNEL_DISPATCH_OPERATION_H
28 
29 #include <telepathy-glib/account.h>
30 #include <telepathy-glib/base-client.h>
31 #include <telepathy-glib/connection.h>
32 #include <telepathy-glib/dbus.h>
33 #include <telepathy-glib/defs.h>
34 #include <telepathy-glib/proxy.h>
35 
36 G_BEGIN_DECLS
37 
38 
39 /* TpChannelDispatchOperation is defined in base-client.h */
40 typedef struct _TpChannelDispatchOperationClass
41     TpChannelDispatchOperationClass;
42 typedef struct _TpChannelDispatchOperationPrivate
43     TpChannelDispatchOperationPrivate;
44 typedef struct _TpChannelDispatchOperationClassPrivate
45     TpChannelDispatchOperationClassPrivate;
46 
47 struct _TpChannelDispatchOperation {
48     /*<private>*/
49     TpProxy parent;
50     TpChannelDispatchOperationPrivate *priv;
51 };
52 
53 struct _TpChannelDispatchOperationClass {
54     /*<private>*/
55     TpProxyClass parent_class;
56     GCallback _padding[7];
57     TpChannelDispatchOperationClassPrivate *priv;
58 };
59 
60 GType tp_channel_dispatch_operation_get_type (void);
61 
62 #define TP_TYPE_CHANNEL_DISPATCH_OPERATION \
63   (tp_channel_dispatch_operation_get_type ())
64 #define TP_CHANNEL_DISPATCH_OPERATION(obj) \
65   (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CHANNEL_DISPATCH_OPERATION, \
66                                TpChannelDispatchOperation))
67 #define TP_CHANNEL_DISPATCH_OPERATION_CLASS(klass) \
68   (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CHANNEL_DISPATCH_OPERATION, \
69                             TpChannelDispatchOperationClass))
70 #define TP_IS_CHANNEL_DISPATCH_OPERATION(obj) \
71   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CHANNEL_DISPATCH_OPERATION))
72 #define TP_IS_CHANNEL_DISPATCH_OPERATION_CLASS(klass) \
73   (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CHANNEL_DISPATCH_OPERATION))
74 #define TP_CHANNEL_DISPATCH_OPERATION_GET_CLASS(obj) \
75   (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CHANNEL_DISPATCH_OPERATION, \
76                               TpChannelDispatchOperationClass))
77 
78 #ifndef TP_DISABLE_DEPRECATED
79 _TP_DEPRECATED_IN_0_20
80 TpChannelDispatchOperation *tp_channel_dispatch_operation_new (
81     TpDBusDaemon *bus_daemon, const gchar *object_path,
82     GHashTable *immutable_properties, GError **error)
83   G_GNUC_WARN_UNUSED_RESULT;
84 #endif
85 
86 void tp_channel_dispatch_operation_init_known_interfaces (void);
87 
88 #define TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE \
89   tp_channel_dispatch_operation_get_feature_quark_core ()
90 
91 GQuark tp_channel_dispatch_operation_get_feature_quark_core (void) G_GNUC_CONST;
92 
93 #ifndef TP_DISABLE_DEPRECATED
94 _TP_DEPRECATED_IN_0_20_FOR(tp_channel_dispatch_operation_get_connection)
95 TpConnection * tp_channel_dispatch_operation_borrow_connection (
96     TpChannelDispatchOperation *self);
97 
98 _TP_DEPRECATED_IN_0_20_FOR(tp_channel_dispatch_operation_get_account)
99 TpAccount * tp_channel_dispatch_operation_borrow_account (
100     TpChannelDispatchOperation *self);
101 
102 _TP_DEPRECATED_IN_0_20_FOR(tp_channel_dispatch_operation_get_channels)
103 GPtrArray * tp_channel_dispatch_operation_borrow_channels (
104     TpChannelDispatchOperation *self);
105 
106 _TP_DEPRECATED_IN_0_20_FOR(tp_channel_dispatch_operation_get_possible_handlers)
107 GStrv tp_channel_dispatch_operation_borrow_possible_handlers (
108     TpChannelDispatchOperation *self);
109 
110 _TP_DEPRECATED_IN_0_20
111 GHashTable * tp_channel_dispatch_operation_borrow_immutable_properties (
112     TpChannelDispatchOperation *self);
113 #endif
114 
115 _TP_AVAILABLE_IN_0_20
116 TpConnection * tp_channel_dispatch_operation_get_connection (
117     TpChannelDispatchOperation *self);
118 
119 _TP_AVAILABLE_IN_0_20
120 TpAccount * tp_channel_dispatch_operation_get_account (
121     TpChannelDispatchOperation *self);
122 
123 _TP_AVAILABLE_IN_0_20
124 GPtrArray * tp_channel_dispatch_operation_get_channels (
125     TpChannelDispatchOperation *self);
126 
127 _TP_AVAILABLE_IN_0_20
128 GStrv tp_channel_dispatch_operation_get_possible_handlers (
129     TpChannelDispatchOperation *self);
130 
131 void tp_channel_dispatch_operation_handle_with_async (
132     TpChannelDispatchOperation *self,
133     const gchar *handler,
134     GAsyncReadyCallback callback,
135     gpointer user_data);
136 
137 gboolean tp_channel_dispatch_operation_handle_with_finish (
138     TpChannelDispatchOperation *self,
139     GAsyncResult *result,
140     GError **error);
141 
142 void tp_channel_dispatch_operation_claim_async (
143     TpChannelDispatchOperation *self,
144     GAsyncReadyCallback callback,
145     gpointer user_data);
146 
147 gboolean tp_channel_dispatch_operation_claim_finish (
148     TpChannelDispatchOperation *self,
149     GAsyncResult *result,
150     GError **error);
151 
152 void tp_channel_dispatch_operation_handle_with_time_async (
153     TpChannelDispatchOperation *self,
154     const gchar *handler,
155     gint64 user_action_time,
156     GAsyncReadyCallback callback,
157     gpointer user_data);
158 
159 gboolean tp_channel_dispatch_operation_handle_with_time_finish (
160     TpChannelDispatchOperation *self,
161     GAsyncResult *result,
162     GError **error);
163 
164 _TP_AVAILABLE_IN_0_16
165 void tp_channel_dispatch_operation_claim_with_async (
166     TpChannelDispatchOperation *self,
167     TpBaseClient *client,
168     GAsyncReadyCallback callback,
169     gpointer user_data);
170 
171 _TP_AVAILABLE_IN_0_16
172 gboolean tp_channel_dispatch_operation_claim_with_finish (
173     TpChannelDispatchOperation *self,
174     GAsyncResult *result,
175     GError **error);
176 
177 /* Reject API */
178 
179 _TP_AVAILABLE_IN_0_16
180 void tp_channel_dispatch_operation_close_channels_async (
181     TpChannelDispatchOperation *self,
182     GAsyncReadyCallback callback,
183     gpointer user_data);
184 
185 _TP_AVAILABLE_IN_0_16
186 gboolean tp_channel_dispatch_operation_close_channels_finish (
187     TpChannelDispatchOperation *self,
188     GAsyncResult *result,
189     GError **error);
190 
191 _TP_AVAILABLE_IN_0_16
192 void tp_channel_dispatch_operation_leave_channels_async (
193     TpChannelDispatchOperation *self,
194     TpChannelGroupChangeReason reason,
195     const gchar *message,
196     GAsyncReadyCallback callback,
197     gpointer user_data);
198 
199 _TP_AVAILABLE_IN_0_16
200 gboolean tp_channel_dispatch_operation_leave_channels_finish (
201     TpChannelDispatchOperation *self,
202     GAsyncResult *result,
203     GError **error);
204 
205 _TP_AVAILABLE_IN_0_16
206 void tp_channel_dispatch_operation_destroy_channels_async (
207     TpChannelDispatchOperation *self,
208     GAsyncReadyCallback callback,
209     gpointer user_data);
210 
211 _TP_AVAILABLE_IN_0_16
212 gboolean tp_channel_dispatch_operation_destroy_channels_finish (
213     TpChannelDispatchOperation *self,
214     GAsyncResult *result,
215     GError **error);
216 
217 G_END_DECLS
218 
219 #include <telepathy-glib/_gen/tp-cli-channel-dispatch-operation.h>
220 
221 #endif
222