Editing URL Handler/API rev2

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
This document describes the second revision of the <code>hildon_uri_*</code> API that was added in rev 2. Please see [[URL Handler/API rev1|revision 1 of the API]] for the background and also information about the basic file format used.
+
= Hildon URI API, rev 2 =
 +
 
 +
This document describes the second revision of the hildon_uri_* API that was added in rev 2. Please see rev 1 for the background and also information about the basic file format used.
Make sure to read the desktop entry [http://standards.freedesktop.org/desktop-entry-spec/latest/ specification].
Make sure to read the desktop entry [http://standards.freedesktop.org/desktop-entry-spec/latest/ specification].
-
The utility <code>update-desktop-database</code> from desktop-file-utils is used to handle the new fields that have been added.
+
The utility update-desktop-database from desktop-file-utils is used to handle the new fields that have been added.
== Backwards compatibility ==
== Backwards compatibility ==
-
 
This new version of the framework is still compatible with the older version. This means that the old format for URI action in desktop files can still be used. See the rev1 for information about that.
This new version of the framework is still compatible with the older version. This means that the old format for URI action in desktop files can still be used. See the rev1 for information about that.
The code uses the existance of the new key 'X-Osso-URI-Actions' in the [Desktop Entry] group. If the key is missing, the file is interpreted using the old format, otherwise using the new format. It is an error to mix those two versions of the format in the same file.
The code uses the existance of the new key 'X-Osso-URI-Actions' in the [Desktop Entry] group. If the key is missing, the file is interpreted using the old format, otherwise using the new format. It is an error to mix those two versions of the format in the same file.
 +
== Changes to the format ==
== Changes to the format ==
Line 38: Line 40:
The keys used in each action group are:
The keys used in each action group are:
-
* '''Type:''' specifes the type of the action
+
* '''Type:''' specifes the type of the action, can be XXXX
* '''MimeType:''' lists the MIME types handled by this action
* '''MimeType:''' lists the MIME types handled by this action
* '''Name:''' the name of the action
* '''Name:''' the name of the action
Line 45: Line 47:
* '''TranslationDomain:''' the translation domain to use when translation the name
* '''TranslationDomain:''' the translation domain to use when translation the name
-
The keys 'Type', 'X-Osso-Service', 'MimeType', and 'TranslationDomain' are optional.
+
The keys 'Type', 'X-Osso-Service', 'MimeType', and 'TranslationDomain' are completely optional.
The keys 'X-Osso-Service' and 'MimeType' are both inherited from the regular [Desktop Entry] group, which means that if you don't specify them in the action group, the values used in the [Desktop Entry] group will be used. If you specify them, the values will override the ones from the [Desktop Entry] group.
The keys 'X-Osso-Service' and 'MimeType' are both inherited from the regular [Desktop Entry] group, which means that if you don't specify them in the action group, the values used in the [Desktop Entry] group will be used. If you specify them, the values will override the ones from the [Desktop Entry] group.
Line 60: Line 62:
== Default actions ==
== Default actions ==
-
 
+
The uri-default-action.list format as described on the rev-1 fie has been extended as well, but also remains compatible so older files will still work. It now looks like this:
-
The <code>uri-default-action.list</code> format as described on the rev-1 fie has been extended as well, but also remains compatible so older files will still work. It now looks like this:
+
   [X-Osso-URI-Scheme <scheme>]
   [X-Osso-URI-Scheme <scheme>]
Line 95: Line 96:
== Example ==
== Example ==
-
 
Here we have some made up examples, first showing files using the older URI action format, then the new one.
Here we have some made up examples, first showing files using the older URI action format, then the new one.
Line 111: Line 111:
   X-Osso-Type=application/x-executable
   X-Osso-Type=application/x-executable
   X-Osso-URI-Actions=voipto;callto;videovoip
   X-Osso-URI-Actions=voipto;callto;videovoip
-
 
+
   [X-Osso-URI-Action Handler voipto]
   [X-Osso-URI-Action Handler voipto]
   Method=voip_to
   Method=voip_to
   Name=tana_fi_new_call
   Name=tana_fi_new_call
   TranslationDomain=osso-contact-plugin
   TranslationDomain=osso-contact-plugin
-
 
+
 
   [X-Osso-URI-Action Handler callto]
   [X-Osso-URI-Action Handler callto]
   Method=voip_to
   Method=voip_to
   Name=tana_fi_new_call
   Name=tana_fi_new_call
   TranslationDomain=osso-contact-plugin
   TranslationDomain=osso-contact-plugin
-
 
+
 
   [X-Osso-URI-Action Handler videovoip]
   [X-Osso-URI-Action Handler videovoip]
   Method=video_voip
   Method=video_voip
Line 140: Line 140:
   X-Osso-Service=osso_voip_ui
   X-Osso-Service=osso_voip_ui
   X-Osso-Type=application/x-executable
   X-Osso-Type=application/x-executable
-
 
+
   [X-Osso-URI-Actions]
   [X-Osso-URI-Actions]
   voipto=X-Osso-URI-Action-Voip-To;
   voipto=X-Osso-URI-Action-Voip-To;
   callto=X-Osso-URI-Action-Voip-To;
   callto=X-Osso-URI-Action-Voip-To;
   videovoip=X-Osso-URI-Action-Video-Voip-To;
   videovoip=X-Osso-URI-Action-Video-Voip-To;
-
 
+
 
   [X-Osso-URI-Action-Voip-To]
   [X-Osso-URI-Action-Voip-To]
   Method=voip_to
   Method=voip_to
   Name=tana_fi_new_call
   Name=tana_fi_new_call
   TranslationDomain=osso-contact-plugin
   TranslationDomain=osso-contact-plugin
-
 
+
 
   [X-Osso-URI-Action-Video-Voip-To]
   [X-Osso-URI-Action-Video-Voip-To]
   Method=video_voip
   Method=video_voip
Line 171: Line 171:
   X-Osso-URI-Actions=mailto;xmpp;sipto;
   X-Osso-URI-Actions=mailto;xmpp;sipto;
   MimeType=text/x-vcard
   MimeType=text/x-vcard
-
 
+
   [X-Osso-URI-Action Handler mailto]
   [X-Osso-URI-Action Handler mailto]
   Method=add_account
   Method=add_account
   Name=addr_me_cs_addtocontacts
   Name=addr_me_cs_addtocontacts
   TranslationDomain=osso-addressbook
   TranslationDomain=osso-addressbook
-
 
+
 
   [X-Osso-URI-Action Handler xmpp]
   [X-Osso-URI-Action Handler xmpp]
   Method=add_account
   Method=add_account
   Name=addr_ap_address_book
   Name=addr_ap_address_book
   TranslationDomain=osso-addressbook
   TranslationDomain=osso-addressbook
-
 
+
   [X-Osso-URI-Action Handler sipto]
   [X-Osso-URI-Action Handler sipto]
   Method=add_account
   Method=add_account
Line 201: Line 201:
   StartupWMClass=osso-addressbook
   StartupWMClass=osso-addressbook
   MimeType=text/x-vcard
   MimeType=text/x-vcard
-
 
+
   [X-Osso-URI-Actions]
   [X-Osso-URI-Actions]
   mailto=X-Osso-URI-Action-Add-Contact;
   mailto=X-Osso-URI-Action-Add-Contact;
   xmpp=X-Osso-URI-Action-Add-Account;
   xmpp=X-Osso-URI-Action-Add-Account;
   sipto=X-Osso-URI-Action-Add-Account;
   sipto=X-Osso-URI-Action-Add-Account;
-
 
+
 
   [X-Osso-URI-Action-Add-Contact]
   [X-Osso-URI-Action-Add-Contact]
   Method=add_account
   Method=add_account
   Name=addr_me_cs_addtocontacts
   Name=addr_me_cs_addtocontacts
   TranslationDomain=osso-addressbook
   TranslationDomain=osso-addressbook
-
 
+
   [X-Osso-URI-Action-Add-Account]
   [X-Osso-URI-Action-Add-Account]
   Method=add_account
   Method=add_account
Line 235: Line 235:
   MimeType=text/html;text/css;text/sgml;text/x-dtd;application/x-javascript;image/gif;image/jpeg;image/png;image/vnd.wap.wbmp;image/pjpeg;image/bmp;image/x-windows-bmp;image/x-ms-bmp;image/xbm;image/ico;image/x-ico;image/x-xbitmap;text/plain;application/x-shockwave-flash;
   MimeType=text/html;text/css;text/sgml;text/x-dtd;application/x-javascript;image/gif;image/jpeg;image/png;image/vnd.wap.wbmp;image/pjpeg;image/bmp;image/x-windows-bmp;image/x-ms-bmp;image/xbm;image/ico;image/x-ico;image/x-xbitmap;text/plain;application/x-shockwave-flash;
   X-Osso-URI-Actions=http;https;ftp;file;
   X-Osso-URI-Actions=http;https;ftp;file;
-
 
+
 
   [X-Osso-URI-Action Handler http]
   [X-Osso-URI-Action Handler http]
   Method=load_url
   Method=load_url
   Name=uri_link_open_link
   Name=uri_link_open_link
   TranslationDomain=osso-uri
   TranslationDomain=osso-uri
-
 
+
   [X-Osso-URI-Action Handler https]
   [X-Osso-URI-Action Handler https]
   Method=load_url
   Method=load_url
   Name=uri_link_open_link
   Name=uri_link_open_link
   TranslationDomain=osso-uri
   TranslationDomain=osso-uri
-
 
+
   [X-Osso-URI-Action Handler ftp]
   [X-Osso-URI-Action Handler ftp]
   Method=load_url
   Method=load_url
   Name=uri_link_open_link
   Name=uri_link_open_link
   TranslationDomain=osso-uri
   TranslationDomain=osso-uri
-
 
+
   [X-Osso-URI-Action Handler file]
   [X-Osso-URI-Action Handler file]
   Method=load_url
   Method=load_url
   Name=uri_link_open_link
   Name=uri_link_open_link
   TranslationDomain=osso-uri
   TranslationDomain=osso-uri
 +
:New format browser desktop file (with new "neutral" and "fallback" features):
:New format browser desktop file (with new "neutral" and "fallback" features):
Line 272: Line 273:
   X-Osso-Type=application/x-executable
   X-Osso-Type=application/x-executable
   MimeType=text/html;text/css;text/sgml;text/x-dtd;application/x-javascript;image/gif;image/jpeg;image/png;image/vnd.wap.wbmp;image/pjpeg;image/bmp;image/x-windows-bmp;image/x-ms-bmp;image/xbm;image/ico;image/x-ico;image/x-xbitmap;text/plain;application/x-shockwave-flash;
   MimeType=text/html;text/css;text/sgml;text/x-dtd;application/x-javascript;image/gif;image/jpeg;image/png;image/vnd.wap.wbmp;image/pjpeg;image/bmp;image/x-windows-bmp;image/x-ms-bmp;image/xbm;image/ico;image/x-ico;image/x-xbitmap;text/plain;application/x-shockwave-flash;
-
 
+
 
   [X-Osso-URI-Actions]
   [X-Osso-URI-Actions]
   http=X-Osso-URI-Action-Open;X-Osso-URI-Action-Save;X-Osso-URI-Action-Fallback
   http=X-Osso-URI-Action-Open;X-Osso-URI-Action-Save;X-Osso-URI-Action-Fallback
Line 278: Line 279:
   ftp=X-Osso-URI-Action-Open;X-Osso-URI-Action-Save;X-Osso-URI-Action-Fallback
   ftp=X-Osso-URI-Action-Open;X-Osso-URI-Action-Save;X-Osso-URI-Action-Fallback
   file=X-Osso-URI-Action-Open;X-Osso-URI-Action-Save;X-Osso-URI-Action-Fallback;
   file=X-Osso-URI-Action-Open;X-Osso-URI-Action-Save;X-Osso-URI-Action-Fallback;
-
 
+
 
   [X-Osso-URI-Action-Open]
   [X-Osso-URI-Action-Open]
   Method=load_url
   Method=load_url
   Name=uri_link_open_link
   Name=uri_link_open_link
   TranslationDomain=osso-uri
   TranslationDomain=osso-uri
-
 
+
 
   [X-Osso-URI-Action-Save]
   [X-Osso-URI-Action-Save]
   Type=Neutral
   Type=Neutral
Line 289: Line 290:
   Name=uri_link_save_link
   Name=uri_link_save_link
   TranslationDomain=osso-uri
   TranslationDomain=osso-uri
-
 
+
 
   [X-Osso-URI-Action-Fallback]
   [X-Osso-URI-Action-Fallback]
   Type=Fallback
   Type=Fallback
Line 315: Line 316:
   MimeType=video/x-msvideo;audio/x-mp3;video/mpeg;audio/x-wav;audio/x-real;video/x-real;audio/x-m4a;audio/x-amr;video/x-mp4;video/3gpp;audio/x-mp2;audio/x-ms-wma;audio/x-mpegurl;audio/x-scpls;audio/x-pn-realaudio;audio/x-pn-realaudio-plugin;video/x-ms-asf;audio/x-ms-wax;video/x-ms-wvx;application/vnd.ms-wpl;audio/mp3;video/avi;audio/wav;audio/mpeg;
   MimeType=video/x-msvideo;audio/x-mp3;video/mpeg;audio/x-wav;audio/x-real;video/x-real;audio/x-m4a;audio/x-amr;video/x-mp4;video/3gpp;audio/x-mp2;audio/x-ms-wma;audio/x-mpegurl;audio/x-scpls;audio/x-pn-realaudio;audio/x-pn-realaudio-plugin;video/x-ms-asf;audio/x-ms-wax;video/x-ms-wvx;application/vnd.ms-wpl;audio/mp3;video/avi;audio/wav;audio/mpeg;
   Comment=medi_ap_mediaplayer_name_thumb
   Comment=medi_ap_mediaplayer_name_thumb
-
 
+
 
   [X-Osso-URI-Action Handler rtsp]
   [X-Osso-URI-Action Handler rtsp]
   Method=mime_open
   Method=mime_open
Line 339: Line 340:
   MimeType=video/x-msvideo;audio/x-mp3;video/mpeg;audio/x-wav;audio/x-real;video/x-real;audio/x-m4a;audio/x-amr;video/x-mp4;video/3gpp;audio/x-mp2;audio/x-ms-wma;audio/x-mpegurl;audio/x-scpls;audio/x-pn-realaudio;audio/x-pn-realaudio-plugin;video/x-ms-asf;audio/x-ms-wax;video/x-ms-wvx;application/vnd.ms-wpl;audio/mp3;video/avi;audio/wav;audio/mpeg;
   MimeType=video/x-msvideo;audio/x-mp3;video/mpeg;audio/x-wav;audio/x-real;video/x-real;audio/x-m4a;audio/x-amr;video/x-mp4;video/3gpp;audio/x-mp2;audio/x-ms-wma;audio/x-mpegurl;audio/x-scpls;audio/x-pn-realaudio;audio/x-pn-realaudio-plugin;video/x-ms-asf;audio/x-ms-wax;video/x-ms-wvx;application/vnd.ms-wpl;audio/mp3;video/avi;audio/wav;audio/mpeg;
   Comment=medi_ap_mediaplayer_name_thumb
   Comment=medi_ap_mediaplayer_name_thumb
-
 
+
 
   [X-Osso-URI-Actions]
   [X-Osso-URI-Actions]
   rtsp=X-Osso-URI-Action-Open;
   rtsp=X-Osso-URI-Action-Open;
-
 
+
 
   [X-Osso-URI-Action-Open]
   [X-Osso-URI-Action-Open]
   Method=mime_open
   Method=mime_open
   Name=medi_ap_mediaplayer_name
   Name=medi_ap_mediaplayer_name
   TranslationDomain=mediaplayer
   TranslationDomain=mediaplayer
 +
==Implementation details==
==Implementation details==
-
 
The schemeinfo.cache file that is a cache for faster lookups, remains unchanged from the old revision. It is used to make scheme->desktop file lookups.
The schemeinfo.cache file that is a cache for faster lookups, remains unchanged from the old revision. It is used to make scheme->desktop file lookups.
-
 
-
[[Category:Development]]
 

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)