2023-03-09 14:16:50 +00:00
|
|
|
// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "warning-disable.hpp"
|
|
|
|
#include <QUrl>
|
|
|
|
#include <QWidget>
|
2023-03-10 19:22:48 +00:00
|
|
|
|
|
|
|
#include <memory>
|
2023-03-09 14:16:50 +00:00
|
|
|
#include "warning-enable.hpp"
|
|
|
|
|
2023-03-13 08:17:20 +00:00
|
|
|
#include "obs/browser/obs-browser-panel.hpp"
|
2023-03-10 19:22:48 +00:00
|
|
|
#include "util/util-library.hpp"
|
|
|
|
|
2023-03-09 14:16:50 +00:00
|
|
|
namespace streamfx::ui {
|
|
|
|
class obs_browser_cef {
|
|
|
|
std::shared_ptr<::streamfx::util::library> _module;
|
|
|
|
|
2023-03-13 08:17:20 +00:00
|
|
|
streamfx::obs::QCef* _cef;
|
|
|
|
streamfx::obs::QCefCookieManager* _cookie;
|
2023-03-09 14:16:50 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
obs_browser_cef();
|
|
|
|
|
|
|
|
public:
|
|
|
|
~obs_browser_cef();
|
|
|
|
|
2023-03-13 08:17:20 +00:00
|
|
|
streamfx::obs::QCef* cef();
|
2023-03-09 14:16:50 +00:00
|
|
|
|
2023-03-13 08:17:20 +00:00
|
|
|
streamfx::obs::QCefCookieManager* cookie_manager();
|
2023-03-09 14:16:50 +00:00
|
|
|
|
|
|
|
public: // Singleton
|
|
|
|
static std::shared_ptr<obs_browser_cef> instance();
|
|
|
|
};
|
|
|
|
|
|
|
|
class obs_browser_widget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2023-03-10 19:15:18 +00:00
|
|
|
private:
|
2023-03-09 14:16:50 +00:00
|
|
|
std::shared_ptr<obs_browser_cef> _cef;
|
2023-03-13 08:17:20 +00:00
|
|
|
streamfx::obs::QCefWidget* _widget;
|
2023-03-09 14:16:50 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
obs_browser_widget(QUrl url, QWidget* parent = nullptr);
|
|
|
|
virtual ~obs_browser_widget();
|
|
|
|
|
|
|
|
void set_url(QUrl url);
|
2023-03-09 14:36:53 +00:00
|
|
|
|
2023-03-13 08:17:20 +00:00
|
|
|
streamfx::obs::QCefWidget* cefwidget();
|
2023-03-09 14:40:19 +00:00
|
|
|
|
2023-03-09 14:36:53 +00:00
|
|
|
public:
|
|
|
|
static bool is_available();
|
2023-03-09 14:16:50 +00:00
|
|
|
};
|
|
|
|
} // namespace streamfx::ui
|