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.
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
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/>.
17 * Copyright (C) 2011 Red Hat, Inc. (www.redhat.com)
21 #ifndef E_GDBUS_BOOK_VIEW_H
22 #define E_GDBUS_BOOK_VIEW_H
26 #include <libedataserver/libedataserver.h>
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))
38 * Opaque type representing a proxy or an exported object.
40 typedef struct _EGdbusBookView EGdbusBookView; /* Dummy typedef */
41 typedef struct _EGdbusBookViewIface EGdbusBookViewIface;
43 GType e_gdbus_book_view_get_type (void) G_GNUC_CONST;
45 /* ---------------------------------------------------------------------- */
47 typedef struct _EGdbusBookViewProxy EGdbusBookViewProxy;
48 typedef struct _EGdbusBookViewProxyClass EGdbusBookViewProxyClass;
49 typedef struct _EGdbusBookViewProxyPrivate EGdbusBookViewProxyPrivate;
51 struct _EGdbusBookViewProxy
53 GDBusProxy parent_instance;
54 EGdbusBookViewProxyPrivate *priv;
57 struct _EGdbusBookViewProxyClass
59 GDBusProxyClass parent_class;
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;
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);
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);
73 /* ---------------------------------------------------------------------- */
75 typedef struct _EGdbusBookViewStub EGdbusBookViewStub;
76 typedef struct _EGdbusBookViewStubClass EGdbusBookViewStubClass;
77 typedef struct _EGdbusBookViewStubPrivate EGdbusBookViewStubPrivate;
79 struct _EGdbusBookViewStub
81 GObject parent_instance;
82 EGdbusBookViewStubPrivate *priv;
85 struct _EGdbusBookViewStubClass
87 GObjectClass parent_class;
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;
93 EGdbusBookView *e_gdbus_book_view_stub_new (void);
95 guint e_gdbus_book_view_register_object (EGdbusBookView *object, GDBusConnection *connection, const gchar *object_path, GError **error);
97 void e_gdbus_book_view_drain_notify (EGdbusBookView *object);
99 const GDBusInterfaceInfo *e_gdbus_book_view_interface_info (void) G_GNUC_CONST;
101 struct _EGdbusBookViewIface
103 GTypeInterface parent_iface;
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);
110 void (*progress) (EGdbusBookView *object, guint arg_percent, const gchar *arg_message);
111 void (*complete) (EGdbusBookView *object, const gchar * const *arg_error);
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);
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);
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);
130 void e_gdbus_book_view_call_set_flags (GDBusProxy *proxy,
132 GCancellable *cancellable,
133 GAsyncReadyCallback callback,
135 gboolean e_gdbus_book_view_call_set_flags_finish (GDBusProxy *proxy,
138 gboolean e_gdbus_book_view_call_set_flags_sync (GDBusProxy *proxy,
140 GCancellable *cancellable,
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);
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);
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
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);
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);
168 #endif /* E_GDBUS_BOOK_VIEW_H */