/* * 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) public slots: void about(); public: void setConfiguration(std::shared_ptr &config); void registerPlugin(const Plugin &plugin); 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(); } 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; }; #endif // SMOLBOTE_BROWSER_H