Falkon Develop
Cross-platform Qt-based web browser
tabmanagerplugin.h
Go to the documentation of this file.
1/* ============================================================
2* TabManager plugin for Falkon
3* Copyright (C) 2013-2017 S. Razi Alavizadeh <s.r.alavizadeh@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 TABMANAGERPLUGIN_H
19#define TABMANAGERPLUGIN_H
20
21
22#include "plugininterface.h"
24
25#include <QDebug>
26#include <QLabel>
27#include <QMessageBox>
28#include <QVBoxLayout>
29#include <QPointer>
30
32
33class TabManagerPlugin : public QObject, public PluginInterface
34{
35 Q_OBJECT
36 Q_INTERFACES(PluginInterface)
37 Q_PLUGIN_METADATA(IID "Falkon.Browser.plugin.TabManagerPlugin" FILE "tabmanager.json")
38
39public:
40 explicit TabManagerPlugin();
41
42 void init(InitState state, const QString &settingsPath) override;
43 void unload() override;
44 bool testPlugin() override;
45 void showSettings(QWidget *parent) override;
46
47 void populateExtensionsMenu(QMenu *menu) override;
48
49 enum ViewType {
52 Undefined = -1
53 };
54
56
58 void setViewType(ViewType type);
59
60 static QString settingsPath();
61 void saveSettings();
62
63 bool asTabBarReplacement() const;
64 void setAsTabBarReplacement(bool yes);
65
66public Q_SLOTS:
68
69private Q_SLOTS:
70 void mainWindowCreated(BrowserWindow* window, bool refresh = true);
71
72private:
73 void setTabBarVisible(bool visible);
74
75 TabManagerWidgetController* m_controller;
76 TabManagerWidget* m_tabManagerWidget;
77 static QString s_settingsPath;
78 ViewType m_viewType;
79 bool m_initState;
80 bool m_asTabBarReplacement;
81};
82
83#endif // TABMANAGERPLUGIN_H
void init(InitState state, const QString &settingsPath) override
void setViewType(ViewType type)
static QString settingsPath()
void unload() override
bool asTabBarReplacement() const
bool testPlugin() override
void showSettings(QWidget *parent) override
void populateExtensionsMenu(QMenu *menu) override
void setAsTabBarReplacement(bool yes)
State state