1 /*---------------------------------------------------------------------------*
2 
3   Project:  OLV
4   File:     olv_Types.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_Types.h
17  *
18  *  @brief Defines structs and other data types used by the Olive library (OLV).
19  *
20  */
21 //------------------------------------------------------------------------------
22 #ifndef __OLV_TYPES_H_
23 #define __OLV_TYPES_H_
24 
25 #include <cafe/os/OSTime.h>
26 #include <nn/ffl/FFLStandard.h>
27 #include <nn/Result.h>
28 #include <nn/olv/olv_Result.h>
29 #include <nn/olv/olv_Const.h>
30 
31 /// <span>nn</span>
32 namespace nn {
33 
34 /// <span>olv</span>
35 namespace olv {
36 
37 namespace internal
38 {
39 
40 /// Internal dependent class.
41 class Main;
42 
43 }
44 
45 /**  @defgroup class Classes
46  *  @{
47  */
48 
49 /**
50  *  Parameters used for initialization.
51  *
52  *  All member functions can be called even in offline mode. <br/>
53  *  All member functions are thread-safe.
54  *
55  */
56 class InitializeParam
57 {
58 public:
59     /** Flags to specify with <tt>InitializeParam::SetFlags</tt>. */
60     enum
61     {
62         FLAG_NONE = 0,              //!< The default flag value.
63         FLAG_OFFLINE_MODE = (1<<0), //!< This flag is used for initialization in offline mode.
64         //FLAG_RESERVED0 = (1<<1)   //!< This is a reserved region.
65     };
66 
67 public:
68     /** Instantiates the object. */
69     InitializeParam();
70 
71     /**
72      *  Sets flags. <br/>
73      *  This setting is not required. <br/>
74      *  To use in offline mode, set the flag to <tt>@ref FLAG_OFFLINE_MODE</tt>. <br/>
75      *  Although some features are not available in offline mode, no communication is performed in this mode. <br/>
76      *  You ordinarily do not need to set this flag.
77      *
78      *  @param[in] flags  Flags defined in the <tt>@ref InitializeParam</tt> class. <br/>
79       *
80      *                       The following flags can be used. <br/>
81      *                       @ref InitializeParam::FLAG_OFFLINE_MODE
82      *
83      *  @retval ResultSuccess  Indicates success.
84      */
85     nn::Result SetFlags(const u32 flags);
86 
87     /**
88      *  Sets the working buffer for the Olive library (OLV). <br/>
89      *  This setting is required. <br/>
90      *  The Olive library uses this buffer to allocate working memory.
91      *
92      *  @param[in] work  Specifies the start address of the work buffer.
93      *  @param[in] workSize  Specifies the size of the work buffer.
94      *
95      *  @retval ResultSuccess  Indicates success.
96      *  @retval ResultInvalidPointer  Indicates that <span class="argument">work</span> is <tt>NULL</tt>.
97      *  @retval ResultInvalidSize  Indicates that <span class="argument">workSize</span> is <tt>0</tt>.
98      */
99     nn::Result SetWork(u8* work, const u32 workSize);
100 
101     /**
102      *  Specifies the type of debug information output by the Olive library (OLV). <br/>
103      *  This setting is not required. <br/>
104      *
105      *  By default, all information types are output except the following. <br/>
106      *  <tt>@ref nn::olv::REPORT_TYPE_MEMORY</tt> <br/>
107      *  <tt>@ref nn::olv::REPORT_TYPE_RESPONSE</tt>
108      *
109      *
110      *  You do not need to call this function if you are using these settings. <br/>
111      *  No matter what combination of settings is specified, you must specify <tt>@ref nn::olv::REPORT_TYPE_INFO</tt>. <br/>
112      *
113      *
114      *  @param[in] flags  Specifies the output flags.
115      *
116      *  @retval ResultSuccess  Indicates success.
117      */
118     nn::Result SetReportTypes(u32 flags);
119 
120     /**
121      *  Sets system parameters. <br/>
122      *  Necessary if an application jump from Miiverse or if initializing. <br/>
123      *
124      *  @param[in] args ... The start address of the system parameters.
125      *  @param[in] argsSize ... The size of the system parameters.
126      *
127      *  @retval ResultSuccess  Indicates success.
128      *  @retval ResultInvalidPointer   Indicates that <span class="argument">args</span> is <tt>NULL</tt>.
129      *  @retval ResultInvalidSize    ... Indicates that <span class="argument">argsSize</span> is <tt>0</tt>.
130      */
131     nn::Result SetSysArgs(const void* args, const u32 argsSize);
132 
133 private:
134     /// @cond
135     u32 flags;          /*!< Sets flags. */
136     u32 reportTypes;    /*!< Output control flags. */
137     u8* work;           /*!< Address of the start of the working buffer. */
138     u32 workSize;       /*!< Working buffer size. */
139     const void* args;   /*!< System parameters. */
140     u32 argsSize;       /*!< The size of system parameters. */
141     u8  reserved[40];   /*!< Represents a reserved region. */
142 
143     friend class internal::Main;
144     /// @endcond
145 };
146 
147 /**
148  *  The base class for parameters when sending post data, direct message data, or comment data.
149  *
150  *  It is inherited by <tt>@ref UploadPostDataParam</tt> (the parameter when sending post data), <tt>@ref UploadDirectMessageDataParam</tt> (the parameter when sending direct message data), and <tt>@ref UploadCommentDataParam</tt> (the parameter when sending comment data). <br/>
151  *
152  *
153  *
154  *  All member functions can be called even in offline mode. <br/>
155  *  All member functions are thread-safe.
156  */
157 class UploadParamBase
158 {
159 public:
160     /** Instantiates the object. */
161     UploadParamBase();
162 
163     /** Destructor. */
164     virtual ~UploadParamBase() = 0;
165 
166     /**
167      *  Sets the mood (the feeling). <br/>
168      *  Does not need to be specified. <br/>
169      *  If not specified, <tt>@ref nn::olv::FEELING_NORMAL</tt> is set by default. <br/>
170      *
171      *  @param[in] feeling  Specifies the mood.
172      *
173      *  @retval ResultSuccess  Indicates success.
174      */
175     nn::Result SetFeeling(const nn::olv::Feeling feeling);
176 
177     /**
178      *  Sets text. <br/>
179      *  You can set either text data or handwritten memo data. <br/>
180      *  But you must set either text data or handwritten memo data. <br/>
181      *
182      *  @param[in] bodyText  The text data. (Set to <tt>NULL</tt> to clear the buffer.)<br/>
183      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
184      *
185      *  @retval ResultSuccess  Indicates success.
186      *  @retval ResultInvalidSize  Indicates that the length of the text data was either <tt>0</tt> or exceeded <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
187      */
188     nn::Result SetBodyText(const wchar_t* bodyText);
189 
190     /**
191      *  Sets a handwritten memo. <br/>
192      *  You can set either text data or handwritten memo data. <br/>
193      *  You must set either text data or handwritten memo data. <br/>
194      *  Only the start address is passed in; the data is not copied. <br/>
195      *
196      *  @param[in] bodyMemo  Specifies a pointer to the handwritten memo. (Set to <tt>NULL</tt> to clear the start address and set the size to zero.)
197      *  @param[in] bodyMemoSize  Specifies the size of the handwritten memo data. (This value is ignored when the pointer to the handwritten memo data is set to <tt>NULL</tt>.)
198      *
199      *  @retval ResultSuccess  Indicates success.
200      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
201      *  @retval ResultInvalidFormat  Indicates that an invalid handwritten memo was specified.
202      */
203     nn::Result SetBodyMemo(const u8* bodyMemo, const u32 bodyMemoSize);
204 
205     /**
206      *  Sets an image attachment. <br/>
207      *  This setting is not required. <br/>
208      *  For the image to attach, specify a baseline JPEG with a maximum size of <tt>@ref nn::olv::EXTERNAL_IMAGE_DATA_MAX_SIZE</tt> bytes. <br/>
209      *
210      *  Only the start address is passed in; the data is not copied.
211      *
212      *  @param[in] externalImageData  Specifies the start address of the image attachment. (Set to <tt>NULL</tt> to clear the start address and set the size to zero.)
213      *  @param[in] externalImageDataSize  Specifies the size of the image attachment data. (This value is ignored when the starting address of the image attachment data is set to <tt>NULL</tt>.)
214      *
215      *  @retval ResultSuccess  Indicates success.
216      *  @retval ResultInvalidSize  Indicates that the image size is <tt>0</tt> or a value greater than <tt>@ref nn::olv::EXTERNAL_IMAGE_DATA_MAX_SIZE</tt>.
217      */
218     nn::Result SetExternalImageData(const u8* externalImageData, const u32 externalImageDataSize);
219 
220     //-----------------------------------------------------------------------------------------------------------------
221     // Version 1.0 can be used to this point.
222     //-----------------------------------------------------------------------------------------------------------------
223 
224     /**
225      *  Configures application data that the application can use. <br/>
226      *  This setting is not required. <br/>
227      *  Application data of up to <tt>@ref nn::olv::APP_DATA_MAX_SIZE</tt> bytes can be specified. <br/>
228      *  Only the start address is passed in; the data is not copied.
229      *
230      *  @param[in] appData  Specifies the start address of the application data. (Set to <tt>NULL</tt> to clear the start address and set the size to zero.)
231      *  @param[in] appDataSize  Specifies the size of the application data. (This value is ignored when the starting address of the application data is set to <tt>NULL</tt>.)
232      *
233      *  @retval ResultSuccess  Indicates success.
234      *  @retval ResultInvalidSize  Indicates that the application data size is <tt>0</tt> or a value greater than <tt>@ref nn::olv::APP_DATA_MAX_SIZE</tt>.
235      */
236     nn::Result SetAppData(const u8* appData, const u32 appDataSize);
237 
238     /**
239      *  Sets image attachment data and thumbnail image data. <br/>
240      *  This setting is not required. <br/>
241      *  Thumbnails are usually smaller versions of the image attachment data, but you can use this function if you want to customize them in your application. <br/>
242      *  Set the image attachment and thumbnail image data using JPEG (baseline) format. <br/>
243      *  You can set an image attachment of up to <tt>@ref nn::olv::EXTERNAL_IMAGE_DATA_MAX_SIZE</tt> bytes.<br/>
244      *  You can set a thumbnail of up to <tt>@ref nn::olv::EXTERNAL_THUMBNAIL_IMAGE_DATA_MAX_SIZE</tt> bytes.<br/>
245      *  The maximum size for the two image files together is <tt>@ref nn::olv::EXTERNAL_IMAGE_DATA_TOTAL_MAX_SIZE</tt> bytes. <br/>
246      *  Only the start address is passed in; the data is not copied. <br/>
247      *  Clear the data by setting both <span class="argument">externalImageData</span> and <span class="argument">externalThumbnailImageData</span> to <tt>NULL</tt>. <br/>
248      *  When the data is cleared, the values set in <span class="argument">externalImageDataSize</span> and <span class="argument">externalThumbnailImageDataSize</span> are ignored.
249      *
250      *  @param[in] externalImageData  Specifies the starting address of the image attachment data.
251      *  @param[in] externalImageDataSize  Specifies the size of the image attachment data. (This value is ignored when the starting address of the image data is set to <tt>NULL</tt>.)
252      *  @param[in] externalThumbnailImageData  Specifies the starting address of the thumbnail attachment data.
253      *  @param[in] externalThumbnailImageDataSize  Specifies the size of the thumbnail attachment data. (This value is ignored when the starting address of the image data is set to <tt>NULL</tt>.)
254      *
255      *  @retval ResultSuccess  Indicates success.
256      *  @retval ResultInvalidSize  Indicates that the size was set to <tt>0</tt> or the size of the image data exceeds the maximum.
257      *  @retval ResultInvalidPointer  Indicates that either the image attachment data or the thumbnail data was set to <tt>NULL</tt>.
258      */
259     nn::Result SetExternalImageData(const u8* externalImageData, const u32 externalImageDataSize,
260                                     const u8* externalThumbnailImageData, const u32 externalThumbnailImageDataSize);
261 
262     /**
263      *  Set the maximum number of characters of text data to send. <br/>
264      *  This setting is not required. <br/>
265      *  If no value is set using this function, the default is a maximum of 100 characters.
266      *
267      *  @param[in] bodyTextMaxLength ... The maximum length of the string being set for text data. <br/>
268      *                                   You can specify a value in the range of <tt>1</tt> to <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
269      *
270      *  @retval ResultSuccess  Indicates success.
271      *  @retval ResultInvalidParameter  Indicates that the value is <tt>0</tt> or larger than <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
272      */
273     nn::Result SetBodyTextMaxLength(const u32 bodyTextMaxLength);
274 
275 protected:
276     /// @cond
277     // The following functions can only be used by certain classes.
278 
279     /**
280      *  Sets the search keys to use to get post data or direct message data. <br/>
281      *  This setting is not required. <br/>
282      *  The search keys must contain only ASCII characters. (Encode as <tt>UTF-16 BE</tt>.)
283      *  You can specify up to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM</tt> search keys.
284      *
285      *  @param[in] searchKey  Specifies the search key string. (To clear the internal buffer, specify <tt>NULL</tt>.)<br/>
286      *                           The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>.
287      *  @param[in] index  Specifies the search key index. <br/>
288      *                            You can specify a value in the range of <tt>0</tt> to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM - 1</tt>.
289      *
290      *  @retval ResultSuccess  Indicates success.
291      *  @retval ResultInvalidSize  Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters.
292      */
293     nn::Result SetSearchKey(const wchar_t* searchKey, const u8 index);
294 
295     /**
296      *  Sets a topic tag. <br/>
297      *  This setting is not required. <br/>
298      *  Encode the tag as <tt>UTF-16 BE</tt>.
299      *
300      *  @param[in] topicTag  Specifies the topic tag string. (Set to <tt>NULL</tt> to clear the internal buffer.)<br/>
301      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt>.
302      *
303      *  @retval ResultSuccess  Indicates success.
304      *  @retval ResultInvalidSize  Indicates that the topic tag is longer than <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt> characters.
305      */
306     nn::Result SetTopicTag(const wchar_t* topicTag);
307 
308     /**
309      *  Adds a URL attachment to the post. <br/>
310      *  This setting is not required. <br/>
311      *  The URL can be up to <tt>@ref nn::olv::EXTERNAL_URL_MAX_LENGTH</tt> characters in length, excluding the terminating character.
312      *
313      *  @param[in] externalUrl  Specifies the URL. (Set to <tt>NULL</tt> to clear the internal buffer.)<br/>
314      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::EXTERNAL_URL_MAX_LENGTH</tt>.
315      *
316      *  @retval ResultSuccess  Indicates success.
317      *  @retval ResultInvalidSize  Indicates that the URL is longer than <tt>@ref nn::olv::EXTERNAL_URL_MAX_LENGTH</tt> characters.
318      */
319     nn::Result SetExternalUrl(const char* externalUrl);
320 
321     /**
322      *  Sets binary data to attach to the message being posted. <br/>
323      *  This setting is not required. <br/>
324      *  Binary data of up to <tt>@ref nn::olv::EXTERNAL_BINARY_DATA_MAX_SIZE</tt> bytes can be specified. <br/>
325      *  Only the start address is passed in; the data is not copied.
326      *
327      *  @param[in] externalBinaryData  Specifies the start address of the binary data. (Set to <tt>NULL</tt> to clear the start address and set the size to zero.)
328      *  @param[in] externalBinaryDataSize  Specifies the size of the binary data. (This value is ignored when the starting address of the binary data is set to <tt>NULL</tt>.)
329      *
330      *  @retval ResultSuccess  Indicates success.
331      *  @retval ResultInvalidSize  Indicates that the size was <tt>0</tt> or greater than <tt>@ref nn::olv::EXTERNAL_BINARY_DATA_MAX_SIZE</tt>.
332      */
333     nn::Result SetExternalBinaryData(const u8* externalBinaryData, const u32 externalBinaryDataSize);
334 
335     /**
336      *  Sets the work buffers used to set data in the posting applet. <br/>
337      *  You must allocate a work buffer of the size, in bytes, specified by <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt> (1 MB). <br/>
338      *
339      *  @param[in] work  Specifies the start address of the work buffer.
340      *  @param[in] workSize  Specifies the work buffer size. (Specify <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>.)
341      *
342      *  @retval ResultSuccess  Indicates success.
343      *  @retval ResultNotInitialized  Indicates that the library is not initialized.
344      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
345      *  @retval ResultInvalidSize  Indicates that the <span class="argument">workSize</span> parameter is set to something other than <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>.
346      */
347     nn::Result SetWork(u8* work, const u32 workSize);
348 
349     /**
350      *  Adds a stamp used by the posting applet. <br/>
351      *  This setting is not required. <br/>
352      *  Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br/>
353      *  Stamp data set using this member function is compressed at the time it is added. <br/>
354      *  Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br/>
355      *  Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB.
356      *
357      *  @param[in]  stampData  Specifies the stamp data.
358      *  @param[in] stampDataSize  Specifies the size of the stamp data.
359      *
360      *  @retval ResultSuccess  Indicates success.
361      *  @retval ResultTooMuchData  Indicates that you cannot add any more data.
362      *  @retval ResultInvalidPointer  Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured.
363      *  @retval ResultInvalidSize  Indicates that data could not be inserted. (For example, there was not enough remaining memory left.)
364      *  @retval ResultInvalidParameter  Indicates that unusable data was passed in.
365      *  @retval ResultInvalidFormat  Indicates that the stamp format is invalid.
366      */
367     nn::Result AddStampData(const u8* stampData, const u32 stampDataSize);
368 
369     /**
370      *  Gets the number of stamps configured.
371      *
372      *  @return Returns the number of stamps configured.
373      */
374     u32 GetStampDataNum() const;
375 
376     /**
377      *  Gets the amount of memory being used by configured stamps.
378      *
379      *  @return Returns the amount of memory being used by configured stamps.
380      */
381     u32 GetStampDataListSize() const;
382 
383     /**
384      *  Gets the number of data items that have been set.
385      *
386      *  @return Returns the number of data items.
387      */
388     s32 GetDataTypeNum(const u32 dataTypeId) const ;
389 
390     /**
391      *  Adds common data. <br/>
392      *  This setting is not required. <br/>
393      *  Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br/>
394      *
395      *  @retval ResultSuccess  Indicates success.
396      *  @retval ResultTooMuchData  Indicates that you cannot add any more data.
397      *  @retval ResultInvalidPointer  Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured.
398      *  @retval ResultInvalidSize  Indicates that data could not be inserted. (For example, there was not enough remaining memory left.)
399      */
400     nn::Result AddCommonData(const u32 dataTypeId, const u8* data, const u32 dataSize);
401 
402     /**
403      *  Adds a stamp used by the posting applet. <br/>
404      *  This setting is not required. <br/>
405      *  Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br/>
406      *  Stamp data set using this member function is compressed at the time it is added. <br/>
407      *  Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br/>
408      *  Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB.
409      *
410      *  @param[in]  stampData  Specifies the stamp data.
411      *  @param[in] stampDataSize  Specifies the size of the stamp data.
412      *  @param[in] stampFlags  Flags that represent stamp attributes (<tt>STAMP_FLAG_*</tt>).
413      *
414      *  @retval ResultSuccess  Indicates success.
415      *  @retval ResultTooMuchData  Indicates that you cannot add any more data.
416      *  @retval ResultInvalidPointer  Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured.
417      *  @retval ResultInvalidSize  Indicates that data could not be inserted. (For example, there was not enough remaining memory left.)
418      *  @retval ResultInvalidParameter  Indicates that unusable data was passed in.
419      *  @retval ResultInvalidFormat  Indicates that the stamp format is invalid.
420      */
421     nn::Result SetStampData(const u8* stampData, const u32 stampDataSize, const u32 stampFlags = 0)
422     {
423         const u32 dataNum = GetDataTypeNum(DATA_TYPE_STAMP) + GetDataTypeNum(DATA_TYPE_INVALID_STAMP);
424         if(dataNum >= STAMP_DATA_MAX_NUM)
425         {
426             return nn::olv::ResultTooMuchData();
427         }
428         u32 type = DATA_TYPE_STAMP;
429         if ((stampFlags == STAMP_FLAG_VALUE_INVALID))
430         {
431             type = DATA_TYPE_INVALID_STAMP;
432         }
433         return AddCommonData(type, stampData, stampDataSize);
434     }
435 
436     /**
437      *  Gets the number of stamps configured.
438      *
439      *  @param[in] stampFlags    ...  Flags that represent the stamp attributes (<tt>STAMP_FLAG_*</tt>) to get.
440      *
441      *  @return Returns the number of pieces of stamp data that are set, or <tt>0</tt> if the flags are invalid.
442      */
GetStampDataNum(const u32 stampFlags)443     u32 GetStampDataNum(const u32 stampFlags) const
444     {
445         if ((stampFlags == STAMP_FLAG_VALUE_NONE))
446         {
447             return GetDataTypeNum(DATA_TYPE_STAMP);
448         }
449         else if ((stampFlags == STAMP_FLAG_VALUE_INVALID))
450         {
451             return GetDataTypeNum(DATA_TYPE_INVALID_STAMP);
452         }
453         return 0;
454     }
455     /// @endcond
456 
457 protected:
458     /// @cond
459     u32 flags;                              /*!< Sets flags. */
460     u16 bodyText[BODY_TEXT_BUFF_LENGTH];    /*!< Represents text data. */
461     const u8* bodyMemo;                     /*!< Handwritten memo. */
462     u32 bodyMemoSize;                       /*!< Handwritten memo data size. */
463     s8  feeling;                            /*!< Mood. */
464     u8  padding[3];
465     u16 topicTag
466         [TOPIC_TAG_BUFF_LENGTH];            /*!< Topic tag. */
467     const u8* externalImageData;            /*!< Specifies an image attachment. */
468     u32 externalImageDataSize;              /*!< Size of the image attachment. */
469     u16 searchKeys
470         [SEARCH_KEY_MAX_NUM]
471         [SEARCH_KEY_BUFF_LENGTH];           /*!< Search keys. */
472     const u8* appData;                      /*!< Application data attachment. */
473     u32 appDataSize;                        /*!< Size of the application data to attach (maximum: 1 KB). */
474     const u8* externalBinaryData;           /*!< Binary data attachment. */
475     u32 externalBinaryDataSize;             /*!< Size of binary data for the attachment. */
476     s8  externalUrl
477         [EXTERNAL_URL_BUFF_LENGTH];         /*!< External URL. */
478     u64 titleId;                            /*!< Specifies the title ID. */
479     const u8* externalThumbnailImageData;   /*!< Thumbnail attachment data. */
480     u32 externalThumbnailImageDataSize;     /*!< Size of the thumbnail attachment data. */
481     u32 bodyTextMaxLength;                  /*!< Maximum number of characters to send. */
482     u8 reserved[1433];                      /*!< Represents a reserved region. */
483 
484     //-----------------------------------------------------------------------------------------------------------------
485     // The members to this point are in version 1.0.
486     //-----------------------------------------------------------------------------------------------------------------
487 
488     friend class internal::Main;
489     /// @endcond
490 };
491 
492 /**
493  *  Parameters used when sending post data <br/>
494  *  <b>Note:</b> <br/>
495  *  This class is for debugging purposes. Do not use it in the retail version. <br/>
496  *  (The inherited class <tt>@ref nn::olv::UploadPostDataByPostAppParam</tt> can be used in the retail version. ) <br />
497  *
498  *   It is inherited by <tt>@ref UploadPostDataByPostAppParam</tt>, which is the parameter when uploading post data via the posting applet.
499  *
500  *  All member functions can be called even in offline mode. <br/>
501  *  All member functions are thread-safe.
502  */
503 class UploadPostDataParam : public UploadParamBase
504 {
505 public:
506     /**
507      * Flags to specify with <tt>UploadPostDataParam::SetFlags</tt>. <br/>
508      * These flags cannot be specified using the following functions in the respective inherited classes: <tt>@ref UploadPostDataByPostAppParam::SetFlags</tt> and <tt>@ref UploadDirectMessageDataByPostAppParam::SetFlags</tt>.
509      */
510     enum
511     {
512         FLAG_NONE            = 0,                                //!< The default flag value.
513         FLAG_SPOILER         = UPLOAD_FLAG_VALUE_SPOILER,        //!< The flag specified when the post includes spoilers.
514         FLAG_APP_STARTABLE   = UPLOAD_FLAG_VALUE_APP_STARTABLE,  //!< The flag specified for a post when an application jump is possible from post data in the Miiverse application.
515         FLAG_DELETE          = UPLOAD_FLAG_VALUE_DELETE,         //!< The flag specified when deleting a post. <br/>
516                                                                  //!< The post ID must be specified by <tt>@ref SetPostId</tt>.
517     };
518 
519 public:
520     /** Instantiates the object. */
521     UploadPostDataParam();
522 
523     //-----------------------------------------------------------------------------------------------------------------
524     // Version 1.0 can be used to this point.
525     //-----------------------------------------------------------------------------------------------------------------
526 
527     /**
528      *  Sets a topic tag. <br/>
529      *  This setting is not required. <br/>
530      *  Encode the tag as <tt>UTF-16 BE</tt>.
531      *
532      *  @param[in] topicTag  Specifies the topic tag string. (Set to <tt>NULL</tt> to clear the internal buffer.)<br/>
533      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt>.
534      *
535      *  @retval ResultSuccess  Indicates success.
536      *  @retval ResultInvalidSize  Indicates that the topic tag is longer than <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt> characters.
537      */
538     nn::Result SetTopicTag(const wchar_t* topicTag);
539 
540     /**
541      *  Adds a URL attachment to the post. <br/>
542      *  This setting is not required. <br/>
543      *  The URL can be up to <tt>@ref nn::olv::EXTERNAL_URL_MAX_LENGTH</tt> characters in length, excluding the terminating character.
544      *
545      *  @param[in] externalUrl  Specifies the URL. (Set to <tt>NULL</tt> to clear the internal buffer.)<br/>
546      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::EXTERNAL_URL_MAX_LENGTH</tt>.
547      *
548      *  @retval ResultSuccess  Indicates success.
549      *  @retval ResultInvalidSize  Indicates that the URL is longer than <tt>@ref nn::olv::EXTERNAL_URL_MAX_LENGTH</tt> characters.
550      */
551     nn::Result SetExternalUrl(const char* externalUrl);
552 
553     /**
554      *  Sets the search keys to use for downloading posts. <br/>
555      *  This setting is not required. <br/>
556      *  The search keys must contain only ASCII characters. (Encode as <tt>UTF-16 BE</tt>.)
557      *  You can specify up to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM</tt> search keys.
558      *
559      *  @param[in] searchKey  Specifies the search key string. (To clear the internal buffer, specify <tt>NULL</tt>.)<br/>
560      *                           The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>.
561      *  @param[in] index  Specifies the search key index. <br/>
562      *                            You can specify a value in the range of <tt>0</tt> to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM - 1</tt>.
563      *
564      *  @retval ResultSuccess  Indicates success.
565      *  @retval ResultInvalidSize  Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters.
566      */
567     nn::Result SetSearchKey(const wchar_t* searchKey, const u8 index);
568 
569     /**
570      *  Sets flags. <br/>
571      *  This setting is not required. <br/>
572      *
573      *  @param[in] flags  Flags defined in the <tt>@ref UploadPostDataParam</tt> class.<br/>
574       *
575      *                       The following flags can be used. <br/>
576      *                       @ref UploadPostDataParam::FLAG_SPOILER <br/>
577      *                       @ref UploadPostDataParam::FLAG_APP_STARTABLE <br/>
578      *                       @ref UploadPostDataParam::FLAG_DELETE <br/>
579      *
580      *  @retval ResultInvalidParameter  Indicates that one or more flags are invalid.
581      */
582     nn::Result SetFlags(const u32 flags);
583 
584     /**
585      *  Sets whether the post has community data. <br/>
586      *  This setting is not required. <br/>
587      *  If no community ID is specified (the value is <tt>0</tt>), the post is made to the official community.
588      *
589      *  @param[in] communityId  Specifies the community ID.
590      *
591      *  @retval ResultSuccess  Indicates success.
592      *  @retval ResultInvalidParameter  Indicates that the community ID is not available.
593      */
594     nn::Result SetCommunityId(const u32 communityId);
595 
596     /**
597      *  Sets the ID of the post to delete. <br/>
598      *  Necessary if <tt>@ref FLAG_DELETE</tt> was specified by <tt>@ref SetFlags</tt>.
599      *
600      *  @param[in] postId  Specifies a text string representing the post ID. <br/>
601      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH</tt>.
602      *
603      *  @retval ResultSuccess  Indicates success.
604      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
605      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
606      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::POST_ID_MAX_LENGTH</tt> characters.
607      */
608     nn::Result SetPostId(const char* postId);
609 
610 private:
611     /// @cond
612     u32 communityId;        /*!< Community ID. */
613 
614     //-----------------------------------------------------------------------------------------------------------------
615     // The members to this point are in version 1.0.
616     //-----------------------------------------------------------------------------------------------------------------
617 
618     s8 postId[POST_ID_BUFF_LENGTH];  /*!< Post ID. */
619     u8 reserved[469];                /*!< Represents a reserved region. */
620 
621     friend class internal::Main;
622     /// @endcond
623 };
624 
625 /**
626  *  Parameters used when deleting post data. <br/>
627  *
628  *  All member functions can be called even in offline mode. <br/>
629  *  All member functions are thread-safe.
630  */
631 class DeletePostDataParam : protected UploadPostDataParam
632 {
633 public:
634     /** Instantiates the object. */
DeletePostDataParam()635     DeletePostDataParam() { UploadPostDataParam::SetFlags(UploadPostDataParam::FLAG_DELETE); }
636 
637     /**
638      * Sets the ID of the post to delete. <br/>
639      * You must specify this.
640      *
641      *  @param[in] postId  Specifies a text string representing the post ID. <br/>
642      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH</tt>.
643      *
644      *  @retval ResultSuccess  Indicates success.
645      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
646      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
647      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::POST_ID_MAX_LENGTH</tt> characters.
648      */
SetPostId(const char * postId)649     nn::Result SetPostId(const char* postId) {
650         return UploadPostDataParam::SetPostId(postId);
651     }
652 };
653 
654 /**
655  *  Specifies parameters used when sending direct messages. <br/>
656  *  <b>Note:</b> <br/>
657  *  This class is for debugging purposes. Do not use it in the retail version. <br/>
658  *  (The inherited class <tt>@ref nn::olv::UploadDirectMessageDataByPostAppParam</tt> can be used in the retail version. ) <br />
659  *
660  *  All member functions can be called even in offline mode. <br/>
661  *  All member functions are thread-safe.
662  */
663 class UploadDirectMessageDataParam : public UploadParamBase
664 {
665 public:
666     /** Flags to specify with <tt>UploadDirectMessageDataParam::SetFlags</tt>. */
667     enum
668     {
669         FLAG_NONE            = 0,                                //!< The default flag value.
670         FLAG_DELETE          = UPLOAD_FLAG_VALUE_DELETE,         //!< The flag specified when deleting direct message data. <br/>
671                                                                  //!< The direct message ID must be specified by <tt>@ref SetDirectMessageId</tt>.
672     };
673 
674 public:
675     /** Instantiates the object. */
676     UploadDirectMessageDataParam();
677 
678     /**
679      *  Sets the principal ID of the recipient of the direct message. <br/>
680      *  You must specify this ID except when you set <tt>@ref FLAG_DELETE</tt> in the <tt>@ref SetFlags</tt> function to delete direct message data.
681      *
682      *  @param[in] userPid  Specifies the principal ID of the recipient of the direct message.
683      *
684      *  @retval ResultSuccess  Indicates success.
685      *  @retval ResultInvalidParameter  Indicates that a value of <tt>0</tt> was specified.
686      */
687     nn::Result SetUserPid(const u32 userPid);
688 
689     //-----------------------------------------------------------------------------------------------------------------
690     // Version 1.0 can be used to this point.
691     //-----------------------------------------------------------------------------------------------------------------
692 
693     /**
694      *  Sets the search keys to use for downloading direct messages. <br/>
695      *  This setting is not required. <br/>
696      *  The search keys must contain only ASCII characters. (Encode as <tt>UTF-16 BE</tt>.)
697      *  You can specify up to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM</tt> search keys.
698      *
699      *  @param[in] searchKey  Specifies the search key string. (To clear the internal buffer, specify <tt>NULL</tt>.)<br/>
700      *                           The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>.
701      *  @param[in] index  Specifies the search key index. <br/>
702      *                            You can specify a value in the range of <tt>0</tt> to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM - 1</tt>.
703      *
704      *  @retval ResultSuccess  Indicates success.
705      *  @retval ResultInvalidSize  Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters.
706      */
707     nn::Result SetSearchKey(const wchar_t* searchKey, const u8 index);
708 
709     /**
710      *  Sets flags. <br/>
711      *  This setting is not required. <br/>
712      *
713      *  @param[in] flags  Flags defined in the <tt>@ref UploadDirectMessageDataParam</tt> class.<br/>
714       *
715      *                       The following flags can be used. <br/>
716      *                       @ref UploadDirectMessageDataParam::FLAG_DELETE <br/>
717      *
718      *  @retval ResultSuccess  Indicates success.
719      *  @retval ResultInvalidParameter  Indicates that one or more flags are invalid.
720      */
721     nn::Result SetFlags(const u32 flags);
722 
723     /**
724      *  Set the ID of the direct message you want to delete. <br/>
725      *  Necessary if <tt>@ref FLAG_DELETE</tt> was specified by <tt>@ref SetFlags</tt>.
726      *
727      *  @param[in] directMessageId  The string to set for the direct message ID. (Specify <tt>NULL</tt> to clear the internal buffer.)<br/>
728      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt>.
729      *
730      *  @retval ResultSuccess  Indicates success.
731      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
732      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
733      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt> characters.
734      */
735     nn::Result SetDirectMessageId(const char* directMessageId);
736 
737 private:
738     /// @cond
739     u32 userPid[DIRECT_MESSAGE_PID_MAX_NUM];    /*!< Specifies the principal ID of the target user. */
740 
741 
742     //-----------------------------------------------------------------------------------------------------------------
743     // The members to this point are in version 1.0.
744     //-----------------------------------------------------------------------------------------------------------------
745 
746     s8  directMessageId
747         [DIRECT_MESSAGE_ID_BUFF_LENGTH];    /*!< Direct message ID. */
748     u8 reserved[469];                       /*!< Represents a reserved region. */
749 
750     friend class internal::Main;
751     /// @endcond
752 };
753 
754 /**
755  *  Parameters used when deleting direct messages. <br/>
756  *
757  *  All member functions can be called even in offline mode. <br/>
758  *  All member functions are thread-safe.
759  */
760 class DeleteDirectMessageDataParam : protected UploadDirectMessageDataParam
761 {
762 public:
763     /** Instantiates the object. */
DeleteDirectMessageDataParam()764     DeleteDirectMessageDataParam() { UploadDirectMessageDataParam::SetFlags(UploadDirectMessageDataParam::FLAG_DELETE); }
765 
766     /**
767      *  Set the ID of the direct message you want to delete. <br/>
768      *  You must specify this.
769      *
770      *  @param[in] directMessageId  The string to set for the direct message ID. (Specify <tt>NULL</tt> to clear the internal buffer.)<br/>
771      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt>.
772      *
773      *  @retval ResultSuccess  Indicates success.
774      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
775      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
776      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt> characters.
777      */
SetDirectMessageId(const char * directMessageId)778     nn::Result SetDirectMessageId(const char* directMessageId) {
779         return UploadDirectMessageDataParam::SetDirectMessageId(directMessageId);
780     }
781 };
782 
783 /**
784  *  Parameters for adding a comment to a post. <br/>
785  *  <b>Note:</b> <br/>
786  *  This class is for debugging purposes. Do not use it in the retail version. <br/>
787  *  (The inherited class <tt>@ref nn::olv::UploadCommentDataByPostAppParam</tt> can be used in the retail version. ) <br />
788  *
789  *   It is inherited by <tt>@ref UploadCommentDataByPostAppParam</tt>, which is the parameter when uploading comment data via the posting applet.
790  *
791  *  All member functions can be called even in offline mode.
792  *  All member functions are thread-safe.
793  *
794  */
795 class UploadCommentDataParam : public UploadParamBase
796 {
797 public:
798     /**
799      * Flags to specify with <tt>UploadCommentDataParam::SetFlags</tt>. <br/>
800      * These flags cannot be specified using the following function in the respective inherited class: <tt>@ref UploadCommentDataByPostAppParam::SetFlags</tt>.
801      */
802     enum
803     {
804         FLAG_NONE            = 0,                                //!< The default flag value.
805         FLAG_SPOILER         = UPLOAD_FLAG_VALUE_SPOILER,        //!< The flag specified when the comment includes spoilers.
806         FLAG_DELETE          = UPLOAD_FLAG_VALUE_DELETE,         //!< The flag specified when deleting a comment. <br/>
807                                                                  //!< The comment ID must be specified by <tt>@ref SetCommentId</tt>.
808     };
809 
810 public:
811     /** Instantiates the object.  */
812     UploadCommentDataParam();
813 
814     /**
815      *  Sets flags. <br/>
816      *  This setting is not required. <br/>
817      *
818      *  @param[in] flags  Flags defined in the <tt>@ref UploadCommentDataParam</tt> class.<br/>
819      *
820      *                       The following flags can be used. <br/>
821      *                       @ref UploadCommentDataParam::FLAG_SPOILER <br/>
822      *                       @ref UploadCommentDataParam::FLAG_DELETE <br/>
823      *
824      *  @retval ResultSuccess  Indicates success.
825      *  @retval ResultInvalidParameter  Indicates that one or more flags are invalid.
826      */
827     nn::Result SetFlags(const u32 flags);
828 
829     /**
830      *  Sets the ID of the post to add the comment to. <br/>
831      *  You must specify this ID except when you set <tt>@ref FLAG_DELETE</tt> in the <tt>@ref SetFlags</tt> function to delete comment data.
832      *
833      *  @param[in] postId  Specifies a text string representing the post ID. <br/>
834      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH</tt>.
835      *
836      *  @retval ResultSuccess  Indicates success.
837      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
838      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
839      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::POST_ID_MAX_LENGTH</tt> characters.
840      */
841     nn::Result SetPostId(const char* postId);
842 
843     /**
844      *  Sets the ID of the comment to delete. <br/>
845      *  Necessary if <tt>@ref FLAG_DELETE</tt> was specified by <tt>@ref SetFlags</tt>.
846      *
847      *  @param[in] commentId  Specifies the comment ID to set as a text string.
848      *
849      *  @retval ResultSuccess  Indicates success.
850      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
851      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
852      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::COMMENT_ID_MAX_LENGTH</tt> characters.
853      */
854     nn::Result SetCommentId(const char* commentId);
855 
856 private:
857     /// @cond
858     s8  postId[POST_ID_BUFF_LENGTH];       /*!< Post ID. */
859     s8  commentId[COMMENT_ID_BUFF_LENGTH]; /*!< Represents the comment ID. */
860     u8  reserved[445];                     /*!< Represents a reserved region. */
861 
862     friend class internal::Main;
863     /// @endcond
864 };
865 
866 /**
867  *  Parameters used when deleting comments. <br/>
868  *
869  *  All member functions can be called even in offline mode. <br/>
870  *  All member functions are thread-safe.
871  */
872 class DeleteCommentDataParam : protected UploadCommentDataParam
873 {
874 public:
875     /** Instantiates the object. */
DeleteCommentDataParam()876     DeleteCommentDataParam() { UploadCommentDataParam::SetFlags(UploadCommentDataParam::FLAG_DELETE); }
877 
878     /**
879      *  Sets the ID of the comment to delete. <br/>
880      *  You must specify this.
881      *
882      *  @param[in] commentId  Specifies the comment ID to set as a text string.
883      *
884      *  @retval ResultSuccess  Indicates success.
885      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
886      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
887      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::COMMENT_ID_MAX_LENGTH</tt> characters.
888      */
SetCommentId(const char * commentId)889     nn::Result SetCommentId(const char* commentId) {
890         return UploadCommentDataParam::SetCommentId(commentId);
891     }
892 };
893 
894 /**
895  * Parameters used when updating Yeahs for a post.
896  *
897  *  All member functions can be called even in offline mode. <br/>
898  *  All member functions are thread-safe.
899  */
900 class UploadEmpathyToPostDataParam
901 {
902 public:
903     /** Flags to specify with <tt>@ref UploadEmpathyToPostDataParam::SetFlags</tt>.*/
904     enum
905     {
906         FLAG_NONE = 0,          /*!< The default flag value. */
907         FLAG_REMOVE = (1<<0)    /*!< Set this flag to remove a Yeah. */
908     };
909 
910 public:
911     /** Instantiates the object. */
912     UploadEmpathyToPostDataParam();
913 
914     /**
915      *  Sets the ID of the post for which to give or remove a Yeah. <br/>
916      *  This setting is required. <br/>
917      *
918      *  @param[in] postId  Specifies a text string representing the post ID. <br/>
919      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH</tt>.
920      *
921      *  @retval ResultSuccess  Indicates success.
922      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
923      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
924      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::POST_ID_MAX_LENGTH</tt> characters.
925      */
926     nn::Result SetPostId(const char* postId);
927 
928     /**
929      *  Sets flags. <br/>
930      *  This setting is not required. <br/>
931      *  If not specified, the Yeah is set to a post's data. <br/>
932      *
933      *  @param[in] flags  Flags defined in the <tt>UploadEmpathyToPostDataParam</tt> class. <br/>
934      *
935      *                       The following flags can be used. <br/>
936      *                       @ref UploadEmpathyToPostDataParam::FLAG_REMOVE
937      *
938      *  @retval ResultSuccess  Indicates success.
939      *  @retval ResultInvalidParameter  Indicates that one or more flags are invalid.
940      */
941     nn::Result SetFlags(const u32 flags);
942 
943 private:
944     /// @cond
945     u32 flags;                          /*!< Sets flags. */
946     s8  postId[POST_ID_BUFF_LENGTH];    /*!< Post ID. */
947     u8 reserved[28];
948 
949     friend class internal::Main;
950     /// @endcond
951 };
952 
953 /**
954  *  Parameters used when updating communities
955  *
956  *  Used to create, update, and delete communities. <br/>
957  *  All member functions can be called even in offline mode. <br/>
958  *  All member functions are thread-safe.
959  */
960 class UploadCommunityDataParam
961 {
962 public:
963     /** Flags to specify with <tt>UploadCommunityDataParam::SetFlags</tt>. */
964     enum
965     {
966         FLAG_NONE = 0,          /*!< The default flag value. */
967         FLAG_DELETE = (1<<0)    /*!< Set this flag to delete community data. */
968     };
969 
970 public:
971     /** Instantiates the object. */
972     UploadCommunityDataParam();
973 
974     /**
975      *  Sets flags. <br/>
976      *  This setting is not required.
977      *
978      *  @param[in] flags  Flags defined in the <tt>@ref UploadCommunityDataParam</tt> class.<br/>
979      *
980      *                       The following flags can be used. <br/>
981      *                       @ref UploadCommunityDataParam::FLAG_DELETE <br/>
982      *
983      *  @retval ResultSuccess  Indicates success.
984      */
985     nn::Result SetFlags(const u32 flags);
986 
987     /**
988      *  Configures the ID of the community being updated. <br/>
989      *  Required when updating or deleting community data. <br/>
990      *  Creates a new community if the community ID is not specified. (The ID is <tt>0</tt>.)
991      *
992      *  @param[in] communityId  Specifies the community ID.
993      *
994      *  @retval ResultSuccess  Indicates success.
995      */
996     nn::Result SetCommunityId(const u32 communityId);
997 
998     /**
999      *  Configures application data that the application can use. <br/>
1000      *  This setting is not required. <br/>
1001      *  Application data of up to <tt>@ref nn::olv::APP_DATA_MAX_SIZE</tt> bytes can be specified. <br/>
1002      *  Only the start address is passed in; the data is not copied.
1003      *
1004      *  @param[in] appData  Specifies the start address of the application data. (Set to <tt>NULL</tt> to clear the start address and set the size to zero.)
1005      *  @param[in] appDataSize  Specifies the size of the application data.
1006      *
1007      *  @retval ResultSuccess  Indicates success.
1008      *  @retval ResultInvalidSize  Indicates that the application data size is <tt>0</tt> or a value greater than <tt>@ref nn::olv::APP_DATA_MAX_SIZE</tt>.
1009      */
1010     nn::Result SetAppData(const u8* appData, const u32 appDataSize);
1011 
1012     /**
1013      *  Sets the community name. <br/>
1014      *  This specification is required when creating new community data. <br/>
1015      *  The specification is disabled when you set <tt>@ref FLAG_DELETE</tt> in the <tt>@ref SetFlags</tt> function to delete community data. <br/>
1016      *
1017      *  @param[in] titleText  Specifies the community name. (Set to <tt>NULL</tt> to clear the internal buffer.)<br/>
1018      *                           <tt>UTF-16LE</tt> character encoding. <br/>
1019      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::TITLE_TEXT_MAX_LENGTH </tt>.
1020      *
1021      *  @retval ResultSuccess  Indicates success.
1022      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::TITLE_TEXT_MAX_LENGTH</tt> characters.
1023      */
1024     nn::Result SetTitleText(const wchar_t* titleText);
1025 
1026     /**
1027      *  Sets the community description. <br/>
1028      *  This setting is not required. <br/>
1029      *  The specification is disabled when you set <tt>@ref FLAG_DELETE</tt> in the <tt>@ref SetFlags</tt> function to delete community data. <br/>
1030      *
1031      *  @param[in] descriptionText  Specifies the community description. (Set to <tt>NULL</tt> to clear the internal buffer.)<br/>
1032      *                           <tt>UTF-16LE</tt> character encoding. <br/>
1033      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::DESCRIPTION_TEXT_MAX_LENGTH</tt>.
1034      *
1035      *  @retval ResultSuccess  Indicates success.
1036      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::DESCRIPTION_TEXT_MAX_LENGTH</tt> characters.
1037      */
1038     nn::Result SetDescriptionText(const wchar_t* descriptionText);
1039 
1040     /**
1041      *  Sets the community icon. <br/>
1042      *  This setting is not required. <br/>
1043      *  You must specify an uncompressed, 128x128, 32-bit color TGA image for the icon. <br/>
1044      *  Only the start address is passed in; the data is not copied. <br/>
1045      *  The specification is disabled when you set <tt>@ref FLAG_DELETE</tt> in the <tt>@ref SetFlags</tt> function to delete community data. <br/>
1046      *
1047      *  @param[in] iconData  Specifies the start address of the community icon. (Specify <tt>NULL</tt> to clear the start address and size.)
1048      *  @param[in] iconDataSize  Specifies the size of the community icon, in bytes.
1049      *
1050      *  @retval ResultSuccess  Indicates success.
1051      *  @retval ResultInvalidSize  Indicates that the size is invalid.
1052      *  @retval ResultInvalidFormat  Indicates that the icon data format is invalid.
1053      */
1054     nn::Result SetIconData(const u8* iconData, const u32 iconDataSize);
1055 
1056 private:
1057     /// @cond
1058     u32 flags;                              /*!< Sets flags. */
1059     u64 titleId;                            /*!< Specifies the title ID. */
1060     u32 communityId;                        /*!< Community ID. */
1061     u16 titleText
1062         [TITLE_TEXT_BUFF_LENGTH];           /*!< Specifies the community title. */
1063     u16 descriptionText
1064         [DESCRIPTION_TEXT_BUFF_LENGTH];     /*!< Specifies the community description. */
1065     u16 searchKeys
1066         [SEARCH_KEY_MAX_NUM]
1067         [SEARCH_KEY_BUFF_LENGTH];           /*!< Search keys. */
1068     const u8* appData;                      /*!< Application data attachment. */
1069     u32 appDataSize;                        /*!< Specifies the size of the application data attachment. */
1070     const u8* iconData;                     /*!< Specifies the icon data to attach. */
1071     u32 iconDataSize;                       /*!< Specifies the size of the icon data to attach. */
1072     u8 reserved[1768];
1073 
1074     friend class internal::Main;
1075     /// @endcond
1076 };
1077 
1078 /**
1079  * Parameters used when setting or updating favorites in community data.
1080  *
1081  *  All member functions can be called even in offline mode. <br/>
1082  *  All member functions are thread-safe.
1083  */
1084 class UploadFavoriteToCommunityDataParam
1085 {
1086 public:
1087     /** Flags to specify with <tt>UploadFavoriteToCommunityDataParam::SetFlags</tt>. */
1088     enum
1089     {
1090         FLAG_NONE = 0,          /*!< The default flag value. */
1091         FLAG_REMOVE = (1<<0)    /*!< Set this flag to remove a favorite. */
1092     };
1093 
1094 public:
1095     /** Instantiates the object. */
1096     UploadFavoriteToCommunityDataParam();
1097 
1098     /**
1099      *  Sets flags. <br/>
1100      *  This setting is not required. <br/>
1101      *
1102      *  @param[in] flags  Flags defined in the <tt>@ref UploadFavoriteToCommunityDataParam</tt> class.<br/>
1103      *
1104      *                       The following flags can be used. <br/>
1105      *                       @ref UploadFavoriteToCommunityDataParam::FLAG_REMOVE
1106      *
1107      *  @retval ResultSuccess  Indicates success.
1108      */
1109     nn::Result SetFlags(const u32 flags);
1110 
1111     /**
1112      *  Sets the community code of the community to add to favorites. <br/>
1113      *  This setting is not required. <br/>
1114      *  The specification is prohibited when specifying a community ID with the <tt>@ref SetCommunityId</tt> function. <br/>
1115      *  If neither a community ID nor a community code is specified, the official community is registered or removed as a favorite by default. <br/>
1116      *
1117      *  @param[in] communityCode  Specifies the community.
1118      *
1119      *  @retval ResultSuccess  Indicates success.
1120      *  @retval ResultInvalidSize  The size of the community code is invalid.
1121      *  @retval ResultInvalidCommunityCode  Indicates an invalid community code.
1122      */
1123     nn::Result SetCommunityCode(const char* communityCode);
1124 
1125     /**
1126      *  Sets the ID of the community to add to favorites. <br/>
1127      *  This setting is not required. <br/>
1128      *  The specification is prohibited when specifying a community code with the <tt>@ref SetCommunityCode</tt> function. <br/>
1129      *  If neither a community ID nor a community code is specified, the official community is registered or removed as a favorite by default. <br/>
1130      *
1131      *  @param[in] communityId  Specifies the community ID.
1132      *
1133      *  @retval ResultSuccess  Indicates success.
1134      *  @retval ResultInvalidParameter  An invalid community code has been specified.
1135      */
1136     nn::Result SetCommunityId(const u32 communityId);
1137 
1138 private:
1139     /// @cond
1140     u32 flags;                          /*!< Sets flags. */
1141     u32 communityId;                    /*!< Community ID. */
1142     u8  reserved[53];
1143 
1144     friend class internal::Main;
1145     /// @endcond
1146 };
1147 
1148 /**
1149  *  Parameters used when following or unfollowing a user.
1150  *
1151  *  All member functions can be called even in offline mode. <br/>
1152  *  All member functions are thread-safe.
1153  */
1154 class UploadFollowToUserDataParam
1155 {
1156 public:
1157     /** Flags to specify with <tt>UploadFollowToUserDataParam::SetFlags</tt>. */
1158     enum
1159     {
1160         FLAG_NONE = 0,          /*!< Flag used to follow a user (default value). */
1161         FLAG_REMOVE = (1<<0)    /*!< Set this flag to unfollow a user. */
1162     };
1163 
1164 public:
1165     /** Instantiates the object. */
1166     UploadFollowToUserDataParam();
1167 
1168     /**
1169      *  Sets flags. <br/>
1170      *  This setting is not required. <br/>
1171      *  If not specified, the user will be followed. <br/>
1172      *
1173      *  @param[in] flags  Flags defined in the <tt>@ref UploadFollowToUserDataParam </tt> class.<br/>
1174      *
1175      *                       The following flags can be used. <br/>
1176      *                       @ref UploadFollowToUserDataParam::FLAG_REMOVE
1177      *
1178      *  @retval ResultSuccess  Indicates success.
1179      */
1180     nn::Result SetFlags(const u32 flags);
1181 
1182     /**
1183      *  Sets the principal ID of the user being followed or unfollowed. <br/>
1184      *  This setting is required. <br/>
1185      *
1186      *  @param[in] userPid  Principal ID of the user being followed or unfollowed.
1187      *
1188      *  @retval ResultSuccess  Indicates success.
1189      *  @retval ResultInvalidParameter  Indicates that a value of <tt>0</tt> was specified.
1190      */
1191     nn::Result SetUserPid(const u32 userPid);
1192 
1193 protected:
1194     /// @cond
1195     u32 flags;          /*!< Sets flags. */
1196     u32 userPid;        /*!< User ID. */
1197     u8  reserved[53];
1198 
1199     friend class internal::Main;
1200     /// @endcond
1201 };
1202 
1203 /**
1204  *  Parameters used when receiving post data.
1205  *
1206  *  All member functions are thread-safe and can also be called in offline mode. <br/>
1207  *
1208  */
1209 class DownloadPostDataListParam
1210 {
1211 public:
1212     /**
1213         Flags to specify with <tt>DownloadPostDataListParam::SetFlags</tt>.
1214 
1215         - You can filter the posts by specifying a combination of <tt>@ref FLAG_FILTER_BY_FRIEND</tt>, <tt>@ref FLAG_FILTER_BY_FOLLOW</tt>, and <tt>@ref FLAG_FILTER_BY_SELF</tt>. If none of these are specified, posts are not filtered. <br/>
1216      */
1217     enum
1218     {
1219         FLAG_NONE = 0,                      //!< The default flag value.
1220         // Specifies whether a combination of flags is to be used.
1221         FLAG_FILTER_BY_FRIEND = (1<<0),     //!< Downloads posts by friends. <br/>
1222                                             //!< This flag is disabled if a principal ID has been specified with the <tt>@ref SetSearchPid</tt> function. <br/>
1223                                             //!< This flag is disabled if a post ID has been specified with the <tt>@ref SetPostId</tt> function. <br/>
1224         FLAG_FILTER_BY_FOLLOW = (1<<1),     //!< Downloads posts being followed. <br/>
1225                                             //!< This flag is disabled if a principal ID has been specified with the <tt>@ref SetSearchPid</tt> function. <br/>
1226                                             //!< This flag is disabled if a post ID has been specified with the <tt>@ref SetPostId</tt> function. <br/>
1227         FLAG_FILTER_BY_SELF = (1<<2),       //!< Downloads one's own posts. <br/>
1228                                             //!< This flag is disabled if a principal ID has been specified with the <tt>@ref SetSearchPid</tt> function. <br/>
1229                                             //!< This flag is disabled if a post ID has been specified with the <tt>@ref SetPostId</tt> function. <br/>
1230         // Specifies whether the body type is <span class="argument">bodyText</span> or <span class="argument">bodyMemo</span>.
1231         FLAG_FILTER_BY_BODY_TEXT = (1<<3),  //!< Downloads only posts that include text data. <br/>
1232                                             //!< You cannot specify this flag at the same time as <tt>@ref FLAG_FILTER_BY_BODY_MEMO</tt>. <br/>
1233         FLAG_FILTER_BY_BODY_MEMO = (1<<4),  //!< Downloads only posts that include handwritten memos. <br/>
1234                                             //!< You cannot specify this flag at the same time as <tt>@ref FLAG_FILTER_BY_BODY_TEXT</tt>. <br/>
1235         // Specifies whether a combination of flags is to be used.
1236         FLAG_DISTINCT_PID = (1<<5),         //!< Filters posts to just those from the same poster and gets that data.
1237         FLAG_WITH_MII_DATA = (1<<6),        //!< Downloads posts, including Mii character data.
1238         FLAG_WITH_EMPATHY_ADDED = (1<<7),   //!< Downloads posts, including flags indicating that the local user has given a Yeah.
1239         FLAG_WITH_SPOILER = (1<<8)          //!< Downloads posts that include spoilers.
1240         //FLAG_RESERVED0 = (1<<9),
1241         //FLAG_RESERVED1 = (1<<10),
1242     };
1243 
1244 public:
1245     /** Instantiates the object. */
1246     DownloadPostDataListParam();
1247 
1248     /**
1249      *  Sets flags. <br/>
1250      *  This setting is not required. <br/>
1251      *
1252      *  @param[in] flags  Flags defined in the <tt>@ref DownloadPostDataListParam</tt> class.<br/>
1253      *
1254      *                       The following flags can be used. <br/>
1255      *                       @ref DownloadPostDataListParam::FLAG_FILTER_BY_FRIEND <br/>
1256      *                       @ref DownloadPostDataListParam::FLAG_FILTER_BY_FOLLOW <br/>
1257      *                       @ref DownloadPostDataListParam::FLAG_FILTER_BY_SELF <br/>
1258      *                       @ref DownloadPostDataListParam::FLAG_FILTER_BY_BODY_TEXT <br/>
1259      *                       @ref DownloadPostDataListParam::FLAG_FILTER_BY_BODY_MEMO <br/>
1260      *                       @ref DownloadPostDataListParam::FLAG_DISTINCT_PID <br/>
1261      *                       @ref DownloadPostDataListParam::FLAG_WITH_MII_DATA <br/>
1262      *                       @ref DownloadPostDataListParam::FLAG_WITH_EMPATHY_ADDED <br/>
1263      *                       @ref DownloadPostDataListParam::FLAG_WITH_SPOILER <br/>
1264      *
1265      *  @retval ResultSuccess  Indicates success.
1266      *  @retval ResultInvalidParameter  Indicates that a principal ID other than <tt>0</tt> was specified in <tt>@ref SetSearchPid</tt>.
1267      */
1268     nn::Result SetFlags(const u32 flags);
1269 
1270     /**
1271      *  Sets the language ID. <br/>
1272      *  This setting is not required. <br/>
1273      *  To get the language ID, reference the enumerand <tt>CfgLanguageCode</tt> that represents the language code. <br/>
1274      *  If not specified, the language indicated in System Settings is used. <br/>
1275      *  A language ID is not usually specified. <br/>
1276      *  You can download data for all languages by specifying <tt>@ref nn::olv::LANGUAGE_ID_ALL</tt>.
1277      *
1278      *  @param[in] languageId  Specifies the language ID.
1279      *
1280      *  @retval ResultSuccess  Indicates success.
1281      */
1282     nn::Result SetLanguageId(const u8 languageId);
1283 
1284     /**
1285      *  Sets the ID of the community to download posts from. <br/>
1286      *  This setting is not required. <br/>
1287      *  Posts are downloaded from the official community if this is left unspecified (=0). <br/>
1288      *  This setting is disabled if a post ID has been specified with the <tt>@ref SetPostId</tt> function. <br/>
1289      *
1290      *  @param[in] communityId  Specifies the community ID.
1291      *
1292      *  @retval ResultSuccess  Indicates success.
1293      */
1294     nn::Result SetCommunityId(const u32 communityId);
1295 
1296     /**
1297      *  Sets the search keys to use for downloading posts. <br/>
1298      *  This setting is not required. <br/>
1299      *  When set, only posts for which this search key has been set are downloaded. <br/>
1300      *  The search keys must contain only ASCII characters. (Set the encoding to <tt>UTF-16 BE</tt>.)
1301      *
1302      *  @param[in] searchKey  Specifies the search key string. (To clear the internal buffer, specify <tt>NULL</tt>.)<br/>
1303      *                           The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>.
1304      *
1305      *  @retval ResultSuccess  Indicates success.
1306      *  @retval ResultInvalidSize  Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters.
1307      */
1308     nn::Result SetSearchKey(const wchar_t* searchKey);
1309 
1310     /**
1311      *  Sets the principal ID of the user to search for. <br/>
1312      *  This setting is not required. <br/>
1313      *  You cannot use the <tt>@ref FLAG_FILTER_BY_FRIEND</tt>, <tt>@ref FLAG_FILTER_BY_FOLLOW</tt>, and <tt>@ref FLAG_FILTER_BY_SELF</tt> flags at the same time. <br/>
1314      *  This function fails if the flags are already set. <br/>
1315      *  This setting is disabled if a post ID has been specified with the <tt>@ref SetPostId</tt> function.
1316      *
1317      *  @param[in] searchPid  Principal ID of the user being searched for. (0 clears the search.)
1318      *
1319      *  @retval ResultSuccess  Indicates success.
1320      *  @retval ResultInvalidParameter  Indicates that a parameter configuration error occurred. (Mutually exclusive flags were specified.)
1321      */
1322     nn::Result SetSearchPid(const u32 searchPid);
1323 
1324     /**
1325      *  Sets the ID of the post to get. <br/>
1326      *  This setting is not required. <br/>
1327      *  You can specify up to <tt>@ref nn::olv::POST_ID_MAX_NUM</tt> post IDs. <br/>
1328      *  The only flags that can be used along with a post ID specification are <tt>@ref FLAG_WITH_MII_DATA</tt> and <tt>@ref FLAG_WITH_EMPATHY_ADDED</tt>. <br/>
1329      *  You cannot perform any other filtering based on other flags, search keys, or principal IDs. <br/>
1330      *  If you use this function to set a post ID, you do not need to call <tt>@ref SetPostDataMaxNum</tt> because the maximum number of posts to retrieve is set internally.
1331      *
1332      *  @param[in] postId  Specifies the ID of the post to get. (Specify <tt>NULL</tt> to clear the post ID.)<br/>
1333      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH</tt>.
1334      *  @param[in] index  Index number of the post ID to set. <br/>
1335      *                        The range of values that can be specified is from <tt>0</tt> to <tt>@ref nn::olv::POST_ID_MAX_NUM - 1</tt>.
1336      *
1337      *  @retval ResultSuccess  Indicates success.
1338      *  @retval ResultInvalidParameter  Indicates that the text string exceeds <tt>@ref nn::olv::POST_ID_MAX_NUM</tt> characters.
1339      *  @retval ResultInvalidSize  Indicates an invalid post ID string length.
1340      */
1341     nn::Result SetPostId(const char* postId, const u32 index);
1342 
1343     /**
1344      *  Sets the date and time of the post data to download. <br/>
1345      *  This setting is not required. <br/>
1346      *  Set to the account's local date and time, because those values will be converted when sent to reflect time zone differences. <br/>
1347      *
1348      *  Data posted on or before the specified date and time is downloaded. <br/>
1349      *
1350      *  @param[in] postDate  Specifies the post date and time. (To clear the setting, specify <tt>0</tt>.)
1351      *
1352      *  @retval ResultSuccess  Indicates success.
1353      */
1354     nn::Result SetPostDate(const OSTime postDate);
1355 
1356     /**
1357      *  Sets the maximum number of posts to get. <br/>
1358      *  This setting is required, except if a post ID has been set by <tt>@ref SetPostId</tt>. <br/>
1359      *  Be sure to set the same value as that of the <span class="argument">downloadPostDataMaxNum</span> parameter passed to the <tt>@ref nn::olv::DownloadPostDataList</tt> function. <br/>
1360      *  (The larger this value, the more temporary memory the Olive library (OLV) allocates when you call this function.)
1361      *
1362      *  @param[in]  postDataMaxNum  Specifies the maximum number of posts to download.
1363      *
1364      *  @retval ResultSuccess  Indicates success.
1365      *  @retval ResultInvalidParameter  Indicates that a value of <tt>0</tt> was specified.
1366      */
1367     nn::Result SetPostDataMaxNum(const u32 postDataMaxNum);
1368 
1369     /**
1370      *  Sets the maximum number of characters of text data to download. <br/>
1371      *  This setting is not required. <br/>
1372      *  If no value is set using this function, up to 100 characters are downloaded by default.
1373      *
1374      *  @param[in] bodyTextMaxLength ... The maximum length of the string being set for text data. <br/>
1375      *                                   You can specify a value in the range of <tt>1</tt> to <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
1376      *
1377      *  @retval ResultSuccess  Indicates success.
1378      *  @retval ResultInvalidParameter  Indicates that the value is <tt>0</tt> or larger than <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
1379      */
1380     nn::Result SetBodyTextMaxLength(const u32 bodyTextMaxLength);
1381 
1382 protected:
1383     /// @cond
1384     /**
1385      *  Sets the search keys to use for downloading posts. <br/>
1386      *  This setting is not required. <br/>
1387      *  The search keys must contain only ASCII characters. (Encode as <tt>UTF-16 BE</tt>.)
1388      *  You can specify up to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM</tt> search keys.
1389      *
1390      *  @param[in] searchKey  Specifies the search key string. (To clear the internal buffer, specify <tt>NULL</tt>.)<br/>
1391      *                           The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>.
1392      *  @param[in] index  Specifies the search key index. <br/>
1393      *                            You can specify a value in the range of <tt>0</tt> to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM - 1</tt>.
1394      *
1395      *  @retval ResultSuccess  Indicates success.
1396      *  @retval ResultInvalidSize  Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters.
1397      */
1398     nn::Result SetSearchKey(const wchar_t* searchKey, const u8 index);
1399 
1400     /**
1401      *  Sets the title ID of the post to get.
1402      *  This setting is not required. <br/>
1403      *
1404      @param[in] titleId  Specifies the title ID.
1405      *
1406      *  @retval ResultSuccess  Indicates success.
1407      */
1408     nn::Result SetTitleId(const u64 titleId);
1409 
1410     /**
1411      *  Gets the URL to download raw data from. <br/>
1412      *  This setting is not required. <br/>
1413      *  Use this URL in an instance of <tt>@ref nn::olv::DownloadRawData</tt>.
1414      *
1415      *  @param[out] url  Specifies the buffer for storing the download URL.
1416      *  @param[in] urlBuffLength  Specifies the size of the buffer for storing the download URL. (We recommend a size of <tt>@ref nn::olv::URL_BUFF_LENGTH</tt> or greater.)
1417      *
1418      *  @retval ResultSuccess  Indicates success.
1419      *  @retval ResultInvalidParameter  Indicates that a parameter configuration error occurred. (Mutually exclusive flags were specified.)
1420      *  @retval  ResultInvalidSize  Indicates that the URL created is longer than the specified buffer.
1421      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
1422      *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
1423      */
1424     nn::Result GetRawDataUrl(char* url, const u32 urlBuffLength) const;
1425     /// @endcond
1426 
1427 protected:
1428     /// @cond
1429     u32 flags;                              /*!< Sets flags. */
1430     u32 communityId;                        /*!< Community ID. */
1431     u32 searchPid[SEARCH_PID_BUFF_NUM];     /*!< Principal ID of the user to search for. */
1432     u8  languageId;                         /*!< Language ID. */
1433     s8  isSetLanguageId;                    /*!< Language ID settings flag. */
1434     u8  padding_0[2];
1435     u32 postDataMaxNum;                     /*!< Maximum number of posts to download. */
1436     u16 searchKeys
1437         [SEARCH_KEY_MAX_NUM]
1438         [SEARCH_KEY_BUFF_LENGTH];           /*!< Search keys. */
1439     s8  postIds
1440         [POST_ID_MAX_NUM]
1441         [POST_ID_BUFF_LENGTH];              /*!< Post ID. */
1442     OSTime postDate;                        /*!< Date and time of the post. */
1443     u64 titleId;                            /*!< Specifies the title ID. */
1444     u32 bodyTextMaxLength;                  /*!< Number of characters to get. */
1445     u8 reserved[1850];
1446 
1447     friend class internal::Main;
1448     /// @endcond
1449 };
1450 
1451 /**
1452  *  Parameters used when receiving direct messages.
1453  *
1454  *  All member functions are thread-safe and can also be called in offline mode. <br/>
1455  *
1456  */
1457 class DownloadDirectMessageDataListParam
1458 {
1459 public:
1460     /** Flags to specify with <tt>DownloadDirectMessageDataListParam::SetFlags</tt>. */
1461     enum
1462     {
1463         FLAG_NONE = 0,                      //!< The default flag value.
1464         FLAG_FILTER_BY_FRIEND = (1<<0),     //!< Downloads direct messages from friends (only received messages).
1465         // Specifies whether the body type is <span class="argument">bodyText</span> or <span class="argument">bodyMemo</span>.
1466         FLAG_FILTER_BY_BODY_TEXT = (1<<1),  //!< Downloads only direct messages that include text data. <br/>
1467                                             //!< You cannot specify this flag at the same time as <tt>@ref FLAG_FILTER_BY_BODY_MEMO</tt>. <br/>
1468         FLAG_FILTER_BY_BODY_MEMO = (1<<2),  //!< Downloads only direct messages that include handwritten memos. <br/>
1469                                             //!< You cannot specify this flag at the same time as <tt>@ref FLAG_FILTER_BY_BODY_TEXT</tt>. <br/>
1470         // Specifies whether a combination of flags is to be used.
1471         FLAG_WITH_MII_DATA = (1<<3),        //!< Downloads direct messages, including Mii character data.
1472     };
1473 
1474 public:
1475     /** Instantiates the object. */
1476     DownloadDirectMessageDataListParam();
1477 
1478     /**
1479      *  Sets flags. <br/>
1480      *  This setting is not required.
1481      *
1482      *  @param[in] flags  Flags defined in the <tt>@ref DownloadDirectMessageDataListParam</tt> class.<br/>
1483      *
1484      *                       The following flags can be used. <br/>
1485      *                       @ref DownloadDirectMessageDataListParam::FLAG_FILTER_BY_FRIEND <br/>
1486      *                       @ref DownloadDirectMessageDataListParam::FLAG_FILTER_BY_BODY_TEXT <br/>
1487      *                       @ref DownloadDirectMessageDataListParam::FLAG_FILTER_BY_BODY_MEMO <br/>
1488      *                       @ref DownloadDirectMessageDataListParam::FLAG_WITH_MII_DATA <br/>
1489      *
1490      *  @retval ResultSuccess  Indicates success.
1491      */
1492     nn::Result SetFlags(const u32 flags);
1493 
1494     /**
1495      *  Sets the search keys to use for downloading direct messages. <br/>
1496      *  This setting is not required. <br/>
1497      *  When set, only direct messages for which this search key has been set are downloaded. <br/>
1498      *  The search keys must contain only ASCII characters. (Set the encoding to <tt>UTF-16 BE</tt>.)
1499      *
1500      *  @param[in] searchKey  Specifies the search key string. (To clear the internal buffer, specify <tt>NULL</tt>.)<br/>
1501      *                           The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>.
1502      *
1503      *  @retval ResultSuccess  Indicates success.
1504      *  @retval ResultInvalidSize  Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters.
1505      */
1506     nn::Result SetSearchKey(const wchar_t* searchKey);
1507 
1508     /**
1509      *  Sets the principal ID of the user to search for. <br/>
1510      *  This setting is not required. <br/>
1511      *  Set this if you want to download direct messages from only a particular user. <br/>
1512      *
1513      *  @param[in] searchPid  The principal ID of the user to search for.
1514      *
1515      *  @retval ResultSuccess  Indicates success.
1516      */
1517     nn::Result SetSearchPid(const u32 searchPid);
1518 
1519     /**
1520      *  Sets the ID of the direct message you want to download. <br/>
1521      *  This setting is not required. <br/>
1522      *  If specifying a direct message ID to get data, the only flag that can be used is <tt>FLAG_WITH_MII_DATA</tt>. <br/>
1523      *
1524      *  (When you call this function, the maxiumum number to download is set to <tt>1</tt> if no value has been explicitly set.)
1525      *
1526      *  @param[in] directMessageId  The string to set for the direct message ID. (Specify <tt>NULL</tt> to clear the internal buffer.)<br/>
1527      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt>.
1528      *
1529      *  @retval ResultSuccess  Indicates success.
1530      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
1531      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt> characters.
1532      */
1533     nn::Result SetDirectMessageId(const char* directMessageId);
1534 
1535     /**
1536      *  Sets the date and time of direct message data to download. <br/>
1537      *  This setting is not required. <br/>
1538      *  Set to the account's local date and time, because those values will be converted when sent to reflect time zone differences. <br/>
1539      *
1540      *  Data posted on or before the specified date and time is downloaded. <br/>
1541      *
1542      *  @param[in] postDate  Specifies the post date and time. (To clear the setting, specify <tt>0</tt>.)
1543      *
1544      *  @retval ResultSuccess  Indicates success.
1545      */
1546     nn::Result SetPostDate(const OSTime postDate);
1547 
1548     /**
1549      *  Sets the maximum number of direct messages to download. <br/>
1550      *  This setting is required. <br/>
1551      *  Be sure to set the same value as that of the <span class="argument">directMessageDataListMaxSize</span> parameter passed to the <tt>@ref nn::olv::DownloadDirectMessageDataList</tt> function. <br/>
1552      *  The larger this value, the more temporary memory the OLV library allocates when the API is used.
1553      *
1554      *  @param[in] directMessageDataMaxNum  The maximum number to download.
1555      *
1556      *  @retval ResultSuccess  Indicates success.
1557      *  @retval ResultInvalidParameter  Indicates that a value of <tt>0</tt> was specified.
1558      */
1559     nn::Result SetDirectMessageDataMaxNum(const u32 directMessageDataMaxNum);
1560 
1561     /**
1562      *  Sets the maximum number of characters of text data to download. <br/>
1563      *  This setting is not required. <br/>
1564      *  If no value is set using this function, up to 100 characters are downloaded by default.
1565      *
1566      *  @param[in] bodyTextMaxLength ... The maximum length of the string being set for text data. <br/>
1567      *                                   You can specify a value in the range of <tt>1</tt> to <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
1568      *
1569      *  @retval ResultSuccess  Indicates success.
1570      *  @retval ResultInvalidParameter  Indicates that the value is <tt>0</tt> or larger than <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
1571      */
1572     nn::Result SetBodyTextMaxLength(const u32 bodyTextMaxLength);
1573 
1574 protected:
1575     /// @cond
1576     /**
1577      *  Sets the search keys to use for downloading direct messages. <br/>
1578      *  This setting is not required. <br/>
1579      *  The search keys must contain only ASCII characters. (Encode as <tt>UTF-16 BE</tt>.)
1580      *  You can specify up to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM</tt> search keys.
1581      *
1582      *  @param[in] searchKey  Specifies the search key string. (To clear the internal buffer, specify <tt>NULL</tt>.)<br/>
1583      *                           The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>.
1584      *  @param[in] index  Specifies the search key index. <br/>
1585      *                            You can specify a value in the range of <tt>0</tt> to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM - 1</tt>.
1586      *
1587      *  @retval ResultSuccess  Indicates success.
1588      *  @retval ResultInvalidSize  Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters.
1589      */
1590     nn::Result SetSearchKey(const wchar_t* searchKey, const u8 index);
1591 
1592     /**
1593      *  Gets the URL to download raw data from. <br/>
1594      *  This setting is not required. <br/>
1595      *  Use this URL in an instance of <tt>@ref nn::olv::DownloadRawData</tt>.
1596      *
1597      *  @param[out] url  Specifies the buffer for storing the download URL.
1598      *  @param[in] urlBuffLength  Specifies the size of the buffer for storing the download URL. (We recommend a size of <tt>@ref nn::olv::URL_BUFF_LENGTH</tt> or greater.)
1599      *
1600      *  @retval ResultSuccess  Indicates success.
1601      *  @retval ResultInvalidParameter  Indicates that a parameter configuration error occurred. (Mutually exclusive flags were specified.)
1602      *  @retval ResultMemoryAllocateError  Indicates that the attempt to allocate temporary memory failed.
1603      *  @retval  ResultInvalidSize  Indicates that the URL created is longer than the specified buffer.
1604      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
1605      *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
1606      */
1607     nn::Result GetRawDataUrl(char* url, const u32 urlBuffLength) const;
1608     /// @endcond
1609 
1610 private:
1611     /// @cond
1612     u32 flags;                              /*!< Sets flags. */
1613     u16 searchKeys
1614         [SEARCH_KEY_MAX_NUM]
1615         [SEARCH_KEY_BUFF_LENGTH];           /*!< Search keys. */
1616     u32 directMessageDataMaxNum;            /*!< Maximum number of downloads. */
1617     u32 searchPid;                          /*!< Principal ID of the user to search for. */
1618     s8  directMessageId
1619         [DIRECT_MESSAGE_ID_BUFF_LENGTH];    /*!< Direct message ID. */
1620     OSTime postDate;                        /*!< Date and time of the post. */
1621     u32 bodyTextMaxLength;                  /*!< Number of characters to get. */
1622     u8 reserved[2512];
1623 
1624     friend class internal::Main;
1625     /// @endcond
1626 };
1627 
1628 /**
1629  *  Parameters used when receiving comments.
1630  *
1631  *  All member functions are thread-safe and can also be called in offline mode. <br/>
1632  *
1633  */
1634 class DownloadCommentDataListParam
1635 {
1636 public:
1637     /** Flags to specify with <tt>DownloadCommentDataListParam::SetFlags</tt>. */
1638     enum
1639     {
1640         FLAG_NONE = 0,                      //!< The default flag value.
1641         FLAG_FILTER_BY_FRIEND = (1<<0),     //!< This flag cannot be used. It will be deprecated in the next version.
1642         FLAG_FILTER_BY_FOLLOW = (1<<1),     //!< This flag cannot be used. It will be deprecated in the next version.
1643         FLAG_FILTER_BY_SELF = (1<<2),       //!< This flag cannot be used. It will be deprecated in the next version.
1644         // Specifies whether the body type is <span class="argument">bodyText</span> or <span class="argument">bodyMemo</span>.
1645         FLAG_FILTER_BY_BODY_TEXT = (1<<3),  //!< Gets only comments that include text data.
1646                                             //!< You cannot specify this flag at the same time as <tt>@ref FLAG_FILTER_BY_BODY_MEMO</tt>. <br/>
1647         FLAG_FILTER_BY_BODY_MEMO = (1<<4),  //!< Gets only comments that include handwritten memos.
1648                                             //!< You cannot specify this flag at the same time as <tt>@ref FLAG_FILTER_BY_BODY_TEXT</tt>. <br/>
1649         // Specifies whether a combination of flags is to be used.
1650         FLAG_DISTINCT_PID = (1<<5),         //!< Gets only one comment from each poster.
1651         FLAG_WITH_MII_DATA = (1<<6),        //!< Gets comments, including Mii character data.
1652         //FLAG_WITH_EMPATHY_ADDED = (1<<7), //!< (Reserved: Currently not used.) Get comments, including the flags indicating that the local user has given a Yeah.
1653         FLAG_WITH_SPOILER = (1<<8)          //!< Gets comments that include a spoiler.
1654     };
1655 
1656 public:
1657     /** Instantiates the object. */
1658     DownloadCommentDataListParam();
1659 
1660     /**
1661      *  Sets flags. <br/>
1662      *  This setting is not required.
1663      *
1664      *  @param[in] flags  Flags defined in the <tt>@ref DownloadCommentDataListParam</tt> class.<br/>
1665      *
1666      *                       The following flags can be used. <br/>
1667      *                       @ref DownloadCommentDataListParam::FLAG_FILTER_BY_BODY_TEXT <br/>
1668      *                       @ref DownloadCommentDataListParam::FLAG_FILTER_BY_BODY_MEMO <br/>
1669      *                       @ref DownloadCommentDataListParam::FLAG_DISTINCT_PID <br/>
1670      *                       @ref DownloadCommentDataListParam::FLAG_WITH_MII_DATA <br/>
1671      *                       @ref DownloadCommentDataListParam::FLAG_WITH_SPOILER <br/>
1672      *
1673      *  @retval ResultSuccess  Indicates success.
1674      */
1675     nn::Result SetFlags(const u32 flags);
1676 
1677     /**
1678      * Sets the ID of the post to get comments about. <br/>
1679      * This setting is required. <br/>
1680      *
1681      *  @param[in] postId  Specifies a text string representing the post ID. <br/>
1682      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH</tt>.
1683      *
1684      *  @retval ResultSuccess  Indicates success.
1685      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
1686      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
1687      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::POST_ID_MAX_LENGTH</tt> characters.
1688      */
1689     nn::Result SetPostId(const char* postId);
1690 
1691     /**
1692      *  Sets the ID of the comment to get. <br/>
1693      *  This setting is not required. <br/>
1694      *
1695      *  @param[in] commentId  Specifies the comment ID to set as a text string.
1696      *
1697      *  @retval ResultSuccess  Indicates success.
1698      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
1699      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
1700      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::COMMENT_ID_MAX_LENGTH</tt> characters.
1701      */
1702     nn::Result SetCommentId(const char* commentId);
1703 
1704     /**
1705      *  Sets the posting date and time of the comment to get. <br/>
1706      *  This setting is not required. <br/>
1707      *  Set to the account's local date and time, because those values will be converted when sent to reflect time zone differences. <br/>
1708      *
1709      *  Data posted on or before the specified date and time is downloaded. <br/>
1710      *
1711      *  @param[in] postDate  Specifies the post date and time. (To clear the setting, specify <tt>0</tt>.)
1712      *
1713      *  @retval ResultSuccess  Indicates success.
1714      */
1715     nn::Result SetPostDate(const OSTime postDate);
1716 
1717     /**
1718      *  Sets the maximum number of comments to get. <br/>
1719      *  This setting is required. <br/>
1720      *  Be sure to set the same value as that of the <span class="argument">commentDataListMaxSize</span> parameter passed to the <tt>@ref nn::olv::DownloadCommentDataList</tt> function. <br/>
1721      *  The larger this value, the more temporary memory the OLV library allocates when the API is used.
1722      *
1723      *  @param[in]  commentDataMaxNum  The maximum number to get.
1724      *
1725      *  @retval ResultSuccess  Indicates success.
1726      *  @retval ResultInvalidParameter  Indicates that a value of <tt>0</tt> was specified.
1727      */
1728     nn::Result SetCommentDataMaxNum(const u32 commentDataMaxNum);
1729 
1730     /**
1731      *  Sets the language ID. <br/>
1732      *  This setting is not required. <br/>
1733      *  To get the language ID, reference the enumerand <tt>CfgLanguageCode</tt> that represents the language code. <br/>
1734      *  If not specified, the language indicated in System Settings is used. <br/>
1735      *  A language ID is not usually specified. <br/>
1736      *  You can download data for all languages by specifying <tt>@ref nn::olv::LANGUAGE_ID_ALL</tt>.
1737      *
1738      *  @param[in] languageId  Specifies the language ID.
1739      *
1740      *  @retval ResultSuccess  Indicates success.
1741      */
1742     nn::Result SetLanguageId(const u8 languageId);
1743 
1744     /**
1745      *  Sets the maximum number of characters of text data to download. <br/>
1746      *  This setting is not required. <br/>
1747      *  If no value is set using this function, up to 100 characters are downloaded by default.
1748      *
1749      *  @param[in] bodyTextMaxLength ... The maximum length of the string being set for text data. <br/>
1750      *                                   You can specify a value in the range of <tt>1</tt> to <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
1751      *
1752      *  @retval ResultSuccess  Indicates success.
1753      *  @retval ResultInvalidParameter  Indicates that the value is <tt>0</tt> or larger than <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
1754      */
1755     nn::Result SetBodyTextMaxLength(const u32 bodyTextMaxLength);
1756 
1757 protected:
1758     /// @cond
1759     /**
1760      *  Gets the URL to download raw data from. <br/>
1761      *  This setting is not required. <br/>
1762      *
1763      *  @param[out] url  Specifies the buffer for storing the download URL.
1764      *  @param[in] urlBuffLength  Specifies the size of the buffer for storing the download URL. (We recommend a size of <tt>@ref nn::olv::URL_BUFF_LENGTH</tt> or greater.)
1765      *
1766      *  @retval ResultSuccess  Indicates success.
1767      *  @retval ResultInvalidParameter  Indicates that a parameter configuration error occurred. (Mutually exclusive flags were specified.)
1768      *  @retval ResultMemoryAllocateError  Indicates that the attempt to allocate temporary memory failed.
1769      *  @retval  ResultInvalidSize  Indicates that the URL created is longer than the specified buffer.
1770      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
1771      *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
1772      */
1773     nn::Result GetRawDataUrl(char* url, const u32 urlBuffLength) const;
1774     /// @endcond
1775 
1776 private:
1777     /// @cond
1778     u32 flags;                             /*!< Sets flags. */
1779     u32 commentDataMaxNum;                 /*!< Maximum number of downloads. */
1780     s8  postId[POST_ID_BUFF_LENGTH];       /*!< ID of the new post to get comments about. */
1781     s8  commentId[COMMENT_ID_BUFF_LENGTH]; /*!< ID of the comment being retrieved. */
1782     OSTime postDate;                       /*!< Date and time of the post. */
1783     u8  languageId;                        /*!< Language ID. */
1784     s8  isSetLanguageId;                   /*!< Language ID settings flag. */
1785     u8  padding[2];
1786     u32 bodyTextMaxLength;                 /*!< Number of characters to get. */
1787     u8  reserved[4008];
1788 
1789     friend class internal::Main;
1790     /// @endcond
1791 };
1792 
1793 /**
1794  * Parameters used when receiving community data.
1795  *
1796  *  All member functions are thread-safe and can also be called in offline mode. <br/>
1797  *
1798  */
1799 class DownloadCommunityDataListParam
1800 {
1801 public:
1802     /**
1803         * Flags to specify with <tt>DownloadCommunityDataListParam::SetFlags</tt>.
1804 
1805         - If not using the <tt>@ref SetCommunityId</tt> function, be sure to specify one of the following: <tt>@ref FLAG_FILTER_BY_FAVORITE</tt>, <tt>@ref FLAG_FILTER_BY_OFFICIAL</tt>, or <tt>@ref FLAG_FILTER_BY_SELF</tt>. <br/>
1806     */
1807     enum
1808     {
1809         FLAG_NONE = 0,                      //!< The default flag value.
1810         FLAG_FILTER_BY_FAVORITE = (1<<0),   //!< Gets the community data that has been favorited. <br/>
1811                                             //!< Communities created by the user are automatically treated as favorites, so you can use this flag to get them. <br/>
1812                                             //!< You cannot specify <tt>@ref FLAG_FILTER_BY_OFFICIAL</tt> and <tt>@ref FLAG_FILTER_BY_SELF</tt> at the same time. <br/>
1813                                             //!< This flag is disabled if a community ID has been specified with the <tt>@ref SetCommunityId</tt> function. <br/>
1814         FLAG_FILTER_BY_OFFICIAL = (1<<1),   //!< Gets the official community. <br/>
1815                                             //!< You cannot specify <tt>@ref FLAG_FILTER_BY_FAVORITE</tt> and <tt>@ref FLAG_FILTER_BY_SELF</tt> at the same time. <br/>
1816                                             //!< This flag is disabled if a community ID has been specified with the <tt>@ref SetCommunityId</tt> function. <br/>
1817         FLAG_FILTER_BY_SELF = (1<<2),       //!< Gets communities created by the local user. <br/>
1818                                             //!< You cannot specify <tt>@ref FLAG_FILTER_BY_FAVORITE</tt> and <tt>@ref FLAG_FILTER_BY_OFFICIAL</tt> at the same time. <br/>
1819                                             //!< This flag is disabled if a community ID has been specified with the <tt>@ref SetCommunityId</tt> function. <br/>
1820         FLAG_WITH_MII_DATA = (1<<3),        //!< Gets the community, including the Mii character of the community creator.
1821         FLAG_WITH_ICON_DATA = (1<<4)        //!< Downloads icon data included with the community.
1822     };
1823 
1824 public:
1825     /** Instantiates the object. */
1826     DownloadCommunityDataListParam();
1827 
1828     /**
1829      *  Sets flags. <br/>
1830      *  This setting is not required.
1831      *
1832      *  @param[in] flags  Flags defined in the <tt>@ref DownloadCommunityDataListParam</tt> class.<br/>
1833      *
1834      *                       The following flags can be used. <br/>
1835      *                       @ref DownloadCommunityDataListParam::FLAG_FILTER_BY_FAVORITE <br/>
1836      *                       @ref DownloadCommunityDataListParam::FLAG_FILTER_BY_OFFICIAL <br/>
1837      *                       @ref DownloadCommunityDataListParam::FLAG_FILTER_BY_SELF <br/>
1838      *                       @ref DownloadCommunityDataListParam::FLAG_WITH_MII_DATA <br/>
1839      *                       @ref DownloadCommunityDataListParam::FLAG_WITH_ICON_DATA <br/>
1840      *
1841      *  @retval ResultSuccess  Indicates success.
1842      */
1843     nn::Result SetFlags(const u32 flags);
1844 
1845     /**
1846      *  Specifies the ID of the community to get. <br/>
1847      *  This setting is not required. <br/>
1848      *  When getting data by specifying a community ID, the only flags that can be used are <tt>@ref FLAG_WITH_MII_DATA</tt> and <tt>@ref FLAG_WITH_ICON_DATA</tt>. <br/>
1849      *
1850      *  (When you call this function, the maxiumum number to download is set to <tt>1</tt> if no value has been explicitly set.)<br/>
1851      *  To specify more than one community ID, use the function with the same name but with an added parameter for indices. <br/>
1852      *  (You cannot simultaneously use this function and the same-named function that has the added parameter for indices.)
1853      *
1854      *  @param[in] communityId  Specifies the community ID.
1855      *
1856      *  @retval ResultSuccess  Indicates success.
1857      *  @retval ResultInvalidParameter  Indicates that the community ID is not available.
1858      */
1859     nn::Result SetCommunityId(const u32 communityId);
1860 
1861     /**
1862      *  Specifies the ID of the community to get. <br/>
1863      *  This setting is not required. <br/>
1864      *  When getting data by specifying a community ID, the only flags that can be used are <tt>@ref FLAG_WITH_MII_DATA</tt> and <tt>@ref FLAG_WITH_ICON_DATA</tt>. <br/>
1865      *
1866      *  (If a maximum number has not been explicitly set, the maximum number is automatically set to the number of configured community IDs when this function is called.)<br/>
1867      *  You cannot simultaneously use this function and the function with the same name but no setting for indices.
1868      *
1869      *  @param[in] communityId  Specifies the community ID.
1870      *  @param[in] index  Specifies the community ID index.
1871      *
1872      *  @retval ResultSuccess  Indicates success.
1873      *  @retval ResultInvalidParameter  Indicates that the <tt>index</tt> parameter is set to an unusable community ID or to a value that is equal to or greater than <tt>@ref nn::olv::COMMUNITY_ID_MAX_NUM</tt>.
1874      */
1875     nn::Result SetCommunityId(const u32 communityId, const u8 index);
1876 
1877     /**
1878      *  Specifies the maximum number of communities to get. <br/>
1879      *  This setting is not required. <br/>
1880      *  Be sure to set the same value as that of the <span class="argument">communityDataListMaxSize</span> parameter passed to the <tt>@ref nn::olv::DownloadCommunityDataList</tt> function. <br/>
1881      *  The larger this value, the more temporary memory the OLV library allocates when the API is used.
1882      *
1883      *  @param[in]  communityDataMaxNum  The maximum number to get.
1884      *
1885      *  @retval ResultSuccess  Indicates success.
1886      *  @retval ResultInvalidParameter  Indicates that <tt>0</tt> was specified or that a value equal to or less than the number of community IDs currently configured was specified.
1887      */
1888     nn::Result SetCommunityDataMaxNum(const u32 communityDataMaxNum);
1889 
1890 protected:
1891     /// @cond
1892     /**
1893      *  Gets the URL to download raw data from. <br/>
1894      *  This setting is not required. <br/>
1895      *  Use this URL in an instance of <tt>@ref nn::olv::DownloadRawData</tt>.
1896      *
1897      *  @param[out] url  Specifies the buffer for storing the download URL.
1898      *  @param[in] urlBuffLength  Specifies the size of the buffer for storing the download URL. (We recommend a size of <tt>@ref nn::olv::URL_BUFF_LENGTH</tt> or greater.)
1899      *
1900      *  @retval ResultSuccess  Indicates success.
1901      *  @retval ResultInvalidParameter  Indicates that a parameter configuration error occurred. (Mutually exclusive flags were specified.)
1902      *  @retval  ResultInvalidSize  Indicates that the URL created is longer than the specified buffer.
1903      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
1904      *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
1905      */
1906     nn::Result GetRawDataUrl(char* url, const u32 urlBuffLength) const;
1907     /// @endcond
1908 
1909 private:
1910     /// @cond
1911     u32 flags;                              /*!< Sets flags. */
1912     u32 communityId;                        /*!< Community ID. */
1913     u32 communityDataMaxNum;                /*!< Maximum number of downloads. */
1914     u32 communityIds[COMMUNITY_ID_BUFF_NUM]; /*!< The community ID when more than one is configured. */
1915     u8 reserved[3964];
1916 
1917     friend class internal::Main;
1918     /// @endcond
1919 };
1920 
1921 /**
1922  * Parameters used when receiving user data.
1923  *
1924  *  All member functions can be called even in offline mode. <br/>
1925  *  All member functions are thread-safe.
1926  */
1927 class DownloadUserDataListParam
1928 {
1929 public:
1930     /**
1931         Flags specified using <tt>DownloadUserDataListParam::SetFlags</tt>.
1932 
1933         - Be sure to set one of the following flags: <tt>@ref FLAG_FRIEND_TO_USER</tt>, <tt>@ref FLAG_FOLLOW_TO_USER</tt>, <tt>@ref FLAG_EMPATHY_TO_POST</tt>, or <tt>@ref FLAG_FAVORITE_TO_COMMUNITY</tt>. <br/>
1934     */
1935     enum
1936     {
1937         FLAG_NONE = 0,                        //!< The default flag value.
1938         FLAG_FRIEND_TO_USER = (1<<0),         //!< Gets friends of the specified user. Specify the user using <tt>@ref SetUserPid</tt>. <br/>
1939                                               //!< You cannot specify <tt>@ref FLAG_FOLLOW_TO_USER</tt>, <tt>@ref FLAG_EMPATHY_TO_POST</tt>, and <tt>@ref FLAG_FAVORITE_TO_COMMUNITY</tt> at the same time.
1940         FLAG_FOLLOW_TO_USER = (1<<1),         //!< Gets followers of the specified user. Specify the user using <tt>@ref SetUserPid</tt>. <br/>
1941                                               //!< You cannot specify <tt>@ref FLAG_FRIEND_TO_USER</tt>, <tt>@ref FLAG_EMPATHY_TO_POST</tt>, and <tt>@ref FLAG_FAVORITE_TO_COMMUNITY</tt> at the same time.
1942         FLAG_EMPATHY_TO_POST = (1<<2),        //!< Gets users who have given a Yeah to the specified post. Specify the target post using <tt>@ref SetPostId</tt>. <br/>
1943                                               //!< You cannot specify <tt>@ref FLAG_FRIEND_TO_USER</tt>, <tt>@ref FLAG_FOLLOW_TO_USER</tt>, and <tt>@ref FLAG_FAVORITE_TO_COMMUNITY</tt> at the same time.
1944         FLAG_FAVORITE_TO_COMMUNITY = (1<<3),  //!< Gets users who have added the specified community to favorites. Specify the community using <tt>@ref SetCommunityId</tt>. <br/>
1945                                               //!< You cannot specify <tt>@ref FLAG_FRIEND_TO_USER</tt>, <tt>@ref FLAG_FOLLOW_TO_USER</tt>, and <tt>@ref FLAG_EMPATHY_TO_POST</tt> at the same time.
1946         FLAG_WITH_MII_DATA = (1<<4)           //!< Gets user data, including Mii character data.
1947     };
1948 
1949 public:
1950     /** Instantiates the object. */
1951     DownloadUserDataListParam();
1952 
1953     /**
1954      *  Sets flags. <br/>
1955      *  This setting is not required. <br/>
1956      *
1957      *  @param[in] flags  Flags defined in the <tt>@ref DownloadUserDataListParam</tt> class.<br/>
1958      *
1959      *                       The following flags can be used. <br/>
1960      *                       @ref DownloadUserDataListParam::FLAG_FRIEND_TO_USER <br/>
1961      *                       @ref DownloadUserDataListParam::FLAG_FOLLOW_TO_USER <br/>
1962      *                       @ref DownloadUserDataListParam::FLAG_EMPATHY_TO_POST <br/>
1963      *                       @ref DownloadUserDataListParam::FLAG_FAVORITE_TO_COMMUNITY <br/>
1964      *                       @ref DownloadUserDataListParam::FLAG_WITH_MII_DATA <br/>
1965      *
1966      *  @retval ResultSuccess  Indicates success.
1967      *  @retval ResultInvalidParameter  Indicates that mutually exclusive flags were specified.
1968      */
1969     nn::Result SetFlags(const u32 flags);
1970 
1971     /**
1972      *  Sets the principal ID of the user whose friends or followers are to be retrieved. <br/>
1973      *  This setting is not required. <br/>
1974      *
1975      *  To get the friends or followers, use this function to specify the user's principal ID.<br/>
1976      *  To get friends, specify <tt>@ref DownloadUserDataListParam::FLAG_FRIEND_TO_USER</tt> in <tt>@ref SetFlags</tt>.<br/>
1977      *  To get followers, specify <tt>@ref DownloadUserDataListParam::FLAG_FOLLOW_TO_USER</tt> in <tt>@ref SetFlags</tt>.<br/>
1978      *  (Both flags cannot be used together.)
1979      *
1980      *  @param[in] userPid  Principal ID of the user.
1981      *
1982      *  @retval ResultSuccess  Indicates success.
1983      *  @retval ResultInvalidParameter  Indicates that a value of <tt>0</tt> was specified.
1984      */
1985     nn::Result SetUserPid(const u32 userPid);
1986 
1987     /**
1988      *  Sets the ID of a community to get a list of users who have favorited that community. <br/>
1989      *  This setting is not required. <br/>
1990      *
1991      *  To get users who have favorited a particular community, set the target community with this function and specify <tt>@ref DownloadUserDataListParam::FLAG_FAVORITE_TO_COMMUNITY</tt> in <tt>@ref SetFlags</tt>.<br/>
1992      *
1993      *
1994      *
1995      *  @param[in] communityId  Specifies the community ID.
1996      *
1997      *  @retval ResultSuccess  Indicates success.
1998      */
1999     nn::Result SetCommunityId(const u32 communityId);
2000 
2001     /**
2002      *  Sets a post ID for downloading the list of users who gave a yeah to that post. <br/>
2003      *  This setting is not required. <br/>
2004      *
2005      *  To download the list of users who gave a Yeah to a particular post, set the target post with this method and specify <tt>@ref DownloadUserDataListParam::FLAG_EMPATHY_TO_POST</tt> in <tt>@ref SetFlags</tt>. <br/>
2006      *
2007      *
2008      *
2009      *  @param[in] postId  Specifies a text string representing the post ID. <br/>
2010      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH</tt>.
2011      *
2012      *  @retval ResultSuccess  Indicates success.
2013      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2014      *  @retval ResultInvalidParameter  Indicates that an empty string was specified.
2015      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::POST_ID_MAX_LENGTH</tt> characters.
2016      */
2017     nn::Result SetPostId(const char* postId);
2018 
2019     /**
2020      *  Sets the maximum number of instances of user data to download. <br/>
2021      *  This setting is not required. <br/>
2022      *  Be sure to set the same value as that of the <span class="argument">userDataListMaxSize</span> parameter passed to the <tt>@ref nn::olv::DownloadUserDataList</tt> function. <br/>
2023      *  The larger this value, the more temporary memory the OLV library allocates when the API is used.
2024      *
2025      *  @param[in] userDataMaxNum  The maximum number to download.
2026      *
2027      *  @retval ResultSuccess  Indicates success.
2028      *  @retval ResultInvalidParameter  Indicates that a value of <tt>0</tt> was specified.
2029      */
2030     nn::Result SetUserDataMaxNum(const u32 userDataMaxNum);
2031 
2032 protected:
2033     /// @cond
2034     /**
2035      *  Gets the URL to download raw data from. <br/>
2036      *  This setting is not required. <br/>
2037      *
2038      *  @param[out] url  Specifies the buffer for storing the download URL.
2039      *  @param[in] urlBuffLength  Specifies the size of the buffer for storing the download URL. (We recommend a size of <tt>@ref nn::olv::URL_BUFF_LENGTH</tt> or greater.)
2040      *
2041      *  @retval ResultSuccess  Indicates success.
2042      *  @retval ResultInvalidParameter  Indicates that a parameter configuration error occurred. (Mutually exclusive flags were specified.)
2043      *  @retval  ResultInvalidSize  Indicates that the URL created is longer than the specified buffer.
2044      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2045      *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
2046      */
2047     nn::Result GetRawDataUrl(char* url, const u32 urlBuffLength) const;
2048     /// @endcond
2049 
2050 private:
2051     /// @cond
2052     u32 flags;                          /*!< Sets flags. */
2053     u32 userPid;                        /*!< The principal ID. */
2054     u32 communityId;                    /*!< Community ID. */
2055     u32 userDataMaxNum;                 /*!< Maximum number to download. */
2056     s8  postId[POST_ID_BUFF_LENGTH];    /*!< Post ID. */
2057     u8  reserved[4048];                 /*!< Represents a reserved region. */
2058 
2059     friend class internal::Main;
2060     /// @endcond
2061 };
2062 
2063 /**
2064  *  Class for storing downloaded topic data.
2065  *
2066  *  All member functions can be called even in offline mode. <br/>
2067  *  All member functions are thread-safe.
2068  */
2069 class DownloadedTopicData
2070 {
2071 public:
2072     /** Instantiates the object.*/
2073     DownloadedTopicData();
2074 
2075     /**
2076      * Downloads a community ID.
2077      *
2078      *  @return Returns the community ID.
2079      */
2080     u32 GetCommunityId() const;
2081 
2082     /**
2083      *  Gets the number of people participating in the topic. <br/>
2084      *  This function remains temporarily available for compatibility. <br/>
2085      *  It is scheduled for removal in the next release. Do not use it.
2086      *
2087      *  @return Always returns <tt>0</tt>.
2088      */
2089     u32 GetUserCount() const;
2090 
2091 protected:
2092     /// @cond
2093     u32 flags;              /*!< Flag. */
2094     /// @endcond
2095 
2096 private:
2097     /// @cond
2098     u32 communityId;        /*!< Community ID. */
2099     u8 reserved[4088];
2100 
2101     friend class internal::Main;
2102     /// @endcond
2103 };
2104 
2105 /**
2106  *  Base class for storing downloaded post data.
2107  *
2108  *  It is inherited by the class for storing downloaded post data (<tt>@ref DownloadedPostData </tt>), the class for storing downloaded direct message data <tt>@ref DownloadedDirectMessageData</tt>, and the class for storing downloaded comment data <tt>@ref DownloadedCommentData</tt>. <br/>
2109  *
2110  *
2111  *
2112  *  All member functions except for <tt>@ref DownloadExternalImageData</tt> are thread-safe and can be called even in offline mode. <br/>
2113  *
2114  */
2115 class DownloadedDataBase
2116 {
2117 public:
2118     /** Flags to specify with <tt>@ref DownloadedPostData::TestFlags</tt> and <tt>@ref DownloadedDirectMessageData::TestFlags</tt>.*/
2119     enum
2120     {
2121         FLAG_NONE                      = 0,                                             /*!< The default flag value. */
2122         FLAG_WITH_BODY_TEXT            = DOWNLOAD_FLAG_VALUE_WITH_BODY_TEXT,            /*!< The flag for checking whether a post includes body text. */
2123         FLAG_WITH_BODY_MEMO            = DOWNLOAD_FLAG_VALUE_WITH_BODY_MEMO,            /*!< The flag for checking whether a post includes handwritten memo data. */
2124         FLAG_WITH_EXTERNAL_IMAGE_DATA  = DOWNLOAD_FLAG_VALUE_WITH_EXTERNAL_IMAGE_DATA,  /*!< The flag for checking whether a post has image attachments. */
2125         FLAG_WITH_EXTERNAL_BINARY_DATA = DOWNLOAD_FLAG_VALUE_WITH_EXTERNAL_BINARY_DATA, /*!< The flag for checking whether a post includes binary attachments. */
2126         FLAG_WITH_MII_DATA             = DOWNLOAD_FLAG_VALUE_WITH_MII_DATA,             /*!< The flag for checking whether a post includes Mii character data. */
2127         FLAG_WITH_EXTERNAL_URL         = DOWNLOAD_FLAG_VALUE_WITH_EXTERNAL_URL,         /*!< The flag for checking whether a post includes an external URL. */
2128         FLAG_WITH_APP_DATA             = DOWNLOAD_FLAG_VALUE_WITH_APP_DATA,             /*!< The flag for checking whether a post includes application data. */
2129         FLAG_EMPATHY_ADDED             = DOWNLOAD_FLAG_VALUE_EMPATHY_ADDED,             /*!< The flag for checking whether the user has given a Yeah. */
2130         FLAG_RESERVED1                 = DOWNLOAD_FLAG_VALUE_RESERVED1,                 /*!< Reserved flag. Do not use it. */
2131         FLAG_SPOILER                   = DOWNLOAD_FLAG_VALUE_SPOILER,                   /*!< The flag for checking whether the post contains a spoiler. */
2132     };
2133 
2134 public:
2135     /** Instantiates the object. */
2136     DownloadedDataBase();
2137 
2138     /** Destructor. */
2139     virtual ~DownloadedDataBase() = 0;
2140 
2141     /**
2142      *  Checks flags. <br/>
2143      *  This function determines which types of data are included.
2144      *
2145      *  @param[in] flags  Flags defined in the <tt>@ref DownloadedDataBase</tt> class. <br/>
2146       *
2147      *                       The following flags can be used. <br/>
2148      *                       @ref DownloadedDataBase::FLAG_WITH_BODY_TEXT <br/>
2149      *                       @ref DownloadedDataBase::FLAG_WITH_BODY_MEMO <br/>
2150      *                       @ref DownloadedDataBase::FLAG_WITH_EXTERNAL_IMAGE_DATA <br/>
2151      *                       @ref DownloadedDataBase::FLAG_WITH_EXTERNAL_BINARY_DATA <br/>
2152      *                       @ref DownloadedDataBase::FLAG_WITH_MII_DATA <br/>
2153      *                       @ref DownloadedDataBase::FLAG_WITH_EXTERNAL_URL <br/>
2154      *                       @ref DownloadedDataBase::FLAG_WITH_APP_DATA <br/>
2155      *                       @ref DownloadedDataBase::FLAG_EMPATHY_ADDED <br/>
2156      *                       @ref DownloadedDataBase::FLAG_SPOILER <br/>
2157      *
2158      *  @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise.
2159      */
2160     bool TestFlags(const u32 flags) const;
2161 
2162     /**
2163      *  Gets the principal ID of the poster.
2164      *
2165      *  @return Returns the principal ID of the poster.
2166      */
2167     u32 GetUserPid() const;
2168 
2169     /**
2170      * Gets the date and time after accounting for differences between time zones.
2171      *
2172      *  @return Returns the date and time of the post.
2173      */
2174     OSTime GetPostDate() const;
2175 
2176     /**
2177      *  Gets the mood (feeling).
2178      *
2179      *  @return Returns the mood. Returns any of the values specified by <tt>nn::olv::FEELING_~</tt>.
2180      */
2181     s8 GetFeeling() const;
2182 
2183     /**
2184      *  Gets the region ID.
2185      *
2186      *  @return Returns the region ID.
2187      */
2188     u32 GetRegionId() const;
2189 
2190     /**
2191      *  Gets the platform ID.
2192      *
2193      *  @return Returns the platform ID.
2194      */
2195     u8 GetPlatformId() const;
2196 
2197     /**
2198      *  Gets the language ID. <br/>
2199      *  To get the language ID, reference the enumerand <tt>CfgLanguageCode</tt> that represents the language code.
2200      *
2201      *  @return Returns the language ID.
2202      */
2203     u8 GetLanguageId() const;
2204 
2205     /**
2206      *  Gets the country ID.
2207      *
2208      *  @return Returns the country ID.
2209      */
2210     u8 GetCountryId() const;
2211 
2212     /**
2213      *  Gets the external URL. <br/>
2214      *  Can get a valid value if <tt>@ref FLAG_WITH_EXTERNAL_URL</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2215      *
2216      *
2217      *  @return Returns the URL.
2218      */
2219     const char* GetExternalUrl() const;
2220 
2221     /**
2222      *  Gets the Mii character data. <br/>
2223      *  It can get a valid value if <tt>@ref FLAG_WITH_MII_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2224      *
2225      *
2226      *  @param[out] storeData  Specifies a structure for storing the Mii character data.
2227      *
2228      *  @retval ResultSuccess  Indicates success.
2229      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2230      *  @retval ResultNotExistData  Indicates that the data was not found.
2231      */
2232     nn::Result GetMiiData(FFLStoreData* storeData) const;
2233 
2234     /**
2235      *  Gets the Mii character nickname. <br/>
2236      *  It can get a valid value if <tt>@ref FLAG_WITH_MII_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned.<br/>
2237      *
2238      *
2239      *  <b>Note:</b><br/>
2240      *  Mii character nicknames may sometimes include characters that are not supported in the application. <br/>
2241      *  When that happens, you must handle it without adversely affecting the screen display or hindering the application's progress. <br/>
2242      *  For more information, see the Nicknames and Creator Names section in the Wii U Guidelines.
2243      *
2244      *  @return Returns the Mii character nickname.
2245      */
2246     const wchar_t* GetMiiNickname() const;
2247 
2248     /**
2249      *  Gets text data. <br/>
2250      *  It can get a valid value if <tt>@ref FLAG_WITH_BODY_TEXT</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned.<br/>
2251      *
2252      *
2253      *  <b>Note:</b><br/>
2254      *  Text data may sometimes include characters that are not supported in the application. <br/>
2255      *  When there are unsupported characters, you must handle it without adversely affecting the screen display or hindering the application's progress. <br/>
2256      *
2257      *  @param[out] bodyText  Specifies a buffer for storing the text data.
2258      *  @param[in] bodyTextBuffLength  Specifies the size of the buffer for storing the text data (the number of elements in the <tt>wchar_t</tt> array).
2259      *
2260      *  @retval ResultSuccess  Indicates success.
2261      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2262      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2263      *  @retval ResultNotExistData  Indicates that the data was not found.
2264      */
2265     nn::Result GetBodyText(wchar_t* bodyText, const u32 bodyTextBuffLength) const;
2266 
2267     /**
2268      *  Gets handwritten memo data. <br/>
2269      *  Can get a valid value if <tt>@ref FLAG_WITH_BODY_MEMO</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2270      *
2271      *
2272      *  <b>Note:</b><br/>
2273      *  Handwritten memos use the following data format. <br/>
2274      *  TGA 1.0. (No color map. 32-bit color without RLE compression. Stored in BGRA order starting from the lower left. 320&times;120 pixels.) <br/>
2275      *  Fixed-length 18-byte header (00 00 02 00 00 00 00 00 00 00 00 00 40 01 78 00 20 08). <br/>
2276      *
2277      *
2278      *  @param[out] bodyMemo  Specifies a buffer for storing a handwritten memo.
2279      *  @param[out] bodyMemoSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
2280      *  @param[in] bodyMemoMaxSize  Specifies the size of the buffer for storing the handwritten memo.
2281      *
2282      *  @retval ResultSuccess  Indicates success.
2283      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2284      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2285      *  @retval ResultNotExistData  Indicates that the data was not found.
2286      *  @retval ResultDataDecodeError  Indicates that the attempt to decode the data failed.
2287      */
2288     nn::Result GetBodyMemo(u8* bodyMemo, u32* bodyMemoSize, const u32 bodyMemoMaxSize) const;
2289 
2290     /**
2291      *  Gets the topic tag.
2292      *
2293      * @return Returns the topic tag.
2294      */
2295     const wchar_t* GetTopicTag() const;
2296 
2297     /**
2298      *  Gets application data. <br/>
2299      *  Can get a valid value if <tt>@ref FLAG_WITH_APP_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2300      *
2301      *
2302      *  @param[out] appData  Specifies the buffer for storing application data.
2303      *  @param[out] appDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
2304      *  @param[in] appDataMaxSize  Specifies the size of the buffer for storing the application data.
2305      *
2306      *  @retval ResultSuccess  Indicates success.
2307      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2308      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2309      *  @retval ResultNotExistData  Indicates that the data was not found.
2310      */
2311     nn::Result GetAppData(u8* appData, u32* appDataSize, const u32 appDataMaxSize) const;
2312 
2313     /**
2314      *  Gets the size of the application data. <br/>
2315      *  Can get a valid value if <tt>@ref FLAG_WITH_APP_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2316      *
2317      *
2318      *  @return Returns the size of the application data.
2319      */
2320     u32 GetAppDataSize(void) const;
2321 
2322     /**
2323      *  Downloads the image attachment. <br/>
2324      *  Calling this function initiates communication. <br/>
2325      *  Can get a valid value if <tt>@ref FLAG_WITH_EXTERNAL_IMAGE_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2326      *
2327      *
2328      *  @param[out] externalImageData  Buffer for storing the image attachment.
2329      *  @param[out] externalImageDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
2330      *  @param[in] externalImageDataMaxSize  Specifies the buffer for storing the image attachment.
2331      *
2332      *  @retval ResultSuccess  Indicates success.
2333      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2334      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2335      *  @retval ResultNotExistData  Indicates that the data was not found.
2336      *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
2337      *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
2338      *  @retval ResultCanceled  Indicates that the action was canceled.
2339      *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
2340      *  @retval ResultDataNotFound  Indicates that the data was not found.
2341      *  @retval ResultHttpError  Indicates an HTTP error.
2342      */
2343     nn::Result DownloadExternalImageData(void* externalImageData, u32* externalImageDataSize, const u32 externalImageDataMaxSize) const;
2344 
2345     /**
2346      *  Gets the size of the image attachment. <br/>
2347      *  Can get a valid value if <tt>@ref FLAG_WITH_EXTERNAL_IMAGE_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned.  <br/>
2348      *
2349      *
2350      *  @return Returns the size of the image attachment.
2351      */
2352     u32 GetExternalImageDataSize(void) const;
2353 
2354 protected:
2355     /// @cond
2356     /**
2357      *  Gets the post ID.
2358      *
2359      *  @return Returns the post ID.
2360      */
2361     const char* GetPostId() const;
2362 
2363     /**
2364      *  Downloads a binary attachment. <br/>
2365      *  Calling this function initiates communication. <br/>
2366      *  Can get a valid value if <tt>@ref FLAG_WITH_EXTERNAL_BINARY_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2367      *
2368      *
2369      *  @param[out] externalBinaryData  Buffer for storing the binary attachment.
2370      *  @param[out] externalBinaryDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
2371      *  @param[in] externalBinaryDataMaxSize  Size of the buffer for storing the binary attachment.
2372      *
2373      *  @retval ResultSuccess  Indicates success.
2374      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2375      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2376      *  @retval ResultNotExistData  Indicates that the data was not found.
2377      *  @retval ResultOfflineMode  Indicates that the object was initialized in offline mode.
2378      *  @retval ResultMemoryAllocateError  Indicates a failure to allocate memory.
2379      *  @retval ResultCanceled  Indicates that the action was canceled.
2380      *  @retval ResultCurlError  Indicates that a <tt>Curl</tt> function failed.
2381      *  @retval ResultDataNotFound  Indicates that the data was not found.
2382      *  @retval ResultHttpError  Indicates an HTTP error.
2383      */
2384     nn::Result DownloadExternalBinaryData(void* externalBinaryData, u32* externalBinaryDataSize, const u32 externalBinaryDataMaxSize) const;
2385 
2386     /**
2387      *  Gets the size of the binary attachment. <br/>
2388      *  Can get a valid value if <tt>@ref FLAG_WITH_EXTERNAL_BINARY_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2389      *
2390      *
2391      *  @return Returns the size of the binary attachment.
2392      */
2393     u32 GetExternalBinaryDataSize(void) const;
2394     /// @endcond
2395 
2396 private:
2397     /// @cond
2398     /**
2399      *  Gets the Mii character data. <br/>
2400      *  It can get a valid value if <tt>@ref FLAG_WITH_MII_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2401      *
2402      *
2403      *  This function remains temporarily available for compatibility reasons. Its use is not recommended. <br/>
2404      *
2405      *  Use the following function to get Mii character data. <br/>
2406      *  <tt>nn::Result GetMiiData(FFLStoreData* storeData) const;</tt>
2407      *
2408      *  @return Returns Mii character data. (Get it as type <tt>FFLStoreData</tt>.)<br/>
2409      *  Returns <tt>NULL</tt> if the data does not exist.
2410      */
2411     const u8* GetMiiData() const;
2412     /// @endcond
2413 
2414 protected:
2415     /// @cond
2416     u32 flags;                              /*!< Sets flags. */
2417     u32 userPid;                            /*!< The principal ID. */
2418     s8  postId[POST_ID_BUFF_LENGTH];        /*!< Post ID. */
2419     s64 postDate;                           /*!< Post date (=<tt>OSTime</tt> type). */
2420     s8  feeling;                            /*!< Mood. */
2421     u8  padding_0[3];
2422     u32 regionId;                           /*!< Region ID. */
2423     u8  platformId;                         /*!< Platform ID. */
2424     u8  languageId;                         /*!< Language ID. */
2425     u8  countryId;                          /*!< Country ID. */
2426     u8  padding_1;                          /*!< Region ID reserved. */
2427     u16 bodyText[BODY_TEXT_BUFF_LENGTH];    /*!< Represents text data. */
2428     u32 bodyTextMaxLength;                  /*!< Size of the text data. */
2429     u8  bodyMemo
2430         [COMPRESSED_BODY_MEMO_BUFF_SIZE];   /*!< Handwritten memo. */
2431     u32 bodyMemoMaxSize;                    /*!< Size of the handwritten memo data. */
2432     u16 topicTag
2433         [TOPIC_TAG_BUFF_LENGTH];            /*!< Topic tag. */
2434     u8  appData[APP_DATA_MAX_SIZE];         /*!< Application data. */
2435     u32 appDataSize;                        /*!< Size of the application data. */
2436     s8  externalBinaryUrl
2437         [EXTERNAL_URL_BUFF_LENGTH];         /*!< The URL from which to get the binary attachment. */
2438     u32 externalBinarySize;                 /*!< Size of the binary attachment. */
2439     s8  externalImageUrl
2440         [EXTERNAL_URL_BUFF_LENGTH];         /*!< The URL from which to get the image attachment. */
2441     u32 externalImageSize;                  /*!< Size of the image attachment. */
2442     s8  externalUrl
2443         [EXTERNAL_URL_BUFF_LENGTH];         /*!< External URL. */
2444     u8  miiData[MII_DATA_SIZE];             /*!< Mii character data. */
2445     u16 miiNickname
2446         [MII_NICKNAME_BUFF_LENGTH];         /*!< Mii character nickname. */
2447     u8 reserved[5341];
2448 
2449     friend class internal::Main;
2450     /// @endcond
2451 };
2452 
2453 /**
2454  *  Class for storing downloaded post data.
2455  *
2456  *  All member functions except for <tt>@ref DownloadExternalImageData</tt> are thread-safe and can be called even while in offline mode.
2457  *
2458  */
2459 class DownloadedPostData : public DownloadedDataBase
2460 {
2461 public:
2462     /** Instantiates the object. */
2463     DownloadedPostData();
2464 
2465     /**
2466      * Downloads a community ID.
2467      *
2468      *  @return Returns the community ID.
2469      */
2470     u32 GetCommunityId() const;
2471 
2472     /**
2473      *  Gets the number of Yeahs to this post.
2474      *
2475      *  @return Returns the number of Yeahs.
2476      */
2477     u32 GetEmpathyCount() const;
2478 
2479     /**
2480      *  Gets the number of comments for this post.
2481      *
2482      *  @return Returns the number of comments.
2483      */
2484     u32 GetCommentCount() const;
2485 
2486     /**
2487      *  Gets the post ID (a text string used to uniquely identify the post).
2488      *
2489      *  @return Returns the post ID.
2490      */
2491     const char* GetPostId() const;
2492 
2493 private:
2494     /// @cond
2495     u32 communityId;            /*!< Community ID. */
2496     u32 empathyCount;           /*!< Yeah count. */
2497     u32 commentCount;           /*!< Number of replies. */
2498     u8 reserved[500];
2499 
2500     friend class internal::Main;
2501     /// @endcond
2502 };
2503 
2504 /**
2505  *  Class for storing downloaded direct message data.
2506  *
2507  *  All member functions except for <tt>@ref DownloadExternalImageData</tt> are thread-safe and can be called even while in offline mode.
2508  *
2509  */
2510 class DownloadedDirectMessageData : public DownloadedDataBase
2511 {
2512 public:
2513     /** Instantiates the object. */
2514     DownloadedDirectMessageData();
2515 
2516     /**
2517      *  Gets the direct message ID (a text string used to uniquely identify the direct message).
2518      *
2519      *  @return Returns the direct message ID.
2520      */
2521     const char* GetDirectMessageId() const;
2522 
2523 private:
2524     /// @cond
2525     u8 reserved[512];
2526 
2527     friend class internal::Main;
2528     /// @endcond
2529 };
2530 
2531 
2532 /**
2533  *  Class for storing downloaded comment data.
2534  *
2535  *  All member functions except for <tt>@ref DownloadExternalImageData</tt> are thread-safe and can be called even while in offline mode.
2536  *
2537  */
2538 class DownloadedCommentData : public DownloadedDataBase
2539 {
2540 public:
2541     /** Instantiates the object. */
2542     DownloadedCommentData();
2543 
2544     /**
2545      *  Gets the comment ID (a text string used to uniquely identify the comment).
2546      *
2547      *  @return Returns the comment ID.
2548      */
2549     const char* GetCommentId() const;
2550 
2551 private:
2552     /// @cond
2553     u8 reserved[512];
2554 
2555     friend class internal::Main;
2556     /// @endcond
2557 };
2558 
2559 /**
2560  *  Class that stores downloaded community data
2561  *
2562  *  All member functions can be called even in offline mode. <br/>
2563  *  All member functions are thread-safe.
2564  */
2565 class DownloadedCommunityData
2566 {
2567 public:
2568     /** Flags to specify with <tt>DownloadedCommunityData::TestFlags</tt>. */
2569     enum
2570     {
2571         FLAG_NONE = 0,                          /*!< The default flag value. */
2572         FLAG_WITH_TITLE_TEXT = (1<<0),          /*!< The flag for checking whether a post includes titles. */
2573         FLAG_WITH_DESCRIPTION_TEXT = (1<<1),    /*!< The flag for checking whether a post includes descriptions. */
2574         FLAG_WITH_APP_DATA = (1<<2),            /*!< The flag for checking whether a post includes application data. */
2575         FLAG_WITH_ICON_DATA = (1<<3),           /*!< The flag for checking whether a post includes application data. */
2576         FLAG_WITH_MII_DATA = (1<<4)             /*!< Flag for checking whether a post includes Mii character data. */
2577     };
2578 
2579 public:
2580     /** Instantiates the object. */
2581     DownloadedCommunityData();
2582 
2583     /**
2584      *  Checks flags. <br/>
2585      *  This function determines which types of data are included.
2586      *
2587      *  @param[in] flags  Flags defined in the <tt>@ref DownloadedCommunityData</tt> class. <br/>
2588      *
2589      *                       The following flags can be used. <br/>
2590      *                       @ref DownloadedCommunityData::FLAG_WITH_TITLE_TEXT <br/>
2591      *                       @ref DownloadedCommunityData::FLAG_WITH_DESCRIPTION_TEXT <br/>
2592      *                       @ref DownloadedCommunityData::FLAG_WITH_APP_DATA <br/>
2593      *                       @ref DownloadedCommunityData::FLAG_WITH_ICON_DATA <br/>
2594      *                       @ref DownloadedCommunityData::FLAG_WITH_MII_DATA <br/>
2595      *
2596      *  @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise.
2597      */
2598     bool TestFlags(const u32 flags) const;
2599 
2600     /**
2601      * Downloads a community ID.
2602      *
2603      *  @return Returns the community ID.
2604      */
2605     u32 GetCommunityId() const;
2606 
2607     /**
2608      *  Gets the community data.
2609      *
2610      *  @param[out] communityCode  Specifies a buffer for storing the community code.
2611      *  @param[in] communityCodeBuffSize  Specifies the size of the buffer for storing the community code. (It must be <tt>@ref nn::olv::COMMUNITY_CODE_LENGTH</tt> + 1 or greater.)
2612      *
2613      *  @retval ResultSuccess  Indicates success.
2614      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2615      *  @retval ResultInvalidSize  Indicates that the buffer is too small.
2616      *  @retval ResultInvalidParameter  Indicates that the community ID is invalid.
2617      */
2618     nn::Result GetCommunityCode(char* communityCode, const u32 communityCodeBuffSize) const;
2619 
2620     /**
2621      *  Gets the principal ID of the community's creator.
2622      *
2623      *  @return Returns the principal ID of the community's creator.
2624      */
2625     u32 GetOwnerPid() const;
2626 
2627     /**
2628      * Gets the community name. <br/>
2629      *  This function gets information about the language specified in system settings. <br/>
2630      *  Can get a valid value if <tt>@ref FLAG_WITH_TITLE_TEXT</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned.
2631      *
2632      *
2633      *  <b>Note:</b><br/>
2634      *  Community names may sometimes include characters that are not supported in the application. <br/>
2635      *  When there are unsupported characters, you must handle it without adversely affecting the screen display or hindering the application's progress.
2636      *
2637      *  @param[out] titleText  Specifies the buffer for storing the community name.
2638      *  @param[in] titleTextBuffLength  Specifies the size of the buffer for storing the community name (the number of elements in the <tt>wchar_t</tt> array).
2639      *
2640      *  @retval ResultSuccess  Indicates success.
2641      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2642      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2643      *  @retval ResultNotExistData  Indicates that the data was not found.
2644      */
2645     nn::Result GetTitleText(wchar_t* titleText, const u32 titleTextBuffLength) const;
2646 
2647     /**
2648      * Gets the community description. <br/>
2649      *  This function gets information about the language specified in System Settings. <br/>
2650      *  Can get a valid value if <tt>@ref FLAG_WITH_DESCRIPTION_TEXT</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned.
2651      *
2652      *
2653      *  <b>Note:</b><br/>
2654      *  Community descriptions may sometimes include characters that are not supported in the application. <br/>
2655      *  When there are unsupported characters, you must handle it without adversely affecting the screen display or hindering the application's progress.
2656      *
2657      *  @param[out] descriptionText  Specifies a buffer for storing the community name.
2658      *  @param[in] descriptionTextBuffLength  Specifies the size of the buffer for storing the community description. (The number of elements in the <tt>wchar_t</tt> array.)
2659      *
2660      *  @retval ResultSuccess  Indicates success.
2661      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2662      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2663      *  @retval ResultNotExistData  Indicates that the data was not found.
2664      */
2665     nn::Result GetDescriptionText(wchar_t* descriptionText, const u32 descriptionTextBuffLength) const;
2666 
2667     /**
2668      *  Gets application data. <br/>
2669      *  Can get a valid value if <tt>@ref FLAG_WITH_APP_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2670      *
2671      *
2672      *  @param[out] appData  Specifies the buffer for storing application data.
2673      *  @param[out] appDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
2674      *  @param[in] appDataMaxSize  Specifies the size of the buffer for storing the application data.
2675      *
2676      *  @retval ResultSuccess  Indicates success.
2677      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2678      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2679      *  @retval ResultNotExistData  Indicates that the data was not found.
2680      */
2681     nn::Result GetAppData(u8* appData, u32* appDataSize, const u32 appDataMaxSize) const;
2682 
2683     /**
2684      *  Gets the size of the application data.
2685      *
2686      *  @return Returns the size of the application data.
2687      */
2688     u32 GetAppDataSize(void) const;
2689 
2690     /**
2691      *  Gets the community icon. <br/>
2692      *  Can get a valid value if <tt>@ref FLAG_WITH_ICON_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2693      *
2694      *
2695      *  @param[out] iconData  Specifies a buffer for storing the icon image.
2696      *  @param[out] iconDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
2697      *  @param[in] iconDataMaxSize  Specifies the buffer for storing the icon image.
2698      *
2699      *  @retval ResultSuccess  Indicates success.
2700      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2701      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2702      *  @retval ResultNotExistData  Indicates that the data was not found.
2703      *  @retval ResultDataDecodeError  Indicates that the attempt to decode the image failed.
2704      */
2705     nn::Result GetIconData(u8* iconData, u32* iconDataSize, const u32 iconDataMaxSize) const;
2706 
2707     /**
2708      *  Gets the Mii character of the community's creator. <br/>
2709      *  It can get a valid value if <tt>@ref FLAG_WITH_MII_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2710      *
2711      *
2712      *  @param[out] storeData  Specifies a structure for storing the Mii character data.
2713      *
2714      *  @retval ResultSuccess  Indicates success.
2715      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2716      *  @retval ResultNotExistData  Indicates that the data was not found.
2717      */
2718     nn::Result GetOwnerMiiData(FFLStoreData* storeData) const;
2719 
2720     /**
2721      *  Gets the Mii character nickname of the community's creator.
2722      *
2723      *  <b>Note:</b><br/>
2724      *  Mii character nicknames may sometimes include characters that are not supported in the application. <br/>
2725      *  When that happens, you must handle it without adversely affecting the screen display or hindering the application's progress. <br/>
2726      *  For more details, see the Nicknames and Creator Names section in the Wii U Guidelines.
2727      *
2728      *  @return Returns the Mii character nickname.
2729      */
2730     const wchar_t* GetOwnerMiiNickname() const;
2731 
2732 private:
2733     /// @cond
2734     u32 flags;                              /*!< Sets flags. */
2735     u32 communityId;                        /*!< Community ID. */
2736     u32 ownerPid;                           /*!< Creator's principal ID. */
2737     u16 titleText
2738         [TITLE_TEXT_BUFF_LENGTH];           /*!< Community title. */
2739     u32 titleTextMaxLength;                 /*!< Length of the community title. */
2740     u16 descriptionText
2741         [DESCRIPTION_TEXT_BUFF_LENGTH];     /*!< Text description of the community. */
2742     u32 descriptionTextMaxLength;           /*!< Length of the community description. */
2743     u8  appData[APP_DATA_MAX_SIZE];         /*!< Application data. */
2744     u32 appDataSize;                        /*!< Size of the application data. */
2745     u8  iconData
2746         [COMPRESSED_ICON_DATA_BUFF_SIZE];   /*!< Community icon. */
2747     s32 iconDataSize;                       /*!< Community icon size. */
2748     u8  miiData[MII_DATA_SIZE];             /*!< Mii character data. */
2749     u16 miiNickname
2750         [MII_NICKNAME_BUFF_LENGTH];         /*!< Mii character nickname. */
2751     u8 reserved[6168];
2752 
2753     friend class internal::Main;
2754     /// @endcond
2755 };
2756 
2757 /**
2758  *  Class for storing downloaded user data.
2759  *
2760  *  All member functions can be called even in offline mode. <br/>
2761  *  All member functions are thread-safe.
2762  */
2763 class DownloadedUserData
2764 {
2765 public:
2766     /** Flags to specify with <tt>DownloadedUserData::TestFlags</tt>. */
2767     enum
2768     {
2769         FLAG_NONE = 0,                /*!< The default flag value. */
2770         FLAG_WITH_MII_DATA = (1<<0),  /*!< The flag for checking whether a post includes Mii character data. */
2771     };
2772 
2773 public:
2774     /** Instantiates the object. */
2775     DownloadedUserData();
2776 
2777     /**
2778      *  Checks flags. <br/>
2779      *  This function determines which types of data are included.
2780      *
2781      *  @param[in] flags  Flags defined in the <tt>@ref DownloadedUserData</tt> class. <br/>
2782      *
2783      *                       The following flags can be used. <br/>
2784      *                       @ref DownloadedUserData::FLAG_WITH_MII_DATA
2785      *
2786      *  @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise.
2787      */
2788     bool TestFlags(const u32 flags) const;
2789 
2790     /**
2791      *  Gets the principal ID of the user.
2792      *
2793      *  @return Returns the principal ID of the user.
2794      */
2795     u32 GetUserPid() const;
2796 
2797     /**
2798      *  Gets the Mii character data. <br/>
2799      *  It can get a valid value if <tt>@ref FLAG_WITH_MII_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
2800      *
2801      *
2802      *  @param[out] storeData  Specifies a structure for storing the Mii character data.
2803      *
2804      *  @retval ResultSuccess  Indicates success.
2805      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2806      *  @retval ResultNotExistData  Indicates that the data was not found.
2807      */
2808     nn::Result GetMiiData(FFLStoreData* storeData) const;
2809 
2810     /**
2811      *  Gets the Mii character nickname.
2812      *
2813      *  <b>Note:</b><br/>
2814      *  Mii character nicknames may sometimes include characters that are not supported in the application. <br/>
2815      *  When that happens, you must handle it without adversely affecting the screen display or hindering the application's progress. <br/>
2816      *  For more details, see the Nicknames and Creator Names section in the Wii U Guidelines.
2817      *
2818      *  @return Returns the Mii character nickname.
2819      */
2820     const wchar_t* GetMiiNickname() const;
2821 
2822 private:
2823     /// @cond
2824     u32 flags;                              /*!< Sets flags. */
2825     u32 userPid;                            /*!< The principal ID. */
2826     u8  miiData[MII_DATA_SIZE];             /*!< Mii character data. */
2827     u16 miiNickname
2828         [MII_NICKNAME_BUFF_LENGTH];         /*!< Mii character nickname. */
2829     u8 reserved[3928];
2830 
2831     friend class internal::Main;
2832     /// @endcond
2833 };
2834 
2835 /**
2836  *  Base class for uploaded data.
2837  *
2838  *   It is inherited by the class for storing uploaded post data (<tt>@ref UploadedPostData</tt>), the class for storing uploaded direct message data (<tt>@ref UploadedDirectMessageData</tt>), and the class for storing uploaded comment data (<tt>@ref UploadedCommentData</tt>). <br/>
2839  *
2840  *
2841  *
2842  *  All member functions can be called even in offline mode. <br/>
2843  *  All member functions are thread-safe.
2844  */
2845 
2846 class UploadedDataBase
2847 {
2848 public:
2849     /** Flags to specify with <tt>UploadedPostData::TestFlags</tt>, <tt>@ref UploadedDirectMessageData::TestFlags</tt>, and <tt>@ref UploadedCommentData::TestFlags</tt>. */
2850     enum
2851     {
2852         FLAG_NONE           = 0,                                  /*!< The default flag value. */
2853         FLAG_WITH_BODY_TEXT = UPLOADED_FLAG_VALUE_WITH_BODY_TEXT, /*!< The flag for checking whether a post includes body text. */
2854         FLAG_WITH_BODY_MEMO = UPLOADED_FLAG_VALUE_WITH_BODY_MEMO, /*!< The flag for checking whether a post includes handwritten memo data. */
2855         FLAG_WITH_APP_DATA  = UPLOADED_FLAG_VALUE_WITH_APP_DATA,  /*!< The flag for checking whether a post includes application data. */
2856         FLAG_SPOILER        = UPLOADED_FLAG_VALUE_SPOILER         /*!< The flag for checking whether the post contains a spoiler. */
2857     };
2858 
2859 public:
2860     /** Instantiates the object. */
2861     UploadedDataBase();
2862 
2863     /** Destructor. */
2864     virtual ~UploadedDataBase() = 0;
2865 
2866     /**
2867      *  Checks flags. <br/>
2868      *  This function determines which types of data are included.
2869      *
2870      *  @param[in] flags  Flags defined in the <tt>@ref UploadedDataBase</tt> class. <br/>
2871       *
2872      *                       The following flags can be used. <br/>
2873      *                       @ref UploadedDataBase::FLAG_WITH_BODY_TEXT <br/>
2874      *                       @ref UploadedDataBase::FLAG_WITH_BODY_MEMO <br/>
2875      *                       @ref UploadedDataBase::FLAG_WITH_APP_DATA <br/>
2876      *                       @ref UploadedDataBase::FLAG_SPOILER <br/>
2877      *
2878      *  @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise.
2879      */
2880     bool TestFlags(const u32 flags) const;
2881 
2882     /**
2883      *  Gets the post ID (a text string used to uniquely identify the post).
2884      *
2885      *  @return Returns the post ID.
2886      */
2887     const char* GetPostId() const;
2888 
2889     /**
2890      *  Gets text data.
2891      *
2892      *  @param[out] bodyText  Specifies a buffer for storing the text data.
2893      *  @param[in] bodyTextBuffLength  Specifies the size of the buffer for storing the text data (the number of elements in the <tt>wchar_t</tt> array).
2894      *
2895      *  @retval ResultSuccess  Indicates success.
2896      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2897      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2898      *  @retval ResultNotExistData  Indicates that the data was not found.
2899      */
2900     nn::Result GetBodyText(wchar_t* bodyText, const u32 bodyTextBuffLength) const;
2901 
2902     /**
2903      *  Gets handwritten memo data.
2904      *
2905      *  <b>Note:</b><br/>
2906      *  Handwritten memos use the following data format. <br/>
2907      *  TGA 1.0. (No color map. 32-bit color without RLE compression. Stored in BGRA order starting from the lower left. 320&times;120 pixels.) <br/>
2908      *  Fixed-length 18-byte header (00 00 02 00 00 00 00 00 00 00 00 00 40 01 78 00 20 08). <br/>
2909      *
2910      *
2911      *  @param[out] bodyMemo  Specifies a buffer for storing a handwritten memo.
2912      *  @param[out] bodyMemoSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
2913      *  @param[in] bodyMemoMaxSize  Specifies the size of the buffer for storing the handwritten memo.
2914      *
2915      *  @retval ResultSuccess  Indicates success.
2916      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2917      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2918      *  @retval ResultNotExistData  Indicates that the data was not found.
2919      *  @retval ResultDataDecodeError  Indicates that the attempt to decode the data failed.
2920      */
2921     nn::Result GetBodyMemo(u8* bodyMemo, u32* bodyMemoSize, const u32 bodyMemoMaxSize) const;
2922 
2923     /**
2924      *  Gets application data.
2925      *
2926      *  @param[out] appData  Specifies the buffer for storing application data.
2927      *  @param[out] appDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
2928      *  @param[in] appDataMaxSize  Specifies the size of the buffer for storing the application data.
2929      *
2930      *  @retval ResultSuccess  Indicates success.
2931      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2932      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
2933      *  @retval ResultNotExistData  Indicates that the data was not found.
2934      */
2935     nn::Result GetAppData(u8* appData, u32* appDataSize, const u32 appDataMaxSize) const;
2936 
2937     /**
2938      *  Gets the size of the application data.
2939      *
2940      *  @return Returns the size of the application data.
2941      */
2942     u32 GetAppDataSize(void) const;
2943 
2944     /**
2945      *  Gets the mood (feeling).
2946      *
2947      *  @return Returns the mood.
2948      */
2949     s8 GetFeeling() const;
2950 
2951 protected:
2952     /// @cond
2953     /**
2954      *  Gets common data.
2955      *
2956      *  @param[out] type  Specifies the type of data to write to the target.
2957      *  @param[out] data  Specifies the buffer to write the passed data to.
2958      *  @param[out] dataSize  Specifies the size of the data that was actually passed.
2959      *  @param[in] dataMaxSize  Specifies the maximum size of the buffer where the data is written to.
2960      *
2961      *  @retval ResultSuccess  Indicates success.
2962      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
2963      *  @retval ResultNotExistData  Indicates that the data was not found.
2964      *  @retval ResultInvalidSize  Indicates that the maximum size of the write target buffer is too small.
2965      **/
2966     nn::Result GetCommonData(u32 *type, u8* data, u32 *dataSize, const u32 dataMaxSize);
2967     /// @endcond
2968 
2969 protected:
2970     /// @cond
2971     u32 flags;                              /*!< Sets flags. */
2972     s8  postId[POST_ID_BUFF_LENGTH];        /*!< Post ID. */
2973     u16 bodyText[BODY_TEXT_BUFF_LENGTH];    /*!< Represents text data. */
2974     u32 bodyTextMaxLength;                  /*!< Size of the text data. */
2975     u8  bodyMemo
2976         [COMPRESSED_BODY_MEMO_BUFF_SIZE];   /*!< Handwritten memo. */
2977     u32 bodyMemoMaxSize;                    /*!< Size of the handwritten memo data. */
2978     u8  appData[APP_DATA_MAX_SIZE];         /*!< Application data. */
2979     u32 appDataSize;                        /*!< Size of the application data. */
2980     s8  feeling;                            /*!< Mood. */
2981     u8  padding[3];
2982     u32 commonDataType;                            /*!< Common data type. */
2983     u32 commonDataSize;                            /*!< Common data size. */
2984     u8  commonData[UPLOADED_COMMON_DATA_MAX_SIZE]; /*!< Common data. */
2985     u8 reserved[2504];
2986 
2987     friend class internal::Main;
2988     /// @endcond
2989 };
2990 
2991 /**
2992  *  Class for storing uploaded posts.
2993  *
2994  *  All member functions are thread-safe, and can be called even in offline mode.
2995  */
2996 class UploadedPostData : public UploadedDataBase
2997 {
2998 public:
2999     /** Instantiates the object. */
3000     UploadedPostData();
3001 
3002     /**
3003      *  Checks flags. <br/>
3004      *  This function determines which types of data are included.
3005      *
3006      *  @param[in] flags  Flags defined in the <tt>@ref UploadedPostData</tt> class.
3007       *
3008      *                       The following flags can be used. <br/>
3009      *                       @ref UploadedPostData::FLAG_WITH_BODY_TEXT <br/>
3010      *                       @ref UploadedPostData::FLAG_WITH_BODY_MEMO <br/>
3011      *                       @ref UploadedPostData::FLAG_WITH_APP_DATA <br/>
3012      *                       @ref UploadedPostData::FLAG_SPOILER <br/>
3013      *
3014      *  @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise.
3015      */
3016     bool TestFlags(const u32 flags) const;
3017 
3018     /**
3019      *  Gets the post ID (a text string used to uniquely identify the post).
3020      *
3021      *  @return Returns the post ID.
3022      */
3023     const char* GetPostId() const;
3024 
3025     /**
3026      *  Gets text data. <br/>
3027      *  Can get a valid value if <tt>@ref FLAG_WITH_BODY_TEXT</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3028      *
3029      *
3030      *  @param[out] bodyText  Specifies a buffer for storing the text data.
3031      *  @param[in] bodyTextBuffLength  Specifies the size of the buffer for storing the text data (the number of elements in the <tt>wchar_t</tt> array).
3032      *
3033      *  @retval ResultSuccess  Indicates success.
3034      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3035      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3036      *  @retval ResultNotExistData  Indicates that the data was not found.
3037      */
3038     nn::Result GetBodyText(wchar_t* bodyText, const u32 bodyTextBuffLength) const;
3039 
3040     /**
3041      *  Gets handwritten memo data. <br/>
3042      *  Can get a valid value if <tt>@ref FLAG_WITH_BODY_MEMO</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3043      *
3044      *
3045      *  <b>Note:</b><br/>
3046      *  Handwritten memos use the following data format. <br/>
3047      *  TGA 1.0. (No color map. 32-bit color without RLE compression. Stored in BGRA order starting from the lower left. 320&times;120 pixels.) <br/>
3048      *  Fixed-length 18-byte header (00 00 02 00 00 00 00 00 00 00 00 00 40 01 78 00 20 08). <br/>
3049      *
3050      *
3051      *  @param[out] bodyMemo  Specifies a buffer for storing a handwritten memo.
3052      *  @param[out] bodyMemoSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
3053      *  @param[in] bodyMemoMaxSize  Specifies the size of the buffer for storing the handwritten memo.
3054      *
3055      *  @retval ResultSuccess  Indicates success.
3056      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3057      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3058      *  @retval ResultNotExistData  Indicates that the data was not found.
3059      *  @retval ResultDataDecodeError  Indicates that the attempt to decode the data failed.
3060      */
3061     nn::Result GetBodyMemo(u8* bodyMemo, u32* bodyMemoSize, const u32 bodyMemoMaxSize) const;
3062 
3063     /**
3064      *  Gets application data. <br/>
3065      *  Can get a valid value if <tt>@ref FLAG_WITH_APP_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3066      *
3067      *
3068      *  @param[out] appData  Specifies the buffer for storing application data.
3069      *  @param[out] appDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
3070      *  @param[in] appDataMaxSize  Specifies the size of the buffer for storing the application data.
3071      *
3072      *  @retval ResultSuccess  Indicates success.
3073      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3074      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3075      *  @retval ResultNotExistData  Indicates that the data was not found.
3076      */
3077     nn::Result GetAppData(u8* appData, u32* appDataSize, const u32 appDataMaxSize) const;
3078 
3079     /**
3080      *  Gets the size of the application data.
3081      *
3082      *  @return Returns the size of the application data.
3083      */
3084     u32 GetAppDataSize(void) const;
3085 
3086     /**
3087      *  Gets the mood (feeling).
3088      *
3089      *  @return Returns the mood.
3090      */
3091     s8 GetFeeling() const;
3092 
3093     /**
3094      *  Gets the structure for getting the video upload result.
3095      *
3096      *  @param[out] youtubeResult  Specifies a buffer for storing the data.
3097      *  @param[in]  youtubeResultSize  The size of the buffer to write the data to.
3098      *
3099      *  @retval ResultSuccess  Indicates success.
3100      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3101      *  @retval ResultNotExistData  Indicates that the data was not found.
3102      *  @retval ResultInvalidSize  Indicates that the maximum size of the write target buffer is too small.
3103      */
GetYoutubeResult(u8 * youtubeResult,const u32 youtubeResultSize)3104     nn::Result GetYoutubeResult(u8* youtubeResult, const u32 youtubeResultSize)
3105     {
3106         u32 type, dataSize;
3107         nn::Result result = GetCommonData(&type, youtubeResult, &dataSize, youtubeResultSize);
3108         if (result.IsSuccess())
3109         {
3110             if (type != RESULT_COMMON_DATA_TYPE_YOUTUBE || dataSize != youtubeResultSize)
3111             {
3112                 return nn::olv::ResultNotExistData();
3113             }
3114         }
3115         return result;
3116     }
3117 
3118 private:
3119     /// @cond
3120     u8 reserved[512];
3121 
3122     friend class internal::Main;
3123     /// @endcond
3124 };
3125 
3126 /**
3127  *  Class for storing uploaded direct messages.
3128  *
3129  *  All member functions are thread-safe, and can be called even in offline mode.
3130  */
3131 class UploadedDirectMessageData : public UploadedDataBase
3132 {
3133 public:
3134     /** Instantiates the object. */
3135     UploadedDirectMessageData();
3136 
3137     /**
3138      *  Checks flags. <br/>
3139      *  This function determines which types of data are included.
3140      *
3141      *  @param[in] flags  Flags defined in the <tt>@ref UploadedDirectMessageData</tt> class. <br/>
3142      *
3143      *                       The following flags can be used. <br/>
3144      *                       @ref UploadedDirectMessageData::FLAG_WITH_BODY_TEXT <br/>
3145      *                       @ref UploadedDirectMessageData::FLAG_WITH_BODY_MEMO <br/>
3146      *                       @ref UploadedDirectMessageData::FLAG_WITH_APP_DATA <br/>
3147      *
3148      *  @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise.
3149      */
3150     bool TestFlags(const u32 flags) const;
3151 
3152     /**
3153      *  Gets the direct message ID (a text string used to uniquely identify the direct message).
3154      *
3155      *  @return Returns the direct message ID.
3156      */
3157     const char* GetDirectMessageId() const;
3158 
3159     /**
3160      *  Gets text data. <br/>
3161      *  Can get a valid value if <tt>@ref FLAG_WITH_BODY_TEXT</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3162      *
3163      *
3164      *  @param[out] bodyText  Specifies a buffer for storing the text data.
3165      *  @param[in] bodyTextBuffLength  Specifies the size of the buffer for storing the text data (the number of elements in the <tt>wchar_t</tt> array).
3166      *
3167      *  @retval ResultSuccess  Indicates success.
3168      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3169      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3170      *  @retval ResultNotExistData  Indicates that the data was not found.
3171      */
3172     nn::Result GetBodyText(wchar_t* bodyText, const u32 bodyTextBuffLength) const;
3173 
3174     /**
3175      *  Gets handwritten memo data. <br/>
3176      *  Can get a valid value if <tt>@ref FLAG_WITH_BODY_MEMO</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3177      *
3178      *
3179      *  <b>Note:</b><br/>
3180      *  Handwritten memos use the following data format. <br/>
3181      *  TGA 1.0. (No color map. 32-bit color without RLE compression. Stored in BGRA order starting from the lower left. 320&times;120 pixels.) <br/>
3182      *  Fixed-length 18-byte header (00 00 02 00 00 00 00 00 00 00 00 00 40 01 78 00 20 08). <br/>
3183      *
3184      *
3185      *  @param[out] bodyMemo  Specifies a buffer for storing a handwritten memo.
3186      *  @param[out] bodyMemoSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
3187      *  @param[in] bodyMemoMaxSize  Specifies the size of the buffer for storing the handwritten memo.
3188      *
3189      *  @retval ResultSuccess  Indicates success.
3190      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3191      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3192      *  @retval ResultNotExistData  Indicates that the data was not found.
3193      *  @retval ResultDataDecodeError  Indicates that the attempt to decode the data failed.
3194      */
3195     nn::Result GetBodyMemo(u8* bodyMemo, u32* bodyMemoSize, const u32 bodyMemoMaxSize) const;
3196 
3197     /**
3198      *  Gets application data. <br/>
3199      *  Can get a valid value if <tt>@ref FLAG_WITH_APP_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3200      *
3201      *
3202      *  @param[out] appData  Specifies the buffer for storing application data.
3203      *  @param[out] appDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
3204      *  @param[in] appDataMaxSize  Specifies the size of the buffer for storing the application data.
3205      *
3206      *  @retval ResultSuccess  Indicates success.
3207      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3208      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3209      *  @retval ResultNotExistData  Indicates that the data was not found.
3210      */
3211     nn::Result GetAppData(u8* appData, u32* appDataSize, const u32 appDataMaxSize) const;
3212 
3213     /**
3214      *  Gets the size of the application data.
3215      *
3216      *  @return Returns the size of the application data.
3217      */
3218     u32 GetAppDataSize(void) const;
3219 
3220     /**
3221      *  Gets the mood (feeling).
3222      *
3223      *  @return Returns the mood.
3224      */
3225     s8 GetFeeling() const;
3226 
3227 private:
3228     /// @cond
3229     u8 reserved[512];
3230 
3231     friend class internal::Main;
3232     /// @endcond
3233 };
3234 
3235 /**
3236  *  Represents a class for storing uploaded comment data.
3237  *
3238  *  All member functions are thread-safe, and can be called even in offline mode.
3239  */
3240 class UploadedCommentData : public UploadedDataBase
3241 {
3242 public:
3243     /** Instantiates the object. */
3244     UploadedCommentData();
3245 
3246     /**
3247      *  Checks flags. <br/>
3248      *  This function determines which types of data are included.
3249      *
3250      *  @param[in] flags  Flags defined in the <tt>@ref UploadedCommentData </tt> class. <br/>
3251      *
3252      *                       The following flags can be used. <br/>
3253      *                       @ref UploadedCommentData::FLAG_WITH_BODY_TEXT <br/>
3254      *                       @ref UploadedCommentData::FLAG_WITH_BODY_MEMO <br/>
3255      *                       @ref UploadedCommentData::FLAG_WITH_APP_DATA <br/>
3256      *                       @ref UploadedCommentData::FLAG_SPOILER <br/>
3257      *
3258      *  @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise.
3259      */
3260     bool TestFlags(const u32 flags) const;
3261 
3262     /**
3263      *  Gets the comment ID (a text string used to uniquely identify the comment).
3264      *
3265      *  @return Returns the comment ID.
3266      */
3267     const char* GetCommentId() const;
3268 
3269     /**
3270      *  Gets text data. <br/>
3271      *  Can get a valid value if <tt>@ref FLAG_WITH_BODY_TEXT</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3272      *
3273      *
3274      *  @param[out] bodyText  Specifies a buffer for storing the text data.
3275      *  @param[in] bodyTextBuffLength  Specifies the size of the buffer for storing the text data (the number of elements in the <tt>wchar_t</tt> array).
3276      *
3277      *  @retval ResultSuccess  Indicates success.
3278      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3279      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3280      *  @retval ResultNotExistData  Indicates that the data was not found.
3281      */
3282     nn::Result GetBodyText(wchar_t* bodyText, const u32 bodyTextBuffLength) const;
3283 
3284     /**
3285      *  Gets handwritten memo data. <br/>
3286      *  Can get a valid value if <tt>@ref FLAG_WITH_BODY_MEMO</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3287      *
3288      *
3289      *  <b>Note:</b><br/>
3290      *  Handwritten memos use the following data format. <br/>
3291      *  TGA 1.0. (No color map. 32-bit color without RLE compression. Stored in BGRA order starting from the lower left. 320&times;120 pixels.) <br/>
3292      *  Fixed-length 18-byte header (00 00 02 00 00 00 00 00 00 00 00 00 40 01 78 00 20 08). <br/>
3293      *
3294      *
3295      *  @param[out] bodyMemo  Specifies a buffer for storing a handwritten memo.
3296      *  @param[out] bodyMemoSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
3297      *  @param[in] bodyMemoMaxSize  Specifies the size of the buffer for storing the handwritten memo.
3298      *
3299      *  @retval ResultSuccess  Indicates success.
3300      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3301      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3302      *  @retval ResultNotExistData  Indicates that the data was not found.
3303      *  @retval ResultDataDecodeError  Indicates that the attempt to decode the data failed.
3304      */
3305     nn::Result GetBodyMemo(u8* bodyMemo, u32* bodyMemoSize, const u32 bodyMemoMaxSize) const;
3306 
3307     /**
3308      *  Gets application data. <br/>
3309      *  Can get a valid value if <tt>@ref FLAG_WITH_APP_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3310      *
3311      *
3312      *  @param[out] appData  Specifies the buffer for storing application data.
3313      *  @param[out] appDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
3314      *  @param[in] appDataMaxSize  Specifies the size of the buffer for storing the application data.
3315      *
3316      *  @retval ResultSuccess  Indicates success.
3317      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3318      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3319      *  @retval ResultNotExistData  Indicates that the data was not found.
3320      */
3321     nn::Result GetAppData(u8* appData, u32* appDataSize, const u32 appDataMaxSize) const;
3322 
3323     /**
3324      *  Gets the size of the application data.
3325      *
3326      *  @return Returns the size of the application data.
3327      */
3328     u32 GetAppDataSize(void) const;
3329 
3330     /**
3331      *  Gets the mood (feeling).
3332      *
3333      *  @return Returns the mood.
3334      */
3335     s8 GetFeeling() const;
3336 
3337 private:
3338     /// @cond
3339     u8 reserved[512];
3340 
3341     friend class internal::Main;
3342     /// @endcond
3343 };
3344 
3345 /**
3346  *  Class for storing uploaded community data.
3347  *
3348  *  All member functions can be called even in offline mode. <br/>
3349  *  All member functions are thread-safe.
3350  */
3351 class UploadedCommunityData
3352 {
3353 public:
3354     /** Flags to specify with <tt>UploadedCommunityData::TestFlags</tt>.*/
3355     enum
3356     {
3357         FLAG_NONE = 0,                          /*!< The default flag value. */
3358         FLAG_WITH_TITLE_TEXT = (1<<0),          /*!< The flag for checking whether a post includes titles. */
3359         FLAG_WITH_DESCRIPTION_TEXT = (1<<1),    /*!< The flag for checking whether a post includes descriptions. */
3360         FLAG_WITH_APP_DATA = (1<<2),            /*!< The flag for checking whether a post includes application data. */
3361         FLAG_WITH_ICON_DATA = (1<<3),           /*!< The flag for checking whether a post includes application data. */
3362     };
3363 
3364 public:
3365     /** Instantiates the object. */
3366     UploadedCommunityData();
3367 
3368     /**
3369      *  Checks flags. <br/>
3370      *  This function determines which types of data are included.
3371      *
3372      *  @param[in] flags  Flags defined in the <tt>@ref UploadedCommunityData</tt> class. <br/>
3373      *
3374      *                       The following flags can be used. <br/>
3375      *                       @ref UploadedCommunityData::FLAG_WITH_TITLE_TEXT <br/>
3376      *                       @ref UploadedCommunityData::FLAG_WITH_DESCRIPTION_TEXT <br/>
3377      *                       @ref UploadedCommunityData::FLAG_WITH_APP_DATA <br/>
3378      *                       @ref UploadedCommunityData::FLAG_WITH_ICON_DATA <br/>
3379      *
3380      *  @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise.
3381      */
3382     bool TestFlags(const u32 flags) const;
3383 
3384     /**
3385      * Downloads a community ID.
3386      *
3387      *  @return Returns the community ID.
3388      */
3389     u32 GetCommunityId() const;
3390 
3391     /**
3392      *  Gets the community data.
3393      *
3394      *  @param[out] communityCode  Specifies a buffer for storing the community code.
3395      *  @param[in] communityCodeBuffSize  Specifies the size of the buffer for storing the community code. (It must be <tt>@ref nn::olv::COMMUNITY_CODE_LENGTH</tt> + 1 or greater.)
3396      *
3397      *  @retval ResultSuccess  Indicates success.
3398      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3399      *  @retval ResultInvalidSize  Indicates that the buffer is too small.
3400      *  @retval ResultInvalidParameter  Indicates that the community ID is invalid.
3401      */
3402     nn::Result GetCommunityCode(char* communityCode, const u32 communityCodeBuffSize) const;
3403 
3404     /**
3405      *  Gets the principal ID of the community's creator.
3406      *
3407      *  @return Returns the principal ID of the community's creator.
3408      */
3409     u32 GetOwnerPid() const;
3410 
3411     /**
3412      * Gets the community name. <br/>
3413      *  Can get a valid value if <tt>@ref FLAG_WITH_TITLE_TEXT</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3414      *
3415      *
3416      *  @param[out] titleText  Specifies the buffer for storing the community name.
3417      *  @param[in] titleTextBuffLength  Specifies the size of the buffer for storing the community name (the number of elements in the <tt>wchar_t</tt> array).
3418      *
3419      *  @retval ResultSuccess  Indicates success.
3420      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3421      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3422      *  @retval ResultNotExistData  Indicates that the data was not found.
3423      */
3424     nn::Result GetTitleText(wchar_t* titleText, const u32 titleTextBuffLength) const;
3425 
3426     /**
3427      * Gets the community description. <br/>
3428      *  Can get a valid value if <tt>@ref FLAG_WITH_DESCRIPTION_TEXT</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3429      *
3430      *
3431      *  @param[out] descriptionText  Specifies a buffer for storing the community name.
3432      *  @param[in] descriptionTextBuffLength  Specifies the size of the buffer for storing the community description. (The number of elements in the <tt>wchar_t</tt> array.)
3433      *
3434      *  @retval ResultSuccess  Indicates success.
3435      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3436      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3437      *  @retval ResultNotExistData  Indicates that the data was not found.
3438      */
3439     nn::Result GetDescriptionText(wchar_t* descriptionText, const u32 descriptionTextBuffLength) const;
3440 
3441     /**
3442      *  Gets application data. <br/>
3443      *  Can get a valid value if <tt>@ref FLAG_WITH_APP_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3444      *
3445      *
3446      *  @param[out] appData  Specifies the buffer for storing application data.
3447      *  @param[out] appDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
3448      *  @param[in] appDataMaxSize  Specifies the size of the buffer for storing the application data.
3449      *
3450      *  @retval ResultSuccess  Indicates success.
3451      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3452      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3453      *  @retval ResultNotExistData  Indicates that the data was not found.
3454      */
3455     nn::Result GetAppData(u8* appData, u32* appDataSize, const u32 appDataMaxSize) const;
3456 
3457     /**
3458      *  Gets the size of the application data.
3459      *
3460      *  @return Returns the size of the application data.
3461      */
3462     u32 GetAppDataSize(void) const;
3463 
3464     /**
3465      *  Gets the community icon. <br/>
3466      *  Can get a valid value if <tt>@ref FLAG_WITH_ICON_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3467      *
3468      *
3469      *  @param[out] iconData  Specifies a buffer for storing the icon image.
3470      *  @param[out] iconDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
3471      *  @param[in] iconDataMaxSize  Specifies the buffer for storing the icon image.
3472      *
3473      *  @retval ResultSuccess  Indicates success.
3474      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3475      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3476      *  @retval ResultNotExistData  Indicates that the data was not found.
3477      *  @retval ResultDataDecodeError  Indicates that the attempt to decode the image failed.
3478      */
3479     nn::Result GetIconData(u8* iconData, u32* iconDataSize, const u32 iconDataMaxSize) const;
3480 
3481 private:
3482     /// @cond
3483     u32 flags;                              /*!< Sets flags. */
3484     u32 communityId;                        /*!< Community ID. */
3485     u32 ownerPid;                           /*!< Creator's principal ID. */
3486     u16 titleText
3487         [TITLE_TEXT_BUFF_LENGTH];           /*!< Community title. */
3488     u32 titleTextMaxLength;                 /*!< Length of the community title. */
3489     u16 descriptionText
3490         [DESCRIPTION_TEXT_BUFF_LENGTH];     /*!< Text description of the community. */
3491     u32 descriptionTextMaxLength;           /*!< Length of the community description. */
3492     u8  appData[APP_DATA_MAX_SIZE];         /*!< Application data. */
3493     u32 appDataSize;                        /*!< Size of the application data. */
3494     u8  iconData
3495         [COMPRESSED_ICON_DATA_BUFF_SIZE];   /*!< Community icon. */
3496     s32 iconDataSize;                       /*!< Community icon size. */
3497     u8 reserved[6328];
3498 
3499     friend class internal::Main;
3500     /// @endcond
3501 };
3502 
3503 /**
3504  *  Class for storing uploaded community favorites data.
3505  *
3506  *  All member functions can be called even in offline mode. <br/>
3507  *  All member functions are thread-safe.
3508  */
3509 class UploadedFavoriteToCommunityData
3510 {
3511 public:
3512     /** Flags to specify with <tt>UploadedFavoriteToCommunityData::TestFlags</tt>.*/
3513     enum
3514     {
3515         FLAG_NONE = 0,                          /*!< The default flag value. */
3516         FLAG_WITH_TITLE_TEXT = (1<<0),          /*!< The flag for checking whether a post includes titles. */
3517         FLAG_WITH_DESCRIPTION_TEXT = (1<<1),    /*!< The flag for checking whether a post includes descriptions. */
3518         FLAG_WITH_APP_DATA = (1<<2),            /*!< The flag for checking whether a post includes application data. */
3519         FLAG_WITH_ICON_DATA = (1<<3),           /*!< The flag for checking whether a post includes application data. */
3520     };
3521 
3522 public:
3523     /** Constructor. */
3524     UploadedFavoriteToCommunityData();
3525 
3526     /**
3527      *  Checks flags. <br/>
3528      *  This function determines which types of data are included.
3529      *
3530      *  @param[in] flags  Flags defined in the <tt>@ref UploadedFavoriteToCommunityData</tt> class. <br/>
3531      *
3532      *                       The following flags can be used. <br/>
3533      *                       @ref UploadedFavoriteToCommunityData::FLAG_WITH_TITLE_TEXT <br/>
3534      *                       @ref UploadedFavoriteToCommunityData::FLAG_WITH_DESCRIPTION_TEXT <br/>
3535      *                       @ref UploadedFavoriteToCommunityData::FLAG_WITH_APP_DATA <br/>
3536      *                       @ref UploadedFavoriteToCommunityData::FLAG_WITH_ICON_DATA <br/>
3537      *
3538      *  @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise.
3539      */
3540     bool TestFlags(const u32 flags) const;
3541 
3542     /**
3543      * Downloads a community ID.
3544      *
3545      *  @return Returns the community ID.
3546      */
3547     u32 GetCommunityId() const;
3548 
3549     /**
3550      *  Gets the community data.
3551      *
3552      *  @param[out] communityCode  Specifies a buffer for storing the community code.
3553      *  @param[in] communityCodeBuffSize  Specifies the size of the buffer for storing the community code. (It must be <tt>@ref nn::olv::COMMUNITY_CODE_LENGTH</tt> + 1 or greater.)
3554      *
3555      *  @retval ResultSuccess  Indicates success.
3556      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3557      *  @retval ResultInvalidSize  Indicates that the buffer is too small.
3558      *  @retval ResultInvalidParameter  Indicates that the community ID is invalid.
3559      */
3560     nn::Result GetCommunityCode(char* communityCode, const u32 communityCodeBuffSize) const;
3561 
3562     /**
3563      *  Gets the principal ID of the community's creator.
3564      *
3565      *  @return Returns the principal ID of the community's creator.
3566      */
3567     u32 GetOwnerPid() const;
3568 
3569     /**
3570      * Gets the community name. <br/>
3571      *  Can get a valid value if <tt>@ref FLAG_WITH_TITLE_TEXT</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3572      *
3573      *
3574      *  @param[out] titleText  Specifies the buffer for storing the community name.
3575      *  @param[in] titleTextBuffLength  Specifies the size of the buffer for storing the community name (the number of elements in the <tt>wchar_t</tt> array).
3576      *
3577      *  @retval ResultSuccess  Indicates success.
3578      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3579      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3580      *  @retval ResultNotExistData  Indicates that the data was not found.
3581      */
3582     nn::Result GetTitleText(wchar_t* titleText, const u32 titleTextBuffLength) const;
3583 
3584     /**
3585      *  Gets the community description. <br/>
3586      *  Can get a valid value if <tt>@ref FLAG_WITH_DESCRIPTION_TEXT</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3587      *
3588      *
3589      *  @param[out] descriptionText  Specifies a buffer for storing the community name.
3590      *  @param[in] descriptionTextBuffLength  Specifies the size of the buffer for storing the community description. (The number of elements in the <tt>wchar_t</tt> array.)
3591      *
3592      *  @retval ResultSuccess  Indicates success.
3593      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3594      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3595      *  @retval ResultNotExistData  Indicates that the data was not found.
3596      */
3597     nn::Result GetDescriptionText(wchar_t* descriptionText, const u32 descriptionTextBuffLength) const;
3598 
3599     /**
3600      *  Gets application data. <br/>
3601      *  Can get a valid value if <tt>@ref FLAG_WITH_APP_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3602      *
3603      *
3604      *  @param[out] appData  Specifies the buffer for storing application data.
3605      *  @param[out] appDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
3606      *  @param[in] appDataMaxSize  Specifies the size of the buffer for storing the application data.
3607      *
3608      *  @retval ResultSuccess  Indicates success.
3609      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3610      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3611      *  @retval ResultNotExistData  Indicates that the data was not found.
3612      */
3613     nn::Result GetAppData(u8* appData, u32* appDataSize, const u32 appDataMaxSize) const;
3614 
3615     /**
3616      *  Gets the size of the application data.
3617      *
3618      *  @return Returns the size of the application data.
3619      */
3620     u32 GetAppDataSize(void) const;
3621 
3622     /**
3623      *  Gets the community icon. <br/>
3624      *  Can get a valid value if <tt>@ref FLAG_WITH_ICON_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
3625      *
3626      *
3627      *  @param[out] iconData  Specifies a buffer for storing the icon image.
3628      *  @param[out] iconDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
3629      *  @param[in] iconDataMaxSize  Specifies the buffer for storing the icon image.
3630      *
3631      *  @retval ResultSuccess  Indicates success.
3632      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3633      *  @retval ResultInvalidSize  Indicates that the size is <tt>0</tt>.
3634      *  @retval ResultNotExistData  Indicates that the data was not found.
3635      *  @retval ResultDataDecodeError  Indicates that the attempt to decode the image failed.
3636      */
3637     nn::Result GetIconData(u8* iconData, u32* iconDataSize, const u32 iconDataMaxSize) const;
3638 
3639 private:
3640     /// @cond
3641     u32 flags;                              /*!< Sets flags. */
3642     u32 communityId;                        /*!< Community ID. */
3643     u32 ownerPid;                           /*!< Creator's principal ID. */
3644     u16 titleText
3645         [TITLE_TEXT_BUFF_LENGTH];           /*!< Community title. */
3646     u32 titleTextMaxLength;                 /*!< Length of the community title. */
3647     u16 descriptionText
3648         [DESCRIPTION_TEXT_BUFF_LENGTH];     /*!< Text description of the community. */
3649     u32 descriptionTextMaxLength;           /*!< Length of the community description. */
3650     u8  appData[APP_DATA_MAX_SIZE];         /*!< Application data. */
3651     u32 appDataSize;                        /*!< Size of the application data. */
3652     u8  iconData
3653         [COMPRESSED_ICON_DATA_BUFF_SIZE];   /*!< Community icon. */
3654     s32 iconDataSize;                       /*!< Community icon size. */
3655     u8 reserved[6328];
3656 
3657     friend class internal::Main;
3658     /// @endcond
3659 };
3660 
3661 /**
3662  * Parameters used when getting the URL for notifications.
3663  *
3664  *  All member functions can be called even in offline mode. <br/>
3665  *  All member functions are thread-safe.
3666  */
3667 class GetNotificationsUrlParam
3668 {
3669 public:
3670     /** Flags to specify with <tt>GetNotificationsUrlParam::SetFlags</tt>. */
3671     enum
3672     {
3673         FLAG_NONE = 0,                              /*!< The default flag value. */
3674         FLAG_FILTER_BY_DIRECT_MESSAGE = (1<<0),     /*!< Notification flag for direct messages. */
3675         FLAG_END,
3676     };
3677 
3678     /** Instantiates the object. */
3679     GetNotificationsUrlParam();
3680 
3681     /**
3682      *  Sets flags. <br/>
3683      *  This setting is not required.
3684      *
3685      *  @param[in] flags  Flags defined in the <tt>@ref GetNotificationsUrlParam</tt> class.<br/>
3686      *
3687      *                       The following flags can be used. <br/>
3688      *                       @ref GetNotificationsUrlParam::FLAG_FILTER_BY_DIRECT_MESSAGE <br/>
3689      *
3690      *  @retval ResultSuccess  Indicates success.
3691      *  @retval ResultInvalidParameter  Invalid flags have been set.
3692      */
3693     nn::Result SetFlags(const u32 flags);
3694 
3695 private:
3696     /// @cond
3697     u32 flags;                          /*!< Sets flags. */
3698     u8 reserved[60];
3699 
3700     friend class internal::Main;
3701     /// @endcond
3702 };
3703 
3704 /**
3705  * Parameters used when starting the Miiverse service.
3706  *
3707  *  All member functions can be called even in offline mode. <br/>
3708  *  All member functions are thread-safe.
3709  */
3710 class StartPortalAppParam
3711 {
3712 public:
3713     /**
3714      * Flags to specify with <tt>StartPortalAppParam::SetFlags</tt>. <br/>
3715      * Only one can be specified.  <br/>
3716      * You can use this setting to determine the startup mode of the Miiverse application. <br/>
3717      * Values other than <tt>@ref FLAG_DIRECT_MESSAGE</tt> are set automatically by the following setter methods.
3718      */
3719     enum {
3720         FLAG_NONE = 0,                //!< The default flag value. <br/>
3721         FLAG_COMMUNITY_ID   = (1<<0), //!< Flag for starting the Miiverse service with a specified community ID. <br/>
3722                                       //!< A community ID must be specified by <tt>@ref SetCommunityId</tt>. <br/>
3723                                       //!< Can also be used together with <tt>SetTopicTag</tt> to attach a topic tag when starting. <br/>
3724         FLAG_POST_ID        = (1<<1), //!< Flag for starting the Miiverse service with a specified post ID. <br/>
3725                                       //!< A post ID must be specified by <tt>SetPostId</tt>. <br/>
3726         FLAG_USER_PID       = (1<<2), //!< Flag for starting the Miiverse service with a specified user's principal ID. <br/>
3727                                       //!< A principal ID must be specified by <tt>SetUserPid</tt>. <br/>
3728         FLAG_DIRECT_MESSAGE = (1<<3), //!< Flag for starting the Miiverse service for the purpose of direct messaging.
3729         FLAG_END,
3730     };
3731 
3732 public:
3733     /** Instantiates the object. */
3734     StartPortalAppParam();
3735 
3736     /**
3737      *  Sets a community ID. <br/>
3738      *  This setting is not required. <br/>
3739      *  <tt>@ref FLAG_COMMUNITY_ID</tt> is set internally.
3740      *
3741      *  @param[in] id  Specifies the ID.
3742      *
3743      *  @retval ResultSuccess  Indicates success.
3744      */
3745     nn::Result SetCommunityId(const u32 id);
3746 
3747     /**
3748      *  Sets a post ID. <br/>
3749      *  This setting is not required. <br/>
3750      * <tt>@ref FLAG_POST_ID</tt> is set internally.
3751      *
3752      *  @param[in] postId  Specifies a text string representing the post ID. <br/>
3753      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH</tt>.
3754      *
3755      *  @retval ResultSuccess  Indicates success.
3756      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3757      *  @retval ResultInvalidSize  Indicates that the string exceeds <tt>@ref nn::olv::POST_ID_MAX_LENGTH</tt> characters.
3758      */
3759     nn::Result SetPostId(const char* postId);
3760 
3761     /**
3762      *  Sets a principal ID. <br/>
3763      *  This setting is not required. <br/>
3764      *  <tt>@ref FLAG_USER_PID</tt> is set internally.
3765      *
3766      *  @param[in] userPid  Specifies the principal ID being set.
3767      *
3768      *  @retval ResultSuccess  Indicates success.
3769      */
3770     nn::Result SetUserPid(const u32 userPid);
3771 
3772     /**
3773      *  Sets the launch flags. <br/>
3774      *  This setting is not required. <br/>
3775      *  If not set, the top page of the Miiverse application opens. <br/>
3776      *
3777      *  @param[in] flags  Flags defined in the <tt>@ref StartPortalAppParam</tt> class. (Specify only one of them.)<br/>
3778      *
3779      *                       The following flags can be used. <br/>
3780      *                       @ref StartPortalAppParam::FLAG_COMMUNITY_ID <br/>
3781      *                       @ref StartPortalAppParam::FLAG_POST_ID <br/>
3782      *                       @ref StartPortalAppParam::FLAG_USER_PID <br/>
3783      *                       @ref StartPortalAppParam::FLAG_DIRECT_MESSAGE <br/>
3784      *
3785      *  @retval ResultSuccess  Indicates success.
3786      *  @retval ResultInvalidParameter  Indicates that one or more flags are invalid.
3787      */
3788     nn::Result SetFlags(const u32 flags);
3789 
3790     /**
3791      *  Sets a topic tag. <br/>
3792      *  This setting is not required. <br/>
3793      *  Encode the tag as <tt>UTF-16 BE</tt>.
3794      *
3795      *  Starting the application with an attached topic tag uses one of the following two patterns.<br/>
3796      *  [*] Specify the topic tag only.<br/>
3797      *  [*] Specify both the community ID and the topic tag.<br/>
3798      * There are two patterns. (Other patterns are ignored.)<br/>
3799      *  To specify a community ID, use <tt>@ref SetCommunityId</tt>.
3800      *
3801      *  @param[in] topicTag  Specifies the topic tag string. (Set to <tt>NULL</tt> to clear the internal buffer.)<br/>
3802      *                          The maximum number of characters that can be specified is <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt>.
3803      *
3804      *  @retval ResultSuccess  Indicates success.
3805      *  @retval ResultInvalidSize  Indicates that the topic tag is longer than <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt> characters.
3806      */
3807     nn::Result SetTopicTag(const wchar_t* topicTag);
3808 
3809 protected:
3810     /// @cond
3811     u32 flags;                                  /*!< Sets flags. */
3812     u64 titleId;                                /*!< Specifies the title ID. */
3813     u32 communityId;                            /*!< Community ID. */
3814     u32 userPid;                                /*!< User ID. */
3815     s8  postId[POST_ID_BUFF_LENGTH];            /*!< Post ID. */
3816     char redirect[1024];                        /*!< Internally processed text. */
3817     u16 topicTag
3818         [TOPIC_TAG_BUFF_LENGTH];                /*!< Topic tag. */
3819     u8 reserved[2712];
3820 
3821     friend class internal::Main;
3822     /// @endcond
3823 };
3824 
3825 /**
3826  * Parameters used when uploading posts via the posting applet.
3827  *
3828  *   Inherited by <tt>@ref UploadDirectMessageDataByPostAppParam</tt>, which is the parameter when uploading a direct message data via the posting applet.
3829  *
3830  *  All member functions can be called even in offline mode. <br/>
3831  */
3832 class UploadPostDataByPostAppParam : public UploadPostDataParam
3833 {
3834 public:
3835     /** Flags to specify with <tt>UploadPostDataByPostAppParam::SetFlags</tt> and <tt>UploadDirectMessageDataByPostAppParam::SetFlags</tt>. */
3836     enum
3837     {
3838         FLAG_NONE            = 0,                                //!< The default flag value.
3839         FLAG_ONLY_SPOILER    = UPLOAD_FLAG_VALUE_SPOILER,        //!< The flag specified when the post includes spoilers. <br/>
3840                                                                  //!< Invalid if specified using <tt>UploadDirectMessageDataByPostAppParam::SetFlags</tt>.
3841         FLAG_APP_STARTABLE   = UPLOAD_FLAG_VALUE_APP_STARTABLE,  //!< The flag specified for a post when an application jump is possible from post data in the Miiverse application. <br/>
3842                                                                  //!< Invalid if specified using <tt>UploadDirectMessageDataByPostAppParam::SetFlags</tt>.
3843         FLAG_ONLY_BODY_TEXT  = UPLOAD_FLAG_VALUE_ONLY_BODY_TEXT, //!< This flag restricts what can be input with the posting applet to only text data.
3844         FLAG_ONLY_BODY_MEMO  = UPLOAD_FLAG_VALUE_ONLY_BODY_MEMO, //!< This flag restricts what can be input with the posting applet to only handwritten memo data.
3845     };
3846 
3847     /** Flags to specify with <tt>UploadPostDataByPostAppParam::SetStampData</tt>. */
3848     enum
3849     {
3850         STAMP_FLAG_NONE    = STAMP_FLAG_VALUE_NONE,      /*!< The state when no flags are specified. */
3851         STAMP_FLAG_INVALID = STAMP_FLAG_VALUE_INVALID    /*!< The flag that indicates that the stamp is invalid (and cannot be selected). */
3852     };
3853 
3854 public:
3855     /** Instantiates the object. */
3856     UploadPostDataByPostAppParam();
3857     /** Destructor. */
3858     ~UploadPostDataByPostAppParam();
3859 
3860     /**
3861      * Specifies the maximum length of the text string. <br/>
3862      * Does not need to be specified. If not specified, the maximum length defaults to 100 characters.
3863      *
3864      *  @param[in] bodyTextMaxLength ... The length of the string being set for text data. <br/>
3865      *                                   You can specify a value in the range of <tt>1</tt> to <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
3866      *
3867      *  @retval ResultSuccess  Indicates success.
3868      *  @retval ResultInvalidParameter  Indicates that the size is greater than <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
3869      */
3870     nn::Result SetBodyTextMaxLength(const u32 bodyTextMaxLength);
3871 
3872     /**
3873      *  Sets flags. <br/>
3874      *  This setting is not required.
3875      *
3876      *  @param[in] flags  Flags defined in the <tt>@ref UploadPostDataByPostAppParam</tt> class.<br/>
3877      *
3878      *                       The following flags can be used. <br/>
3879      *                       @ref UploadPostDataByPostAppParam::FLAG_ONLY_SPOILER <br/>
3880      *                       @ref UploadPostDataByPostAppParam::FLAG_APP_STARTABLE <br/>
3881      *                       @ref UploadPostDataByPostAppParam::FLAG_ONLY_BODY_TEXT <br/>
3882      *                       @ref UploadPostDataByPostAppParam::FLAG_ONLY_BODY_MEMO <br/>
3883      *
3884      *  @retval ResultSuccess  Indicates success.
3885      *  @retval ResultInvalidParameter  Indicates that one or more flags are invalid.
3886      */
3887     nn::Result SetFlags(const u32 flags);
3888 
3889     /**
3890      *  Sets the work buffers used to set data in the posting applet. <br/>
3891      *  This setting is required if additional information is being added with <tt>@ref SetStampData</tt> or <tt>@ref AddYoutubeMovieData</tt>. <br/>
3892      *  You must allocate a work buffer of the size, in bytes, specified by <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt> (1 MB). <br/>
3893      *
3894      *  @param[in] work  Specifies the start address of the work buffer.
3895      *  @param[in] workSize  Specifies the work buffer size. (Specify <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>.)
3896      *
3897      *  @retval ResultSuccess  Indicates success.
3898      *  @retval ResultNotInitialized  Indicates that the library is not initialized.
3899      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
3900      *  @retval ResultInvalidSize  Indicates that the <span class="argument">workSize</span> parameter is set to something other than <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>.
3901      */
3902     nn::Result SetWork(u8* work, const u32 workSize);
3903 
3904     /**
3905      *  Sets video data in the posting applet. <br/>
3906      *  This setting is not required. <br/>
3907      *  Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br/>
3908      *  If you are using this function to set video data, you cannot use the <tt>@ref SetExternalUrl</tt> function or the <tt>@ref SetExternalImageData</tt> function.
3909      *
3910      *  The combined size of video information and stamp data must not exceed 900 KB. <br/>
3911      *  Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB.
3912      *
3913      *  @param[in] movieData  The video information data.
3914      *  @param[in] movieDataSize  The size of the video information data.
3915      *
3916      *  @retval ResultSuccess  Indicates success.
3917      *  @retval ResultTooMuchData  Indicates that you cannot add any more data.
3918      *  @retval ResultInvalidPointer  Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured.
3919      *  @retval ResultInvalidSize  Indicates that data could not be inserted. (For example, there was not enough remaining memory left.)
3920      */
AddYoutubeMovieData(const u8 * movieData,const u32 movieDataSize)3921     nn::Result AddYoutubeMovieData(const u8* movieData , const u32 movieDataSize)
3922     {
3923         if(GetDataTypeNum(DATA_TYPE_YOUTUBE_MOVIE_DATA) >= YOUTUBE_MOVIE_DATA_MAX_NUM)
3924         {
3925             // A video has already been added.
3926             return nn::olv::ResultTooMuchData();
3927         }
3928         return AddCommonData(DATA_TYPE_YOUTUBE_MOVIE_DATA, movieData, movieDataSize) ;
3929     }
3930 
3931     /**
3932      *  Adds a stamp used by the posting applet. <br/>
3933      *  This setting is not required. <br/>
3934      *  Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br/>
3935      *  Stamp data set using this member function is compressed at the time it is added. <br/>
3936      *  The combined size of the compressed stamp data and video information data must not exceed 900 KB. <br/>
3937      *  Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB.
3938      *
3939      *  @param[in]  stampData  Specifies the stamp data.
3940      *  @param[in] stampDataSize  Specifies the size of the stamp data.
3941      *  @param[in] stampFlags    ... Flags (<tt>STAMP_FLAG_*</tt>) that represent attributes of stamps defined in the <tt>@ref UploadPostDataByPostAppParam</tt> class. <br/>
3942      *                               If you specify <tt>@ref STAMP_FLAG_INVALID</tt>, stamps cannot be selected in the posting applet.
3943      *
3944      *  @retval ResultSuccess  Indicates success.
3945      *  @retval ResultTooMuchData  Indicates that you cannot add any more data.
3946      *  @retval ResultInvalidPointer  Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured.
3947      *  @retval ResultInvalidSize  Indicates that data could not be inserted. (For example, there was not enough remaining memory left.)
3948      *  @retval ResultInvalidParameter  Indicates that unusable data was passed in.
3949      *  @retval ResultInvalidFormat  Indicates that the stamp format is invalid.
3950      */
3951     nn::Result SetStampData(const u8* stampData, const u32 stampDataSize, const u32 stampFlags = 0)
3952     {
3953         return UploadParamBase::SetStampData(stampData, stampDataSize, stampFlags);
3954     }
3955 
3956     /**
3957      *  Gets the number of stamps configured.
3958      *
3959      *  @param[in] stampFlags    ... Flags (<tt>STAMP_FLAG_*</tt>) that represent attributes of stamps defined in the <tt>@ref UploadPostDataByPostAppParam</tt> class.
3960      *
3961      *  @return Returns the number of pieces of stamp data that are set, or <tt>0</tt> if the flags are invalid.
3962      */
GetStampDataNum(const u32 stampFlags)3963     u32 GetStampDataNum(const u32 stampFlags) const
3964     {
3965         return UploadParamBase::GetStampDataNum(stampFlags);
3966     }
3967 
3968 private:
3969     /// @cond
3970     /**
3971      *  Gets the number of stamps configured.
3972      *
3973      *  @return Returns the number of stamps configured.
3974      */
3975     u32 GetStampDataNum() const;
3976 
3977     /**
3978      *  Gets the amount of memory being used by configured stamps.
3979      *
3980      *  @return Returns the amount of memory being used by configured stamps.
3981      */
3982     u32 GetStampDataListSize() const;
3983 
3984     /**
3985      *  Adds a stamp used by the posting applet. <br/>
3986      *  Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br/>
3987      *  Stamp data set using this member function is compressed at the time it is added. <br/>
3988      *  Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br/>
3989      *  Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB.
3990      *
3991      *  @param[in]  stampData  Specifies the stamp data.
3992      *  @param[in] stampDataSize  Specifies the size of the stamp data.
3993      *
3994      *  @retval ResultSuccess  Indicates success.
3995      *  @retval ResultTooMuchData  Indicates that you cannot add any more data.
3996      *  @retval ResultInvalidPointer  Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured.
3997      *  @retval ResultInvalidSize  Indicates that data could not be inserted. (For example, there was not enough remaining memory left.)
3998      *  @retval ResultInvalidParameter  Indicates that unusable data was passed in.
3999      *  @retval ResultInvalidFormat  Indicates that the stamp format is invalid.
4000      */
4001     nn::Result AddStampData(const u8* stampData, const u32 stampDataSize);
4002     /// @endcond
4003 
4004 private:
4005     /// @cond
4006     u8 reserved[508];
4007 
4008     friend class internal::Main;
4009     /// @endcond
4010 };
4011 
4012 /**
4013  * Parameters used when uploading comments via the posting applet.
4014  *
4015  *  All member functions can be called even in offline mode. <br/>
4016  *  All member functions are thread-safe.
4017  */
4018 class UploadCommentDataByPostAppParam : public UploadCommentDataParam
4019 {
4020 public:
4021     /** Flags to specify with <tt>UploadCommentDataByPostAppParam::SetFlags</tt>. */
4022     enum
4023     {
4024         FLAG_NONE            = 0,                                /*!< The default flag value. */
4025         FLAG_ONLY_SPOILER    = UPLOAD_FLAG_VALUE_SPOILER,        /*!< The flag specified when the post includes spoilers. */
4026         FLAG_ONLY_BODY_TEXT  = UPLOAD_FLAG_VALUE_ONLY_BODY_TEXT, /*!< This flag restricts what can be input with the posting applet to only text data. */
4027         FLAG_ONLY_BODY_MEMO  = UPLOAD_FLAG_VALUE_ONLY_BODY_MEMO  /*!< This flag restricts what can be input with the posting applet to only handwritten memo data. */
4028     };
4029 
4030     /** Flags to specify with <tt>@ref SetStampData</tt>. */
4031     enum
4032     {
4033         STAMP_FLAG_NONE    = STAMP_FLAG_VALUE_NONE,      /*!< The state when no flags are specified. */
4034         STAMP_FLAG_INVALID = STAMP_FLAG_VALUE_INVALID    /*!< The flag that indicates that the stamp is invalid (and cannot be selected). */
4035     };
4036 
4037 public:
4038     /** Instantiates the object. */
4039     UploadCommentDataByPostAppParam();
4040 
4041     /**
4042      *  Specifies the maximum length of the text string. <br/>
4043      *  This setting is not required. <br/>
4044      *
4045      *  @param[in] bodyTextMaxLength ... The length of the string being set for text data. <br/>
4046      *                                   You can specify a value in the range of <tt>1</tt> to <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
4047      *
4048      *  @retval ResultSuccess  Indicates success.
4049      *  @retval ResultInvalidParameter  Indicates that the size is greater than <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>.
4050      */
4051     nn::Result SetBodyTextMaxLength(const u32 bodyTextMaxLength);
4052 
4053     /**
4054      *  Sets flags. <br/>
4055      *  This setting is not required.
4056      *
4057      *  @param[in] flags  Flags defined in the <tt>@ref UploadCommentDataByPostAppParam</tt> class.<br/>
4058      *
4059      *                       The following flags can be used. <br/>
4060      *                       @ref UploadCommentDataByPostAppParam::FLAG_ONLY_SPOILER <br/>
4061      *                       @ref UploadCommentDataByPostAppParam::FLAG_ONLY_BODY_TEXT <br/>
4062      *                       @ref UploadCommentDataByPostAppParam::FLAG_ONLY_BODY_MEMO <br/>
4063      *
4064      *  @retval ResultSuccess  Indicates success.
4065      *  @retval ResultInvalidParameter  Indicates that one or more flags are invalid.
4066      */
4067      nn::Result SetFlags(const u32 flags);
4068 
4069     /**
4070      *  Sets the work buffers used to set data in the posting applet. <br/>
4071      *  This setting is required if additional information is being added with <tt>@ref SetStampData</tt>. <br/>
4072      *  You must allocate a work buffer of the size, in bytes, specified by <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt> (1 MB). <br/>
4073      *
4074      *  @param[in] work  Specifies the start address of the work buffer.
4075      *  @param[in] workSize  Specifies the work buffer size. (Specify <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>.)
4076      *
4077      *  @retval ResultSuccess  Indicates success.
4078      *  @retval ResultNotInitialized  Indicates that the library is not initialized.
4079      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
4080      *  @retval ResultInvalidSize  Indicates that the <span class="argument">workSize</span> parameter is set to something other than <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>.
4081      */
4082     nn::Result SetWork(u8* work, const u32 workSize);
4083 
4084     /**
4085      *  Adds a stamp used by the posting applet. <br/>
4086      *  This setting is not required. <br/>
4087      *  Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br/>
4088      *  Stamp data set using this member function is compressed at the time it is added. <br/>
4089      *  Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br/>
4090      *  Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB.
4091      *
4092      *  @param[in]  stampData  Specifies the stamp data.
4093      *  @param[in] stampDataSize  Specifies the size of the stamp data.
4094      *  @param[in] stampFlags    ... Flags (<tt>STAMP_FLAG_*</tt>) that represent attributes of stamps defined in the <tt>@ref UploadCommentDataByPostAppParam</tt> class. <br/>
4095      *                               If you specify <tt>@ref STAMP_FLAG_INVALID</tt>, stamps cannot be selected in the posting applet.
4096      *
4097      *  @retval ResultSuccess  Indicates success.
4098      *  @retval ResultTooMuchData  Indicates that you cannot add any more data.
4099      *  @retval ResultInvalidPointer  Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured.
4100      *  @retval ResultInvalidSize  Indicates that data could not be inserted. (For example, there was not enough remaining memory left.)
4101      *  @retval ResultInvalidParameter  Indicates that unusable data was passed in.
4102      *  @retval ResultInvalidFormat  Indicates that the stamp format is invalid.
4103      */
4104     nn::Result SetStampData(const u8* stampData, const u32 stampDataSize, const u32 stampFlags = 0)
4105     {
4106         return UploadParamBase::SetStampData(stampData, stampDataSize, stampFlags);
4107     }
4108 
4109     /**
4110      *  Gets the number of stamps configured.
4111      *
4112      *  @param[in] stampFlags    ...  Flags that represent the stamp attributes (<tt>STAMP_FLAG_*</tt>) to get.
4113      *
4114      *  @return Returns the number of pieces of stamp data that are set, or <tt>0</tt> if the flags are invalid.
4115      */
GetStampDataNum(const u32 stampFlags)4116     u32 GetStampDataNum(const u32 stampFlags) const
4117     {
4118         return UploadParamBase::GetStampDataNum(stampFlags);
4119     }
4120 
4121 private:
4122     /// @cond
4123     /**
4124      *  Gets the number of stamps configured.
4125      *
4126      *  @return Returns the number of stamps configured.
4127      */
4128     u32 GetStampDataNum() const;
4129 
4130     /**
4131      *  Gets the amount of memory being used by configured stamps.
4132      *
4133      *  @return Returns the amount of memory being used by configured stamps.
4134      */
4135     u32 GetStampDataListSize() const;
4136 
4137     /**
4138      *  Adds a stamp used by the posting applet. <br/>
4139      *  Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br/>
4140      *  Stamp data set using this member function is compressed at the time it is added. <br/>
4141      *  Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br/>
4142      *  Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB.
4143      *
4144      *  @param[in]  stampData  Specifies the stamp data.
4145      *  @param[in] stampDataSize  Specifies the size of the stamp data.
4146      *
4147      *  @retval ResultSuccess  Indicates success.
4148      *  @retval ResultTooMuchData  Indicates that you cannot add any more data.
4149      *  @retval ResultInvalidPointer  Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured.
4150      *  @retval ResultInvalidSize  Indicates that data could not be inserted. (For example, there was not enough remaining memory left.)
4151      *  @retval ResultInvalidParameter  Indicates that unusable data was passed in.
4152      *  @retval ResultInvalidFormat  Indicates that the stamp format is invalid.
4153      */
4154     nn::Result AddStampData(const u8* stampData, const u32 stampDataSize);
4155     /// @endcond
4156 
4157 private:
4158     /// @cond
4159     u8 reserved[476];
4160 
4161     friend class internal::Main;
4162     /// @endcond
4163 };
4164 
4165 /**
4166  * Parameters used when uploading direct messages via the posting applet. <br/>
4167  *
4168  *
4169  *  All member functions can be called even in offline mode. <br/>
4170  *  All member functions are thread-safe.
4171  */
4172 class UploadDirectMessageDataByPostAppParam : public UploadPostDataByPostAppParam
4173 {
4174 public:
4175     /** The following flags cannot currently be used. */
4176     enum
4177     {
4178         FLAG_NONE = 0                    /*!< The default flag value. */
4179     };
4180 
4181     /** Flags to specify with <tt>UploadDirectMessageDataByPostAppParam::SetStampData</tt>. */
4182     enum
4183     {
4184         STAMP_FLAG_NONE    = STAMP_FLAG_VALUE_NONE,      /*!< The state when no flags are specified. */
4185         STAMP_FLAG_INVALID = STAMP_FLAG_VALUE_INVALID    /*!< The flag indicating that stamps are invalid (and cannot be selected). */
4186     };
4187 
4188 public:
4189     /** Instantiates the object. */
4190     UploadDirectMessageDataByPostAppParam();
4191 
4192     /**
4193      * Specifies the principal ID of the recipient. <br/>
4194      * This setting is required. <br/>
4195      *
4196      *  @param[in] userPid  The principal ID.
4197      *
4198      *  @retval ResultSuccess  Indicates success.
4199      *  @retval ResultInvalidParameter  Indicates that a value of 0 was specified.
4200      */
4201     nn::Result SetUserPid(u32 userPid);
4202 
4203     /**
4204      *  Sets the work buffers used to set data in the posting applet. <br/>
4205      *  This setting is required if additional information is being added with <tt>@ref SetStampData</tt> or <tt>@ref AddYoutubeMovieData</tt>. <br/>
4206      *  You must allocate a work buffer of the size, in bytes, specified by <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt> (1 MB). <br/>
4207      *
4208      *  @param[in] work  Specifies the start address of the work buffer.
4209      *  @param[in] workSize  Specifies the work buffer size. (Specify <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>.)
4210      *
4211      *  @retval ResultSuccess  Indicates success.
4212      *  @retval ResultNotInitialized  Indicates that the library is not initialized.
4213      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
4214      *  @retval ResultInvalidSize  Indicates that the <span class="argument">workSize</span> parameter is set to something other than <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>.
4215      */
4216     nn::Result SetWork(u8* work, const u32 workSize);
4217 
4218     /**
4219      *  Adds a stamp used by the posting applet. <br/>
4220      *  This setting is not required. <br/>
4221      *  Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br/>
4222      *  Stamp data set using this member function is compressed at the time it is added. <br/>
4223      *  Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br/>
4224      *  Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB.
4225      *
4226      *  @param[in]  stampData  Specifies the stamp data.
4227      *  @param[in] stampDataSize  Specifies the size of the stamp data.
4228      *  @param[in] stampFlags    ... Flags (<tt>STAMP_FLAG_*</tt>) that represent attributes of stamps defined in the <tt>@ref UploadDirectMessageDataByPostAppParam</tt> class. <br/>
4229      *                               If you specify <tt>@ref STAMP_FLAG_INVALID</tt>, stamps cannot be selected in the posting applet.
4230      *
4231      *  @retval ResultSuccess  Indicates success.
4232      *  @retval ResultTooMuchData  Indicates that you cannot add any more data.
4233      *  @retval ResultInvalidPointer  Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured.
4234      *  @retval ResultInvalidSize  Indicates that data could not be inserted. (For example, there was not enough remaining memory left.)
4235      *  @retval ResultInvalidParameter  Indicates that unusable data was passed in.
4236      *  @retval ResultInvalidFormat  Indicates that the stamp format is invalid.
4237      */
4238     nn::Result SetStampData(const u8* stampData, const u32 stampDataSize, const u32 stampFlags = 0)
4239     {
4240         return UploadParamBase::SetStampData(stampData, stampDataSize, stampFlags);
4241     }
4242 
4243     /**
4244      *  Gets the number of stamps configured. <br/>
4245      *  This setting is not required. <br/>
4246      *
4247      *  @param[in] stampFlags    ...  Flags that represent the stamp attributes (<tt>STAMP_FLAG_*</tt>) to get.
4248      *
4249      *  @return Returns the number of pieces of stamp data that are set, or <tt>0</tt> if the flags are invalid.
4250      */
GetStampDataNum(const u32 stampFlags)4251     u32 GetStampDataNum(const u32 stampFlags) const
4252     {
4253         return UploadParamBase::GetStampDataNum(stampFlags);
4254     }
4255 
4256 private:
4257     /// @cond
4258     /**
4259      *  Gets the number of stamps configured.
4260      *
4261      *  @return Returns the number of stamps configured.
4262      */
4263     u32 GetStampDataNum() const;
4264 
4265     /**
4266      *  Gets the amount of memory being used by configured stamps.
4267      *
4268      *  @return Returns the amount of memory being used by configured stamps.
4269      */
4270     u32 GetStampDataListSize() const;
4271 
4272     /**
4273      *  Adds a stamp used by the posting applet. <br/>
4274      *  Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br/>
4275      *  Stamp data set using this member function is compressed at the time it is added. <br/>
4276      *  Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br/>
4277      *  Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB.
4278      *
4279      *  @param[in]  stampData  Specifies the stamp data.
4280      *  @param[in] stampDataSize  Specifies the size of the stamp data.
4281      *
4282      *  @retval ResultSuccess  Indicates success.
4283      *  @retval ResultTooMuchData  Indicates that you cannot add any more data.
4284      *  @retval ResultInvalidPointer  Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured.
4285      *  @retval ResultInvalidSize  Indicates that data could not be inserted. (For example, there was not enough remaining memory left.)
4286      *  @retval ResultInvalidParameter  Indicates that unusable data was passed in.
4287      *  @retval ResultInvalidFormat  Indicates that the stamp format is invalid.
4288      */
4289     nn::Result AddStampData(const u8* stampData, const u32 stampDataSize);
4290     /// @endcond
4291 
4292 private:
4293     /// @cond
4294     u32 userPid;         /*!< Specifies the principal ID of the target user. */
4295     u8 reserved[502];
4296 
4297     friend class internal::Main;
4298     /// @endcond
4299 };
4300 
4301 /**
4302  * The parameter storing the data passed from the Miiverse application when there was a jump from the Miiverse application. <br/>
4303  *
4304  *
4305  *  All member functions can be called even in offline mode. <br/>
4306  *  All member functions are thread-safe.
4307  */
4308 class MainAppParam
4309 {
4310 public:
4311     /** Flags to specify with <tt>MainAppParam::TestFlags</tt>. */
4312     enum {
4313         FLAG_COMMUNITY_ID  = (1<<0),  /*!< Start from the specified community. */
4314         FLAG_POST_ID       = (1<<1),  /*!< Start from the specified post ID (and from the community to which the post belongs). */
4315         FLAG_WITH_APP_DATA = (1<<2),  /*!< The flag for checking whether a post includes application data. */
4316     };
4317 
4318 public:
4319     /** Instantiates the object. */
4320     MainAppParam();
4321 
4322     /**
4323      *  Checks flags. <br/>
4324      *  This function determines which types of data are included. <br/>
4325      *  The following data can be downloaded depending on the flags specified. <br/>
4326      *
4327      *  @param[in] flags  Flags defined in the <tt>@ref MainAppParam</tt> class.<br/>
4328      *
4329      *                       The following flags can be used. <br/>
4330      *                       @ref MainAppParam::FLAG_COMMUNITY_ID <br/>
4331      *                       @ref MainAppParam::FLAG_POST_ID <br/>
4332      *                       @ref MainAppParam::FLAG_WITH_APP_DATA <br/>
4333      *
4334      *  @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise.
4335      */
4336     bool TestFlags(const u32 flags) const;
4337 
4338     /**
4339      *  Downloads a community ID. <br/>
4340      *  Can get a valid value if <tt>@ref FLAG_COMMUNITY_ID</tt> or <tt>@ref FLAG_POST_ID</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
4341      *
4342      *
4343      *  @return Returns the community ID.
4344      */
4345     u32 GetCommunityId() const;
4346 
4347     /**
4348      *  Gets the post ID (a text string used to uniquely identify the post). <br/>
4349      *  Can get a valid value if <tt>@ref FLAG_POST_ID</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
4350      *
4351      *
4352      *  @return Returns the post ID.
4353      */
4354     const char* GetPostId() const;
4355 
4356     /**
4357      *  Gets application data. <br/>
4358      *  Can get a valid value if <tt>@ref FLAG_WITH_APP_DATA</tt> has been specified by <tt> @ref TestFlags</tt> and <tt>true</tt> is returned. <br/>
4359      *
4360      *
4361      *  @param[out] appData  Specifies the buffer for storing application data.
4362      *  @param[out] appDataSize  Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.)
4363      *  @param[in] appDataMaxSize  Specifies the size of the buffer for storing the application data.
4364      *
4365      *  @retval ResultSuccess  Indicates success.
4366      *  @retval ResultInvalidPointer  Indicates that <tt>NULL</tt> was specified.
4367      *  @retval ResultInvalidSize  Indicates that <tt>0</tt> was specified for <tt>appDataMaxSize</tt>.
4368      *  @retval ResultNotExistData  Indicates that the data was not found.
4369      */
4370     nn::Result GetAppData(u8* appData, u32* appDataSize, const u32 appDataMaxSize) const;
4371 
4372     /**
4373      *  Gets the size of the application data.
4374      *
4375      *  @return Returns the size of the application data.
4376      */
4377     u32 GetAppDataSize(void) const;
4378 
4379 private:
4380     /// @cond
4381     u32 flags;
4382     u32 communityId;
4383     s8 postId[nn::olv::POST_ID_BUFF_LENGTH];
4384     u8 appData[nn::olv::APP_DATA_MAX_SIZE];
4385     u32 appDataSize;
4386     u8 reserved[3028];
4387 
4388     friend class internal::Main;
4389     /// @endcond
4390 };
4391 
4392 
4393 /** @} */
4394 
4395 }
4396 }   // end of namespace
4397 
4398 #endif
4399