summaryrefslogblamecommitdiffstats
path: root/src/core/frontend/applets/web_browser.h
blob: b70856a22befeee2592b4ecbe69421badeb5f7a8 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                                               



                     
 
                                         
                                                                  
 

                          
                                        
       

                                                       
                                                                               
 
                                
 


                                                                              
 

                                                                             




                                                               
 

                                

                                                                                                    
 
                                                             
                                                                          


                             
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <functional>

#include "core/frontend/applets/applet.h"
#include "core/hle/service/am/frontend/applet_web_browser_types.h"

namespace Core::Frontend {

class WebBrowserApplet : public Applet {
public:
    using ExtractROMFSCallback = std::function<void()>;
    using OpenWebPageCallback =
        std::function<void(Service::AM::Frontend::WebExitReason, std::string)>;

    virtual ~WebBrowserApplet();

    virtual void OpenLocalWebPage(const std::string& local_url,
                                  ExtractROMFSCallback extract_romfs_callback,
                                  OpenWebPageCallback callback) const = 0;

    virtual void OpenExternalWebPage(const std::string& external_url,
                                     OpenWebPageCallback callback) const = 0;
};

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

    void Close() const override;

    void OpenLocalWebPage(const std::string& local_url, ExtractROMFSCallback extract_romfs_callback,
                          OpenWebPageCallback callback) const override;

    void OpenExternalWebPage(const std::string& external_url,
                             OpenWebPageCallback callback) const override;
};

} // namespace Core::Frontend