1 /*---------------------------------------------------------------------------*
2 
3 Project: OLV
4 File: olv_Api.h
5 
6 Copyright (C) 2009-2013 Nintendo. All rights reserved.
7 
8 These coded instructions, statements, and computer programs contain
9 proprietary information of Nintendo of America Inc. and/or Nintendo
10 Company Ltd., and are protected by Federal copyright law.  They may
11 not be disclosed to third parties or copied or duplicated in any form,
12 in whole or in part, without the prior written consent of Nintendo.
13 
14  *---------------------------------------------------------------------------*/
15 //------------------------------------------------------------------------------
16 /** @file  olv_Api.h
17  *
18 *  @brief The main header for the OLV library.
19  *
20  */
21 //------------------------------------------------------------------------------
22 
23 // -----------------------------------------------------------------------------
24 // standard header here
25 // -----------------------------------------------------------------------------
26 
27 #ifndef __OLV_API_H_
28 #define __OLV_API_H_
29 
30 /// <span>nn</span>
31 namespace nn {
32 
33 /// <span>olv</span>
34 namespace olv {
35 
36 /** @defgroup function  Static Functions
37  *  @{
38  */
39 
40 //------------------------------------------------------------------------------
41 /**
42 *  Initialization.
43  *
44 *  Initializes the Olive library (OLV). <br/>
45 *  Call this function before using the Olive library.
46  *
47 *  If this function is called with <tt>nn::olv::InitializeParam</tt> specified in its default state, the library is initialized in online mode. <br/>
48  *
49 *  If this function is called with <tt>@ref nn::olv::InitializeParam::FLAG_OFFLINE_MODE</tt> specified by <tt>nn::olv::InitializeParam::SetFlags</tt>, the library is initialized in offline mode <br/>
50  *
51 *  The difference between online mode and offline mode is described below.
52  *
53 *  <b>Online Mode</b><br />
54 *  At initialization, the service token is obtained, a connection is made to the server, and it prepares the online APIs to be available. <br/>
55  *
56 *  If initialized in online mode, you can use all the features of the OLV library. <br/>
57 *  When this function is called in online mode, it temporarily blocks processing while it searches for a server to connect to. <br/>
58  *
59 *  (The server stores the URLs that the OLV library needs to send and receive data.) <br/>
60 *  The <tt>@ref nn::olv::SwitchToOnlineMode</tt> function is called if the library is initialized in online mode. <br/>
61 *  Also refer to the errors from that function.
62  *
63 *  <b>Offline Mode</b><br />
64 *  Performs minimal initialization, such as initializing a work buffer, that does not require communication to be established. <br/>
65 *  The function finishes quickly because it does not establish communication, but API functions for use in online mode are not available. <br/>
66 *  If the library is initialized in offline mode, you can switch to online mode later at any time by calling the <tt>@ref nn::olv::SwitchToOnlineMode</tt> function. <br/>
67 *
68  *
69 *  When this function is called, it also initializes other OLV modules.
70  *
71 *  @param[in] param  Specifies parameters used for initialization.
72  *
73 *  @retval ResultSuccess  Indicates success.
74 *  @retval ResultInitialized  Indicates that the library is already initialized.
75 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
76 *  @retval ResultInitializeError  Indicates that initialization failed.
77 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
78 *  @retval ResultCanceled  Indicates that the action was canceled.
79 *  @retval ResultLibraryRestrictedByParentalControl  Indicates that posting and viewing are blocked by Parental Controls.
80 *  @retval ResultAcpError  Indicates that the ACP function failed.
81 *  @retval ResultSciError  Indicates that the SCI function failed.
82 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
83 *  @retval ResultHttpError  Indicates an HTTP error.
84 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
85 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
86 *  @retval ResultServerError  Indicates that an error occurred on the server.
87 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
88 *  @retval ResultInternalError  Indicates an internal error in the library.
89  *
90 *  This function calls the following functions in the <tt>nn::act</tt> namespace. <br />
91 *  - <tt>nn::act::Initialize</tt><br />
92 *  - <tt>nn::act::GetSlotNo</tt><br />
93 *  - <tt>nn::act::GetTransferableIdEx</tt><br />
94 *  - <tt>nn::act::GetTimeZoneId</tt><br />
95 *  - <tt>nn::act::GetUtcOffset</tt><br />
96 *  <b>If initialized in online mode</b><br />
97 *  - <tt>nn::act::AcquireIndependentServiceToken</tt>
98  *
99 *  All of these functions except for <tt>nn::act::GetSlotNo</tt> and <tt>nn::act::GetUtcOffset</tt> may return an error. <br />
100 *  The error that is returned is an <tt>nn::act</tt> error, so refer to the <tt>nn::act</tt> error codes.<br />
101 *
102  *
103 *  <b>Note:</b><br/>
104 * If the library is initialized in online mode, this function calls <tt>@ref nn::olv::SwitchToOnlineMode</tt>. The application is prohibited from automatically trying to call the function again if the function fails.<br/>
105 *
106  */
107 nn::Result Initialize(const nn::olv::InitializeParam* param);
108 
109 //------------------------------------------------------------------------------
110 /**
111 *  Initializes the version that gets the parameters passed at the time of the application jump from the system parameters. <br/>
112  *
113  *
114 *  If initialization succeeds, the information passed at the time of the application jump is stored in <tt>@ref nn::olv::MainAppParam</tt> and can be used by the application. <br/>
115  *
116  *
117 *  If the parameters passed at the time of the application jump failed to be stored, the <tt>@ref nn::olv::Initialize</tt> function is called internally to perform the normal initialization process without bothering to return an error. <br/>
118  *
119 * (If this happens, values inside <tt>@ref nn::olv::MainAppParam</tt> are undefined.)
120  *
121 *  The initialization process is otherwise the same as the <tt>@ref nn::olv::Initialize</tt> function, but initialization is faster because communications do not take place, even when the library is being initialized in online mode to use the parameters passed at the time of the application jump that are necessary for communications. <br/>
122  *
123  *
124  *
125 *  Also, see the description of the <tt>@ref nn::olv::Initialize</tt> function.
126  *
127 *  <b>Note:</b><br/>
128 *  You cannot call this function in offline mode. <br/>
129 *  If this function is called in offline mode, <tt>@ref nn::olv::ResultInvalidParameter</tt> is returned. <br/>
130  *
131  *
132 *  @param[out] mainAppParam ... Specifies the parameter storing the parameters passed at the time of the application jump.
133 *  @param[in] param  Specifies parameters used for initialization.
134  *
135 *  @retval ResultSuccess  Indicates success.
136 *  @retval ResultInitialized  Indicates that the library is already initialized.
137 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
138 *  @retval ResultInitializeError  Indicates that initialization failed.
139 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
140 *  @retval ResultCanceled  Indicates that the action was canceled.
141 *  @retval ResultLibraryRestrictedByParentalControl  Indicates that posting and viewing are blocked by Parental Controls.
142 *  @retval ResultAcpError  Indicates that the ACP function failed.
143 *  @retval ResultSciError  Indicates that the SCI function failed.
144 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
145 *  @retval ResultHttpError  Indicates an HTTP error.
146 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
147 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
148 *  @retval ResultServerError  Indicates that an error occurred on the server.
149 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
150 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
151 *  @retval ResultInternalError  Indicates an internal error in the library.
152  *
153 *  This function may call the following functions in the <tt>nn::act</tt> namespace. <br/>
154 *  - <tt>nn::act::Initialize</tt><br />
155 *  - <tt>nn::act::GetSlotNo</tt><br />
156 *  - <tt>nn::act::GetTransferableIdEx</tt><br />
157 *  - <tt>nn::act::GetTimeZoneId</tt><br />
158 *  - <tt>nn::act::GetUtcOffset</tt><br />
159 *  - <tt>nn::act::AcquireIndependentServiceToken</tt>
160  *
161 *  All of these functions except for <tt>nn::act::GetSlotNo</tt> and <tt>nn::act::GetUtcOffset</tt> may return an error.
162 *  An <tt>nn::act</tt> error is returned. See the <tt>nn::act</tt> error codes. <br/>
163  *
164  *
165 *  <b>Note:</b><br/>
166 *  This function makes an internal call to <tt>@ref nn::olv::SwitchToOnlineMode</tt>. If the function fails, the application is prohibited from automatically trying to call the function again. <br/>
167  *
168  */
169 nn::Result Initialize(nn::olv::MainAppParam* mainAppParam, const nn::olv::InitializeParam* param);
170 
171 //------------------------------------------------------------------------------
172 /**
173 *  Finalization.
174  *
175 *  Finalizes the OLV library. <br/>
176 *  Call this function when you are finished using the OLV library.
177  *
178 *  Works in offline mode.
179  *
180 *  When this function is called, it also finalizes other OLV modules.
181  */
182 void Finalize();
183 
184 //------------------------------------------------------------------------------
185 /**
186 *  Returns whether the OLV library is available.
187  *
188 *  Works in offline mode. <br/>
189 *  This function is thread-safe.
190  *
191 *  @return Returns <tt>true</tt> if it is available, and <tt>false</tt> if it is not.
192  */
193 bool IsInitialized();
194 
195 //------------------------------------------------------------------------------
196 /**
197 *  Switches the OLV library to online mode. <br/>
198 *  This results in communications to get a service token and search for a server to connect to. <br/>
199  *
200 *  (The server stores the URLs that the OLV library needs to send and receive data.)
201  *
202 *  @retval ResultSuccess  Indicates success.
203 *  @retval ResultInitializeError  Indicates that initialization failed.
204 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
205 *  @retval ResultInitialized  Indicates that the object is already initialized in online mode.
206 *  @retval ResultCanceled  Indicates that the action was canceled.
207 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
208 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
209 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
210 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
211 *  @retval ResultHttpError  Indicates an HTTP error.
212 *  @retval ResultInternalError  Indicates an internal error in the library.
213  *
214 *  This function can return an error because it internally calls <tt>nn::act::AcquireIndependentServiceToken</tt>. <br />
215  *
216 *  An <tt>nn::act</tt> error is returned. See the <tt>nn::act</tt> error codes. <br />
217  *
218  *
219 *  <b>Note:</b><br/>
220 *   If this function fails, the application is prohibited from automatically trying to call the function again.
221  */
222 nn::Result SwitchToOnlineMode();
223 
224 //------------------------------------------------------------------------------
225 /**
226 *  Forcibly terminate the current send/receive operation. <br />
227 *  Call this function if you want to cancel a send/receive operation and perform a different operation or if an operation blocks and does not return for a long period of time.
228 *  You can also call this function when the OLV library is not initialized.
229  *
230 *  Works in offline mode. <br />
231 *  This function is thread-safe.
232  *
233 *  <b>Note:</b><br />
234 *  Calling this function also cancels the processing of the following functions called by the application.
235 
236 *  (The function also calls the <tt>nn::act::Cancel</tt> function, but does not return that function's return values.)
237  *
238 *  - <tt>nn::nex::NgsFacade::Login</tt>
239 *  - <tt>nn::act::AcquireIndependentServiceToken</tt>
240 *  - <tt>nn::act::AcquireEcServiceToken</tt>
241  *
242 *  @retval nn::ResultSuccess  Indicates success.
243 *  @retval nn::olv::ResultNotCanceled  Indicates that there was no action to cancel.
244  *
245 
246 */
247 nn::Result Cancel();
248 
249 //------------------------------------------------------------------------------
250 /**
251 *  Uploads a post. <br />
252 *  Calling this function triggers communication. <br/>
253 *  <b>Note:</b><br/>
254 *  This function and <tt>@ref nn::olv::UploadPostDataParam</tt> can be used only for debugging purposes. <br/>
255 *  Note that they cannot be used in the retail version. <br/>
256 *  In addition, the resulting posts uploaded with this function are not shown in the community timeline by the Miiverse application. To check on the display of the posts, use the Activity Feed. <br/>
257 *  To delete the posts, use <tt>@ref nn::olv::DeletePostData</tt>.
258  *
259 *  @param[out] uploadedData  Buffer storing the result of sending the post. (Specify <tt>NULL</tt> if it is not needed.)
260 *  @param[in] uploadParam  Parameters for uploading the post.
261  *
262 *  @retval ResultSuccess  Indicates success.
263 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
264 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
265 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
266 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
267 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
268 *  @retval ResultCanceled  Indicates that the action was canceled.
269 *  @retval ResultNotEnoughMemory  Indicates a failure to allocate memory.
270 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
271 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
272 *  @retval ResultInvalidSize  Indicates an invalid post size.
273 *  @retval ResultHttpError  Indicates an HTTP error.
274 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
275 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
276 *  @retval ResultLibraryRestrictedToUploadByParentalControl  Indicates that posting is restricted.
277 *  @retval ResultInternalError  Indicates an internal error in the library.
278  */
279 nn::Result UploadPostData(nn::olv::UploadedPostData* uploadedData, const nn::olv::UploadPostDataParam* uploadParam);
280 
281 //------------------------------------------------------------------------------
282 /**
283 *  Deletes posts. <br/>
284 *  Calling this function triggers communication. <br/>
285  *
286 *  @param[in] deleteParam   ... Parameters used when deleting posts.
287  *
288 *  @retval ResultSuccess  Indicates success.
289 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
290 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
291 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
292 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
293 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
294 *  @retval ResultCanceled  Indicates that the action was canceled.
295 *  @retval ResultNotEnoughMemory  Indicates a failure to allocate memory.
296 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
297 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
298 *  @retval ResultInvalidSize  Indicates an invalid post size.
299 *  @retval ResultHttpError  Indicates an HTTP error.
300 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
301 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
302 *  @retval ResultLibraryRestrictedToUploadByParentalControl  Indicates that posting is restricted.
303 *  @retval ResultInternalError  Indicates an internal error in the library.
304  */
DeletePostData(const DeletePostDataParam * deleteParam)305 inline nn::Result DeletePostData(const DeletePostDataParam* deleteParam)
306 {
307     return UploadPostData(NULL, reinterpret_cast<const UploadPostDataParam*>(deleteParam));
308 }
309 
310 //------------------------------------------------------------------------------
311 /**
312 *  Downloads posts. <br/>
313 *  Calling this function triggers communication.
314  *
315 *  @param[out] topicData  Specifies the location for storing topic data.
316 *  @param[out] postDataList  Specifies an array for storing posts.
317 *  @param[out] downloadedPostDataNum  Specifies a variable in which to store the actual number of retrieved posts.
318 *  @param[in] downloadPostDataMaxNum  Specifies the maximum number of posts to retrieve (the number of elements in the storage array).
319 *  @param[in] downloadParam  Specifies parameters for downloading posts.
320  *
321 *  @retval ResultSuccess  Indicates success.
322 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
323 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
324 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
325 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
326 *  @retval ResultInvalidSize  Indicates that the size specified in the parameter is invalid.
327 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
328 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
329 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
330 *  @retval ResultCanceled  Indicates that the action was canceled.
331 *  @retval ResultHttpError  Indicates an HTTP error.
332 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
333 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
334 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
335 *  @retval ResultServerError  Indicates that an error occurred on the server.
336 *  @retval ResultInternalError  Indicates an internal error in the library.
337  */
338 nn::Result DownloadPostDataList(
339     nn::olv::DownloadedTopicData* topicData,
340     nn::olv::DownloadedPostData* postDataList,
341     u32* downloadedPostDataNum,
342     const u32 downloadPostDataMaxNum,
343     const nn::olv::DownloadPostDataListParam* downloadParam);
344 
345 //------------------------------------------------------------------------------
346 /**
347 *  Uploads a Yeah to a post. <br/>
348 *  Calling this function triggers communication.
349  *
350 *  A Yeah cannot be given to a post by the same user that created the post. <br />
351 *  This function returns <tt>ResultHttpError403Forbidden</tt> when users try to give Yeahs to one of their own posts.
352  *
353 *  @param[in]  uploadParam  Specifies parameters for updating the Yeah on a post.
354  *
355 *  @retval ResultSuccess  Indicates success.
356 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
357 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
358 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
359 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
360 *  @retval ResultCanceled  Indicates that the action was canceled.
361 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
362 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
363 *  @retval ResultHttpError  Indicates an HTTP error.
364 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
365 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
366 *  @retval ResultServerError  Indicates that an error occurred on the server.
367 *  @retval ResultLibraryRestrictedToUploadByParentalControl  Indicates that posting is restricted.
368 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
369 *  @retval ResultInternalError  Indicates an internal error in the library.
370 
371 */
372 nn::Result UploadEmpathyToPostData(const nn::olv::UploadEmpathyToPostDataParam* uploadParam);
373 
374 //------------------------------------------------------------------------------
375 /**
376 *  Uploads a direct message. <br />
377 *  Calling this function triggers communication. <br/>
378 *  <b>Note:</b><br/>
379 *  This function and <tt>@ref nn::olv::UploadDirectMessageDataParam</tt> can be used only for debugging purposes. <br/>
380 *  Note that they cannot be used in the retail version. <br />
381 *  To delete the direct messages, use <tt>@ref nn::olv::DeleteDirectMessageData</tt>.
382  *
383 *  @param[out] uploadedData  Specifies a buffer for storing the result of uploading the direct message. (Specify <tt>NULL</tt> if it is not needed.)
384 *  @param[in] uploadParam  Specifies parameters for uploading the direct message.
385  *
386 *  @retval ResultSuccess  Indicates success.
387 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
388 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
389 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
390 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
391 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
392 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
393 *  @retval ResultCanceled  Indicates that the action was canceled.
394 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
395 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
396 *  @retval ResultHttpError  Indicates an HTTP error.
397 *  @retval ResultInvalidSize  Indicates an invalid post size.
398 *  @retval ResultServerError  Indicates that an error occurred on the server.
399 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
400 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
401 *  @retval ResultInternalError  Indicates an internal error in the library.
402  */
403 nn::Result UploadDirectMessageData(nn::olv::UploadedDirectMessageData* uploadedData, const nn::olv::UploadDirectMessageDataParam* uploadParam);
404 
405 //------------------------------------------------------------------------------
406 /**
407 *  Deletes a direct message. <br />
408 *  Calling this function triggers communication. <br />
409  *
410 *  @param[in]  deleteParam  ... Parameters used when deleting direct messages.
411  *
412 *  @retval ResultSuccess  Indicates success.
413 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
414 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
415 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
416 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
417 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
418 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
419 *  @retval ResultCanceled  Indicates that the action was canceled.
420 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
421 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
422 *  @retval ResultHttpError  Indicates an HTTP error.
423 *  @retval ResultInvalidSize  Indicates an invalid post size.
424 *  @retval ResultServerError  Indicates that an error occurred on the server.
425 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
426 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
427 *  @retval ResultInternalError  Indicates an internal error in the library.
428  */
DeleteDirectMessageData(const DeleteDirectMessageDataParam * deleteParam)429 inline nn::Result DeleteDirectMessageData(const DeleteDirectMessageDataParam* deleteParam)
430 {
431     return UploadDirectMessageData(NULL, reinterpret_cast<const UploadDirectMessageDataParam*>(deleteParam));
432 }
433 
434 //------------------------------------------------------------------------------
435 /**
436 *  Downloads direct messages. <br />
437 *  Calling this function triggers communication.
438  *
439 *  <b>Note:</b><br />
440 *  You can only get direct messages sent from the same application. <br />
441  *
442 *  You cannot get direct messages sent from Miiverse and other applications. <br />
443  *
444  *
445 *  @param[out] directMessageDataList       ...Specifies the storage array for direct messages.
446 *  @param[out] directMessageDataListSize   ... Specifies where the number of actually retrieved direct messages are stored.
447 *  @param[in] directMessageDataListMaxSize ... Specifies the maximum number of direct messages to retrieve (the number of elements in the storage array).
448 *  @param[in] downloadParam  Specifies parameters for downloading direct messages.
449  *
450 *  @retval ResultSuccess  Indicates success.
451 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
452 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
453 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
454 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
455 *  @retval ResultInvalidSize  Indicates that the size specified in the parameter is invalid.
456 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
457 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
458 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
459 *  @retval ResultCanceled  Indicates that the action was canceled.
460 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
461 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
462 *  @retval ResultHttpError  Indicates an HTTP error.
463 *  @retval ResultServerError  Indicates that an error occurred on the server.
464 *  @retval ResultInternalError  Indicates an internal error in the library.
465  */
466 nn::Result DownloadDirectMessageDataList(
467     nn::olv::DownloadedDirectMessageData* directMessageDataList,
468     u32* directMessageDataListSize,
469     const u32 directMessageDataListMaxSize,
470     const nn::olv::DownloadDirectMessageDataListParam* downloadParam);
471 
472 //------------------------------------------------------------------------------
473 /**
474 *  Uploads comments. <br />
475 *  Calling this function triggers communication. <br />
476 *  <b>Note:</b><br/>
477 *  This function and <tt>@ref nn::olv::UploadCommentDataParam</tt> can be used only for debugging purposes. <br />
478 *  Note that they cannot be used in the retail version. <br />
479 *  To delete the comments, use <tt>@@ref nn::olv::DeleteCommentData</tt>.
480  *
481 *  @param[out] uploadedData  Specifies the buffer storing the result of uploading the comment data. (Specify <tt>NULL</tt> if it is not needed.)
482 *  @param[in] uploadParam  Specifies parameters for uploading the comment data.
483  *
484 *  @retval ResultSuccess  Indicates success.
485 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
486 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
487 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
488 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
489 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
490 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
491 *  @retval ResultCanceled  Indicates that the action was canceled.
492 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
493 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
494 *  @retval ResultHttpError  Indicates an HTTP error.
495 *  @retval ResultInvalidSize  Indicates an invalid post size.
496 *  @retval ResultServerError  Indicates that an error occurred on the server.
497 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
498 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
499 *  @retval ResultInternalError  Indicates an internal error in the library.
500  */
501 nn::Result UploadCommentData(nn::olv::UploadedCommentData* uploadedData, const nn::olv::UploadCommentDataParam* uploadParam);
502 
503 //------------------------------------------------------------------------------
504 /**
505 * Deletes comments. <br />
506 *  Calling this function triggers communication. <br />
507  *
508 *  @param[in]  deleteParam  ... Parameters used when deleting comments.
509  *
510 *  @retval ResultSuccess  Indicates success.
511 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
512 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
513 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
514 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
515 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
516 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
517 *  @retval ResultCanceled  Indicates that the action was canceled.
518 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
519 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
520 *  @retval ResultHttpError  Indicates an HTTP error.
521 *  @retval ResultInvalidSize  Indicates an invalid post size.
522 *  @retval ResultServerError  Indicates that an error occurred on the server.
523 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
524 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
525 *  @retval ResultInternalError  Indicates an internal error in the library.
526  */
DeleteCommentData(const DeleteCommentDataParam * deleteParam)527 inline nn::Result DeleteCommentData(const DeleteCommentDataParam* deleteParam)
528 {
529     return UploadCommentData(NULL, reinterpret_cast<const UploadCommentDataParam*>(deleteParam));
530 }
531 
532 //------------------------------------------------------------------------------
533 /**
534 *  Downloads comments. <br />
535 *  Calling this function triggers communication.
536  *
537 *  @param[out] commentDataList  Specifies an array for storing comments.
538 *  @param[out] commentDataListSize  Specifies a variable in which to store the actual number of retrieved comments.
539 *  @param[in] downloadCommentDataMaxNum  Specifies the maximum number of comments to retrieve (the number of elements in the storage array).
540 *  @param[in] downloadParam  Specifies parameters for downloading comments.
541  *
542 *  @retval ResultSuccess  Indicates success.
543 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
544 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
545 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
546 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
547 *  @retval ResultInvalidSize  Indicates that the size specified in the parameter is invalid.
548 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
549 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
550 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
551 *  @retval ResultCanceled  Indicates that the action was canceled.
552 *  @retval ResultHttpError  Indicates an HTTP error.
553 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
554 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
555 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
556 *  @retval ResultServerError  Indicates that an error occurred on the server.
557 *  @retval ResultInternalError  Indicates an internal error in the library.
558  */
559 nn::Result DownloadCommentDataList(
560     nn::olv::DownloadedCommentData* commentDataList,
561     u32* commentDataListSize,
562     const u32 downloadCommentDataMaxNum,
563     const nn::olv::DownloadCommentDataListParam* downloadParam);
564 
565 //------------------------------------------------------------------------------
566 /**
567 *  Uploads community data. <br />
568 *  Calling this function triggers communication.
569  *
570 * This function creates, updates, and deletes communities. <br />
571  *
572 *  If you set this parameter to a community ID, the function updates that community. <br />
573 *  To delete a community, specify the community ID in the same way and set the delete flag. <br />
574  *
575 *  @param[out] uploadedData  Specifies the buffer storing the result of uploading the community data. (Specify <tt>NULL</tt> if it is not needed.)
576 *  @param[in]  uploadParam  Specifies parameters for updating the community data.
577  *
578 *  @retval ResultSuccess  Indicates success.
579 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
580 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
581 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
582 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
583 *  @retval ResultInvalidSize  Indicates that the size specified in the parameter is invalid.
584 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
585 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
586 *  @retval ResultCanceled  Indicates that the action was canceled.
587 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
588 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
589 *  @retval ResultHttpError  Indicates an HTTP error.
590 *  @retval ResultServerError  Indicates that an error occurred on the server.
591 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
592 *  @retval ResultLibraryRestrictedToUploadByParentalControl  Indicates that posting is restricted.
593 *  @retval ResultInternalError  Indicates an internal error in the library.
594  */
595 nn::Result UploadCommunityData(nn::olv::UploadedCommunityData* uploadedData, const nn::olv::UploadCommunityDataParam* uploadParam);
596 
597 //------------------------------------------------------------------------------
598 /**
599 *  Downloads community data. <br />
600 *  Calling this function triggers communication.
601  *
602 *  @param[out] communityDataList  Specifies an array for storing the communities.
603 *  @param[out] communityDataListSize  Specifies an out parameter to hold the number of communities that were actually downloaded.
604 *  @param[in] communityDataListMaxSize  Specifies the maximum number of communities that can be retrieved, based on the size of the storage array.
605 *  @param[in] downloadParam  Specifies parameters for downloading community data.
606  *
607 *  @retval ResultSuccess  Indicates success.
608 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
609 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
610 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
611 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
612 *  @retval ResultInvalidSize  Indicates that the size specified in the parameter is invalid.
613 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
614 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
615 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
616 *  @retval ResultCanceled  Indicates that the action was canceled.
617 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
618 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
619 *  @retval ResultHttpError  Indicates an HTTP error.
620 *  @retval ResultServerError  Indicates that an error occurred on the server.
621 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
622 *  @retval ResultInternalError  Indicates an internal error in the library.
623  */
624 nn::Result DownloadCommunityDataList(
625     nn::olv::DownloadedCommunityData* communityDataList,
626     u32* communityDataListSize,
627     const u32 communityDataListMaxSize,
628     const nn::olv::DownloadCommunityDataListParam* downloadParam);
629 
630 //------------------------------------------------------------------------------
631 /**
632 *  Adds a community to, or deletes a community from, favorites. <br />
633 *  Calling this function triggers communication.
634  *
635 *  @param[in] favoriteParam  Specifies parameters for updating favorite community information.
636  *
637 *  @retval ResultSuccess  Indicates success.
638 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
639 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
640 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
641 *  @retval ResultCanceled  Indicates that the action was canceled.
642 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
643 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
644 *  @retval ResultHttpError  Indicates an HTTP error.
645 *  @retval ResultServerError  Indicates that an error occurred on the server.
646 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
647 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
648 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
649 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
650 *  @retval ResultLibraryRestrictedToUploadByParentalControl  Indicates that posting is restricted.
651 *  @retval ResultInternalError  Indicates an internal error in the library.
652  */
653 nn::Result UploadFavoriteToCommunityData(const nn::olv::UploadFavoriteToCommunityDataParam* favoriteParam);
654 
655 //------------------------------------------------------------------------------
656 /**
657 *  Follows or unfollows a user. <br />
658 *  Calling this function triggers communication.
659  *
660 *  @param[in] followParam  Specifies parameters used when following or unfollowing a user.
661  *
662 *  @retval ResultSuccess  Indicates success.
663 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
664 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
665 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
666 *  @retval ResultInvalidParameter  Indicates that invalid parameters have been set.
667 *  @retval ResultCanceled  Indicates that the action was canceled.
668 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
669 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
670 *  @retval ResultHttpError  Indicates an HTTP error.
671 *  @retval ResultServerError  Indicates that an error occurred on the server.
672 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
673 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
674 *  @retval ResultSciError  Indicates a failure to retrieve the Parental Controls settings.
675 *  @retval ResultLibraryRestrictedToUploadByParentalControl  Indicates that posting is restricted.
676  */
677 nn::Result UploadFollowToUserData(
678     const nn::olv::UploadFollowToUserDataParam* followParam);
679 
680 //------------------------------------------------------------------------------
681 /**
682 *  Downloads user data. <br />
683 *  Calling this function triggers communication.
684  *
685 *  @param[out] userDataList  Specifies an array for storing user data.
686 *  @param[out] userDataListSize  Specifies a variable in which to store the actual number of retrieved user data entries.
687 *  @param[in] userDataListMaxSize  Specifies the maximum number of communities that can be retrieved, based on the size of the storage array.
688 *  @param[in] downloadParam  Specifies parameters for downloading user data.
689  *
690 *  @retval ResultSuccess  Indicates success.
691 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
692 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
693 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
694 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
695 *  @retval ResultInvalidSize  Indicates that the size specified in the parameter is invalid.
696 *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
697 *  @retval ResultXmlParseError  Indicates a failure to parse raw data.
698 *  @retval ResultNotEnoughMemory  Indicates that the system is out of memory.
699 *  @retval ResultCanceled  Indicates that the action was canceled.
700 *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
701 *  @retval ResultDataNotFound  Indicates that the server did not return any data.
702 *  @retval ResultHttpError  Indicates an HTTP error.
703 *  @retval ResultServerError  Indicates that an error occurred on the server.
704 *  @retval ResultInternalError  Indicates an internal error in the library.
705  */
706 nn::Result DownloadUserDataList(
707     nn::olv::DownloadedUserData* userDataList,
708     u32* userDataListSize,
709     const u32 userDataListMaxSize,
710     const nn::olv::DownloadUserDataListParam* downloadParam);
711 
712 //------------------------------------------------------------------------------
713 /**
714 *  Gets the error code that is shown to users.
715  *
716 *  Works in offline mode. <br />
717 *  This function is thread-safe.
718  *
719 *  @param[in] result  Specifies the <tt>nn::Result</tt> value returned by the OLV library.
720  *
721 *  @return  Returns the error code as a seven-digit decimal number. <br />
722 *          Returns <tt>OLV_ERROR_CODE_UNKNOWN</tt> if the OLV library has not been initialized, or if it is passed a success result or <tt>nn::Result</tt> value not normally returned by the OLV library.
723 
724 */
725 u32 GetErrorCode(const nn::Result& result);
726 
727 //------------------------------------------------------------------------------
728 /**
729 *  Starts the Miiverse service.
730  *
731 *  Works in offline mode.
732  *
733 *  @param[in] param  Specifies parameters for starting the Miiverse service.
734 *  Opens the default page if no page is specified.
735  *
736 *  @retval ResultSuccess  Indicates success.
737 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
738 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
739 *  @retval ResultSystemUpdateRequired  Indicates that a system update is required.
740  */
741 nn::Result StartPortalApp(const nn::olv::StartPortalAppParam* param = NULL);
742 
743 //------------------------------------------------------------------------------
744 /**
745 *  Starts the post application in a mode that allows posting data.
746  *
747 *  @param[in] param  Specifies conditions for starting the post application. <br />
748 *  Starts the post application under default settings if not specified.
749  *
750 *  @retval ResultSuccess  Indicates success.
751 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
752 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
753 *  @retval ResultInvalidSize  Indicates that the string is longer than the specified length.
754 *  @retval ResultSystemUpdateRequired  Indicates that a system update is required.
755 *  @retval ResultLibraryRestrictedToUploadByParentalControl  Indicates that posting is restricted.
756 *  @retval ResultSciError  Indicates that the SCI function failed.
757 *  @retval ResultInvalidParameter  Indicates that time stamp data is not correctly set.
758  */
759 nn::Result UploadPostDataByPostApp(const nn::olv::UploadPostDataByPostAppParam* param = NULL);
760 
761 //------------------------------------------------------------------------------
762 /**
763 *  Starts the post application in a mode that allows posting comments.
764  *
765 *  @param[in] param  Specifies conditions for starting the post application.
766  *
767 *  @retval ResultSuccess  Indicates success.
768 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
769 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
770 *  @retval ResultInvalidSize  Indicates the string is longer than the specified length.
771 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
772 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
773 *  @retval ResultSystemUpdateRequired  Indicates that a system update is required.
774 *  @retval ResultLibraryRestrictedToUploadByParentalControl  Indicates that posting is restricted.
775 *  @retval ResultSciError  Indicates that the SCI function failed.
776  */
777 nn::Result UploadCommentDataByPostApp(const nn::olv::UploadCommentDataByPostAppParam* param);
778 
779 //------------------------------------------------------------------------------
780 /**
781 *  Starts the post application in a mode that allows posting direct comments.
782  *
783 *  @param[in] param  Specifies conditions for starting the post application.
784  *
785 *  @retval ResultSuccess  Indicates success.
786 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
787 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
788 *  @retval ResultInvalidSize  Indicates that the string is longer than the specified length.
789 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
790 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
791 *  @retval ResultSystemUpdateRequired  Indicates that a system update is required.
792  */
793 nn::Result UploadDirectMessageDataByPostApp(const nn::olv::UploadDirectMessageDataByPostAppParam* param);
794 
795 //------------------------------------------------------------------------------
796 /**
797 *  Gets the result of updating the post, direct message, or comment using the post application. <br />
798 *  Use this function to get the result of the <tt>@ref nn::olv::UploadPostDataByPostApp</tt>, <tt>@ref nn::olv::UploadDirectMessageDataByPostApp</tt>, and <tt>@ref nn::olv::UploadCommentDataByPostApp</tt> functions. <br />
799  *
800 *  If you also want to get the post results, use the functions <tt>@ref nn::olv::GetResultWithUploadedPostDataByPostApp</tt>, <tt>@ref nn::olv::GetResultWithUploadedDirectMessageDataByPostApp</tt>, and <tt>@ref nn::olv::GetResultWithUploadedCommentDataByPostApp</tt>. <br />
801  *
802  *
803  *
804 * Call this function when the application has transitioned from the post application to the main application (in other words, when you get a foreground message from the SDK.) <br />
805  *
806 *  For more information about usage, see the sample demos <tt>UploadPostDataByPostApp</tt>, <tt>UploadCommentDataByPostApp</tt> and <tt>UploadDirectMessageDataByPostApp</tt>.
807  *
808 *  @retval ResultSuccess  Indicates success.
809 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
810 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
811 *  @retval ResultSystemUpdateRequired  Indicates that a system update is required.
812 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
813 *  @retval ResultInvalidFormat        ... The size of the image attachment is invalid.
814 *  @retval ResultCanceled  Indicates that the action was canceled.
815 *  @retval ResultUnknown  Indicates that the function was called at the wrong time.
816  */
817 nn::Result GetResultByPostApp();
818 
819 //------------------------------------------------------------------------------
820 /**
821 *  Gets the result of posting an updated post using the post application. <br />
822 *  Use this function to get the result of the <tt>@ref nn::olv::UploadPostDataByPostApp</tt> function. <br />
823  *
824  *
825 * Call this function when the application has transitioned from the post application to the main application (in other words, when you get a foreground message from the SDK.) <br />
826  *
827 *  For more information about usage, see the <tt>UploadPostDataByPostApp</tt> sample demo.
828  *
829 *  @param[out] uploadedData  Specifies a variable in which to store the resulting post.
830  *
831 *  @retval ResultSuccess  Indicates success.
832 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
833 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
834 *  @retval ResultSystemUpdateRequired  Indicates that a system update is required.
835 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
836 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
837 *  @retval ResultInvalidFormat        ...Indicates that the <tt>@ref nn::olv::UploadPostDataByPostApp</tt> function was not running the post application when this function was called. <br />
838 *                                  Or it indicates that the size of the image attachment is invalid.
839 *  @retval ResultCanceled  Indicates that the action was canceled.
840 *  @retval ResultUnknown  Indicates that the function was called at the wrong time.
841  */
842 nn::Result GetResultWithUploadedPostDataByPostApp(nn::olv::UploadedPostData* uploadedData);
843 
844 //------------------------------------------------------------------------------
845 /**
846 *  Gets the result of posting an updated direct message using the post application. <br />
847 *  Use this function to get the result of the <tt>@ref nn::olv::UploadDirectMessageDataByPostApp</tt> function. <br />
848  *
849  *
850 * Call this function when the application has transitioned from the post application to the main application (in other words, when you get a foreground message from the SDK.) <br />
851  *
852 *  For more information about usage, see the <tt>UploadDirectMessageDataByPostApp</tt> sample demo.
853  *
854 *  @param[out] uploadedData  Specifies a pointer to the location storing the resulting posted direct message.
855  *
856 *  @retval ResultSuccess  Indicates success.
857 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
858 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
859 *  @retval ResultSystemUpdateRequired  Indicates that a system update is required.
860 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
861 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
862 *  @retval ResultInvalidFormat        ...Indicates that the <tt>@ref nn::olv::UploadDirectMessageDataByPostApp</tt> function was not running the post application when this function was called. <br />
863 *                                  Or it indicates that the size of the image attachment is invalid.
864 *  @retval ResultCanceled  Indicates that the action was canceled.
865 *  @retval ResultUnknown  Indicates that the function was called at the wrong time.
866  */
867 nn::Result GetResultWithUploadedDirectMessageDataByPostApp(nn::olv::UploadedDirectMessageData* uploadedData);
868 
869 //------------------------------------------------------------------------------
870 /**
871 *  Gets the result of posting updated comment data using the post application. <br />
872 *  Use this function to get the result of the <tt>@ref nn::olv::UploadCommentDataByPostApp</tt> function. <br />
873  *
874  *
875 * Call this function when the application has transitioned from the post application to the main application (in other words, when you get a foreground message from the SDK.) <br />
876  *
877 *  For more information about usage, see the <tt>UploadCommentDataByPostApp</tt> sample demo.
878  *
879 *  @param[out] uploadedData  Specifies a pointer to the location storing the resulting posted comment data.
880  *
881 *  @retval ResultSuccess  Indicates success.
882 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
883 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
884 *  @retval ResultSystemUpdateRequired  Indicates that a system update is required.
885 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
886 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
887 *  @retval ResultInvalidFormat     Indicates that the <tt>@ref nn::olv::UploadCommentDataByPostApp</tt> function was not running the post application when this function was called. <br />
888 *                                  Or it indicates that the size of the image attachment is invalid.
889 *  @retval ResultCanceled  Indicates that the action was canceled.
890 *  @retval ResultUnknown  Indicates that the function was called at the wrong time.
891  */
892 nn::Result GetResultWithUploadedCommentDataByPostApp(nn::olv::UploadedCommentData* uploadedData);
893 
894 //------------------------------------------------------------------------------
895 /**
896 *  Gets the URL for the notification information to retrieve.
897  *
898 *  @param[out] url  Specifies a character array for storing the URL. <br />
899 *  Pass in a buffer of size <tt>nn::olv::URL_BUFF_LENGTH</tt>.
900 *  @param[in]  urlMaxLength  Specifies the size of the URL buffer.
901 *  @param[in]  param  Specifies the parameter for getting the notification URL.
902  *
903 *  @retval ResultSuccess  Indicates success.
904 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
905 *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
906 *  @retval ResultInvalidParameter  Indicates that a parameter was configured incorrectly.
907 *  @retval ResultInvalidPointer  Indicates that a required parameter was set to <tt>NULL</tt>.
908 *  @retval ResultInvalidSize  Indicates that the size specified in the parameter is invalid.
909  */
910 nn::Result GetNotificationsUrl(char* url, const u32 urlMaxLength, const nn::olv::GetNotificationsUrlParam* param);
911 
912 //------------------------------------------------------------------------------
913 /**
914 *  Preloads the posting applet. <br />
915  *
916 *  <b>Note:</b><br />
917 *  Currently there is no high-speed function for quickly starting the applet even if it is preloaded using this function. <br />
918 *  This function is not recommended for use by applications. <br />
919  *
920 *  Works in offline mode.
921  *
922 *  @retval ResultSuccess  Indicates success.
923 *  @retval ResultNotInitialized  Indicates that the object is not initialized.
924 *  @retval ResultPostappPreloadFailed  Indicates that preloading failed.
925  */
926 nn::Result PreloadPostApp(void);
927 
928 
929 /** @} */
930 
931 
932 }
933 }
934 
935 
936 #endif
937