aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/BrowserApp.hpp
blob: dcfe6f48607eb6032e5e55fa00819a76a3348f34 (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{&default_profile};

  void setup_profile(QWebEngineProfile *profile);
};