summaryrefslogtreecommitdiff
path: root/src/core/frontend/applets/general.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/frontend/applets/general.h')
-rw-r--r--src/core/frontend/applets/general.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/core/frontend/applets/general.h b/src/core/frontend/applets/general.h
new file mode 100644
index 000000000..319838ac7
--- /dev/null
+++ b/src/core/frontend/applets/general.h
@@ -0,0 +1,63 @@
1// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#pragma once
5
6#include <functional>
7#include "common/common_types.h"
8
9#include "core/frontend/applets/applet.h"
10
11namespace Core::Frontend {
12
13class ParentalControlsApplet : public Applet {
14public:
15 virtual ~ParentalControlsApplet();
16
17 // Prompts the user to enter a PIN and calls the callback with whether or not it matches the
18 // correct PIN. If the bool is passed, and the PIN was recently entered correctly, the frontend
19 // should not prompt and simply return true.
20 virtual void VerifyPIN(std::function<void(bool)> finished,
21 bool suspend_future_verification_temporarily) = 0;
22
23 // Prompts the user to enter a PIN and calls the callback for correctness. Frontends can
24 // optionally alert the user that this is to change parental controls settings.
25 virtual void VerifyPINForSettings(std::function<void(bool)> finished) = 0;
26
27 // Prompts the user to create a new PIN for pctl and stores it with the service.
28 virtual void RegisterPIN(std::function<void()> finished) = 0;
29
30 // Prompts the user to verify the current PIN and then store a new one into pctl.
31 virtual void ChangePIN(std::function<void()> finished) = 0;
32};
33
34class DefaultParentalControlsApplet final : public ParentalControlsApplet {
35public:
36 ~DefaultParentalControlsApplet() override;
37
38 void Close() const override;
39 void VerifyPIN(std::function<void(bool)> finished,
40 bool suspend_future_verification_temporarily) override;
41 void VerifyPINForSettings(std::function<void(bool)> finished) override;
42 void RegisterPIN(std::function<void()> finished) override;
43 void ChangePIN(std::function<void()> finished) override;
44};
45
46class PhotoViewerApplet : public Applet {
47public:
48 virtual ~PhotoViewerApplet();
49
50 virtual void ShowPhotosForApplication(u64 title_id, std::function<void()> finished) const = 0;
51 virtual void ShowAllPhotos(std::function<void()> finished) const = 0;
52};
53
54class DefaultPhotoViewerApplet final : public PhotoViewerApplet {
55public:
56 ~DefaultPhotoViewerApplet() override;
57
58 void Close() const override;
59 void ShowPhotosForApplication(u64 title_id, std::function<void()> finished) const override;
60 void ShowAllPhotos(std::function<void()> finished) const override;
61};
62
63} // namespace Core::Frontend