Falkon Develop
Cross-platform Qt-based web browser
closedtabsmanager.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2018 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 CLOSEDTABSMANAGER_H
19#define CLOSEDTABSMANAGER_H
20
21#include <QVector>
22#include <QPointer>
23
24#include "webtab.h"
25#include "qzcommon.h"
26
27class WebTab;
28
30{
31public:
32 struct Tab {
33 int position = -1;
34 QPointer<WebTab> parentTab;
36
37 bool isValid() const {
38 return position > -1;
39 }
40 };
41
43
44 void saveTab(WebTab *tab);
45 bool isClosedTabAvailable() const;
46
47 // Takes tab that was most recently closed
48 Tab takeLastClosedTab();
49 // Takes tab at given index
50 Tab takeTabAt(int index);
51
52 QVector<Tab> closedTabs() const;
53 void clearClosedTabs();
54
55private:
56 QVector<Tab> m_closedTabs;
57};
58
59// Hint to Qt to use std::realloc on item moving
61
62#endif // CLOSEDTABSMANAGER_H
Definition: webtab.h:40
Q_DECLARE_TYPEINFO(ClosedTabsManager::Tab, Q_MOVABLE_TYPE)
#define FALKON_EXPORT
Definition: qzcommon.h:28
QPointer< WebTab > parentTab
WebTab::SavedTab tabState