summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Zach Hilman2019-06-05 12:11:24 -0400
committerGravatar Zach Hilman2019-06-24 20:05:11 -0400
commitc96450f6e248ce0cd8dc69d91c691e70ede984e0 (patch)
treea908fee599f2dc1534eb0dfeb8eedc1f231c608d /src
parentapplets: Implement Auth applet backend (diff)
downloadyuzu-c96450f6e248ce0cd8dc69d91c691e70ede984e0.tar.gz
yuzu-c96450f6e248ce0cd8dc69d91c691e70ede984e0.tar.xz
yuzu-c96450f6e248ce0cd8dc69d91c691e70ede984e0.zip
frontend: Add base class and default impl of parent controls applet frontend
Diffstat (limited to 'src')
-rw-r--r--src/core/frontend/applets/general_frontend.cpp31
-rw-r--r--src/core/frontend/applets/general_frontend.h22
2 files changed, 52 insertions, 1 deletions
diff --git a/src/core/frontend/applets/general_frontend.cpp b/src/core/frontend/applets/general_frontend.cpp
index b974f2289..7483ffb76 100644
--- a/src/core/frontend/applets/general_frontend.cpp
+++ b/src/core/frontend/applets/general_frontend.cpp
@@ -7,9 +7,38 @@
7 7
8namespace Core::Frontend { 8namespace Core::Frontend {
9 9
10ParentalControlsApplet::~ParentalControlsApplet() = default;
11
12DefaultParentalControlsApplet::~DefaultParentalControlsApplet() = default;
13
14void DefaultParentalControlsApplet::VerifyPIN(std::function<void(bool)> finished,
15 bool suspend_future_verification_temporarily) {
16 LOG_INFO(Service_AM,
17 "Application requested frontend to verify PIN (normal), "
18 "suspend_future_verification_temporarily={}, verifying as correct.",
19 suspend_future_verification_temporarily);
20 finished(true);
21}
22
23void DefaultParentalControlsApplet::VerifyPINForSettings(std::function<void(bool)> finished) {
24 LOG_INFO(Service_AM,
25 "Application requested frontend to verify PIN (settings), verifying as correct.");
26 finished(true);
27}
28
29void DefaultParentalControlsApplet::RegisterPIN(std::function<void()> finished) {
30 LOG_INFO(Service_AM, "Application requested frontend to register new PIN");
31 finished();
32}
33
34void DefaultParentalControlsApplet::ChangePIN(std::function<void()> finished) {
35 LOG_INFO(Service_AM, "Application requested frontend to change PIN to new value");
36 finished();
37}
38
10PhotoViewerApplet::~PhotoViewerApplet() = default; 39PhotoViewerApplet::~PhotoViewerApplet() = default;
11 40
12DefaultPhotoViewerApplet::~DefaultPhotoViewerApplet() {} 41DefaultPhotoViewerApplet::~DefaultPhotoViewerApplet() = default;
13 42
14void DefaultPhotoViewerApplet::ShowPhotosForApplication(u64 title_id, 43void DefaultPhotoViewerApplet::ShowPhotosForApplication(u64 title_id,
15 std::function<void()> finished) const { 44 std::function<void()> finished) const {
diff --git a/src/core/frontend/applets/general_frontend.h b/src/core/frontend/applets/general_frontend.h
index d4506c999..48e3ce651 100644
--- a/src/core/frontend/applets/general_frontend.h
+++ b/src/core/frontend/applets/general_frontend.h
@@ -9,6 +9,28 @@
9 9
10namespace Core::Frontend { 10namespace Core::Frontend {
11 11
12class ParentalControlsApplet {
13public:
14 virtual ~ParentalControlsApplet();
15
16 virtual void VerifyPIN(std::function<void(bool)> finished,
17 bool suspend_future_verification_temporarily) = 0;
18 virtual void VerifyPINForSettings(std::function<void(bool)> finished) = 0;
19 virtual void RegisterPIN(std::function<void()> finished) = 0;
20 virtual void ChangePIN(std::function<void()> finished) = 0;
21};
22
23class DefaultParentalControlsApplet final : public ParentalControlsApplet {
24public:
25 ~DefaultParentalControlsApplet() override;
26
27 void VerifyPIN(std::function<void(bool)> finished,
28 bool suspend_future_verification_temporarily) override;
29 void VerifyPINForSettings(std::function<void(bool)> finished) override;
30 void RegisterPIN(std::function<void()> finished) override;
31 void ChangePIN(std::function<void()> finished) override;
32};
33
12class PhotoViewerApplet { 34class PhotoViewerApplet {
13public: 35public:
14 virtual ~PhotoViewerApplet(); 36 virtual ~PhotoViewerApplet();