aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/BrowserApp.hpp
blob: d29dc1baa21cd438eeca41163483d132dbc2ba7d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include "Configuration.hpp"
#include "widgets/BrowserWindow.hpp"
#include <qlist.h>
#include <qwebengineprofile.h>

class BrowserApp : public QObject {
  Q_OBJECT

public:
  BrowserApp(Configuration &configuration);

  BrowserWindow *create_window(const QStringList &urls = {});

protected:
  bool eventFilter(QObject *target, QEvent *event) override;

private:
  Configuration &configuration;
  QWebEngineProfile default_profile{"default"};

  QList<QWebEngineProfile *> profiles() { return {&default_profile}; }
  void setup_profile(QWebEngineProfile *profile);
};