Falkon Develop
Cross-platform Qt-based web browser
verticaltabsplugin.h
Go to the documentation of this file.
1/* ============================================================
2* VerticalTabs plugin for Falkon
3* Copyright (C) 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#pragma once
19
20#include "plugininterface.h"
21
22class BrowserWindow;
23
26
27class VerticalTabsPlugin : public QObject, public PluginInterface
28{
29 Q_OBJECT
30 Q_INTERFACES(PluginInterface)
31 Q_PLUGIN_METADATA(IID "Falkon.Browser.plugin.VerticalTabs" FILE "verticaltabs.json")
32
33public:
34 explicit VerticalTabsPlugin();
35
36 void init(InitState state, const QString &settingsPath) override;
37 void unload() override;
38 bool testPlugin() override;
39 void showSettings(QWidget *parent = nullptr) override;
40 bool keyPress(Qz::ObjectName type, QObject *obj, QKeyEvent *event) override;
41
42 enum ViewType {
45 };
46
47 ViewType viewType() const;
48 void setViewType(ViewType type);
49
50 bool replaceTabBar() const;
51 void setReplaceTabBar(bool replace);
52
56 };
57
60
61 QString theme() const;
62 void setTheme(const QString &theme);
63
64 QString styleSheet() const;
65
66Q_SIGNALS:
68 void styleSheetChanged(const QString &styleSheet);
69
70private:
71 void mainWindowCreated(BrowserWindow *window);
72 void setTabBarVisible(bool visible);
73 void setWebTabBehavior(AddChildBehavior behavior);
74 void loadStyleSheet(const QString &theme);
75
76 QString m_settingsPath;
77 VerticalTabsController *m_controller = nullptr;
78 VerticalTabsSchemeHandler *m_schemeHandler = nullptr;
79 ViewType m_viewType = TabListView;
80 bool m_replaceTabBar = false;
81 AddChildBehavior m_addChildBehavior = AppendChild;
82 QString m_theme;
83 QString m_styleSheet;
84};
void init(InitState state, const QString &settingsPath) override
void setReplaceTabBar(bool replace)
void setAddChildBehavior(AddChildBehavior behavior)
bool testPlugin() override
AddChildBehavior addChildBehavior() const
void viewTypeChanged(VerticalTabsPlugin::ViewType type)
void unload() override
void styleSheetChanged(const QString &styleSheet)
ViewType viewType() const
void setViewType(ViewType type)
bool keyPress(Qz::ObjectName type, QObject *obj, QKeyEvent *event) override
void showSettings(QWidget *parent=nullptr) override
QString styleSheet() const
void setTheme(const QString &theme)
ObjectName
Definition: qzcommon.h:89
State state