Initial commit - version 0.0.1
[beifahrer] / vapi / libhildonmime.vapi
1 [CCode (cheader_filename = "hildon-uri.h")]
2 namespace Hildon {
3
4         [CCode (cprefix = "HILDON_URI_ACTION_")]
5         public enum URIActionType {
6                 NORMAL,
7                 NEUTRAL,
8                 FALLBACK
9         }
10
11         public errordomain URIError {
12                 INVALID_URI,
13                 INVALID_ACTION,
14                 INVALID_SCHEME,
15                 NO_DEFAULT_ACTION,
16                 OPEN_FAILED,
17                 SAVE_FAILED,
18                 DBUS_FAILED,
19                 NO_ACTIONS
20         }
21
22         [CCode (cprefix = "hildon_uri_", ref_function = "hildon_uri_action_ref", unref_function = "hildon_uri_action_unref", cheader_filename = "hildon-uri.h")]
23         public class URIAction {
24                 public Hildon.URIActionType get_type ();
25                 [CCode (cname = "hildon_uri_action_get_name")]
26                 public unowned string get_name ();
27                 [CCode (cname = "hildon_uri_action_get_service")]
28                 public unowned string get_service ();
29                 [CCode (cname = "hildon_uri_action_get_method")]
30                 public unowned string get_method ();
31                 [CCode (cname = "hildon_uri_action_get_translation_domain")]
32                 public unowned string get_translation_domain ();
33                 public static GLib.SList<Hildon.URIAction> get_actions (string scheme) throws GLib.Error;
34                 public static GLib.SList<Hildon.URIAction> get_actions_by_uri (string uri_str, Hildon.URIActionType type) throws GLib.Error;
35                 public static void free_actions (GLib.SList<Hildon.URIAction> list);
36                 public static string get_scheme_from_uri (string uri) throws GLib.Error;
37                 public bool is_default_action () throws GLib.Error;
38                 [CCode (instance_pos = -2)]
39                 public bool is_default_action_by_uri (string uri) throws GLib.Error;
40                 public static Hildon.URIAction get_default_action (string scheme) throws GLib.Error;
41                 public static Hildon.URIAction get_default_action_by_uri (string uri) throws GLib.Error;
42                 [CCode (instance_pos = -2)]
43                 public bool set_default_action (string scheme) throws GLib.Error;
44                 [CCode (instance_pos = -2)]
45                 public bool set_default_action_by_uri (string uri_str) throws GLib.Error;
46                 [CCode (instance_pos = -2)]
47                 public bool open (string uri) throws GLib.Error;
48         }
49
50 }
51
52 [CCode (cheader_filename = "hildon-mime.h")]
53 namespace HildonMime {
54
55         public errordomain PatternsError {
56                 INTERNAL
57         }
58
59         GLib.SList<string> patterns_get_for_mime_type (string mime_type) throws GLib.Error;
60
61         public enum Category {
62                 BOOKMARKS,
63                 CONTACTS,
64                 DOCUMENTS,
65                 EMAILS,
66                 IMAGES,
67                 AUDIO,
68                 VIDEO,
69                 OTHER,
70                 ALL
71         }
72
73         public HildonMime.Category get_category_for_mime_type (string mime_type);
74         public GLib.List<string> get_mime_types_for_category (HildonMime.Category category);
75         [CCode (cname = "hildon_mime_types_list_free")]
76         public void mime_types_list_free (GLib.List<string> list);
77
78         public int open_file (DBus.RawConnection con, string file);
79         public int open_file_list (DBus.RawConnection con, GLib.SList<string> files);
80         public int open_file_with_mime_type (DBus.RawConnection con, string file, string mime_type);
81
82         public unowned string get_category_name (HildonMime.Category category);
83         public HildonMime.Category get_category_from_name (string name);
84
85         public GLib.List<string> application_get_mime_types (string application_id);
86         public void application_mime_types_list_free (GLib.List<string> mime_types);
87
88         [CCode (array_length = -1)]
89         string[] get_icon_names (string mime_type, GnomeVFS.FileInfo file_info);
90 }
91