~ubuntu-branches/ubuntu/precise/libzeitgeist/precise-proposed

« back to all changes in this revision

Viewing changes to src/zeitgeist-data-source-registry.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-08-02 18:22:32 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100802182232-47ohrpyfxep802pr
Tags: 0.2.3-0ubuntu1
* New upstream release.
  - New API to talk to the Data Source Registry extension of Zeitgeist
    (Michal Hruby)
  - A new "connected" property on ZeitgeistLog telling you whether or
    not the Zeitgeist daemon is running (Michal Hruby)
  - Fix a crasher when finalizing a ZeitgeistLog with active monitors
    installed (Michal Hruby)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2010 Canonical, Ltd.
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License
 
6
 * version 3.0 as published by the Free Software Foundation.
 
7
 *
 
8
 * This library is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License version 3.0 for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public
 
14
 * License along with this library. If not, see
 
15
 * <http://www.gnu.org/licenses/>.
 
16
 *
 
17
 * Authored by: Michal Hruby <michal.mhr@gmail.com>
 
18
 */
 
19
 
 
20
#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
 
21
#error "Only <zeitgeist.h> can be included directly."
 
22
#endif
 
23
 
 
24
#ifndef _ZEITGEIST_DATA_SOURCE_REGISTRY_H_
 
25
#define _ZEITGEIST_DATA_SOURCE_REGISTRY_H_
 
26
 
 
27
#include <glib.h>
 
28
#include <glib-object.h>
 
29
#include <gio/gio.h>
 
30
#include <zeitgeist-event.h>
 
31
#include <zeitgeist-enums.h>
 
32
#include <zeitgeist-data-source.h>
 
33
 
 
34
G_BEGIN_DECLS
 
35
 
 
36
#define ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY         (zeitgeist_data_source_registry_get_type())
 
37
#define ZEITGEIST_DATA_SOURCE_REGISTRY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY, ZeitgeistDataSourceRegistry))
 
38
#define ZEITGEIST_DATA_SOURCE_REGISTRY_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY, ZeitgeistDataSourceRegistryClass))
 
39
#define ZEITGEIST_DATA_SOURCE_REGISTRY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY, ZeitgeistDataSourceRegistryClass))
 
40
#define ZEITGEIST_IS_DATA_SOURCE_REGISTRY(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY))
 
41
#define ZEITGEIST_IS_DATA_SOURCE_REGISTRY_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY))
 
42
 
 
43
typedef struct _ZeitgeistDataSourceRegistry ZeitgeistDataSourceRegistry;
 
44
typedef struct _ZeitgeistDataSourceRegistryClass ZeitgeistDataSourceRegistryClass;
 
45
 
 
46
struct _ZeitgeistDataSourceRegistryClass
 
47
{
 
48
  GObjectClass parent_class;
 
49
 
 
50
  void (*source_registered)   (ZeitgeistDataSourceRegistry *registry,
 
51
                               ZeitgeistDataSource *source);
 
52
  void (*source_disconnected) (ZeitgeistDataSourceRegistry *registry,
 
53
                               ZeitgeistDataSource *source);
 
54
  void (*source_enabled)      (ZeitgeistDataSourceRegistry *registry,
 
55
                               gchar *unique_id,
 
56
                               gboolean enabled);
 
57
};
 
58
 
 
59
 
 
60
struct _ZeitgeistDataSourceRegistry
 
61
{
 
62
  GObject parent_instance;
 
63
};
 
64
 
 
65
GType        zeitgeist_data_source_registry_get_type  (void);
 
66
 
 
67
ZeitgeistDataSourceRegistry* zeitgeist_data_source_registry_new  (void);
 
68
 
 
69
void         zeitgeist_data_source_registry_get_data_sources  (
 
70
                                     ZeitgeistDataSourceRegistry *self,
 
71
                                     GCancellable                *cancellable,
 
72
                                     GAsyncReadyCallback          callback,
 
73
                                     gpointer                     user_data);
 
74
 
 
75
GPtrArray*   zeitgeist_data_source_registry_get_data_sources_finish (
 
76
                                     ZeitgeistDataSourceRegistry *self,
 
77
                                     GAsyncResult                *res,
 
78
                                     GError                     **error);
 
79
 
 
80
void         zeitgeist_data_source_registry_register_data_source (
 
81
                                     ZeitgeistDataSourceRegistry *self,
 
82
                                     ZeitgeistDataSource         *source,
 
83
                                     GCancellable                *cancellable,
 
84
                                     GAsyncReadyCallback          callback,
 
85
                                     gpointer                     user_data);
 
86
 
 
87
gboolean     zeitgeist_data_source_registry_register_data_source_finish (
 
88
                                     ZeitgeistDataSourceRegistry *self,
 
89
                                     GAsyncResult                *res,
 
90
                                     GError                     **error);
 
91
 
 
92
void         zeitgeist_data_source_registry_set_data_source_enabled (
 
93
                                     ZeitgeistDataSourceRegistry *self,
 
94
                                     const gchar                 *unique_id,
 
95
                                     gboolean                     enabled,
 
96
                                     GCancellable                *cancellable,
 
97
                                     GAsyncReadyCallback          callback,
 
98
                                     gpointer                     user_data);
 
99
 
 
100
void         zeitgeist_data_source_registry_set_data_source_enabled_finish (
 
101
                                     ZeitgeistDataSourceRegistry *self,
 
102
                                     GAsyncResult                *res,
 
103
                                     GError                     **error);
 
104
 
 
105
G_END_DECLS
 
106
 
 
107
#endif /* _ZEITGEIST_DATA_SOURCE_REGISTRY_H_ */
 
108