/* * 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/smolbote.hg * * SPDX-License-Identifier: GPL-3.0 */ #ifndef BROWSER_H #define BROWSER_H #include "configuration.h" #include "singleapplication.h" #include "webengine/webengineprofile.h" #include #include #include "webengine/cookieinterceptor.h" #include "../plugins/interfaces.h" class MainWindow; class BookmarksWidget; class DownloadsWidget; class UrlRequestInterceptor; class Browser : public SingleApplication { Q_OBJECT public: struct Plugin { QJsonObject meta; QObject *pointer; }; explicit Browser(int &argc, char *argv[]); ~Browser() final; Q_DISABLE_COPY(Browser) void setConfiguration(std::shared_ptr &config); std::shared_ptr profile(const QString &storageName); const QList profiles() const { return m_profiles.keys(); } const QVector plugins() const { return m_plugins; } public slots: MainWindow *createSession(const QString &profileName, bool newWindow, const QStringList &urls); private: MainWindow *createWindow(); std::shared_ptr m_config; QVector m_windows; QVector m_plugins; QHash> m_profiles; std::shared_ptr m_defaultProfile; std::shared_ptr m_urlRequestInterceptor; std::shared_ptr m_cookieInterceptor; std::shared_ptr m_bookmarksManager; std::shared_ptr m_downloadManager; }; #endif // BROWSER_H