12
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
*
|
|
5 |
* This program is free software: you can redistribute it and/or modify
|
|
6 |
* it under the terms of the GNU Lesser General Public License as published by
|
|
7 |
* the Free Software Foundation, version 2.1 of the License.
|
|
8 |
*
|
|
9 |
* This program is distributed in the hope that it will be useful,
|
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 |
* GNU Lesser General Public License for more details.
|
|
13 |
*
|
|
14 |
* You should have received a copy of the GNU Lesser General Public License
|
|
15 |
* along with this program. If not,
|
|
16 |
* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
|
|
17 |
*
|
|
18 |
* Description:
|
|
19 |
*
|
|
20 |
*/
|
|
21 |
|
|
22 |
#ifndef HISTORY_MANAGER_H
|
|
23 |
#define HISTORY_MANAGER_H
|
|
24 |
|
|
25 |
#include <QtGui/QIcon>
|
|
26 |
#include <QObject>
|
|
27 |
#include <QAction>
|
|
28 |
#include "BWFGlobal.h"
|
|
29 |
#include "bedrockprovisioning.h"
|
|
30 |
|
|
31 |
namespace WRT {
|
|
32 |
|
|
33 |
class HistoryManagerPrivate;
|
|
34 |
class HistoryModel;
|
|
35 |
|
|
36 |
class BWF_EXPORT HistoryManager : public QObject {
|
|
37 |
|
|
38 |
Q_OBJECT
|
|
39 |
|
|
40 |
enum EHistoryManagerErrorTypes
|
|
41 |
{
|
|
42 |
ErrNone,
|
|
43 |
ErrGeneral = -1,
|
|
44 |
|
|
45 |
};
|
|
46 |
|
|
47 |
public:
|
|
48 |
HistoryManager(QWidget *parent = 0);
|
|
49 |
~HistoryManager();
|
|
50 |
|
|
51 |
void setSettings(BEDROCK_PROVISIONING::BedrockProvisioning *settings);
|
|
52 |
//Gets ref count of the page from history
|
|
53 |
int getPageRank(const QString &url);
|
|
54 |
static HistoryManager* getSingleton();
|
|
55 |
|
|
56 |
signals:
|
|
57 |
void historyCleared();
|
|
58 |
void confirmHistoryClear();
|
|
59 |
|
|
60 |
public slots:
|
|
61 |
|
|
62 |
//javascript APIS
|
|
63 |
QString getHistoryFoldersJSON(QString folder="");
|
|
64 |
void addHistory(const QString &url, const QString &title);
|
|
65 |
void addHistory(const QUrl &url, const QString &title);
|
|
66 |
void clearHistory();
|
|
67 |
|
|
68 |
QAction * getActionClearHistory();
|
|
69 |
|
|
70 |
private:
|
|
71 |
HistoryManagerPrivate * const d;
|
|
72 |
bool m_isHistoryDbreadRequired;
|
|
73 |
QVector<QString> m_folderVector;
|
|
74 |
QMap<QString, QString> m_historyMap;
|
|
75 |
|
|
76 |
};
|
|
77 |
}
|
|
78 |
#endif //HISTORY_MANAGER
|