summaryrefslogtreecommitdiffstats
path: root/src/core/frontend/applets/web_browser.h
blob: d7bd44c27729ca3cfe779582a4fc772ccf14d307 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <functional>
#include <string_view>

#include "core/hle/service/am/applets/web_types.h"

namespace Core::Frontend {

class WebBrowserApplet {
public:
    virtual ~WebBrowserApplet();

    virtual void OpenLocalWebPage(
        const std::string& local_url, std::function<void()> extract_romfs_callback,
        std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const = 0;

    virtual void OpenExternalWebPage(
        const std::string& external_url,
        std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const = 0;
};

class DefaultWebBrowserApplet final : public WebBrowserApplet {
public:
    ~DefaultWebBrowserApplet() override;

    void OpenLocalWebPage(const std::string& local_url,
                          std::function<void()> extract_romfs_callback,
                          std::function<void(Service::AM::Applets::WebExitReason, std::string)>
                              callback) const override;

    void OpenExternalWebPage(const std::string& external_url,
                             std::function<void(Service::AM::Applets::WebExitReason, std::string)>
                                 callback) const override;
};

} // namespace Core::Frontend