/* * 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 "singleapplication.h" #include #include #include class Configuration; class MainWindow; class BookmarksWidget; class DownloadsWidget; class UrlRequestInterceptor; class WebEngineProfile; class CookieFilter; 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; UrlRequestInterceptor *m_urlRequestInterceptor = nullptr; CookieFilter *m_cookieInterceptor = nullptr; std::shared_ptr m_bookmarksManager; std::shared_ptr m_downloadManager; }; #endif // BROWSER_H