Falkon Develop
Cross-platform Qt-based web browser
qmlhistory.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
20#include <QObject>
21#include "qmlhistoryitem.h"
22
26class QmlHistory : public QObject
27{
28 Q_OBJECT
29public:
30 explicit QmlHistory(QObject *parent = nullptr);
37 Q_INVOKABLE QList<QObject*> search(const QString &text);
43 Q_INVOKABLE int getVisits(const QString &url);
52 Q_INVOKABLE void addUrl(const QVariantMap &map);
57 Q_INVOKABLE void deleteUrl(const QString &url);
66 Q_INVOKABLE void deleteRange(const QVariantMap &map);
70 Q_INVOKABLE void deleteAll();
71Q_SIGNALS:
77 void visited(QmlHistoryItem *historyItem);
78
84 void visitRemoved(QmlHistoryItem *historyItem);
85};
The class exposing the History API to QML.
Definition: qmlhistory.h:27
Q_INVOKABLE void deleteAll()
Clears all the history.
Definition: qmlhistory.cpp:91
Q_INVOKABLE void addUrl(const QVariantMap &map)
Add url to the history.
Definition: qmlhistory.cpp:57
Q_INVOKABLE void deleteUrl(const QString &url)
Deletes a url from the history.
Definition: qmlhistory.cpp:71
void visitRemoved(QmlHistoryItem *historyItem)
The signal emitted when a HistoryEntry is removed.
Q_INVOKABLE void deleteRange(const QVariantMap &map)
Deletes history entries within the given range.
Definition: qmlhistory.cpp:76
QmlHistory(QObject *parent=nullptr)
Definition: qmlhistory.cpp:25
void visited(QmlHistoryItem *historyItem)
The signal emitted when a HistoryEntry is added.
Q_INVOKABLE QList< QObject * > search(const QString &text)
Searches History Entries against a search query.
Definition: qmlhistory.cpp:39
Q_INVOKABLE int getVisits(const QString &url)
Get the visit count of a url.
Definition: qmlhistory.cpp:51
The class exposing HistoryEntry to QML.