summaryrefslogtreecommitdiff
path: root/libzeitgeist/remote.vala
blob: fe253e295e0c621110d46e7399907bdefd5aa6b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/* remote.vala
 *
 * Copyright © 2011-2012 Collabora Ltd.
 *             By Siegfried-Angel Gevatter Pujals <siegfried@gevatter.com>
 * Copyright © 2011 Michal Hruby <michal.mhr@gmail.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

namespace Zeitgeist
{
    /**
     * Version struct consisting of the following fields:
     * - major
     * - minor
     * - minus
     */
    public struct VersionStruct
    {
        /**
         * Major version number.
         */
        int major;
        /**
         * Minor version number.
         */
        int minor;
        /**
         * Micro version number.
         */
        int micro;
    }

    [DBus (name = "org.gnome.zeitgeist.Log")]
    protected interface RemoteLog : Object
    {

        [DBus (signature = "(xx)")]
        public async abstract Variant delete_events (
            uint32[] event_ids,
            Cancellable? cancellable=null,
            BusName? sender=null
        ) throws Error;

        public async abstract uint32[] find_event_ids (
            [DBus (signature = "(xx)")] Variant time_range,
            [DBus (signature = "a(asaasay)")] Variant event_templates,
            uint storage_state, uint num_events, uint result_type,
            Cancellable? cancellable=null, BusName? sender=null
        ) throws Error;

        [DBus (signature = "a(asaasay)")]
        public async abstract Variant find_events (
            [DBus (signature = "(xx)")] Variant time_range,
            [DBus (signature = "a(asaasay)")] Variant event_templates,
            uint storage_state, uint num_events, uint result_type,
            Cancellable? cancellable=null, BusName? sender=null
        ) throws Error;

        public async abstract string[] find_related_uris (
            [DBus (signature = "(xx)")] Variant time_range,
            [DBus (signature = "a(asaasay)")] Variant event_templates,
            [DBus (signature = "a(asaasay)")] Variant result_event_templates,
            uint storage_state, uint num_events, uint result_type,
            Cancellable? cancellable=null, BusName? sender=null
        ) throws Error;

        [DBus (signature = "a(asaasay)")]
        public async abstract Variant get_events (
            uint32[] event_ids,
            Cancellable? cancellable=null,
            BusName? sender=null
        ) throws Error;

        public async abstract uint32[] insert_events (
            [DBus (signature = "a(asaasay)")] Variant events,
            Cancellable? cancellable=null,
            BusName? sender=null
        ) throws Error;

        public async abstract void install_monitor (
            ObjectPath monitor_path,
            [DBus (signature = "(xx)")] Variant time_range,
            [DBus (signature = "a(asaasay)")] Variant event_templates,
            BusName? owner=null
        ) throws Error;

        public async abstract void remove_monitor (
            ObjectPath monitor_path,
            BusName? owner=null
        ) throws Error;

        public async abstract void quit (
            Cancellable? cancellable=null
        ) throws Error;

        [DBus (name = "extensions")]
        public abstract string[] extensions { owned get; }

        [DBus (name = "version")]
        public abstract VersionStruct version { owned get; }

        [DBus (name = "datapath")]
        public abstract string datapath { owned get; }

    }

    [DBus (name = "org.gnome.zeitgeist.Monitor")]
    protected interface RemoteMonitor : Object
    {

        public async abstract void notify_insert (
            [DBus (signature = "(xx)")] Variant time_range,
            [DBus (signature = "a(asaasay)")] Variant events
        ) throws Error;

        public async abstract void notify_delete (
            [DBus (signature = "(xx)")] Variant time_range,
            uint32[] event_ids
        ) throws IOError;

    }

    [DBus (name = "org.gnome.zeitgeist.Index")]
    protected interface RemoteSimpleIndexer : Object
    {
        public abstract async void search (
            string query_string,
            [DBus (signature = "(xx)")] Variant time_range,
            [DBus (signature = "a(asaasay)")] Variant filter_templates,
            uint offset, uint count, uint result_type,
            [DBus (signature = "a(asaasay)")] out Variant events,
            out uint matches, Cancellable? cancellable=null) throws Error;
        public abstract async void search_with_relevancies (
            string query_string,
            [DBus (signature = "(xx)")] Variant time_range,
            [DBus (signature = "a(asaasay)")] Variant filter_templates,
            uint storage_state, uint offset, uint count, uint result_type,
            [DBus (signature = "a(asaasay)")] out Variant events,
            out double[] relevancies, out uint matches,
            Cancellable? cancellable=null) throws Error;
    }

    /* FIXME: Remove this! Only here because of a bug
              in Vala (Vala Bug #661361) */
    [DBus (name = "org.freedesktop.NetworkManager")]
    protected interface NetworkManagerDBus : Object
    {
        [DBus (name = "state")]
        public abstract uint32 state () throws IOError;
        public signal void state_changed (uint32 state);
    }

    /* FIXME: Remove this! Only here because of a bug
              in Vala (Vala Bug #661361) */
    [DBus (name = "net.connman.Manager")]
    protected interface ConnmanManagerDBus : Object
    {
        public abstract string get_state () throws IOError;
        public signal void state_changed (string state);
    }

}

// vim:expandtab:ts=4:sw=4