build,core,plugins: Port to GDBus and GVariant
[profile/ivi/rygel.git] / src / plugins / external / rygel-external-interfaces.vala
1 /*
2  * Copyright (C) 2009,2010 Nokia Corporation.
3  *
4  * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
5  *                               <zeeshan.ali@nokia.com>
6  *
7  * This file is part of Rygel.
8  *
9  * Rygel is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Rygel is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22  */
23
24 [DBus (name = "org.gnome.UPnP.MediaObject2")]
25 public interface Rygel.External.MediaObjectProxy : DBusProxy {
26     public static const string IFACE = "org.gnome.UPnP.MediaObject2";
27     public static const string[] PROPERTIES = { "Parent",
28                                                 "Type",
29                                                 "Path",
30                                                 "DisplayName" };
31
32     public abstract ObjectPath parent { owned get; set; }
33     public abstract string display_name { owned get; set; }
34     [DBus (name = "Type")]
35     public abstract string object_type { owned get; set; }
36 }
37
38 [DBus (name = "org.gnome.UPnP.MediaContainer2")]
39 public interface Rygel.External.MediaContainerProxy : DBusProxy,
40                                                       MediaObjectProxy {
41     public static const string IFACE = "org.gnome.UPnP.MediaContainer2";
42     public static const string[] PROPERTIES = { "ChildCount", "Searchable" };
43
44     public abstract signal void updated ();
45
46     public abstract uint child_count { get; set; }
47     public abstract uint item_count { get; set; }
48     public abstract uint container_count { get; set; }
49     public abstract bool searchable { get; set; }
50
51     public abstract async HashTable<string,Variant>[] list_children (
52                                         uint     offset,
53                                         uint     max_count,
54                                         string[] filter) throws IOError;
55     public abstract async HashTable<string,Variant>[] list_containers (
56                                         uint     offset,
57                                         uint     max_count,
58                                         string[] filter) throws IOError;
59     public abstract async HashTable<string,Variant>[] list_items (
60                                         uint     offset,
61                                         uint     max_count,
62                                         string[] filter) throws IOError;
63
64     // Optional API
65     public abstract async HashTable<string,Variant>[] search_objects (
66                                         string   query,
67                                         uint     offset,
68                                         uint     max_count,
69                                         string[] filter) throws IOError;
70
71     public abstract ObjectPath icon { owned get; set; }
72 }
73
74 [DBus (name = "org.gnome.UPnP.MediaItem2")]
75 public interface Rygel.External.MediaItemProxy : DBusProxy, MediaObjectProxy {
76     public static const string IFACE = "org.gnome.UPnP.MediaItem2";
77     public static const string[] PROPERTIES = { "URLs",
78                                                 "MIMEType",
79                                                 "DLNAProfile",
80                                                 "Size",
81                                                 "Artist",
82                                                 "Album",
83                                                 "Date",
84                                                 "Duration",
85                                                 "Bitrate",
86                                                 "SampleRate",
87                                                 "BitsPerSample",
88                                                 "Width",
89                                                 "Height",
90                                                 "ColorDepth",
91                                                 "PixelWidth",
92                                                 "PixelHeight",
93                                                 "Thumbnail",
94                                                 "AlbumArt" };
95
96     [DBus (name = "URLs")]
97     public abstract string[] urls { owned get; set; }
98     public abstract string mime_type { owned get; set; }
99
100     // Optional API
101     public abstract int size { get; set; }
102     public abstract string artist { owned get; set; }
103     public abstract string album { owned get; set; }
104     public abstract string date { owned get; set; }
105     public abstract string genre { owned get; set; }
106     public abstract string dlna_profile { owned get; set; }
107
108     // video and audio/music
109     // in seconds
110     public abstract int duration { get; set; }
111     // in bytes/second (braindead, yes but tell that to UPnP authors)
112     public abstract int bitrate { get; set; }
113     public abstract int sample_rate { get; set; }
114     public abstract int bits_per_sample { get; set; }
115
116     // video and images
117     public abstract int width { get; set; }
118     public abstract int height { get; set; }
119     public abstract int color_depth { get; set; }
120     public abstract ObjectPath thumbnail { owned get; set; }
121
122     // audio and music
123     public abstract ObjectPath album_art { owned get; set; }
124 }
125