Falkon Develop
Cross-platform Qt-based web browser
restoremanager.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2014 Franz Fellner <alpine.art.de@googlemail.com>
4* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
5*
6* This program is free software: you can redistribute it and/or modify
7* it under the terms of the GNU General Public License as published by
8* the Free Software Foundation, either version 3 of the License, or
9* (at your option) any later version.
10*
11* This program is distributed in the hope that it will be useful,
12* but WITHOUT ANY WARRANTY; without even the implied warranty of
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14* GNU General Public License for more details.
15*
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18* ============================================================ */
19#ifndef RESTOREMANAGER_H
20#define RESTOREMANAGER_H
21
22#include "qzcommon.h"
23#include "browserwindow.h"
24
25class WebPage;
27
29{
30 QVector<BrowserWindow::SavedWindow> windows;
31 QByteArray crashedSession;
32 QByteArray closedWindows;
33
34 bool isValid() const;
35 void clear();
36
37 friend FALKON_EXPORT QDataStream &operator<<(QDataStream &stream, const RestoreData &data);
38 friend FALKON_EXPORT QDataStream &operator>>(QDataStream &stream, RestoreData &data);
39};
40
42{
43public:
44 explicit RestoreManager(const QString &file);
45 virtual ~RestoreManager();
46
47 bool isValid() const;
48 RestoreData restoreData() const;
49 void clearRestoreData();
50
51 QObject *recoveryObject(WebPage *page);
52
53 static bool validateFile(const QString &file);
54 static void createFromFile(const QString &file, RestoreData &data);
55
56private:
57 void createFromFile(const QString &file);
58
59 RecoveryJsObject *m_recoveryObject;
60 RestoreData m_data;
61};
62
63#endif // RESTOREMANAGER_H
QDataStream & operator>>(QDataStream &stream, BrowserWindow::SavedWindow &window)
QDataStream & operator<<(QDataStream &stream, const BrowserWindow::SavedWindow &window)
#define FALKON_EXPORT
Definition: qzcommon.h:28
QVector< BrowserWindow::SavedWindow > windows
QByteArray crashedSession
QByteArray closedWindows