From: Philipp Zabel Date: Tue, 24 Nov 2009 19:34:10 +0000 (+0100) Subject: Add libhildonmime VAPI bindings X-Git-Tag: v0.0.9~13 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=cfa4ef01bc0fb32aa898cc01174a522daf464d8a;p=cinaest Add libhildonmime VAPI bindings --- diff --git a/vapi/libhildonmime.deps b/vapi/libhildonmime.deps new file mode 100644 index 0000000..6c0da8a --- /dev/null +++ b/vapi/libhildonmime.deps @@ -0,0 +1,2 @@ +dbus-glib-1 +gnome-vfs-2.0 diff --git a/vapi/libhildonmime.vapi b/vapi/libhildonmime.vapi new file mode 100644 index 0000000..db65ade --- /dev/null +++ b/vapi/libhildonmime.vapi @@ -0,0 +1,91 @@ +[CCode (cheader_filename = "hildon-uri.h")] +namespace Hildon { + + [CCode (cprefix = "HILDON_URI_ACTION_")] + public enum URIActionType { + NORMAL, + NEUTRAL, + FALLBACK + } + + public errordomain URIError { + INVALID_URI, + INVALID_ACTION, + INVALID_SCHEME, + NO_DEFAULT_ACTION, + OPEN_FAILED, + SAVE_FAILED, + DBUS_FAILED, + NO_ACTIONS + } + + [CCode (cprefix = "hildon_uri_", ref_function = "hildon_uri_action_ref", unref_function = "hildon_uri_action_unref", cheader_filename = "hildon-uri.h")] + public class URIAction { + public Hildon.URIActionType get_type (); + [CCode (cname = "hildon_uri_action_get_name")] + public weak string get_name (); + [CCode (cname = "hildon_uri_action_get_service")] + public weak string get_service (); + [CCode (cname = "hildon_uri_action_get_method")] + public weak string get_method (); + [CCode (cname = "hildon_uri_action_get_translation_domain")] + public weak string get_translation_domain (); + public static GLib.SList get_actions (string scheme) throws GLib.Error; + public static GLib.SList get_actions_by_uri (string uri_str, Hildon.URIActionType type) throws GLib.Error; + public static void free_actions (GLib.SList list); + public static string get_scheme_from_uri (string uri) throws GLib.Error; + public bool is_default_action () throws GLib.Error; + [CCode (instance_pos = -2)] + public bool is_default_action_by_uri (string uri) throws GLib.Error; + public static Hildon.URIAction get_default_action (string scheme) throws GLib.Error; + public static Hildon.URIAction get_default_action_by_uri (string uri) throws GLib.Error; + [CCode (instance_pos = -2)] + public bool set_default_action (string scheme) throws GLib.Error; + [CCode (instance_pos = -2)] + public bool set_default_action_by_uri (string uri_str) throws GLib.Error; + [CCode (instance_pos = -2)] + public bool open (string uri) throws GLib.Error; + } + +} + +[CCode (cheader_filename = "hildon-mime.h")] +namespace HildonMime { + + public errordomain PatternsError { + INTERNAL + } + + GLib.SList patterns_get_for_mime_type (string mime_type) throws GLib.Error; + + public enum Category { + BOOKMARKS, + CONTACTS, + DOCUMENTS, + EMAILS, + IMAGES, + AUDIO, + VIDEO, + OTHER, + ALL + } + + public HildonMime.Category get_category_for_mime_type (string mime_type); + public GLib.List get_mime_types_for_category (HildonMime.Category category); + [CCode (cname = "hildon_mime_types_list_free")] + public void mime_types_list_free (GLib.List list); + + public int open_file (DBus.RawConnection con, string file); + public int open_file_list (DBus.RawConnection con, GLib.SList files); + public int open_file_with_mime_type (DBus.RawConnection con, string file, string mime_type); + + public weak string get_category_name (HildonMime.Category category); + public HildonMime.Category get_category_from_name (string name); + + public GLib.List application_get_mime_types (string application_id); + public void application_mime_types_list_free (GLib.List mime_types); + + [CCode (array_length = -1)] + string[] get_icon_names (string mime_type, GnomeVFS.FileInfo file_info); +} +