updated changelog
[platform/upstream/evolution-data-server.git] / addressbook / libegdbus / e-gdbus-book-view.h
1 /*
2  * e-gdbus-book-view.h
3  *
4  * This library is free software you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11  * for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, see <http://www.gnu.org/licenses/>.
15  *
16  *
17  * Copyright (C) 2011 Red Hat, Inc. (www.redhat.com)
18  *
19  */
20
21 #ifndef E_GDBUS_BOOK_VIEW_H
22 #define E_GDBUS_BOOK_VIEW_H
23
24 #include <gio/gio.h>
25
26 #include <libedataserver/libedataserver.h>
27
28 G_BEGIN_DECLS
29
30 #define E_TYPE_GDBUS_BOOK_VIEW         (e_gdbus_book_view_get_type ())
31 #define E_GDBUS_BOOK_VIEW(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_GDBUS_BOOK_VIEW, EGdbusBookView))
32 #define E_IS_GDBUS_BOOK_VIEW(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_GDBUS_BOOK_VIEW))
33 #define E_GDBUS_BOOK_VIEW_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE((o), E_TYPE_GDBUS_BOOK_VIEW, EGdbusBookViewIface))
34
35 /**
36  * EGdbusBookView:
37  *
38  * Opaque type representing a proxy or an exported object.
39  */
40 typedef struct _EGdbusBookView EGdbusBookView; /* Dummy typedef */
41 typedef struct _EGdbusBookViewIface EGdbusBookViewIface;
42
43 GType e_gdbus_book_view_get_type (void) G_GNUC_CONST;
44
45 /* ---------------------------------------------------------------------- */
46
47 typedef struct _EGdbusBookViewProxy EGdbusBookViewProxy;
48 typedef struct _EGdbusBookViewProxyClass EGdbusBookViewProxyClass;
49 typedef struct _EGdbusBookViewProxyPrivate EGdbusBookViewProxyPrivate;
50
51 struct _EGdbusBookViewProxy
52 {
53         GDBusProxy parent_instance;
54         EGdbusBookViewProxyPrivate *priv;
55 };
56
57 struct _EGdbusBookViewProxyClass
58 {
59         GDBusProxyClass parent_class;
60 };
61
62 #define E_TYPE_GDBUS_BOOK_VIEW_PROXY (e_gdbus_book_view_proxy_get_type ())
63 GType e_gdbus_book_view_proxy_get_type (void) G_GNUC_CONST;
64
65 void            e_gdbus_book_view_proxy_new (GDBusConnection *connection, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
66 EGdbusBookView *e_gdbus_book_view_proxy_new_finish (GAsyncResult  *result, GError **error);
67 EGdbusBookView *e_gdbus_book_view_proxy_new_sync (GDBusConnection *connection, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error);
68
69 void            e_gdbus_book_view_proxy_new_for_bus (GBusType bus_type, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
70 EGdbusBookView *e_gdbus_book_view_proxy_new_for_bus_finish (GAsyncResult  *result, GError **error);
71 EGdbusBookView *e_gdbus_book_view_proxy_new_for_bus_sync (GBusType bus_type, GDBusProxyFlags flags, const gchar *name, const gchar *object_path, GCancellable *cancellable, GError **error);
72
73 /* ---------------------------------------------------------------------- */
74
75 typedef struct _EGdbusBookViewStub EGdbusBookViewStub;
76 typedef struct _EGdbusBookViewStubClass EGdbusBookViewStubClass;
77 typedef struct _EGdbusBookViewStubPrivate EGdbusBookViewStubPrivate;
78
79 struct _EGdbusBookViewStub
80 {
81         GObject parent_instance;
82         EGdbusBookViewStubPrivate *priv;
83 };
84
85 struct _EGdbusBookViewStubClass
86 {
87         GObjectClass parent_class;
88 };
89
90 #define E_TYPE_GDBUS_BOOK_VIEW_STUB (e_gdbus_book_view_stub_get_type ())
91 GType e_gdbus_book_view_stub_get_type (void) G_GNUC_CONST;
92
93 EGdbusBookView *e_gdbus_book_view_stub_new (void);
94
95 guint e_gdbus_book_view_register_object (EGdbusBookView *object, GDBusConnection *connection, const gchar *object_path, GError **error);
96
97 void e_gdbus_book_view_drain_notify (EGdbusBookView *object);
98
99 const GDBusInterfaceInfo *e_gdbus_book_view_interface_info (void) G_GNUC_CONST;
100
101 struct _EGdbusBookViewIface
102 {
103         GTypeInterface parent_iface;
104
105         /* Signal handlers for receiving D-Bus signals: */
106         void (*objects_added)           (EGdbusBookView *object, const gchar * const *arg_objects);
107         void (*objects_modified)        (EGdbusBookView *object, const gchar * const *arg_objects);
108         void (*objects_removed)         (EGdbusBookView *object, const gchar * const *arg_uids);
109
110         void (*progress)                (EGdbusBookView *object, guint arg_percent, const gchar *arg_message);
111         void (*complete)                (EGdbusBookView *object, const gchar * const *arg_error);
112
113         /* Signal handlers for handling D-Bus method calls: */
114         gboolean (*handle_start)                (EGdbusBookView *object, GDBusMethodInvocation *invocation);
115         gboolean (*handle_stop)                 (EGdbusBookView *object, GDBusMethodInvocation *invocation);
116         gboolean (*handle_set_flags)            (EGdbusBookView *object, GDBusMethodInvocation *invocation, guint in_flags);
117         gboolean (*handle_dispose)              (EGdbusBookView *object, GDBusMethodInvocation *invocation);
118         gboolean (*handle_set_fields_of_interest)(EGdbusBookView *object, GDBusMethodInvocation *invocation, const gchar * const *in_only_fields);
119 };
120
121 /* D-Bus Methods */
122 void            e_gdbus_book_view_call_start            (GDBusProxy *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
123 gboolean        e_gdbus_book_view_call_start_finish     (GDBusProxy *proxy, GAsyncResult *result, GError **error);
124 gboolean        e_gdbus_book_view_call_start_sync       (GDBusProxy *proxy, GCancellable *cancellable, GError **error);
125
126 void            e_gdbus_book_view_call_stop             (GDBusProxy *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
127 gboolean        e_gdbus_book_view_call_stop_finish      (GDBusProxy *proxy, GAsyncResult *result, GError **error);
128 gboolean        e_gdbus_book_view_call_stop_sync        (GDBusProxy *proxy, GCancellable *cancellable, GError **error);
129
130 void            e_gdbus_book_view_call_set_flags        (GDBusProxy         *proxy,
131                                                          guint               in_flags,
132                                                          GCancellable       *cancellable,
133                                                          GAsyncReadyCallback callback,
134                                                          gpointer            user_data);
135 gboolean        e_gdbus_book_view_call_set_flags_finish (GDBusProxy         *proxy,
136                                                          GAsyncResult       *res,
137                                                          GError            **error);
138 gboolean        e_gdbus_book_view_call_set_flags_sync   (GDBusProxy         *proxy,
139                                                          guint               in_flags,
140                                                          GCancellable       *cancellable,
141                                                          GError            **error);
142
143 void            e_gdbus_book_view_call_dispose          (GDBusProxy *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
144 gboolean        e_gdbus_book_view_call_dispose_finish   (GDBusProxy *proxy, GAsyncResult *result, GError **error);
145 gboolean        e_gdbus_book_view_call_dispose_sync     (GDBusProxy *proxy, GCancellable *cancellable, GError **error);
146
147 void            e_gdbus_book_view_call_set_fields_of_interest           (GDBusProxy *proxy, const gchar * const *in_only_fileds, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
148 gboolean        e_gdbus_book_view_call_set_fields_of_interest_finish    (GDBusProxy *proxy, GAsyncResult *result, GError **error);
149 gboolean        e_gdbus_book_view_call_set_fields_of_interest_sync      (GDBusProxy *proxy, const gchar * const *in_only_fileds, GCancellable *cancellable, GError **error);
150
151 /* D-Bus Methods Completion Helpers */
152 #define e_gdbus_book_view_complete_start                        e_gdbus_complete_sync_method_void
153 #define e_gdbus_book_view_complete_stop                         e_gdbus_complete_sync_method_void
154 #define e_gdbus_book_view_complete_set_flags                    e_gdbus_complete_sync_method_void
155 #define e_gdbus_book_view_complete_dispose                      e_gdbus_complete_sync_method_void
156 #define e_gdbus_book_view_complete_set_fields_of_interest       e_gdbus_complete_sync_method_void
157
158 /* D-Bus Signal Emission Helpers */
159 void    e_gdbus_book_view_emit_objects_added    (EGdbusBookView *object, const gchar * const *arg_objects);
160 void    e_gdbus_book_view_emit_objects_modified (EGdbusBookView *object, const gchar * const *arg_objects);
161 void    e_gdbus_book_view_emit_objects_removed  (EGdbusBookView *object, const gchar * const *arg_uids);
162
163 void    e_gdbus_book_view_emit_progress         (EGdbusBookView *object, guint arg_percent, const gchar *arg_message);
164 void    e_gdbus_book_view_emit_complete         (EGdbusBookView *object, const gchar * const *arg_error);
165
166 G_END_DECLS
167
168 #endif /* E_GDBUS_BOOK_VIEW_H */