diff options
| author | 2024-01-31 10:25:28 -0600 | |
|---|---|---|
| committer | 2024-01-31 10:25:28 -0600 | |
| commit | 7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c (patch) | |
| tree | 24b2ed412f2683c8460839778ea7761d052bc38f /src/core/frontend/applets/general.h | |
| parent | Merge pull request #12858 from liamwhite/non-blocking (diff) | |
| parent | am: push storage from error applet with non-zero size (diff) | |
| download | yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.gz yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.xz yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.zip | |
Merge pull request #12760 from liamwhite/mp-am
am: rewrite for multiprocess support
Diffstat (limited to 'src/core/frontend/applets/general.h')
| -rw-r--r-- | src/core/frontend/applets/general.h | 63 |
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 | |||
| 11 | namespace Core::Frontend { | ||
| 12 | |||
| 13 | class ParentalControlsApplet : public Applet { | ||
| 14 | public: | ||
| 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 | |||
| 34 | class DefaultParentalControlsApplet final : public ParentalControlsApplet { | ||
| 35 | public: | ||
| 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 | |||
| 46 | class PhotoViewerApplet : public Applet { | ||
| 47 | public: | ||
| 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 | |||
| 54 | class DefaultPhotoViewerApplet final : public PhotoViewerApplet { | ||
| 55 | public: | ||
| 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 | ||