Falkon Develop
Cross-platform Qt-based web browser
locationcompleterrefreshjob.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2014-2017 David Rosca <nowrep@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#ifndef LOCATIONCOMPLETERREFRESHJOB_H
19#define LOCATIONCOMPLETERREFRESHJOB_H
20
21#include <QFutureWatcher>
22
23#include "qzcommon.h"
24
25class QStandardItem;
26
28{
29 Q_OBJECT
30
31public:
32 explicit LocationCompleterRefreshJob(const QString &searchString);
33
34 // Timestamp when the job was created
35 qint64 timestamp() const;
36 QString searchString() const;
37 bool isCanceled() const;
38
39 QList<QStandardItem*> completions() const;
40 QString domainCompletion() const;
41
42Q_SIGNALS:
43 void finished();
44
45private Q_SLOTS:
46 void slotFinished();
47 void jobCancelled();
48
49private:
50 enum Type {
51 HistoryAndBookmarks = 0,
52 History = 1,
53 Bookmarks = 2,
54 Nothing = 4
55 };
56
57 void runJob();
58 void completeFromHistory();
59 void completeMostVisited();
60
61 QString createDomainCompletion(const QString &completion) const;
62
63 qint64 m_timestamp;
64 QString m_searchString;
65 QString m_domainCompletion;
66 QList<QStandardItem*> m_items;
67 QFutureWatcher<void>* m_watcher;
68 bool m_jobCancelled;
69};
70
71#endif // LOCATIONCOMPLETERREFRESHJOB_H
#define FALKON_EXPORT
Definition: qzcommon.h:28