For more information on the Bookmark features, see Bookmark Guide.
Since: 2.1
Interface | Method |
---|---|
BookmarkManagerObject | |
BookmarkManager |
Bookmark[] get (optional BookmarkFolder? parentFolder, optional boolean? recursive) void add (Bookmark bookmark, optional BookmarkFolder? parentFolder) void remove (optional Bookmark? bookmark) |
BookmarkItem | |
BookmarkFolder |
typedef (BookmarkItem or BookmarkFolder) Bookmark;
Since: 2.1
[NoInterfaceObject] interface BookmarkManagerObject { readonly attribute BookmarkManager bookmark; };
Tizen implements BookmarkManagerObject;
Since: 2.1
There will be a tizen.bookmark object that allows to access the functionality of the Bookmark API.
[NoInterfaceObject] interface BookmarkManager { Bookmark[] get(optional BookmarkFolder? parentFolder, optional boolean? recursive) raises(WebAPIException); void add(Bookmark bookmark, optional BookmarkFolder? parentFolder) raises(WebAPIException); void remove(optional Bookmark? bookmark) raises(WebAPIException); };
Since: 2.1
It provides access to the API functionalities through the tizen.bookmark interface.
get
Bookmark[] get(optional BookmarkFolder? parentFolder, optional boolean? recursive);
Since: 2.1
If no parentFolder is passed, or the parentFolder contains null, it is considered as the default bookmark folder (The root bookmark folder). In this case, the return will contain bookmarks under the root bookmark folder.
Privilege level: platform
Privilege: http://tizen.org/privilege/bookmark.read
Parameters:
Return value:
Bookmark[] Array of BookmarksExceptions:
with error type NotFoundError, if the parentFolder parameter isn't found in bookmark database.
with error type TypeMismatchError, if an input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type UnknownError, if any other error occurs.
Code example:
try { // Retrieves bookmarks from the root bookmark folder recursively. var allBookmarks = tizen.bookmark.get(null, true); } catch (err) { console.log (err.name +": " + err.message); }
add
void add(Bookmark bookmark, optional BookmarkFolder? parentFolder);
Since: 2.1
If no parentFolder is passed, or the parentFolder contains null, it is considered as the default bookmark folder(The root bookmark folder). In this case, the bookmark is added under the root bookmark folder.
Privilege level: platform
Privilege: http://tizen.org/privilege/bookmark.write
Parameters:
Exceptions:
with error type NotFoundError, if a parentFolder parameter isn't found in bookmark database.
with error type InvalidValuesError, if any of the input parameters contain an invalid value, or a bookmark parameter is either a bookmark item whose url has already existed in bookmark database or a bookmark folder whose title has already existed under the same parent folder.
with error type TypeMismatchError, if an input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type UnknownError, if any other error occurs.
Code example:
try { // Adds a bookmark item to root bookmark folder. tizen.bookmark.add(new tizen.BookmarkItem("tizen", "https://www.tizen.org")); } catch (err) { console.log (err.name +": " + err.message); }
remove
void remove(optional Bookmark? bookmark);
Since: 2.1
If the bookmark is a BookmarkFolder type, all the bookmark items and bookmark folders under the specified bookmark folder are going to be removed.
If no bookmark is passed, or the bookmark contains null, it is considered as the default bookmark folder(The root bookmark folder).
In this case, all the bookmarks will be removed.
Privilege level: platform
Privilege: http://tizen.org/privilege/bookmark.write
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type UnknownError, if any other error occurs.
Code example:
try { // Removes all the bookmark folders and items. tizen.bookmark.remove(); } catch (err) { console.log (err.name +": " + err.message); }
[Constructor(DOMString title, DOMString url)] interface BookmarkItem { readonly attribute BookmarkFolder? parent; readonly attribute DOMString title; readonly attribute DOMString url; };
Since: 2.1
BookmarkItem(DOMString title, DOMString url);
Code example:
try { // Creates a bookmark item. var tizen = new tizen.BookmarkItem("tizen", "https://www.tizen.org"); } catch (err) { console.log (err.name +": " + err.message); }
This attribute is meaningful when this object is successfully added or retrieved. If this BookmarkItem is not added yet, its value is set to undefined.
If the parent bookmark folder indicates the root bookmark folder, the value will be null.
Since: 2.1
Since: 2.1
Since: 2.1
[Constructor(DOMString title)] interface BookmarkFolder { readonly attribute BookmarkFolder? parent; readonly attribute DOMString title; };
Since: 2.1
BookmarkFolder(DOMString title);
Code example:
try { // creates a bookmark folder var folder = new tizen.BookmarkFolder("folder"); } catch (err) { console.log (err.name +": " + err.message); }
This attribute is meaningful when this object is successfully added or retrieved. If this BookmarkFolder is not added yet, its value is set to undefined.
If the parent bookmark folder indicates the root bookmark folder, the value will be null.
Since: 2.1
Since: 2.1
To guarantee that the bookmark application runs on a device which supports Bookmark API, declare the following feature requirements in the config file:
module Bookmark { typedef (BookmarkItem or BookmarkFolder) Bookmark; [NoInterfaceObject] interface BookmarkManagerObject { readonly attribute BookmarkManager bookmark; }; Tizen implements BookmarkManagerObject; [NoInterfaceObject] interface BookmarkManager { Bookmark[] get(optional BookmarkFolder? parentFolder, optional boolean? recursive) raises(WebAPIException); void add(Bookmark bookmark, optional BookmarkFolder? parentFolder) raises(WebAPIException); void remove(optional Bookmark? bookmark) raises(WebAPIException); }; [Constructor(DOMString title, DOMString url)] interface BookmarkItem { readonly attribute BookmarkFolder? parent; readonly attribute DOMString title; readonly attribute DOMString url; }; [Constructor(DOMString title)] interface BookmarkFolder { readonly attribute BookmarkFolder? parent; readonly attribute DOMString title; }; };