general_frontend.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright 2019 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <functional>
  6. #include "common/common_types.h"
  7. namespace Core::Frontend {
  8. class ParentalControlsApplet {
  9. public:
  10. virtual ~ParentalControlsApplet();
  11. // Prompts the user to enter a PIN and calls the callback with whether or not it matches the
  12. // correct PIN. If the bool is passed, and the PIN was recently entered correctly, the frontend
  13. // should not prompt and simply return true.
  14. virtual void VerifyPIN(std::function<void(bool)> finished,
  15. bool suspend_future_verification_temporarily) = 0;
  16. // Prompts the user to enter a PIN and calls the callback for correctness. Frontends can
  17. // optionally alert the user that this is to change parental controls settings.
  18. virtual void VerifyPINForSettings(std::function<void(bool)> finished) = 0;
  19. // Prompts the user to create a new PIN for pctl and stores it with the service.
  20. virtual void RegisterPIN(std::function<void()> finished) = 0;
  21. // Prompts the user to verify the current PIN and then store a new one into pctl.
  22. virtual void ChangePIN(std::function<void()> finished) = 0;
  23. };
  24. class DefaultParentalControlsApplet final : public ParentalControlsApplet {
  25. public:
  26. ~DefaultParentalControlsApplet() override;
  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. class PhotoViewerApplet {
  34. public:
  35. virtual ~PhotoViewerApplet();
  36. virtual void ShowPhotosForApplication(u64 title_id, std::function<void()> finished) const = 0;
  37. virtual void ShowAllPhotos(std::function<void()> finished) const = 0;
  38. };
  39. class DefaultPhotoViewerApplet final : public PhotoViewerApplet {
  40. public:
  41. ~DefaultPhotoViewerApplet() override;
  42. void ShowPhotosForApplication(u64 title_id, std::function<void()> finished) const override;
  43. void ShowAllPhotos(std::function<void()> finished) const override;
  44. };
  45. } // namespace Core::Frontend