/* * This file is part of smolbote. It's copyrighted by the contributors recorded * in the version control history of the file, available from its original * location: https://neueland.iserlohn-fortress.net/cgit/smolbote * * SPDX-License-Identifier: GPL-3.0 */ #ifndef SMOLBOTE_BROWSER_H #define SMOLBOTE_BROWSER_H #include "smolblok.hpp" #include "smolbote/session.hpp" #include "webengine/webprofilemanager.h" #include #include #include #include #include #include #include class Configuration; class BookmarksWidget; class DownloadsWidget; class MainWindow; class Browser final : public SingleApplication { Q_OBJECT public: explicit Browser(int &argc, char *argv[], bool allowSecondary = true); ~Browser() final; const QVector windows() const { return qAsConst(m_windows); } [[deprecated]] BookmarksWidget *bookmarks() const { return m_bookmarks.get(); } [[deprecated]] DownloadsWidget *downloads() const { return m_downloads.get(); } bool remoteEnabled() const { return static_cast(remoteConnection); } signals: void pluginAdded(QPluginLoader *); public slots: [[deprecated]] void about(); [[deprecated]] void aboutPlugins(); [[deprecated]] void showWidget(QWidget *widget, MainWindow *where) const; void open(const QVector &data, bool merge = true); void loadConfiguration(const QString &path); bool loadPlugin(const QString &path); void enableRemote(bool toggle); private: struct PluginInfo { explicit PluginInfo(QPluginLoader *l) { this->loader = l; } ~PluginInfo() { loader->unload(); for(auto *m : qAsConst(menus)) m->deleteLater(); }; QPluginLoader *loader; QVector menus; }; Q_DISABLE_COPY(Browser) QMetaObject::Connection remoteConnection; std::unique_ptr m_conf; std::shared_ptr m_bookmarks; std::unique_ptr m_downloads; std::unique_ptr> m_profileManager{ nullptr }; smolblok content_filter; QVector m_windows; QVector m_plugins; }; #endif // SMOLBOTE_BROWSER_H