/* * 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 SMOLBOTE_BROWSER_H #define SMOLBOTE_BROWSER_H #include "singleapplication.h" #include #include #include #include #include QVector loadPlugins(const QString &location); class Configuration; class BookmarksWidget; class DownloadsWidget; class UrlRequestInterceptor; class MainWindow; class WebProfile; class Browser : public SingleApplication { Q_OBJECT public: explicit Browser(int &argc, char *argv[]); ~Browser() final; Q_DISABLE_COPY(Browser) void setConfiguration(std::shared_ptr &config); void setup(const QString &defaultProfile); std::shared_ptr bookmarks() { return m_bookmarks; } WebProfile *profile(const QString &name) const; const QStringList profiles() const { return m_profiles.keys(); } int command(const QString &command); const QStringList commands() const { return m_commands.keys(); } const QVector plugins() const { return m_plugins; } signals: void registerProfile(WebProfile *profile); public slots: void createSession(const QString &profileName, bool newWindow, const QStringList &urls); MainWindow *createWindow(); private: std::shared_ptr m_config; std::shared_ptr m_bookmarks; std::shared_ptr m_downloads; std::shared_ptr m_urlFilter; QMap m_profiles; QVector m_windows; QVector m_plugins; QHash> m_commands; }; #endif // SMOLBOTE_BROWSER_H