Falkon Develop
Cross-platform Qt-based web browser
qmlbookmarktreenode.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2018 Anmol Gautam <tarptaeya@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#pragma once
19#include "bookmarkitem.h"
20
21#include <QObject>
22
26class QmlBookmarkTreeNode : public QObject
27{
28 Q_OBJECT
29
33 Q_PROPERTY(Type type READ type CONSTANT)
34
35
38 Q_PROPERTY(QString title READ title CONSTANT)
39
40
43 Q_PROPERTY(QString url READ url CONSTANT)
44
45
48 Q_PROPERTY(QString description READ description CONSTANT)
49
50
53 Q_PROPERTY(QString keyword READ keyword CONSTANT)
54
55
58 Q_PROPERTY(int visitCount READ visitCount CONSTANT)
59
60
63 Q_PROPERTY(QmlBookmarkTreeNode* parent READ parent CONSTANT)
64
65
68 Q_PROPERTY(bool unmodifiable READ unmodifiable CONSTANT)
69
70
73 Q_PROPERTY(QList<QObject*> children READ children CONSTANT)
74
75public:
81 enum Type {
87 };
88 Q_ENUM(Type)
89
90 explicit QmlBookmarkTreeNode(BookmarkItem *item = nullptr);
91
93 Type type() const;
94 QString title() const;
95 QString url() const;
96 QString description() const;
97 QString keyword() const;
98
99private:
100 BookmarkItem *m_item = nullptr;
101
102 int visitCount() const;
104 bool unmodifiable() const;
105 QList<QObject*> children() const;
106};
The class exposing the bookmark item to QML.
int visitCount
visit count of bookmark tree node.
QmlBookmarkTreeNode * parent
parent of bookmark tree node.
bool unmodifiable
checks if bookmark tree node is unmodifiable.
@ Invalid
Represents invalid bookmark item.
@ Folder
Represents the bookmark folder.
@ Separator
Represents the bookmark separator.
@ Url
Represents the single bookmark item of type url.
@ Root
Represents the root bookmark item.
QString description
description of bookmark tree node.
QList< QObject * > children
gets children of bookmark tree node.
QmlBookmarkTreeNode(BookmarkItem *item=nullptr)
QString title
title of bookmark tree node.
QString url
url of bookmark tree node.
QString keyword
keyword of bookmark tree node.
Type type
type of bookmark tree node.