diff options
| author | 2019-06-06 18:40:59 -0400 | |
|---|---|---|
| committer | 2019-06-24 20:05:11 -0400 | |
| commit | 01ff38cca80c5cf7e64494b129dde8d7c8ebbee5 (patch) | |
| tree | 1bcb28a01c067abe641fe167e99416217fba0f5c /src/core/frontend/applets | |
| parent | web_browser: Only delete temporary directory if it was created (diff) | |
| download | yuzu-01ff38cca80c5cf7e64494b129dde8d7c8ebbee5.tar.gz yuzu-01ff38cca80c5cf7e64494b129dde8d7c8ebbee5.tar.xz yuzu-01ff38cca80c5cf7e64494b129dde8d7c8ebbee5.zip | |
general_frontend: Add documentation for parental controls and ecommerce applets
Diffstat (limited to 'src/core/frontend/applets')
| -rw-r--r-- | src/core/frontend/applets/general_frontend.cpp | 12 | ||||
| -rw-r--r-- | src/core/frontend/applets/general_frontend.h | 24 |
2 files changed, 32 insertions, 4 deletions
diff --git a/src/core/frontend/applets/general_frontend.cpp b/src/core/frontend/applets/general_frontend.cpp index e6cb59b64..c30b36de7 100644 --- a/src/core/frontend/applets/general_frontend.cpp +++ b/src/core/frontend/applets/general_frontend.cpp | |||
| @@ -60,10 +60,11 @@ DefaultECommerceApplet::~DefaultECommerceApplet() = default; | |||
| 60 | void DefaultECommerceApplet::ShowApplicationInformation( | 60 | void DefaultECommerceApplet::ShowApplicationInformation( |
| 61 | std::function<void()> finished, u64 title_id, std::optional<u128> user_id, | 61 | std::function<void()> finished, u64 title_id, std::optional<u128> user_id, |
| 62 | std::optional<bool> full_display, std::optional<std::string> extra_parameter) { | 62 | std::optional<bool> full_display, std::optional<std::string> extra_parameter) { |
| 63 | const auto value = user_id.value_or(u128{}); | ||
| 63 | LOG_INFO(Service_AM, | 64 | LOG_INFO(Service_AM, |
| 64 | "Application requested frontend show application information for EShop, " | 65 | "Application requested frontend show application information for EShop, " |
| 65 | "title_id={:016X}, user_id={:016X}{:016X}, full_display={}, extra_parameter={}", | 66 | "title_id={:016X}, user_id={:016X}{:016X}, full_display={}, extra_parameter={}", |
| 66 | title_id, user_id.value_or(u128{})[1], user_id.value_or(u128{})[0], | 67 | title_id, value[1], value[0], |
| 67 | full_display.has_value() ? fmt::format("{}", *full_display) : "null", | 68 | full_display.has_value() ? fmt::format("{}", *full_display) : "null", |
| 68 | extra_parameter.value_or("null")); | 69 | extra_parameter.value_or("null")); |
| 69 | finished(); | 70 | finished(); |
| @@ -72,30 +73,33 @@ void DefaultECommerceApplet::ShowApplicationInformation( | |||
| 72 | void DefaultECommerceApplet::ShowAddOnContentList(std::function<void()> finished, u64 title_id, | 73 | void DefaultECommerceApplet::ShowAddOnContentList(std::function<void()> finished, u64 title_id, |
| 73 | std::optional<u128> user_id, | 74 | std::optional<u128> user_id, |
| 74 | std::optional<bool> full_display) { | 75 | std::optional<bool> full_display) { |
| 76 | const auto value = user_id.value_or(u128{}); | ||
| 75 | LOG_INFO(Service_AM, | 77 | LOG_INFO(Service_AM, |
| 76 | "Application requested frontend show add on content list for EShop, " | 78 | "Application requested frontend show add on content list for EShop, " |
| 77 | "title_id={:016X}, user_id={:016X}{:016X}, full_display={}", | 79 | "title_id={:016X}, user_id={:016X}{:016X}, full_display={}", |
| 78 | title_id, user_id.value_or(u128{})[1], user_id.value_or(u128{})[0], | 80 | title_id, value[1], value[0], |
| 79 | full_display.has_value() ? fmt::format("{}", *full_display) : "null"); | 81 | full_display.has_value() ? fmt::format("{}", *full_display) : "null"); |
| 80 | finished(); | 82 | finished(); |
| 81 | } | 83 | } |
| 82 | 84 | ||
| 83 | void DefaultECommerceApplet::ShowSubscriptionList(std::function<void()> finished, u64 title_id, | 85 | void DefaultECommerceApplet::ShowSubscriptionList(std::function<void()> finished, u64 title_id, |
| 84 | std::optional<u128> user_id) { | 86 | std::optional<u128> user_id) { |
| 87 | const auto value = user_id.value_or(u128{}); | ||
| 85 | LOG_INFO(Service_AM, | 88 | LOG_INFO(Service_AM, |
| 86 | "Application requested frontend show subscription list for EShop, title_id={:016X}, " | 89 | "Application requested frontend show subscription list for EShop, title_id={:016X}, " |
| 87 | "user_id={:016X}{:016X}", | 90 | "user_id={:016X}{:016X}", |
| 88 | title_id, user_id.value_or(u128{})[1], user_id.value_or(u128{})[0]); | 91 | title_id, value[1], value[0]); |
| 89 | finished(); | 92 | finished(); |
| 90 | } | 93 | } |
| 91 | 94 | ||
| 92 | void DefaultECommerceApplet::ShowConsumableItemList(std::function<void()> finished, u64 title_id, | 95 | void DefaultECommerceApplet::ShowConsumableItemList(std::function<void()> finished, u64 title_id, |
| 93 | std::optional<u128> user_id) { | 96 | std::optional<u128> user_id) { |
| 97 | const auto value = user_id.value_or(u128{}); | ||
| 94 | LOG_INFO( | 98 | LOG_INFO( |
| 95 | Service_AM, | 99 | Service_AM, |
| 96 | "Application requested frontend show consumable item list for EShop, title_id={:016X}, " | 100 | "Application requested frontend show consumable item list for EShop, title_id={:016X}, " |
| 97 | "user_id={:016X}{:016X}", | 101 | "user_id={:016X}{:016X}", |
| 98 | title_id, user_id.value_or(u128{})[1], user_id.value_or(u128{})[0]); | 102 | title_id, value[1], value[0]); |
| 99 | finished(); | 103 | finished(); |
| 100 | } | 104 | } |
| 101 | 105 | ||
diff --git a/src/core/frontend/applets/general_frontend.h b/src/core/frontend/applets/general_frontend.h index 616112cfc..4b63f828e 100644 --- a/src/core/frontend/applets/general_frontend.h +++ b/src/core/frontend/applets/general_frontend.h | |||
| @@ -14,10 +14,20 @@ class ParentalControlsApplet { | |||
| 14 | public: | 14 | public: |
| 15 | virtual ~ParentalControlsApplet(); | 15 | virtual ~ParentalControlsApplet(); |
| 16 | 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. | ||
| 17 | virtual void VerifyPIN(std::function<void(bool)> finished, | 20 | virtual void VerifyPIN(std::function<void(bool)> finished, |
| 18 | bool suspend_future_verification_temporarily) = 0; | 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. | ||
| 19 | virtual void VerifyPINForSettings(std::function<void(bool)> finished) = 0; | 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. | ||
| 20 | virtual void RegisterPIN(std::function<void()> finished) = 0; | 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. | ||
| 21 | virtual void ChangePIN(std::function<void()> finished) = 0; | 31 | virtual void ChangePIN(std::function<void()> finished) = 0; |
| 22 | }; | 32 | }; |
| 23 | 33 | ||
| @@ -52,18 +62,32 @@ class ECommerceApplet { | |||
| 52 | public: | 62 | public: |
| 53 | virtual ~ECommerceApplet(); | 63 | virtual ~ECommerceApplet(); |
| 54 | 64 | ||
| 65 | // Shows a page with application icons, description, name, and price. | ||
| 55 | virtual void ShowApplicationInformation(std::function<void()> finished, u64 title_id, | 66 | virtual void ShowApplicationInformation(std::function<void()> finished, u64 title_id, |
| 56 | std::optional<u128> user_id = {}, | 67 | std::optional<u128> user_id = {}, |
| 57 | std::optional<bool> full_display = {}, | 68 | std::optional<bool> full_display = {}, |
| 58 | std::optional<std::string> extra_parameter = {}) = 0; | 69 | std::optional<std::string> extra_parameter = {}) = 0; |
| 70 | |||
| 71 | // Shows a page with all of the add on content available for a game, with name, description, and | ||
| 72 | // price. | ||
| 59 | virtual void ShowAddOnContentList(std::function<void()> finished, u64 title_id, | 73 | virtual void ShowAddOnContentList(std::function<void()> finished, u64 title_id, |
| 60 | std::optional<u128> user_id = {}, | 74 | std::optional<u128> user_id = {}, |
| 61 | std::optional<bool> full_display = {}) = 0; | 75 | std::optional<bool> full_display = {}) = 0; |
| 76 | |||
| 77 | // Shows a page with all of the subscriptions (recurring payments) for a game, with name, | ||
| 78 | // description, price, and renewal period. | ||
| 62 | virtual void ShowSubscriptionList(std::function<void()> finished, u64 title_id, | 79 | virtual void ShowSubscriptionList(std::function<void()> finished, u64 title_id, |
| 63 | std::optional<u128> user_id = {}) = 0; | 80 | std::optional<u128> user_id = {}) = 0; |
| 81 | |||
| 82 | // Shows a page with a list of any additional game related purchasable items (DLC, | ||
| 83 | // subscriptions, etc) for a particular game, with name, description, type, and price. | ||
| 64 | virtual void ShowConsumableItemList(std::function<void()> finished, u64 title_id, | 84 | virtual void ShowConsumableItemList(std::function<void()> finished, u64 title_id, |
| 65 | std::optional<u128> user_id = {}) = 0; | 85 | std::optional<u128> user_id = {}) = 0; |
| 86 | |||
| 87 | // Shows the home page of the shop. | ||
| 66 | virtual void ShowShopHome(std::function<void()> finished, u128 user_id, bool full_display) = 0; | 88 | virtual void ShowShopHome(std::function<void()> finished, u128 user_id, bool full_display) = 0; |
| 89 | |||
| 90 | // Shows the user settings page of the shop. | ||
| 67 | virtual void ShowSettings(std::function<void()> finished, u128 user_id, bool full_display) = 0; | 91 | virtual void ShowSettings(std::function<void()> finished, u128 user_id, bool full_display) = 0; |
| 68 | }; | 92 | }; |
| 69 | 93 | ||