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
27
class
WebTab
;
28
29
class
FALKON_EXPORT
ClosedTabsManager
30
{
31
public
:
32
struct
Tab
{
33
int
position = -1;
34
QPointer<WebTab>
parentTab
;
35
WebTab::SavedTab
tabState
;
36
37
bool
isValid
()
const
{
38
return
position > -1;
39
}
40
};
41
42
explicit
ClosedTabsManager
();
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
55
private
:
56
QVector<Tab> m_closedTabs;
57
};
58
59
// Hint to Qt to use std::realloc on item moving
60
Q_DECLARE_TYPEINFO
(
ClosedTabsManager::Tab
, Q_MOVABLE_TYPE);
61
62
#endif
// CLOSEDTABSMANAGER_H
ClosedTabsManager
Definition:
closedtabsmanager.h:30
ClosedTabsManager::ClosedTabsManager
ClosedTabsManager()
WebTab
Definition:
webtab.h:40
Q_DECLARE_TYPEINFO
Q_DECLARE_TYPEINFO(ClosedTabsManager::Tab, Q_MOVABLE_TYPE)
qzcommon.h
FALKON_EXPORT
#define FALKON_EXPORT
Definition:
qzcommon.h:28
ClosedTabsManager::Tab
Definition:
closedtabsmanager.h:32
ClosedTabsManager::Tab::parentTab
QPointer< WebTab > parentTab
Definition:
closedtabsmanager.h:34
ClosedTabsManager::Tab::tabState
WebTab::SavedTab tabState
Definition:
closedtabsmanager.h:35
ClosedTabsManager::Tab::isValid
bool isValid() const
Definition:
closedtabsmanager.h:37
WebTab::SavedTab
Definition:
webtab.h:43
webtab.h
src
lib
tools
closedtabsmanager.h
Generated by
1.9.3