Falkon Develop
Cross-platform Qt-based web browser
QmlBookmarks Class Reference

The class exposing the Bookmarks API to QML. More...

#include <qmlbookmarks.h>

Inheritance diagram for QmlBookmarks:

Signals

void created (QmlBookmarkTreeNode *treeNode)
 This signal is emitted when a new bookmark item is created. More...
 
void changed (QmlBookmarkTreeNode *treeNode)
 This signal is emitted when a bookmark item is edited. More...
 
void removed (QmlBookmarkTreeNode *treeNode)
 This signal is emitted when a bookmark item is removed. More...
 

Public Member Functions

 QmlBookmarks (QObject *parent=nullptr)
 
Q_INVOKABLE bool isBookmarked (const QString &url) const
 Checks if the url is bookmarked. More...
 
Q_INVOKABLE QmlBookmarkTreeNoderootItem () const
 Get the root bookmark item. More...
 
Q_INVOKABLE QmlBookmarkTreeNodetoolbarFolder () const
 Get the bookmarks toolbar. More...
 
Q_INVOKABLE QmlBookmarkTreeNodemenuFolder () const
 Get the bookmarks menu folder. More...
 
Q_INVOKABLE QmlBookmarkTreeNodeunsortedFolder () const
 Get the unsorted bookmarks folder. More...
 
Q_INVOKABLE QmlBookmarkTreeNodelastUsedFolder () const
 Get the last used bookmarks folder. More...
 
Q_INVOKABLE bool create (const QVariantMap &map) const
 Creates a bookmark item. More...
 
Q_INVOKABLE bool remove (QmlBookmarkTreeNode *treeNode) const
 Removes a bookmark item. More...
 
Q_INVOKABLE QList< QObject * > search (const QVariantMap &map) const
 QmlBookmarks::search. More...
 
Q_INVOKABLE bool update (QObject *object, const QVariantMap &changes) const
 Updates a bookmark item. More...
 
Q_INVOKABLE QmlBookmarkTreeNodeget (const QString &string) const
 Get the first matched bookmark item. More...
 
Q_INVOKABLE QList< QObject * > getChildren (QObject *object) const
 Get children of the bookmark item. More...
 

Detailed Description

The class exposing the Bookmarks API to QML.

Definition at line 28 of file qmlbookmarks.h.

Constructor & Destructor Documentation

◆ QmlBookmarks()

QmlBookmarks::QmlBookmarks ( QObject *  parent = nullptr)
explicit

Definition at line 24 of file qmlbookmarks.cpp.

Member Function Documentation

◆ changed

void QmlBookmarks::changed ( QmlBookmarkTreeNode treeNode)
signal

This signal is emitted when a bookmark item is edited.

Parameters
bookmarkitem, exposed to QML as QmlBookmarkTreeNode

◆ create()

bool QmlBookmarks::create ( const QVariantMap &  map) const

Creates a bookmark item.

Parameters
AJavaScript object containing
  • parent: Object of type QmlBookmarkTreeNode, representing the parent of the new bookmark item. This is required field.
  • title: String representing the title of the new bookmark item. Defaults to empty string
  • url: String representing the url of the new bookmark item. Defaults to empty string
  • description String representing the description of the new bookmark item. Defaults to empty string
  • type: Type representing the type of the new bookmark item. Defaults to Url if url is provided, else Folder if title is provided, else Invalid
Returns
true if the bookmark it created, else false

Definition at line 121 of file qmlbookmarks.cpp.

◆ created

void QmlBookmarks::created ( QmlBookmarkTreeNode treeNode)
signal

This signal is emitted when a new bookmark item is created.

Parameters
bookmarkitem, exposed to QML as QmlBookmarkTreeNode

◆ get()

QmlBookmarkTreeNode * QmlBookmarks::get ( const QString &  string) const

Get the first matched bookmark item.

Parameters
Stringrepresenting the query
Returns
Object of type QmlBookmarkTreeNode if the query is matched with a bookmark, else null

Definition at line 229 of file qmlbookmarks.cpp.

◆ getChildren()

QList< QObject * > QmlBookmarks::getChildren ( QObject *  object) const

Get children of the bookmark item.

Parameters
Objectof type QmlBookmarkTreeNode, representing the parent whose children are requested.
Returns
List containing the children, of type QmlBookmarkTreeNode

Definition at line 241 of file qmlbookmarks.cpp.

◆ isBookmarked()

bool QmlBookmarks::isBookmarked ( const QString &  url) const

Checks if the url is bookmarked.

Parameters
Stringrepresenting the url to check
Returns
true if bookmarked, else false

Definition at line 91 of file qmlbookmarks.cpp.

◆ lastUsedFolder()

QmlBookmarkTreeNode * QmlBookmarks::lastUsedFolder ( ) const

Get the last used bookmarks folder.

Returns
Last used bookmarks folder

Definition at line 116 of file qmlbookmarks.cpp.

◆ menuFolder()

QmlBookmarkTreeNode * QmlBookmarks::menuFolder ( ) const

Get the bookmarks menu folder.

Returns
Bookmarks menu folder

Definition at line 106 of file qmlbookmarks.cpp.

◆ remove()

bool QmlBookmarks::remove ( QmlBookmarkTreeNode treeNode) const

Removes a bookmark item.

Parameters
treeNodeObject of type QmlBookmarkTreeNode to be removed
Returns
true if the bookmark is removed, else false

Definition at line 158 of file qmlbookmarks.cpp.

◆ removed

void QmlBookmarks::removed ( QmlBookmarkTreeNode treeNode)
signal

This signal is emitted when a bookmark item is removed.

Parameters
bookmarkitem, exposed to QML as QmlBookmarkTreeNode

◆ rootItem()

QmlBookmarkTreeNode * QmlBookmarks::rootItem ( ) const

Get the root bookmark item.

Returns
Root boomkark item

Definition at line 96 of file qmlbookmarks.cpp.

◆ search()

QList< QObject * > QmlBookmarks::search ( const QVariantMap &  map) const

QmlBookmarks::search.

Parameters
AJavaScript object containing
  • query: String containing search query
  • url: String representing url to be search
Returns
List containing QmlBookmarkTreeNode. If both query and url are not supplied then empty list is returned.

Definition at line 168 of file qmlbookmarks.cpp.

◆ toolbarFolder()

QmlBookmarkTreeNode * QmlBookmarks::toolbarFolder ( ) const

Get the bookmarks toolbar.

Returns
Bookmarks toolbar

Definition at line 101 of file qmlbookmarks.cpp.

◆ unsortedFolder()

QmlBookmarkTreeNode * QmlBookmarks::unsortedFolder ( ) const

Get the unsorted bookmarks folder.

Returns
Unsorted bookmarks folder

Definition at line 111 of file qmlbookmarks.cpp.

◆ update()

bool QmlBookmarks::update ( QObject *  object,
const QVariantMap &  changes 
) const

Updates a bookmark item.

Parameters
Objectof type QmlBookmarkTreeNode, representing the bookmark to update
JavaScriptobject containing the values to be updated
  • title: String representing the new title of the bookmark item
  • description: String representing the new description of the bookmark item
  • keyword: String representing the new keyword of the bookmark item
Returns
true if the bookmark is updated, else false

Definition at line 191 of file qmlbookmarks.cpp.


The documentation for this class was generated from the following files: