2018-12-24 16:21:41 -05:00
|
|
|
// Copyright 2018 yuzu emulator team
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <functional>
|
2020-11-15 09:00:19 -05:00
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
#include "core/hle/service/am/applets/web_types.h"
|
|
|
|
|
2018-12-24 16:21:41 -05:00
|
|
|
namespace Core::Frontend {
|
|
|
|
|
|
|
|
class WebBrowserApplet {
|
|
|
|
public:
|
|
|
|
virtual ~WebBrowserApplet();
|
2020-11-15 09:00:19 -05:00
|
|
|
|
|
|
|
virtual void OpenLocalWebPage(
|
2021-04-28 11:32:44 -04:00
|
|
|
const std::string& local_url, std::function<void()> extract_romfs_callback,
|
2020-11-30 10:15:00 -05:00
|
|
|
std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const = 0;
|
2020-12-08 06:20:45 -05:00
|
|
|
|
|
|
|
virtual void OpenExternalWebPage(
|
2021-04-28 11:32:44 -04:00
|
|
|
const std::string& external_url,
|
2020-12-08 06:20:45 -05:00
|
|
|
std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const = 0;
|
2018-12-24 16:21:41 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
class DefaultWebBrowserApplet final : public WebBrowserApplet {
|
|
|
|
public:
|
|
|
|
~DefaultWebBrowserApplet() override;
|
2020-11-15 09:00:19 -05:00
|
|
|
|
2021-04-28 11:32:44 -04:00
|
|
|
void OpenLocalWebPage(const std::string& local_url,
|
|
|
|
std::function<void()> extract_romfs_callback,
|
2020-11-30 10:15:00 -05:00
|
|
|
std::function<void(Service::AM::Applets::WebExitReason, std::string)>
|
|
|
|
callback) const override;
|
2020-12-08 06:20:45 -05:00
|
|
|
|
2021-04-28 11:32:44 -04:00
|
|
|
void OpenExternalWebPage(const std::string& external_url,
|
2020-12-08 06:20:45 -05:00
|
|
|
std::function<void(Service::AM::Applets::WebExitReason, std::string)>
|
|
|
|
callback) const override;
|
2018-12-24 16:21:41 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Core::Frontend
|