Editing URL Handler/API rev1

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:
-
{{out of date}}
+
= Hildon URI API, rev 1 =
-
This document describes the first revision of the <code>hildon_uri_*</code> API that was added in IT-2007. It has been revised and expanded in rev 2, see [[URL Handler/API rev2|API revision 2]] for information about that.
+
This document describes the first revision of the hildon_uri_* API
 +
that was added in IT-2007. It has been revised and expanded in rev 2,
 +
see rev 2 for information about that.
-
The API brings functionality for actions to be performed based on the scheme in the URI, such as "http" or "callto". There can be one or more actions for a scheme, and a default action for each scheme.
+
The API brings functionality for actions to be performed basen on the
 +
scheme in the URI, such as "http" or "callto". There can be one or
 +
more actions for a scheme, and a default action for each scheme.
-
This setup closely follows the <code>hildon_mime_*</code> API setup, and the Freedesktop standard for desktop files is reused here as well.
+
This setup closely follows the hildon_mime_* API setup, and the
 +
Freedesktop standard for desktop files is reused here as well.
   
   
-
This is be done by adding custom sections to the desktop files, listing the URI actions for the application. This has the advantage that applications already have the build and Debian packaging mechanisms in place.
+
This is be done by adding custom sections to the desktop files,
 +
listing the URI actions for the application. This has the advantage
 +
that applications already have the build and Debian packaging
 +
mechanisms in place.
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.
== Desktop file format ==
== Desktop file format ==
Line 42: Line 51:
  TranslationDomain=some_app
  TranslationDomain=some_app
-
The X-Osso-URI-Actions key in the [Desktop Entry] specifies the available actions that the application provides. Then for each action there is a corresponding groups, that specifies the properties of that action.
+
: The X-Osso-URI-Actions key in the [Desktop Entry] specifies the available actions that the application provides. Then for each action there is a corresponding groups, that specifies the properties of that action.
-
The keys are:
+
:The keys are:
-
* '''Method:''' the D-Bus method to call on the service
+
:* '''Method:''' the D-Bus method to call on the service
-
* '''Name:''' the name of the action
+
:* '''Name:''' the name of the action
-
* '''TranslationDomain:''' the translation domain to use when translating the name
+
:* '''TranslationDomain:''' the translation domain to use when translating the name
== Default action ==
== Default action ==
-
 
Just like for the MIME open functionality in upstream GNOME and in Maemo, there is a way to specify which application is the default if there are many that support the same URI scheme. The defaults file is located in $(prefix)/share/applications/uri-action-defaults.list.
Just like for the MIME open functionality in upstream GNOME and in Maemo, there is a way to specify which application is the default if there are many that support the same URI scheme. The defaults file is located in $(prefix)/share/applications/uri-action-defaults.list.
== Updating the desktop database ==
== Updating the desktop database ==
-
 
+
:The 'update-desktop-database' command parses all the *.desktop files pointed to and generates a cache for them to speed up the lookup. This generation is usually done in the post-inst phase in a Debian package, in addition to "make install" in the makefile target:
-
The 'update-desktop-database' command parses all the *.desktop files pointed to and generates a cache for them to speed up the lookup. This generation is usually done in the post-inst phase in a Debian package, in addition to "make install" in the makefile target:
+
   update-desktop-database $prefix/share/applications
   update-desktop-database $prefix/share/applications
-
Note that the update-desktop-database tool in Maemo has been patched to generate the cache for the added data. An example of a cache file, that resides in $(prefix)/share/applications:  
+
:Note that the update-desktop-database tool in Maemo has been patched to generate the cache for the added data. An example of a cache file, that resides in $(prefix)/share/applications:  
-
[X-Osso-URI-Action Cache]
+
  [X-Osso-URI-Action Cache]
-
callto=im.desktop;gossip.desktop;gaim.desktop;
+
  callto=im.desktop;gossip.desktop;gaim.desktop;
-
http=browser.desktop
+
  http=browser.desktop
-
https=browser.desktop
+
  https=browser.desktop
== Implementation details ==
== Implementation details ==
When activating an action, the corresponding desktop file is used to lookup the D-Bus message and service name. The message is sent to the service. The arguments to the message consist of a an array of strings, which are the URIs passed. Note that the current implementation only sends one URI in the array, since the API only allows for one.
When activating an action, the corresponding desktop file is used to lookup the D-Bus message and service name. The message is sent to the service. The arguments to the message consist of a an array of strings, which are the URIs passed. Note that the current implementation only sends one URI in the array, since the API only allows for one.
-
 
-
[[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)

Templates used on this page: