libnx  v4.2.2
pctlauth.h
Go to the documentation of this file.
1 /**
2  * @file pctlauth.h
3  * @brief Wrapper for using the Parental Controls authentication LibraryApplet. This applet is used by qlaunch.
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 
10 /// Type values for PctlAuthArg::type.
11 typedef enum {
12  PctlAuthType_Show = 0, ///< ShowParentalAuthentication
13  PctlAuthType_RegisterPasscode = 1, ///< RegisterParentalPasscode
14  PctlAuthType_ChangePasscode = 2, ///< ChangeParentalPasscode
15 } PctlAuthType;
16 
17 /// Input arg storage for the applet.
18 typedef struct {
19  u32 unk_x0; ///< Always set to 0 by the user-process.
20  PctlAuthType type; ///< \ref PctlAuthType
21  u8 arg0; ///< Arg0
22  u8 arg1; ///< Arg1
23  u8 arg2; ///< Arg2
24  u8 pad; ///< Padding
25 } PctlAuthArg;
26 
27 /**
28  * @brief Launches the applet.
29  * @note Should not be used if a PIN is not already registered. See \ref pctlIsRestrictionEnabled.
30  * @param flag Input flag. false = temporarily disable Parental Controls. true = validate the input PIN.
31  */
32 Result pctlauthShow(bool flag);
33 
34 /**
35  * @brief Launches the applet. Only available with [4.0.0+].
36  * @param arg0 Value for PctlAuthArg.arg0.
37  * @param arg1 Value for PctlAuthArg.arg1.
38  * @param arg2 Value for PctlAuthArg.arg2.
39  */
40 Result pctlauthShowEx(u8 arg0, u8 arg1, u8 arg2);
41 
42 /**
43  * @brief Just calls: pctlauthShowEx(1, 0, 1). Launches the applet for checking the PIN, used when changing system-settings.
44  * @note Should not be used if a PIN is not already registered. See \ref pctlIsRestrictionEnabled.
45  */
47 
48 /**
49  * @brief Launches the applet for registering the Parental Controls PIN.
50  */
52 
53 /**
54  * @brief Launches the applet for changing the Parental Controls PIN.
55  * @note Should not be used if a PIN is not already registered. See \ref pctlIsRestrictionEnabled.
56  */
58 
PctlAuthArg
Input arg storage for the applet.
Definition: pctlauth.h:18
pctlauthShow
Result pctlauthShow(bool flag)
Launches the applet.
u8
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
PctlAuthArg::arg1
u8 arg1
Arg1.
Definition: pctlauth.h:22
PctlAuthType_RegisterPasscode
@ PctlAuthType_RegisterPasscode
RegisterParentalPasscode.
Definition: pctlauth.h:13
pctlauthShowForConfiguration
Result pctlauthShowForConfiguration(void)
Just calls: pctlauthShowEx(1, 0, 1).
PctlAuthType_Show
@ PctlAuthType_Show
ShowParentalAuthentication.
Definition: pctlauth.h:12
u32
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
pctlauthShowEx
Result pctlauthShowEx(u8 arg0, u8 arg1, u8 arg2)
Launches the applet.
pctlauthChangePasscode
Result pctlauthChangePasscode(void)
Launches the applet for changing the Parental Controls PIN.
Result
u32 Result
Function error code result type.
Definition: types.h:44
PctlAuthArg::unk_x0
u32 unk_x0
Always set to 0 by the user-process.
Definition: pctlauth.h:19
PctlAuthArg::arg2
u8 arg2
Arg2.
Definition: pctlauth.h:23
PctlAuthArg::pad
u8 pad
Padding.
Definition: pctlauth.h:24
PctlAuthArg::type
PctlAuthType type
PctlAuthType
Definition: pctlauth.h:20
pctlauthRegisterPasscode
Result pctlauthRegisterPasscode(void)
Launches the applet for registering the Parental Controls PIN.
PctlAuthType
PctlAuthType
Type values for PctlAuthArg::type.
Definition: pctlauth.h:11
PctlAuthArg::arg0
u8 arg0
Arg0.
Definition: pctlauth.h:21
PctlAuthType_ChangePasscode
@ PctlAuthType_ChangePasscode
ChangeParentalPasscode.
Definition: pctlauth.h:14