1 /* vi: set et sw=4 ts=8 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */
3 /*
4  * Mission Control client proxy.
5  *
6  * Copyright (C) 2009-2010 Nokia Corporation
7  * Copyright (C) 2009-2010 Collabora Ltd.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23  *
24  */
25 
26 #ifndef MCD_CLIENT_PRIV_H
27 #define MCD_CLIENT_PRIV_H
28 
29 #include <glib.h>
30 #include <glib-object.h>
31 
32 #include <telepathy-glib/telepathy-glib.h>
33 #include <telepathy-glib/telepathy-glib-dbus.h>
34 
35 G_BEGIN_DECLS
36 
37 typedef struct _McdClientProxy McdClientProxy;
38 typedef struct _McdClientProxyClass McdClientProxyClass;
39 typedef struct _McdClientProxyPrivate McdClientProxyPrivate;
40 
41 struct _McdClientProxy
42 {
43   TpClient parent;
44   McdClientProxyPrivate *priv;
45 };
46 
47 struct _McdClientProxyClass
48 {
49   TpClientClass parent_class;
50 };
51 
52 G_GNUC_INTERNAL GType _mcd_client_proxy_get_type (void);
53 
54 #define MCD_TYPE_CLIENT_PROXY \
55   (_mcd_client_proxy_get_type ())
56 #define MCD_CLIENT_PROXY(obj) \
57   (G_TYPE_CHECK_INSTANCE_CAST ((obj), MCD_TYPE_CLIENT_PROXY, \
58                                McdClientProxy))
59 #define MCD_CLIENT_PROXY_CLASS(klass) \
60   (G_TYPE_CHECK_CLASS_CAST ((klass), MCD_TYPE_CLIENT_PROXY, \
61                             McdClientProxyClass))
62 #define MCD_IS_CLIENT_PROXY(obj) \
63   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MCD_TYPE_CLIENT_PROXY))
64 #define MCD_IS_CLIENT_PROXY_CLASS(klass) \
65   (G_TYPE_CHECK_CLASS_TYPE ((klass), MCD_TYPE_CLIENT_PROXY))
66 #define MCD_CLIENT_PROXY_GET_CLASS(obj) \
67   (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_CLIENT_PROXY, \
68                               McdClientProxyClass))
69 
70 G_GNUC_INTERNAL McdClientProxy *_mcd_client_proxy_new (
71     TpDBusDaemon *dbus_daemon,
72     const gchar *well_known_name,
73     const gchar *unique_name_if_known,
74     gboolean activatable);
75 
76 G_GNUC_INTERNAL gboolean _mcd_client_proxy_is_ready (McdClientProxy *self);
77 
78 G_GNUC_INTERNAL gboolean _mcd_client_check_valid_name (
79     const gchar *name_suffix, GError **error);
80 
81 G_GNUC_INTERNAL gboolean _mcd_client_proxy_is_active (McdClientProxy *self);
82 G_GNUC_INTERNAL gboolean _mcd_client_proxy_is_activatable
83     (McdClientProxy *self);
84 G_GNUC_INTERNAL const gchar *_mcd_client_proxy_get_unique_name (
85     McdClientProxy *self);
86 
87 G_GNUC_INTERNAL void _mcd_client_proxy_set_inactive (McdClientProxy *self);
88 G_GNUC_INTERNAL void _mcd_client_proxy_set_active (McdClientProxy *self,
89                                                    const gchar *unique_name);
90 G_GNUC_INTERNAL void _mcd_client_proxy_set_activatable (McdClientProxy *self);
91 
92 G_GNUC_INTERNAL const GList *_mcd_client_proxy_get_approver_filters
93     (McdClientProxy *self);
94 G_GNUC_INTERNAL const GList *_mcd_client_proxy_get_observer_filters
95     (McdClientProxy *self);
96 G_GNUC_INTERNAL const GList *_mcd_client_proxy_get_handler_filters
97     (McdClientProxy *self);
98 G_GNUC_INTERNAL gboolean _mcd_client_proxy_get_bypass_approval
99     (McdClientProxy *self);
100 G_GNUC_INTERNAL gboolean _mcd_client_proxy_get_bypass_observers
101     (McdClientProxy *self);
102 G_GNUC_INTERNAL gboolean _mcd_client_proxy_get_delay_approvers
103     (McdClientProxy *self);
104 
105 G_GNUC_INTERNAL GValueArray *_mcd_client_proxy_dup_handler_capabilities (
106     McdClientProxy *self);
107 
108 G_GNUC_INTERNAL void _mcd_client_proxy_inc_ready_lock (McdClientProxy *self);
109 G_GNUC_INTERNAL void _mcd_client_proxy_dec_ready_lock (McdClientProxy *self);
110 
111 #define MC_CLIENT_BUS_NAME_BASE_LEN (sizeof (TP_CLIENT_BUS_NAME_BASE) - 1)
112 
113 G_GNUC_INTERNAL guint _mcd_client_match_filters (
114     GVariant *channel_properties, const GList *filters,
115     gboolean assume_requested);
116 
117 G_GNUC_INTERNAL void _mcd_client_proxy_handle_channels (McdClientProxy *self,
118     gint timeout_ms, const GList *channels,
119     gint64 user_action_time, GHashTable *handler_info,
120     tp_cli_client_handler_callback_for_handle_channels callback,
121     gpointer user_data, GDestroyNotify destroy, GObject *weak_object);
122 
123 G_GNUC_INTERNAL void _mcd_client_recover_observer (McdClientProxy *self,
124     TpChannel *channel, const gchar *account_path);
125 
126 G_END_DECLS
127 
128 #endif
129