1 /*---------------------------------------------------------------------------*
2 
3   Copyright 2010-2014 Nintendo.  All rights reserved.
4 
5   These coded instructions, statements, and computer programs contain
6   proprietary information of Nintendo of America Inc. and/or Nintendo
7   Company Ltd., and are protected by Federal copyright law.  They may
8   not be disclosed to third parties or copied or duplicated in any form,
9   in whole or in part, without the prior written consent of Nintendo.
10 
11  *---------------------------------------------------------------------------*/
12 
13 // sciPublicApi.h
14 //
15 // Interface
16 
17 #ifndef _CAFE_SCI_PUBLIC_API_H_
18 #define _CAFE_SCI_PUBLIC_API_H_
19 
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif // __cplusplus
24 
25 // -------------------------
26 //
27 // For Console Information
28 //
29 // -------------------------
30 
31 /// \brief Get Platform Region (Product Area) of console
32 ///
33 /// \param  region Pointer to get platform region
34 /// \return status
35 /// \retval SCI_STATUS_SUCCESS      Success.
36 /// \retval SCI_STATUS_FAIL         Failed to get the region bit.
37 /// \retval SCI_STATUS_READ_ERROR   Error reading system product information.
38 ///
39 SCIStatus SCIGetPlatformRegion(SCIPlatformRegion *region);
40 
41 // -------------------------
42 //
43 // For Cafe Config Setting
44 //
45 // -------------------------
46 
47 /// \brief Get Current Cafe Language ID from System Config Setting
48 ///
49 /// \param  language Pointer to get language id
50 /// \return status
51 /// \retval SCI_STATUS_SUCCESS          Successfully done.
52 /// \retval SCI_STATUS_FAIL             Failed to get value.
53 /// \retval SCI_STATUS_READ_ERROR       Error reading the system configuration file.
54 /// \retval SCI_STATUS_FILE_NOT_FOUND   System configuration file is not found.
55 /// \retval SCI_STATUS_ITEM_NOT_FOUND   Item is not found in the system configuration file.
56 ///
57 SCIStatus SCIGetCafeLanguage(SCICafeLanguage *language);
58 
59 /// \brief Get Current Cafe Country ID from System Config Setting
60 ///
61 /// \param  country Pointer to get country id
62 /// \return status
63 /// \retval SCI_STATUS_SUCCESS          Successfully done.
64 /// \retval SCI_STATUS_FAIL             Failed to get value.
65 /// \retval SCI_STATUS_READ_ERROR       Error reading the system config file.
66 /// \retval SCI_STATUS_FILE_NOT_FOUND   System config file is not found.
67 /// \retval SCI_STATUS_ITEM_NOT_FOUND   Item is not found in the system config file.
68 ///
69 SCIStatus SCIGetCafeCountry(u32 *country);
70 
71 /// \brief Get Language Code as String
72 ///
73 /// \param  language Langhage id
74 /// \return Language Code String
75 ///
76 const char* SCIGetLanguageCodeA2(SCICafeLanguage language);
77 
78 /// \brief Get Country Code as String
79 ///
80 /// \param  country Country id
81 /// \return Country Code String
82 ///
83 const char* SCIGetCountryCodeA2(u32 country);
84 
85 #ifdef __ghs__
86 /// \brief Get Country Name as utf-8 String
87 ///
88 /// \param  name    Buffer to get country name
89 /// \param  size    Size of buffer. Should be over SCI_CAFE_COUNTRY_NAME_SIZE_MAX.
90 /// \param  country Country id
91 /// \param  type    Language type for string
92 /// \return status
93 /// \retval SCI_STATUS_SUCCESS  Successfully done.
94 /// \retval SCI_STATUS_FAIL     Failed to get string.
95 /// \retval SCI_STATUS_INVALID_SIZE     Invalid buffer size.
96 /// \retval SCI_STATUS_INVALID_PARAM    Invalid input parameter.
97 /// \retval SCI_STATUS_READ_ERROR   Error reading database file.
98 /// \retval SCI_STATUS_FILE_NOT_FOUND   Database file is not found.
99 /// \retval SCI_STATUS_ITEM_NOT_FOUND   Item is not found in database.
100 ///
101 SCIStatus SCIGetCountryName(char *name, u32 size, u32 country, SCICafeLanguage type);
102 
103 /// \brief Get Country Name as utf-16 String
104 ///
105 /// \param  name    Buffer to get country name
106 /// \param  size    Size of buffer. Should be over SCI_CAFE_COUNTRY_NAME_SIZE_MAX.
107 /// \param  country Country id
108 /// \param  type    Language type for string
109 /// \return status
110 /// \retval SCI_STATUS_SUCCESS          Successfully done.
111 /// \retval SCI_STATUS_FAIL             Failed to get string.
112 /// \retval SCI_STATUS_INVALID_SIZE     Invalid buffer size.
113 /// \retval SCI_STATUS_INVALID_PARAM    Invalid input parameter.
114 /// \retval SCI_STATUS_READ_ERROR       Error reading database file.
115 /// \retval SCI_STATUS_FILE_NOT_FOUND   Database file is not found.
116 /// \retval SCI_STATUS_ITEM_NOT_FOUND   Item is not found in database.
117 ///
118 SCIStatus SCIGetCountryNameUtf16(wchar_t *name, u32 size, u32 country, SCICafeLanguage type);
119 
120 /// \brief Get Country Name List as utf-8 String
121 ///
122 /// \param  countryNameList   Buffer to get country name
123 /// \param  type              Language type for string
124 /// \return status
125 /// \retval SCI_STATUS_SUCCESS          Successfully done.
126 /// \retval SCI_STATUS_FAIL             Failed to get string.
127 /// \retval SCI_STATUS_INVALID_SIZE     Invalid buffer size.
128 /// \retval SCI_STATUS_INVALID_PARAM    Invalid input parameter.
129 /// \retval SCI_STATUS_READ_ERROR       Error reading database file.
130 /// \retval SCI_STATUS_FILE_NOT_FOUND   Database file is not found.
131 /// \retval SCI_STATUS_ITEM_NOT_FOUND   Item is not found in database.
132 ///
133 SCIStatus SCIGetCountryNameList(char countryNameList[SCI_CAFE_COUNTRY_MAX][SCI_CAFE_COUNTRY_NAME_SIZE_MAX], SCICafeLanguage type);
134 
135 /// \brief Get Country Name List as utf-8 String
136 ///
137 /// \param  countryNameList   Buffer to get country name
138 /// \param  type              Language type for string
139 /// \return status
140 /// \retval SCI_STATUS_SUCCESS          Successfully done.
141 /// \retval SCI_STATUS_INVALID_PARAM    Invalid input parameter.
142 /// \retval SCI_STATUS_READ_ERROR       Error reading database file.
143 /// \retval SCI_STATUS_FILE_NOT_FOUND   Database file is not found.
144 ///
145 SCIStatus SCIGetCountryNameListUtf16(wchar_t countryNameList[SCI_CAFE_COUNTRY_MAX][SCI_CAFE_COUNTRY_NAME_SIZE_MAX], SCICafeLanguage type);
146 
147 /// \brief Get Area Info with Name as utf-8 String
148 ///
149 /// \param  areaInfo        Buffer to get SCICafeAreaInfo
150 /// \param  simpleAddressId Simple Address ID
151 /// \param  type            Language type for string
152 /// \return status
153 /// \retval SCI_STATUS_SUCCESS          Successfully done.
154 /// \retval SCI_STATUS_FAIL             Failed to get string.
155 /// \retval SCI_STATUS_INVALID_SIZE     Invalid buffer size.
156 /// \retval SCI_STATUS_INVALID_PARAM    Invalid input parameter.
157 /// \retval SCI_STATUS_READ_ERROR       Error reading database file.
158 /// \retval SCI_STATUS_FILE_NOT_FOUND   Database file is not found.
159 /// \retval SCI_STATUS_ITEM_NOT_FOUND   Item is not found in database.
160 ///
161 SCIStatus SCIGetAreaInfo(SCICafeAreaInfo *areaInfo, u32 simpleAddressId, SCICafeLanguage type);
162 
163 /// \brief Get Area Info with Name as utf-16 String
164 ///
165 /// \param  areaInfo        Buffer to get SCICafeAreaInfoUtf16
166 /// \param  simpleAddressId Simple Address ID
167 /// \param  type            Language type for string
168 /// \return status
169 /// \retval SCI_STATUS_SUCCESS          Successfully done.
170 /// \retval SCI_STATUS_FAIL             Failed to get string.
171 /// \retval SCI_STATUS_INVALID_SIZE     Invalid buffer size.
172 /// \retval SCI_STATUS_INVALID_PARAM    Invalid input parameter.
173 /// \retval SCI_STATUS_READ_ERROR       Error reading database file.
174 /// \retval SCI_STATUS_FILE_NOT_FOUND   Database file is not found.
175 /// \retval SCI_STATUS_ITEM_NOT_FOUND   Item is not found in database.
176 ///
177 SCIStatus SCIGetAreaInfoUtf16(SCICafeAreaInfoUtf16 *areaInfo, u32 simpleAddressId, SCICafeLanguage type);
178 
179 #endif
180 
181 // -----------------------------
182 //
183 // For Parental Control Settings
184 //
185 // -----------------------------
186 
187 /// \brief Get status of "Use Parental Control" from System Config Setting
188 ///
189 /// \param  country Pointer to get staus
190 /// \return status
191 /// \retval SCI_STATUS_SUCCESS          Successfully done.
192 /// \retval SCI_STATUS_FAIL             Failed to get value.
193 /// \retval SCI_STATUS_READ_ERROR       Error reading the system configuration file.
194 /// \retval SCI_STATUS_FILE_NOT_FOUND   System configuration file is not found.
195 /// \retval SCI_STATUS_ITEM_NOT_FOUND   Item is not found in the system configuration file.
196 ///
197 SCIStatus SCIGetParentalEnable(SCIBoolean *enable);
198 
199 /// \brief Check the input parental pin code as utf-8 String with pin code in System Config Setting
200 ///
201 /// \param  pin_code pin_code string as utf-8 to check
202 /// \return result
203 ///
204 SCIBoolean SCICheckParentalPinCode(const char* pin_code);
205 
206 /// \brief Check the input parental pin code as utf-16 String with pin code in System Config Setting
207 ///
208 /// \param  pin_code pin_code string as utf-16 to check
209 /// \return result
210 ///
211 SCIBoolean SCICheckParentalPinCodeUtf16(const wchar_t* pin_code);
212 
213 // ------------------------------
214 //
215 // For Parental Account Settings
216 //
217 // ------------------------------
218 
219 // NOTE:
220 //
221 // It is necessary to initialize act library before using following apis.
222 // slot_no is an account slot number prepared by act library.
223 // Be carefull slot_no does not equal to the number of parental account system config file.
224 // The association of those numbers is managed by SCI internally.
225 
226 /// \brief Get Parental Account permission status of "Wii U Shopping Services" from System Config Setting
227 ///
228 /// \param  eshop_purchase Pointer to get staus
229 /// \param  slot_no        Account slot number.
230 /// \return status
231 /// \retval SCI_STATUS_SUCCESS              Successfully done.
232 /// \retval SCI_STATUS_FAIL                 Failed to get value.
233 /// \retval SCI_STATUS_READ_ERROR           Error reading the system configuration file.
234 /// \retval SCI_STATUS_FILE_NOT_FOUND       System configuration file is not found.
235 /// \retval SCI_STATUS_ITEM_NOT_FOUND       Item is not found in the system configuration file.
236 /// \retval SCI_STATUS_ACCOUNT_NOT_FOUND    Account for the slot is not created.
237 ///
238 SCIStatus SCIGetParentalAccountEShopPurchase(SCIBoolean *eshop_purchase, u8 slot_no);
239 
240 /// \brief Get Parental Account permission status of "Friend Registration" from System Config Setting
241 ///
242 /// \param  friend_reg     Pointer to get staus
243 /// \param  slot_no        Account slot number.
244 /// \return status
245 /// \retval SCI_STATUS_SUCCESS              Successfully done.
246 /// \retval SCI_STATUS_FAIL                 Failed to get value.
247 /// \retval SCI_STATUS_READ_ERROR           Error reading the system configuration file.
248 /// \retval SCI_STATUS_FILE_NOT_FOUND       System configuration file is not found.
249 /// \retval SCI_STATUS_ITEM_NOT_FOUND       Item is not found in the system configuration file.
250 /// \retval SCI_STATUS_ACCOUNT_NOT_FOUND    Account for the slot is not created.
251 ///
252 SCIStatus SCIGetParentalAccountFriendReg(SCIBoolean *friend_reg, u8 slot_no);
253 
254 /// \brief Get Parental Account permission status of "Entertainment Excluding Games" from System Config Setting
255 ///
256 /// \param  int_movie      Pointer to get staus
257 /// \param  slot_no        Account slot number.
258 /// \return status
259 /// \retval SCI_STATUS_SUCCESS              Successfully done.
260 /// \retval SCI_STATUS_FAIL                 Failed to get value.
261 /// \retval SCI_STATUS_READ_ERROR           Error reading the system configuration file.
262 /// \retval SCI_STATUS_FILE_NOT_FOUND       System configuration file is not found.
263 /// \retval SCI_STATUS_ITEM_NOT_FOUND       Item is not found in the system configuration file.
264 /// \retval SCI_STATUS_ACCOUNT_NOT_FOUND    Account for the slot is not created.
265 ///
266 SCIStatus SCIGetParentalAccountIntMovie(SCIBoolean *int_movie, u8 slot_no);
267 
268 /// \brief Get Parental Account permission status of "Internet Browser" from System Config Setting
269 ///
270 /// \param  int_browser    Pointer to get staus
271 /// \param  slot_no        Account slot number.
272 /// \return status
273 /// \retval SCI_STATUS_SUCCESS              Successfully done.
274 /// \retval SCI_STATUS_FAIL                 Failed to get value.
275 /// \retval SCI_STATUS_READ_ERROR           Error reading the system configuration file.
276 /// \retval SCI_STATUS_FILE_NOT_FOUND       System configuration file is not found.
277 /// \retval SCI_STATUS_ITEM_NOT_FOUND       Item is not found in the system configuration file.
278 /// \retval SCI_STATUS_ACCOUNT_NOT_FOUND    Account for the slot is not created.
279 ///
280 SCIStatus SCIGetParentalAccountIntBrowser(SCIBoolean *int_browser, u8 slot_no);
281 
282 /// \brief Get Parental Account permission status of "Online Interaction in Game (e.g: chat, data transfer) " from System Config Setting
283 ///
284 /// \param  net_communication_on_game    Pointer to get staus
285 /// \param  slot_no                      Account slot number.
286 /// \return status
287 /// \retval SCI_STATUS_SUCCESS              Successfully done.
288 /// \retval SCI_STATUS_FAIL                 Failed to get value.
289 /// \retval SCI_STATUS_READ_ERROR           Error reading the system configuration file.
290 /// \retval SCI_STATUS_FILE_NOT_FOUND       System configuration file is not found.
291 /// \retval SCI_STATUS_ITEM_NOT_FOUND       Item is not found in the system configuration file.
292 /// \retval SCI_STATUS_ACCOUNT_NOT_FOUND    Account for the slot is not created.
293 ///
294 SCIStatus SCIGetParentalAccountNetCommunicationOnGame(SCIBoolean *net_communication_on_game, u8 slot_no);
295 
296 /// \brief Get Parental Account restriction level of "Miiverse" from System Config Setting
297 ///
298 /// \param  restriction_level    Pointer to get restriction level
299 /// \param  slot_no               Account slot number.
300 /// \return status
301 /// \retval SCI_STATUS_SUCCESS              Successfully done.
302 /// \retval SCI_STATUS_FAIL                 Failed to get value.
303 /// \retval SCI_STATUS_READ_ERROR           Error reading the system configuration file.
304 /// \retval SCI_STATUS_FILE_NOT_FOUND       System configuration file is not found.
305 /// \retval SCI_STATUS_ITEM_NOT_FOUND       Item is not found in the system configuration file.
306 /// \retval SCI_STATUS_ACCOUNT_NOT_FOUND    Account for the slot is not created.
307 ///
308 SCIStatus SCIGetParentalAccountNetworkLauncher(SCIRestrictionLevel *restriction_level, u8 slot_no);
309 
310 // ------------------------------
311 //
312 // For Error Log
313 //
314 // ------------------------------
315 /// \brief Get Error Log
316 ///
317 /// \param  buffer               Pointer to buffer where log will be copied
318 /// \param  buffer_length        Length in bytes of the buffer.
319 /// \param  log_index            Index to system crash log.
320 /// \return result
321 ///
322 u32 SCIGetErrorLog(char* buffer, u32 buffer_length, u32 log_index);
323 
324 #ifdef __cplusplus
325 }
326 #endif // __cplusplus
327 
328 #endif // _CAFE_SCI_PUBLIC_API_H_
329