summaryrefslogtreecommitdiff
path: root/src/history/historymanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/history/historymanager.h')
-rw-r--r--src/history/historymanager.h47
1 files changed, 41 insertions, 6 deletions
diff --git a/src/history/historymanager.h b/src/history/historymanager.h
index ff3b4381..0f131782 100644
--- a/src/history/historymanager.h
+++ b/src/history/historymanager.h
@@ -4,7 +4,7 @@
*
* Copyright (C) 2007-2008 Trolltech ASA. All rights reserved
* Copyright (C) 2008 Benjamin C. Meyer <ben@meyerhome.net>
-* Copyright (C) 2008-2009 by Andrea Diamantini <adjam7 at gmail dot com>
+* Copyright (C) 2008-2010 by Andrea Diamantini <adjam7 at gmail dot com>
*
*
* This program is free software; you can redistribute it and/or
@@ -12,9 +12,9 @@
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
+* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
-*
+*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -30,6 +30,9 @@
#define HISTORY_H
+// Rekonq Includes
+#include "rekonq_defines.h"
+
// KDE Includes
#include <KUrl>
@@ -51,10 +54,13 @@ class HistoryItem
public:
HistoryItem() {}
explicit HistoryItem(const QString &u,
- const QDateTime &d = QDateTime(),
+ const QDateTime &d = QDateTime(),
const QString &t = QString()
)
- : title(t), url(u), dateTime(d) {}
+ : title(t)
+ , url(u),
+ dateTime(d)
+ {}
inline bool operator==(const HistoryItem &other) const
{
@@ -74,6 +80,29 @@ public:
};
+// ---------------------------------------------------------------------------------------------------------------
+
+
+class DownloadItem
+{
+public:
+ DownloadItem() {}
+ explicit DownloadItem(const QString &srcUrl,
+ const QString &destUrl,
+ const QDateTime &d
+ )
+ : srcUrlString(srcUrl)
+ , destUrlString(destUrl)
+ , dateTime(d)
+ {}
+
+ QString srcUrlString;
+ QString destUrlString;
+ QDateTime dateTime;
+};
+
+
+typedef QList<DownloadItem> DownloadList;
// ---------------------------------------------------------------------------------------------------------------
@@ -92,7 +121,7 @@ class KCompletion;
* It manages rekonq history
*
*/
-class HistoryManager : public QWebHistoryInterface
+class REKONQ_TESTS_EXPORT HistoryManager : public QWebHistoryInterface
{
Q_OBJECT
Q_PROPERTY(int historyLimit READ historyLimit WRITE setHistoryLimit)
@@ -112,6 +141,8 @@ public:
void updateHistoryEntry(const KUrl &url, const QString &title);
void removeHistoryEntry(const KUrl &url, const QString &title = QString());
+ QString titleForHistoryUrl(QString url);
+
int historyLimit() const;
void setHistoryLimit(int limit);
@@ -128,6 +159,10 @@ public:
*/
KCompletion *completionObject() const;
+ void addDownload(const QString &srcUrl, const QString &destUrl);
+ DownloadList downloads();
+ bool clearDownloadsHistory();
+
public slots:
void clear();
void loadSettings();