1 /*
2  * Copyright (C) 2004 Free Software Foundation, Inc.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, see <http://www.gnu.org/licenses/>.
16  *
17  * Authors:
18  *     Mark McLoughlin  <mark@skynet.ie>
19  *     William Jon McCann  <mccann@jhu.edu>
20  *     Martin Grimme  <martin@pycage.de>
21  *     Christian Kellner  <gicmo@xatom.net>
22  */
23 
24 #ifndef __CALENDAR_SOURCES_H__
25 #define __CALENDAR_SOURCES_H__
26 
27 #include <glib-object.h>
28 
29 #define EDS_DISABLE_DEPRECATED
30 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
31 #include <libedataserver/libedataserver.h>
32 #include <libecal/libecal.h>
33 G_GNUC_END_IGNORE_DEPRECATIONS
34 
35 G_BEGIN_DECLS
36 
37 #define CALENDAR_TYPE_SOURCES (calendar_sources_get_type ())
38 G_DECLARE_FINAL_TYPE (CalendarSources, calendar_sources,
39                       CALENDAR, SOURCES, GObject)
40 
41 CalendarSources *calendar_sources_get                (void);
42 ESourceRegistry *calendar_sources_get_registry       (CalendarSources *sources);
43 GSList          *calendar_sources_ref_clients        (CalendarSources *sources);
44 gboolean         calendar_sources_has_clients        (CalendarSources *sources);
45 
46 void             calendar_sources_connect_client     (CalendarSources *sources,
47                                                       ESource *source,
48                                                       ECalClientSourceType source_type,
49                                                       guint32 wait_for_connected_seconds,
50                                                       GCancellable *cancellable,
51                                                       GAsyncReadyCallback callback,
52                                                       gpointer user_data);
53 EClient         *calendar_sources_connect_client_finish
54                                                      (CalendarSources *sources,
55                                                       GAsyncResult *result,
56                                                       GError **error);
57 
58 /* Set the environment variable CALENDAR_SERVER_DEBUG to show debug */
59 void            print_debug                          (const gchar *str,
60                                                       ...) G_GNUC_PRINTF (1, 2);
61 
62 G_END_DECLS
63 
64 #endif /* __CALENDAR_SOURCES_H__ */
65