diff options
| author | 2019-06-05 12:11:24 -0400 | |
|---|---|---|
| committer | 2019-06-24 20:05:11 -0400 | |
| commit | c96450f6e248ce0cd8dc69d91c691e70ede984e0 (patch) | |
| tree | a908fee599f2dc1534eb0dfeb8eedc1f231c608d /src | |
| parent | applets: Implement Auth applet backend (diff) | |
| download | yuzu-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.cpp | 31 | ||||
| -rw-r--r-- | src/core/frontend/applets/general_frontend.h | 22 |
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 | ||
| 8 | namespace Core::Frontend { | 8 | namespace Core::Frontend { |
| 9 | 9 | ||
| 10 | ParentalControlsApplet::~ParentalControlsApplet() = default; | ||
| 11 | |||
| 12 | DefaultParentalControlsApplet::~DefaultParentalControlsApplet() = default; | ||
| 13 | |||
| 14 | void 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 | |||
| 23 | void 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 | |||
| 29 | void DefaultParentalControlsApplet::RegisterPIN(std::function<void()> finished) { | ||
| 30 | LOG_INFO(Service_AM, "Application requested frontend to register new PIN"); | ||
| 31 | finished(); | ||
| 32 | } | ||
| 33 | |||
| 34 | void DefaultParentalControlsApplet::ChangePIN(std::function<void()> finished) { | ||
| 35 | LOG_INFO(Service_AM, "Application requested frontend to change PIN to new value"); | ||
| 36 | finished(); | ||
| 37 | } | ||
| 38 | |||
| 10 | PhotoViewerApplet::~PhotoViewerApplet() = default; | 39 | PhotoViewerApplet::~PhotoViewerApplet() = default; |
| 11 | 40 | ||
| 12 | DefaultPhotoViewerApplet::~DefaultPhotoViewerApplet() {} | 41 | DefaultPhotoViewerApplet::~DefaultPhotoViewerApplet() = default; |
| 13 | 42 | ||
| 14 | void DefaultPhotoViewerApplet::ShowPhotosForApplication(u64 title_id, | 43 | void 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 | ||
| 10 | namespace Core::Frontend { | 10 | namespace Core::Frontend { |
| 11 | 11 | ||
| 12 | class ParentalControlsApplet { | ||
| 13 | public: | ||
| 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 | |||
| 23 | class DefaultParentalControlsApplet final : public ParentalControlsApplet { | ||
| 24 | public: | ||
| 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 | |||
| 12 | class PhotoViewerApplet { | 34 | class PhotoViewerApplet { |
| 13 | public: | 35 | public: |
| 14 | virtual ~PhotoViewerApplet(); | 36 | virtual ~PhotoViewerApplet(); |