1 /*---------------------------------------------------------------------------* 2 3 Project: OLV 4 File: olv_Types.h 5 6 Copyright (C) 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 /// nn 32 namespace nn { 33 34 /// olv 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. 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 an 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 flag can be used. <br /> 81 * <tt>@ref InitializeParam::FLAG_OFFLINE_MODE</tt> 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 <var>work</var> is <tt>NULL</tt>. 97 * @retval ResultInvalidSize Indicates that <var>workSize</var> 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. 106 * @li <tt>@ref nn::olv::REPORT_TYPE_MEMORY</tt> 107 * @li <tt>@ref nn::olv::REPORT_TYPE_RESPONSE</tt> 108 * 109 * You do not need to call this function if you are using these settings. <br /> 110 * No matter what combination of settings is specified, you must specify <tt>@ref nn::olv::REPORT_TYPE_INFO</tt>. 111 * 112 * @param[in] flags Specifies the output flags. 113 * 114 * @retval ResultSuccess Indicates success. 115 116 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 <var>args</var> is <tt>NULL</tt>. 129 * @retval ResultInvalidSize Indicates that <var>argsSize</var> 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). 151 * 152 * All member functions can be called even in offline mode. <br /> 153 * All member functions are thread-safe. 154 155 156 */ 157 class UploadParamBase 158 { 159 public: 160 /** Instantiates an object. */ 161 UploadParamBase(); 162 163 /** Destroys the object. */ 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 * You must set either text data or handwritten memo data. <br /> 181 * 182 * @param[in] bodyText Specifies the text. (Set to <tt>NULL</tt> to clear the buffer.) The maximum number of characters that can be specified is <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>. 183 * 184 * @retval ResultSuccess Indicates success. 185 * @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>. 186 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 * Only the start address is passed in; the data is not copied. 210 * 211 * @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.) 212 * @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>.) 213 * 214 * @retval ResultSuccess Indicates success. 215 * @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>. 216 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 * Image attachment data can be up to <tt>@ref nn::olv::EXTERNAL_IMAGE_DATA_MAX_SIZE</tt> bytes, thumbnail image data up to <tt>@ref nn::olv::EXTERNAL_THUMBNAIL_IMAGE_DATA_MAX_SIZE</tt> bytes, and the combination of both types of image data up to <tt>@ref nn::olv::EXTERNAL_IMAGE_DATA_TOTAL_MAX_SIZE</tt> bytes. <br /> 244 * Only the start address is passed in; the data is not copied. <br /> 245 * Clear the data by setting both <var>externalImageData</var> and <var>externalThumbnailImageData</var> to <tt>NULL</tt>. <br /> 246 * When the data is cleared, the values set in <var>externalImageDataSize</var> and <var>externalThumbnailImageDataSize</var> are ignored. 247 * 248 * @param[in] externalImageData Specifies the starting address of the image attachment data. 249 * @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>.) 250 * @param[in] externalThumbnailImageData Specifies the starting address of the thumbnail attachment data. 251 * @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>.) 252 * 253 * @retval ResultSuccess Indicates success. 254 * @retval ResultInvalidSize Indicates that the size was set to <tt>0</tt> or the size of the image data exceeds the maximum. 255 * @retval ResultInvalidPointer Indicates that either the image attachment data or the thumbnail data was set to <tt>NULL</tt>. 256 257 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. (Set the encoding to <tt>UTF-16 BE</tt>.) You can specify up to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM</tt> search keys. 283 * 284 * @param[in] searchKey Specifies the search key string. (To clear the internal buffer, specify <tt>NULL</tt>.) The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>. 285 * @param[in] index Specifies the search key index. <br /> 286 * You can specify a value in the range of <tt>0</tt> to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM - 1</tt>. 287 * 288 * @retval ResultSuccess Indicates success. 289 * @retval ResultInvalidSize Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters. 290 291 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.) The maximum number of characters that can be specified is <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt>. 301 * 302 * @retval ResultSuccess Indicates success. 303 * @retval ResultInvalidSize Indicates that the topic tag is longer than <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt> characters. 304 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.) The maximum number of characters that can be specified is <tt>@ref nn::olv::EXTERNAL_URL_MAX_LENGTH</tt>. 314 * 315 * @retval ResultSuccess Indicates success. 316 * @retval ResultInvalidSize Indicates that the URL is longer than <tt>@ref nn::olv::EXTERNAL_URL_MAX_LENGTH</tt> characters. 317 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 <var>workSize</var> 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.) 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.) 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 * 495 * @note Contact Nintendo support if you plan on using this class for anything other than debugging. (Its use is normally prohibited in retail versions of products.)<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 an 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.) The maximum number of characters that can be specified is <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt>. 533 * 534 * @retval ResultSuccess Indicates success. 535 * @retval ResultInvalidSize Indicates that the topic tag is longer than <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt> characters. 536 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.) The maximum number of characters that can be specified is <tt>@ref nn::olv::EXTERNAL_URL_MAX_LENGTH</tt>. 546 * 547 * @retval ResultSuccess Indicates success. 548 * @retval ResultInvalidSize Indicates that the URL is longer than <tt>@ref nn::olv::EXTERNAL_URL_MAX_LENGTH</tt> characters. 549 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. (Set the encoding to <tt>UTF-16 BE</tt>.) You can specify up to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM</tt> search keys. 557 * 558 * @param[in] searchKey Specifies the search key string. (To clear the internal buffer, specify <tt>NULL</tt>.) The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>. 559 * @param[in] index Specifies the search key index. <br /> 560 * You can specify a value in the range of <tt>0</tt> to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM - 1</tt>. 561 * 562 * @retval ResultSuccess Indicates success. 563 * @retval ResultInvalidSize Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters. 564 565 566 */ 567 nn::Result SetSearchKey(const wchar_t* searchKey, const u8 index); 568 569 /** 570 * Sets flags. 571 * This setting is not required. 572 * 573 * @param[in] flags Flags defined in the <tt>@ref UploadPostDataParam</tt> class.<br/> 574 * The following flags can be used. 575 * @li <tt>@ref UploadPostDataParam::FLAG_SPOILER</tt> 576 * @li <tt>@ref UploadPostDataParam::FLAG_APP_STARTABLE</tt> 577 * @li <tt>@ref UploadPostDataParam::FLAG_DELETE</tt> 578 * 579 * @retval ResultInvalidParameter Indicates that one or more flags are invalid. 580 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 an 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 * @note Contact Nintendo support if you plan on using this class for anything other than debugging. (Its use is normally prohibited in retail versions of products.)<br /> 657 * (The inherited class <tt>@ref nn::olv::UploadDirectMessageDataByPostAppParam</tt> can be used in the retail version. ) <br /> 658 * 659 * All member functions can be called even in offline mode. <br /> 660 * All member functions are thread-safe. 661 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 an 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. (Set the encoding to <tt>UTF-16 BE</tt>.) You can specify up to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM</tt> search keys. 697 * 698 * @param[in] searchKey Specifies the search key string. (To clear the internal buffer, specify <tt>NULL</tt>.) The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>. 699 * @param[in] index Specifies the search key index. <br /> 700 * You can specify a value in the range of <tt>0</tt> to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM - 1</tt>. 701 * 702 * @retval ResultSuccess Indicates success. 703 * @retval ResultInvalidSize Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters. 704 705 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 * The following flag can be used. 715 * @li <tt>@ref UploadDirectMessageDataParam::FLAG_DELETE</tt> 716 * 717 * @retval ResultSuccess Indicates success. 718 * @retval ResultInvalidParameter Indicates that one or more flags are invalid. 719 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.) The maximum number of characters that can be specified is <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt>. 728 * 729 * @retval ResultSuccess Indicates success. 730 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 731 * @retval ResultInvalidParameter Indicates that an empty string was specified. 732 * @retval ResultInvalidSize Indicates that the string exceeds <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt> characters. 733 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 an 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.) The maximum number of characters that can be specified is <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt>. 771 * 772 * @retval ResultSuccess Indicates success. 773 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 774 * @retval ResultInvalidParameter Indicates that an empty string was specified. 775 * @retval ResultInvalidSize Indicates that the string exceeds <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt> characters. 776 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. 785 * @note Contact Nintendo support if you plan on using this class for anything other than debugging. (Its use is normally prohibited in retail versions of products.)<br /> 786 * (The inherited class <tt>@ref nn::olv::UploadCommentDataByPostAppParam</tt> can be used in the retail version. ) <br /> 787 * 788 * It is inherited by <tt>@ref UploadCommentDataByPostAppParam</tt>, which is the parameter when uploading comment data via the posting applet. 789 * 790 * All member functions can be called even in offline mode. 791 * All member functions are thread-safe. 792 * 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 an 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. 819 * The following flags can be used. 820 * @li <tt>@ref UploadCommentDataParam::FLAG_SPOILER</tt> 821 * @li <tt>@ref UploadCommentDataParam::FLAG_DELETE</tt> 822 * 823 * @retval ResultSuccess Indicates success. 824 * @retval ResultInvalidParameter Indicates that one or more flags are invalid. 825 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 an 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 an 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 * The following flag can be used. 935 * @li <tt>@ref UploadEmpathyToPostDataParam::FLAG_REMOVE</tt> 936 * 937 * @retval ResultSuccess Indicates success. 938 * @retval ResultInvalidParameter Indicates that one or more flags are invalid. 939 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 an 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 * The following flag can be used. 980 * @li <tt>@ref UploadCommunityDataParam::FLAG_DELETE</tt> 981 * 982 * @retval ResultSuccess Indicates success. 983 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.) Use UTF-16LE for the encoding. <br /> 1032 * The maximum number of characters that can be specified is <tt>@ref nn::olv::DESCRIPTION_TEXT_MAX_LENGTH</tt>. 1033 * 1034 * @retval ResultSuccess Indicates success. 1035 * @retval ResultInvalidSize Indicates that the string exceeds <tt>@ref nn::olv::DESCRIPTION_TEXT_MAX_LENGTH</tt> characters. 1036 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 an 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 * The following flag can be used. 1104 * @li <tt>@ref UploadFavoriteToCommunityDataParam::FLAG_REMOVE</tt> 1105 * 1106 * @retval ResultSuccess Indicates success. 1107 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 an 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 * The following flag can be used. 1175 * @li <tt>@ref UploadFollowToUserDataParam::FLAG_REMOVE</tt> 1176 * 1177 * @retval ResultSuccess Indicates success. 1178 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. 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 the <tt>@ref SetSearchPid</tt> function is used to specify a principal ID. <br /> 1226 //!< This flag is disabled if the <tt>@ref SetPostId</tt> function is used to specify a post ID. <br /> 1227 FLAG_FILTER_BY_SELF = (1<<2), //!< Downloads one's own posts. <br /> 1228 //!< This flag is disabled if the <tt>@ref SetSearchPid</tt> function is used to specify a principal ID. <br /> 1229 //!< This flag is disabled if the <tt>@ref SetPostId</tt> function is used to specify a post ID. <br /> 1230 // Specifies whether the body type is <var>bodyText</var> or <var>bodyMemo</var>. 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 to use a combination of flags. 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) //!< Also downloads posts with spoilers and posts with spoilers in review. 1240 //FLAG_RESERVED0 = (1<<9), 1241 //FLAG_RESERVED1 = (1<<10), 1242 }; 1243 1244 public: 1245 /** Instantiates an 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 * The following flags can be used. 1254 * @li <tt>@ref DownloadPostDataListParam::FLAG_FILTER_BY_FRIEND</tt> 1255 * @li <tt>@ref DownloadPostDataListParam::FLAG_FILTER_BY_FOLLOW</tt> 1256 * @li <tt>@ref DownloadPostDataListParam::FLAG_FILTER_BY_SELF</tt> 1257 * @li <tt>@ref DownloadPostDataListParam::FLAG_FILTER_BY_BODY_TEXT</tt> 1258 * @li <tt>@ref DownloadPostDataListParam::FLAG_FILTER_BY_BODY_MEMO</tt> 1259 * @li <tt>@ref DownloadPostDataListParam::FLAG_DISTINCT_PID</tt> 1260 * @li <tt>@ref DownloadPostDataListParam::FLAG_WITH_MII_DATA</tt> 1261 * @li <tt>@ref DownloadPostDataListParam::FLAG_WITH_EMPATHY_ADDED</tt> 1262 * @li <tt>@ref DownloadPostDataListParam::FLAG_WITH_SPOILER</tt> 1263 * 1264 * @retval ResultSuccess Indicates success. 1265 * @retval ResultInvalidParameter Indicates that a principal ID other than <tt>0</tt> was specified in <tt>@ref SetSearchPid</tt>. 1266 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>.) The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>. 1303 * 1304 * @retval ResultSuccess Indicates success. 1305 * @retval ResultInvalidSize Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters. 1306 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.) The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH</tt>. 1333 * @param[in] index Index number of the post ID to set. <br /> 1334 * The range of values that can be specified is from <tt>0</tt> to <tt>@ref nn::olv::POST_ID_MAX_NUM - 1</tt>. 1335 * 1336 * @retval ResultSuccess Indicates success. 1337 * @retval ResultInvalidParameter Indicates that the text string exceeds <tt>@ref nn::olv::POST_ID_MAX_NUM</tt> characters. 1338 * @retval ResultInvalidSize Indicates an invalid post ID string length. 1339 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 * Data posted on or before the specified date and time is downloaded. <br /> 1348 * 1349 * @param[in] postDate Specifies the post date and time. (To clear the setting, specify <tt>0</tt>.) 1350 * 1351 * @retval ResultSuccess Indicates success. 1352 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 <var>downloadPostDataMaxNum</var> 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>.) The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>. 1391 * @param[in] index Specifies the search key index. <br /> 1392 * You can specify a value in the range of <tt>0</tt> to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM - 1</tt>. 1393 * 1394 * @retval ResultSuccess Indicates success. 1395 * @retval ResultInvalidSize Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters. 1396 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. 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 <var>bodyText</var> or <var>bodyMemo</var>. 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 to use a combination of flags. 1471 FLAG_WITH_MII_DATA = (1<<3), //!< Downloads direct messages, including Mii character data. 1472 }; 1473 1474 public: 1475 /** Instantiates an 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 * The following flags can be used. 1484 * @li <tt>@ref DownloadDirectMessageDataListParam::FLAG_FILTER_BY_FRIEND</tt> 1485 * @li <tt>@ref DownloadDirectMessageDataListParam::FLAG_FILTER_BY_BODY_TEXT</tt> 1486 * @li <tt>@ref DownloadDirectMessageDataListParam::FLAG_FILTER_BY_BODY_MEMO</tt> 1487 * @li <tt>@ref DownloadDirectMessageDataListParam::FLAG_WITH_MII_DATA</tt> 1488 * 1489 * @retval ResultSuccess Indicates success. 1490 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>.) The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>. 1501 * 1502 * @retval ResultSuccess Indicates success. 1503 * @retval ResultInvalidSize Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters. 1504 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>. 1523 * (When you call this function, the maximum number to download is set to <tt>1</tt> if no value has been explicitly set.) 1524 * 1525 * @param[in] directMessageId The string to set for the direct message ID. (Specify <tt>NULL</tt> to clear the internal buffer.) The maximum number of characters that can be specified is <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt>. 1526 * 1527 * @retval ResultSuccess Indicates success. 1528 * @retval ResultInvalidParameter Indicates that an empty string was specified. 1529 * @retval ResultInvalidSize Indicates that the string exceeds <tt>@ref nn::olv::DIRECT_MESSAGE_ID_MAX_LENGTH</tt> characters. 1530 1531 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 * Data posted on or before the specified date and time is downloaded. <br /> 1540 * 1541 * @param[in] postDate Specifies the post date and time. (To clear the setting, specify <tt>0</tt>.) 1542 * 1543 * @retval ResultSuccess Indicates success. 1544 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 <var>directMessageDataListMaxSize</var> 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. (Set the encoding to <tt>UTF-16 BE</tt>.) You can specify up to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM</tt> search keys. 1580 * 1581 * @param[in] searchKey Specifies the search key string. (To clear the internal buffer, specify <tt>NULL</tt>.)<br/> 1582 * The maximum number of characters that can be specified is <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt>. 1583 * @param[in] index Specifies the search key index. <br /> 1584 * You can specify a value in the range of <tt>0</tt> to <tt>@ref nn::olv::SEARCH_KEY_MAX_NUM - 1</tt>. 1585 * 1586 * @retval ResultSuccess Indicates success. 1587 * @retval ResultInvalidSize Indicates that the search key is longer than <tt>@ref nn::olv::SEARCH_KEY_MAX_LENGTH</tt> characters. 1588 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. 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 <var>bodyText</var> or <var>bodyMemo</var>. 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 to use a combination of flags. 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) //!< Also downloads comments with spoilers and comments with spoilers in review. 1654 }; 1655 1656 public: 1657 /** Instantiates an 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 * The following flags can be used. 1666 * @li <tt>@ref DownloadCommentDataListParam::FLAG_FILTER_BY_BODY_TEXT</tt> 1667 * @li <tt>@ref DownloadCommentDataListParam::FLAG_FILTER_BY_BODY_MEMO</tt> 1668 * @li <tt>@ref DownloadCommentDataListParam::FLAG_DISTINCT_PID</tt> 1669 * @li <tt>@ref DownloadCommentDataListParam::FLAG_WITH_MII_DATA</tt> 1670 * @li <tt>@ref DownloadCommentDataListParam::FLAG_WITH_SPOILER</tt> 1671 * 1672 * @retval ResultSuccess Indicates success. 1673 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 * Data posted on or before the specified date and time is downloaded. <br /> 1709 * 1710 * @param[in] postDate Specifies the post date and time. (To clear the setting, specify <tt>0</tt>.) 1711 * 1712 * @retval ResultSuccess Indicates success. 1713 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 <var>commentDataListMaxSize</var> 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 <b>System Settings</b> 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. 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 the <tt>@ref SetCommunityId</tt> function is used to specify a community ID. <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 the <tt>@ref SetCommunityId</tt> function is used to specify a community ID. <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 an 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 * The following flags can be used. 1834 * @li <tt>@ref DownloadCommunityDataListParam::FLAG_FILTER_BY_FAVORITE</tt> 1835 * @li <tt>@ref DownloadCommunityDataListParam::FLAG_FILTER_BY_OFFICIAL</tt> 1836 * @li <tt>@ref DownloadCommunityDataListParam::FLAG_FILTER_BY_SELF</tt> 1837 * @li <tt>@ref DownloadCommunityDataListParam::FLAG_WITH_MII_DATA</tt> 1838 * @li <tt>@ref DownloadCommunityDataListParam::FLAG_WITH_ICON_DATA</tt> 1839 * 1840 * @retval ResultSuccess Indicates success. 1841 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 * (When you call this function, the maximum number to download is set to <tt>1</tt> if no value has been explicitly set.)<br/> 1850 * To specify more than one community ID, use the function with the same name but with an added parameter for indices. <br /> 1851 * (You cannot simultaneously use this function and the same-named function that has the added parameter for indices.) 1852 * 1853 * @param[in] communityId Specifies the community ID. 1854 * 1855 * @retval ResultSuccess Indicates success. 1856 * @retval ResultInvalidParameter Indicates that the community ID is not available. 1857 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 * (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 /> 1866 * You cannot simultaneously use this function and the function with the same name but no setting for indices. 1867 * 1868 * @param[in] communityId Specifies the community ID. 1869 * @param[in] index Specifies the community ID index. 1870 * 1871 * @retval ResultSuccess Indicates success. 1872 * @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>. 1873 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 <var>communityDataListMaxSize</var> 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 an 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 * The following flags can be used. 1959 * @li <tt>@ref DownloadUserDataListParam::FLAG_FRIEND_TO_USER</tt> 1960 * @li <tt>@ref DownloadUserDataListParam::FLAG_FOLLOW_TO_USER</tt> 1961 * @li <tt>@ref DownloadUserDataListParam::FLAG_EMPATHY_TO_POST</tt> 1962 * @li <tt>@ref DownloadUserDataListParam::FLAG_FAVORITE_TO_COMMUNITY</tt> 1963 * @li <tt>@ref DownloadUserDataListParam::FLAG_WITH_MII_DATA</tt> 1964 * 1965 * @retval ResultSuccess Indicates success. 1966 * @retval ResultInvalidParameter Indicates that mutually exclusive flags were specified. 1967 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>. 1992 * 1993 * @param[in] communityId Specifies the community ID. 1994 * 1995 * @retval ResultSuccess Indicates success. 1996 1997 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>. 2006 * 2007 * @param[in] postId Specifies a text string representing the post ID. <br /> 2008 * The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH</tt>. 2009 * 2010 * @retval ResultSuccess Indicates success. 2011 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2012 * @retval ResultInvalidParameter Indicates that an empty string was specified. 2013 * @retval ResultInvalidSize Indicates that the string exceeds <tt>@ref nn::olv::POST_ID_MAX_LENGTH</tt> characters. 2014 2015 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 <var>userDataListMaxSize</var> 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 an 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>. 2109 * 2110 * All member functions except for <tt>@ref DownloadExternalImageData</tt> are thread-safe and can be called even in offline mode. 2111 2112 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. The flag is not set for post data with spoilers that are under review. */ 2132 }; 2133 2134 public: 2135 /** Instantiates an object. */ 2136 DownloadedDataBase(); 2137 2138 /** Destroys the object. */ 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 * The following flags can be used. 2147 * @li <tt>@ref DownloadedDataBase::FLAG_WITH_BODY_TEXT</tt> 2148 * @li <tt>@ref DownloadedDataBase::FLAG_WITH_BODY_MEMO</tt> 2149 * @li <tt>@ref DownloadedDataBase::FLAG_WITH_EXTERNAL_IMAGE_DATA</tt> 2150 * @li <tt>@ref DownloadedDataBase::FLAG_WITH_EXTERNAL_BINARY_DATA</tt> 2151 * @li <tt>@ref DownloadedDataBase::FLAG_WITH_MII_DATA</tt> 2152 * @li <tt>@ref DownloadedDataBase::FLAG_WITH_EXTERNAL_URL</tt> 2153 * @li <tt>@ref DownloadedDataBase::FLAG_WITH_APP_DATA</tt> 2154 * @li <tt>@ref DownloadedDataBase::FLAG_EMPATHY_ADDED</tt> 2155 * @li <tt>@ref DownloadedDataBase::FLAG_SPOILER</tt> 2156 * 2157 * @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise. 2158 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. 2215 * 2216 * @return Returns the URL. 2217 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. 2224 * 2225 * @param[out] storeData Specifies a structure for storing the Mii character data. 2226 * 2227 * @retval ResultSuccess Indicates success. 2228 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2229 * @retval ResultNotExistData Indicates that the data was not found. 2230 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. 2237 * 2238 * @note Mii character nicknames may sometimes include characters that are not supported in the application. 2239 * @note When that occurs, you must handle it without adversely affecting the screen display or hindering the application's progress. 2240 * @note For more details, see the Nicknames and Creator Names section in the Wii U Guidelines. 2241 * 2242 * @return Returns the Mii character nickname. 2243 2244 2245 */ 2246 const wchar_t* GetMiiNickname() const; 2247 2248 /** 2249 * Gets text data. <br /> 2250 * 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. 2251 * 2252 * @note Text data may sometimes include characters that are not supported in the application. 2253 * @note When there are unsupported characters, you must handle it without adversely affecting the screen display or hindering the application's progress. <br /> 2254 * 2255 * @param[out] bodyText Specifies a buffer for storing the text data. 2256 * @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). 2257 * 2258 * @retval ResultSuccess Indicates success. 2259 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2260 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 2261 * @retval ResultNotExistData Indicates that the data was not found. 2262 2263 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. 2270 * 2271 * <b>Note:</b><br/> 2272 * Handwritten memos use the following data format. 2273 * @li TGA 1.0. (No color map. 32-bit color without RLE compression. Stored in BGRA order starting from the lower left. 320×120 pixels.) 2274 * @li Fixed-length 18-byte header (00 00 02 00 00 00 00 00 00 00 00 00 40 01 78 00 20 08). 2275 * 2276 * @param[out] bodyMemo Specifies a buffer for storing a handwritten memo. 2277 * @param[out] bodyMemoSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 2278 * @param[in] bodyMemoMaxSize Specifies the size of the buffer for storing the handwritten memo. 2279 * 2280 * @retval ResultSuccess Indicates success. 2281 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2282 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 2283 * @retval ResultNotExistData Indicates that the data was not found. 2284 * @retval ResultDataDecodeError Indicates that the attempt to decode the data failed. 2285 2286 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. 2300 * 2301 * @param[out] appData Specifies the buffer for storing application data. 2302 * @param[out] appDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 2303 * @param[in] appDataMaxSize Specifies the size of the buffer for storing the application data. 2304 * 2305 * @retval ResultSuccess Indicates success. 2306 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2307 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 2308 * @retval ResultNotExistData Indicates that the data was not found. 2309 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. 2316 * 2317 * @return Returns the size of the application data. 2318 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. 2326 * 2327 * @param[out] externalImageData Buffer for storing the image attachment. 2328 * @param[out] externalImageDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 2329 * @param[in] externalImageDataMaxSize Specifies the buffer for storing the image attachment. 2330 * 2331 * @retval ResultSuccess Indicates success. 2332 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2333 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 2334 * @retval ResultNotExistData Indicates that the data was not found. 2335 * @retval ResultOfflineMode Indicates that the object was initialized in offline mode. 2336 * @retval ResultMemoryAllocateError Indicates a failure to allocate memory. 2337 * @retval ResultCanceled Indicates that the action was canceled. 2338 * @retval ResultCurlError Indicates that a <tt>Curl</tt> function failed. 2339 * @retval ResultDataNotFound Indicates that the data was not found. 2340 * @retval ResultHttpError Indicates an HTTP error. 2341 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 * @return Returns the size of the image attachment. 2350 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. 2367 * 2368 * @param[out] externalBinaryData Buffer for storing the binary attachment. 2369 * @param[out] externalBinaryDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 2370 * @param[in] externalBinaryDataMaxSize Size of the buffer for storing the binary attachment. 2371 * 2372 * @retval ResultSuccess Indicates success. 2373 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2374 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 2375 * @retval ResultNotExistData Indicates that the data was not found. 2376 * @retval ResultOfflineMode Indicates that the object was initialized in offline mode. 2377 * @retval ResultMemoryAllocateError Indicates a failure to allocate memory. 2378 * @retval ResultCanceled Indicates that the action was canceled. 2379 * @retval ResultCurlError Indicates that a <tt>Curl</tt> function failed. 2380 * @retval ResultDataNotFound Indicates that the data was not found. 2381 * @retval ResultHttpError Indicates an HTTP error. 2382 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. 2389 * 2390 * @return Returns the size of the binary attachment. 2391 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. 2401 * 2402 * This function remains temporarily available for compatibility reasons. Its use is not recommended. <br /> 2403 * 2404 * Use the following function to get Mii character data. <br /> 2405 * <tt>nn::Result GetMiiData(FFLStoreData* storeData) const;</tt> 2406 * 2407 * @return Returns Mii character data. (Get it as type <tt>FFLStoreData</tt>.)<br/> 2408 * Returns <tt>NULL</tt> if the data does not exist. 2409 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 in offline mode. 2457 2458 */ 2459 class DownloadedPostData : public DownloadedDataBase 2460 { 2461 public: 2462 /** Instantiates an 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 in offline mode. 2508 2509 */ 2510 class DownloadedDirectMessageData : public DownloadedDataBase 2511 { 2512 public: 2513 /** Instantiates an 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 in offline mode. 2536 2537 */ 2538 class DownloadedCommentData : public DownloadedDataBase 2539 { 2540 public: 2541 /** Instantiates an 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 an 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 * The following flags can be used. 2589 * @li <tt>@ref DownloadedCommunityData::FLAG_WITH_TITLE_TEXT</tt> 2590 * @li <tt>@ref DownloadedCommunityData::FLAG_WITH_DESCRIPTION_TEXT</tt> 2591 * @li <tt>@ref DownloadedCommunityData::FLAG_WITH_APP_DATA</tt> 2592 * @li <tt>@ref DownloadedCommunityData::FLAG_WITH_ICON_DATA</tt> 2593 * @li <tt>@ref DownloadedCommunityData::FLAG_WITH_MII_DATA</tt> 2594 * 2595 * @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise. 2596 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 * @note 2633 * Community names may sometimes include characters that are not supported in the application. 2634 * When there are unsupported characters, you must handle it without adversely affecting the screen display or hindering the application's progress. 2635 * 2636 * @param[out] titleText Specifies the buffer for storing the community name. 2637 * @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). 2638 * 2639 * @retval ResultSuccess Indicates success. 2640 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2641 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 2642 * @retval ResultNotExistData Indicates that the data was not found. 2643 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 <b>System Settings</b>. <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 * @note 2653 * Community descriptions may sometimes include characters that are not supported in the application. 2654 * When there are unsupported characters, you must handle it without adversely affecting the screen display or hindering the application's progress. 2655 * 2656 * @param[out] descriptionText Specifies a buffer for storing the community name. 2657 * @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.) 2658 * 2659 * @retval ResultSuccess Indicates success. 2660 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2661 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 2662 * @retval ResultNotExistData Indicates that the data was not found. 2663 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. 2670 * 2671 * @param[out] appData Specifies the buffer for storing application data. 2672 * @param[out] appDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 2673 * @param[in] appDataMaxSize Specifies the size of the buffer for storing the application data. 2674 * 2675 * @retval ResultSuccess Indicates success. 2676 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2677 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 2678 * @retval ResultNotExistData Indicates that the data was not found. 2679 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. 2693 * 2694 * @param[out] iconData Specifies a buffer for storing the icon image. 2695 * @param[out] iconDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 2696 * @param[in] iconDataMaxSize Specifies the buffer for storing the icon image. 2697 * 2698 * @retval ResultSuccess Indicates success. 2699 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2700 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 2701 * @retval ResultNotExistData Indicates that the data was not found. 2702 * @retval ResultDataDecodeError Indicates that the attempt to decode the image failed. 2703 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. 2710 * 2711 * @param[out] storeData Specifies a structure for storing the Mii character data. 2712 * 2713 * @retval ResultSuccess Indicates success. 2714 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2715 * @retval ResultNotExistData Indicates that the data was not found. 2716 2717 */ 2718 nn::Result GetOwnerMiiData(FFLStoreData* storeData) const; 2719 2720 /** 2721 * Gets the Mii character nickname of the community's creator. 2722 * 2723 * @note 2724 * Mii character nicknames may sometimes include characters that are not supported in the application. 2725 * When that occurs, you must handle it without adversely affecting the screen display or hindering the application's progress. 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 an 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 * The following flag can be used. 2783 * @li <tt>@ref DownloadedUserData::FLAG_WITH_MII_DATA</tt> 2784 * 2785 * @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise. 2786 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. 2800 * 2801 * @param[out] storeData Specifies a structure for storing the Mii character data. 2802 * 2803 * @retval ResultSuccess Indicates success. 2804 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2805 * @retval ResultNotExistData Indicates that the data was not found. 2806 2807 */ 2808 nn::Result GetMiiData(FFLStoreData* storeData) const; 2809 2810 /** 2811 * Gets the Mii character nickname. 2812 * 2813 * @note 2814 * Mii character nicknames may sometimes include characters that are not supported in the application. 2815 * When that occurs, you must handle it without adversely affecting the screen display or hindering the application's progress. 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>). 2839 * 2840 * All member functions can be called, even in offline mode. <br /> 2841 * All member functions are thread-safe. 2842 2843 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. The flag is not set for post data with spoilers that are under review. */ 2857 }; 2858 2859 public: 2860 /** Instantiates an object. */ 2861 UploadedDataBase(); 2862 2863 /** Destroys the object. */ 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 * The following flags can be used. 2872 * @li <tt>@ref UploadedDataBase::FLAG_WITH_BODY_TEXT</tt> 2873 * @li <tt>@ref UploadedDataBase::FLAG_WITH_BODY_MEMO</tt> 2874 * @li <tt>@ref UploadedDataBase::FLAG_WITH_APP_DATA</tt> 2875 * @li <tt>@ref UploadedDataBase::FLAG_SPOILER</tt> 2876 * 2877 * @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise. 2878 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. 2907 * @li TGA 1.0. (No color map. 32-bit color without RLE compression. Stored in BGRA order starting from the lower left. 320×120 pixels.) 2908 * @li Fixed-length 18-byte header (00 00 02 00 00 00 00 00 00 00 00 00 40 01 78 00 20 08). 2909 * 2910 * @param[out] bodyMemo Specifies a buffer for storing a handwritten memo. 2911 * @param[out] bodyMemoSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 2912 * @param[in] bodyMemoMaxSize Specifies the size of the buffer for storing the handwritten memo. 2913 * 2914 * @retval ResultSuccess Indicates success. 2915 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 2916 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 2917 * @retval ResultNotExistData Indicates that the data was not found. 2918 * @retval ResultDataDecodeError Indicates that the attempt to decode the data failed. 2919 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 an 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 * The following flags can be used. 3008 * @li <tt>@ref UploadedPostData::FLAG_WITH_BODY_TEXT</tt> 3009 * @li <tt>@ref UploadedPostData::FLAG_WITH_BODY_MEMO</tt> 3010 * @li <tt>@ref UploadedPostData::FLAG_WITH_APP_DATA</tt> 3011 * @li <tt>@ref UploadedPostData::FLAG_SPOILER</tt> 3012 * 3013 * @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise. 3014 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. 3028 * 3029 * @param[out] bodyText Specifies a buffer for storing the text data. 3030 * @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). 3031 * 3032 * @retval ResultSuccess Indicates success. 3033 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3034 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3035 * @retval ResultNotExistData Indicates that the data was not found. 3036 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. 3043 * 3044 * <b>Note:</b><br/> 3045 * Handwritten memos use the following data format. 3046 * @li TGA 1.0. (No color map. 32-bit color without RLE compression. Stored in BGRA order starting from the lower left. 320×120 pixels.) 3047 * @li Fixed-length 18-byte header (00 00 02 00 00 00 00 00 00 00 00 00 40 01 78 00 20 08). 3048 * 3049 * @param[out] bodyMemo Specifies a buffer for storing a handwritten memo. 3050 * @param[out] bodyMemoSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 3051 * @param[in] bodyMemoMaxSize Specifies the size of the buffer for storing the handwritten memo. 3052 * 3053 * @retval ResultSuccess Indicates success. 3054 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3055 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3056 * @retval ResultNotExistData Indicates that the data was not found. 3057 * @retval ResultDataDecodeError Indicates that the attempt to decode the data failed. 3058 3059 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. 3066 * 3067 * @param[out] appData Specifies the buffer for storing application data. 3068 * @param[out] appDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 3069 * @param[in] appDataMaxSize Specifies the size of the buffer for storing the application data. 3070 * 3071 * @retval ResultSuccess Indicates success. 3072 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3073 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3074 * @retval ResultNotExistData Indicates that the data was not found. 3075 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 an 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 * The following flags can be used. 3143 * @li <tt>@ref UploadedDirectMessageData::FLAG_WITH_BODY_TEXT</tt> 3144 * @li <tt>@ref UploadedDirectMessageData::FLAG_WITH_BODY_MEMO</tt> 3145 * @li <tt>@ref UploadedDirectMessageData::FLAG_WITH_APP_DATA</tt> 3146 * 3147 * @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise. 3148 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. 3162 * 3163 * @param[out] bodyText Specifies a buffer for storing the text data. 3164 * @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). 3165 * 3166 * @retval ResultSuccess Indicates success. 3167 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3168 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3169 * @retval ResultNotExistData Indicates that the data was not found. 3170 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. 3177 * 3178 * <b>Note:</b><br/> 3179 * Handwritten memos use the following data format. 3180 * @li TGA 1.0. (No color map. 32-bit color without RLE compression. Stored in BGRA order starting from the lower left. 320×120 pixels.) 3181 * @li Fixed-length 18-byte header (00 00 02 00 00 00 00 00 00 00 00 00 40 01 78 00 20 08). 3182 * 3183 * @param[out] bodyMemo Specifies a buffer for storing a handwritten memo. 3184 * @param[out] bodyMemoSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 3185 * @param[in] bodyMemoMaxSize Specifies the size of the buffer for storing the handwritten memo. 3186 * 3187 * @retval ResultSuccess Indicates success. 3188 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3189 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3190 * @retval ResultNotExistData Indicates that the data was not found. 3191 * @retval ResultDataDecodeError Indicates that the attempt to decode the data failed. 3192 3193 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. 3200 * 3201 * @param[out] appData Specifies the buffer for storing application data. 3202 * @param[out] appDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 3203 * @param[in] appDataMaxSize Specifies the size of the buffer for storing the application data. 3204 * 3205 * @retval ResultSuccess Indicates success. 3206 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3207 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3208 * @retval ResultNotExistData Indicates that the data was not found. 3209 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 an 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 * The following flags can be used. 3252 * @li <tt>@ref UploadedCommentData::FLAG_WITH_BODY_TEXT</tt> 3253 * @li <tt>@ref UploadedCommentData::FLAG_WITH_BODY_MEMO</tt> 3254 * @li <tt>@ref UploadedCommentData::FLAG_WITH_APP_DATA</tt> 3255 * @li <tt>@ref UploadedCommentData::FLAG_SPOILER</tt> 3256 * 3257 * @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise. 3258 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. 3272 * 3273 * @param[out] bodyText Specifies a buffer for storing the text data. 3274 * @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). 3275 * 3276 * @retval ResultSuccess Indicates success. 3277 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3278 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3279 * @retval ResultNotExistData Indicates that the data was not found. 3280 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. 3287 * 3288 * <b>Note:</b><br/> 3289 * Handwritten memos use the following data format. 3290 * @li TGA 1.0. (No color map. 32-bit color without RLE compression. Stored in BGRA order starting from the lower left. 320×120 pixels.) 3291 * @li Fixed-length 18-byte header (00 00 02 00 00 00 00 00 00 00 00 00 40 01 78 00 20 08). 3292 * 3293 * @param[out] bodyMemo Specifies a buffer for storing a handwritten memo. 3294 * @param[out] bodyMemoSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 3295 * @param[in] bodyMemoMaxSize Specifies the size of the buffer for storing the handwritten memo. 3296 * 3297 * @retval ResultSuccess Indicates success. 3298 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3299 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3300 * @retval ResultNotExistData Indicates that the data was not found. 3301 * @retval ResultDataDecodeError Indicates that the attempt to decode the data failed. 3302 3303 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. 3310 * 3311 * @param[out] appData Specifies the buffer for storing application data. 3312 * @param[out] appDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 3313 * @param[in] appDataMaxSize Specifies the size of the buffer for storing the application data. 3314 * 3315 * @retval ResultSuccess Indicates success. 3316 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3317 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3318 * @retval ResultNotExistData Indicates that the data was not found. 3319 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 an 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 * The following flags can be used. 3374 * @li <tt>@ref UploadedCommunityData::FLAG_WITH_TITLE_TEXT</tt> 3375 * @li <tt>@ref UploadedCommunityData::FLAG_WITH_DESCRIPTION_TEXT</tt> 3376 * @li <tt>@ref UploadedCommunityData::FLAG_WITH_APP_DATA</tt> 3377 * @li <tt>@ref UploadedCommunityData::FLAG_WITH_ICON_DATA</tt> 3378 * 3379 * @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise. 3380 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. 3414 * 3415 * @param[out] titleText Specifies the buffer for storing the community name. 3416 * @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). 3417 * 3418 * @retval ResultSuccess Indicates success. 3419 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3420 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3421 * @retval ResultNotExistData Indicates that the data was not found. 3422 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. 3429 * 3430 * @param[out] descriptionText Specifies a buffer for storing the community name. 3431 * @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.) 3432 * 3433 * @retval ResultSuccess Indicates success. 3434 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3435 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3436 * @retval ResultNotExistData Indicates that the data was not found. 3437 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. 3444 * 3445 * @param[out] appData Specifies the buffer for storing application data. 3446 * @param[out] appDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 3447 * @param[in] appDataMaxSize Specifies the size of the buffer for storing the application data. 3448 * 3449 * @retval ResultSuccess Indicates success. 3450 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3451 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3452 * @retval ResultNotExistData Indicates that the data was not found. 3453 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. 3467 * 3468 * @param[out] iconData Specifies a buffer for storing the icon image. 3469 * @param[out] iconDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 3470 * @param[in] iconDataMaxSize Specifies the buffer for storing the icon image. 3471 * 3472 * @retval ResultSuccess Indicates success. 3473 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3474 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3475 * @retval ResultNotExistData Indicates that the data was not found. 3476 * @retval ResultDataDecodeError Indicates that the attempt to decode the image failed. 3477 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 /** Instantiates an object. */ 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 * The following flags can be used. 3532 * @li <tt>@ref UploadedFavoriteToCommunityData::FLAG_WITH_TITLE_TEXT</tt> 3533 * @li <tt>@ref UploadedFavoriteToCommunityData::FLAG_WITH_DESCRIPTION_TEXT</tt> 3534 * @li <tt>@ref UploadedFavoriteToCommunityData::FLAG_WITH_APP_DATA</tt> 3535 * @li <tt>@ref UploadedFavoriteToCommunityData::FLAG_WITH_ICON_DATA</tt> 3536 * 3537 * @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise. 3538 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. 3572 * 3573 * @param[out] titleText Specifies the buffer for storing the community name. 3574 * @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). 3575 * 3576 * @retval ResultSuccess Indicates success. 3577 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3578 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3579 * @retval ResultNotExistData Indicates that the data was not found. 3580 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. 3587 * 3588 * @param[out] descriptionText Specifies a buffer for storing the community name. 3589 * @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.) 3590 * 3591 * @retval ResultSuccess Indicates success. 3592 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3593 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3594 * @retval ResultNotExistData Indicates that the data was not found. 3595 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. 3602 * 3603 * @param[out] appData Specifies the buffer for storing application data. 3604 * @param[out] appDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 3605 * @param[in] appDataMaxSize Specifies the size of the buffer for storing the application data. 3606 * 3607 * @retval ResultSuccess Indicates success. 3608 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3609 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3610 * @retval ResultNotExistData Indicates that the data was not found. 3611 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. 3625 * 3626 * @param[out] iconData Specifies a buffer for storing the icon image. 3627 * @param[out] iconDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 3628 * @param[in] iconDataMaxSize Specifies the buffer for storing the icon image. 3629 * 3630 * @retval ResultSuccess Indicates success. 3631 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3632 * @retval ResultInvalidSize Indicates that the size is <tt>0</tt>. 3633 * @retval ResultNotExistData Indicates that the data was not found. 3634 * @retval ResultDataDecodeError Indicates that the attempt to decode the image failed. 3635 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 an 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 * The following flag can be used. 3687 * @li <tt>@ref GetNotificationsUrlParam::FLAG_FILTER_BY_DIRECT_MESSAGE</tt> 3688 * 3689 * @retval ResultSuccess Indicates success. 3690 * @retval ResultInvalidParameter Invalid flags have been set. 3691 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 an 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. <br /> 3740 * If you set the user community ID, the specified user community is displayed if it has been added to the user's favorites. The general community is displayed if it has not. <br /> 3741 * 3742 * @param[in] id Specifies the ID. 3743 * 3744 * @retval ResultSuccess Indicates success. 3745 */ 3746 nn::Result SetCommunityId(const u32 id); 3747 3748 /** 3749 * Sets a post ID. <br /> 3750 * This setting is not required. <br /> 3751 * <tt>@ref FLAG_POST_ID</tt> is set internally. 3752 * 3753 * @param[in] postId Specifies a text string representing the post ID. <br /> 3754 * The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH</tt>. 3755 * 3756 * @retval ResultSuccess Indicates success. 3757 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3758 * @retval ResultInvalidSize Indicates that the string exceeds <tt>@ref nn::olv::POST_ID_MAX_LENGTH</tt> characters. 3759 */ 3760 nn::Result SetPostId(const char* postId); 3761 3762 /** 3763 * Sets a principal ID. <br /> 3764 * This setting is not required. <br /> 3765 * <tt>@ref FLAG_USER_PID</tt> is set internally. 3766 * 3767 * @param[in] userPid Specifies the principal ID being set. 3768 * 3769 * @retval ResultSuccess Indicates success. 3770 */ 3771 nn::Result SetUserPid(const u32 userPid); 3772 3773 /** 3774 * Sets the launch flags. <br /> 3775 * This setting is not required. <br /> 3776 * If not set, the top page of the Miiverse application opens. <br /> 3777 * 3778 * @param[in] flags Flags defined in the <tt>@ref StartPortalAppParam</tt> class. (Specify only one of them.)<br/> 3779 * The following flags can be used. 3780 * @li <tt>@ref StartPortalAppParam::FLAG_COMMUNITY_ID</tt> 3781 * @li <tt>@ref StartPortalAppParam::FLAG_POST_ID</tt> 3782 * @li <tt>@ref StartPortalAppParam::FLAG_USER_PID</tt> 3783 * @li <tt>@ref StartPortalAppParam::FLAG_DIRECT_MESSAGE</tt> 3784 * 3785 * @retval ResultSuccess Indicates success. 3786 * @retval ResultInvalidParameter Indicates that one or more flags are invalid. 3787 3788 */ 3789 nn::Result SetFlags(const u32 flags); 3790 3791 /** 3792 * Sets a topic tag. <br /> 3793 * This setting is not required. <br /> 3794 * Encode the tag as <tt>UTF-16 BE</tt>. 3795 * 3796 * There are two ways to start Miiverse with a topic tag. (Any other method of configuration is ignored.) To specify a community ID, use <tt>@ref SetCommunityId</tt>. 3797 * @li Specify the topic tag only. 3798 * @li Specify both the community ID and the topic tag. 3799 * 3800 * @param[in] topicTag Specifies the topic tag string. (Set to <tt>NULL</tt> to clear the internal buffer.) The maximum number of characters that can be specified is <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt>. 3801 * 3802 * @retval ResultSuccess Indicates success. 3803 * @retval ResultInvalidSize Indicates that the topic tag is longer than <tt>@ref nn::olv::TOPIC_TAG_MAX_LENGTH</tt> characters. 3804 3805 3806 3807 */ 3808 nn::Result SetTopicTag(const wchar_t* topicTag); 3809 3810 protected: 3811 /// @cond 3812 u32 flags; /*!< Sets flags. */ 3813 u64 titleId; /*!< Specifies the title ID. */ 3814 u32 communityId; /*!< Community ID. */ 3815 u32 userPid; /*!< User ID. */ 3816 s8 postId[POST_ID_BUFF_LENGTH]; /*!< Post ID. */ 3817 char redirect[1024]; /*!< Internally processed text. */ 3818 u16 topicTag 3819 [TOPIC_TAG_BUFF_LENGTH]; /*!< Topic tag. */ 3820 u8 reserved[2712]; 3821 3822 friend class internal::Main; 3823 /// @endcond 3824 }; 3825 3826 /** 3827 * Parameters used when uploading posts via the posting applet. 3828 * 3829 * Inherited by <tt>@ref UploadDirectMessageDataByPostAppParam</tt>, which is the parameter when uploading a direct message data via the posting applet. 3830 * 3831 * Note that the post application does not support line breaks. When using <tt>@ref SetBodyText()</tt> do not include any line breaks to set the initial value of text data. 3832 * All member functions can be called, even in offline mode. 3833 */ 3834 class UploadPostDataByPostAppParam : public UploadPostDataParam 3835 { 3836 public: 3837 /** Flags to specify with <tt>UploadPostDataByPostAppParam::SetFlags</tt> and <tt>UploadDirectMessageDataByPostAppParam::SetFlags</tt>. */ 3838 enum 3839 { 3840 FLAG_NONE = 0, //!< The default flag value. 3841 FLAG_ONLY_SPOILER = UPLOAD_FLAG_VALUE_SPOILER, //!< The flag specified when the post includes spoilers. <br /> 3842 //!< Invalid if specified using <tt>UploadDirectMessageDataByPostAppParam::SetFlags</tt>. 3843 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 /> 3844 //!< Invalid if specified using <tt>UploadDirectMessageDataByPostAppParam::SetFlags</tt>. 3845 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. 3846 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. 3847 }; 3848 3849 /** Flags to specify with <tt>UploadPostDataByPostAppParam::SetStampData</tt>. */ 3850 enum 3851 { 3852 STAMP_FLAG_NONE = STAMP_FLAG_VALUE_NONE, /*!< The state when no flags are specified. */ 3853 STAMP_FLAG_INVALID = STAMP_FLAG_VALUE_INVALID /*!< The flag that indicates that the stamp is invalid (and cannot be selected). */ 3854 }; 3855 3856 public: 3857 /** Instantiates an object. */ 3858 UploadPostDataByPostAppParam(); 3859 /** Destroys the object. */ 3860 ~UploadPostDataByPostAppParam(); 3861 3862 /** 3863 * Specifies the maximum length of the text string. <br /> 3864 * Does not need to be specified. If not specified, the maximum length defaults to 100 characters. 3865 * 3866 * @param[in] bodyTextMaxLength The length of the string being set for text data. <br /> 3867 * You can specify a value in the range of <tt>1</tt> to <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>. 3868 * 3869 * @retval ResultSuccess Indicates success. 3870 * @retval ResultInvalidParameter Indicates that the size is greater than <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>. 3871 */ 3872 nn::Result SetBodyTextMaxLength(const u32 bodyTextMaxLength); 3873 3874 /** 3875 * Sets flags. <br /> 3876 * This setting is not required. 3877 * 3878 * @param[in] flags Flags defined in the <tt>@ref UploadPostDataByPostAppParam</tt> class.<br/> 3879 * The following flags can be used. 3880 * @li <tt>@ref UploadPostDataByPostAppParam::FLAG_ONLY_SPOILER</tt> 3881 * @li <tt>@ref UploadPostDataByPostAppParam::FLAG_APP_STARTABLE</tt> 3882 * @li <tt>@ref UploadPostDataByPostAppParam::FLAG_ONLY_BODY_TEXT</tt> 3883 * @li <tt>@ref UploadPostDataByPostAppParam::FLAG_ONLY_BODY_MEMO</tt> 3884 * 3885 * @retval ResultSuccess Indicates success. 3886 * @retval ResultInvalidParameter Indicates that one or more flags are invalid. 3887 3888 */ 3889 nn::Result SetFlags(const u32 flags); 3890 3891 /** 3892 * Sets the work buffers used to set data in the posting applet. <br /> 3893 * This setting is required if additional information is being added with <tt>@ref SetStampData</tt> or <tt>@ref AddYoutubeMovieData</tt>. <br /> 3894 * 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 /> 3895 * 3896 * @param[in] work Specifies the start address of the work buffer. 3897 * @param[in] workSize Specifies the work buffer size. (Specify <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>.) 3898 * 3899 * @retval ResultSuccess Indicates success. 3900 * @retval ResultNotInitialized Indicates that the library is not initialized. 3901 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 3902 * @retval ResultInvalidSize Indicates that the <var>workSize</var> parameter is set to something other than <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>. 3903 */ 3904 nn::Result SetWork(u8* work, const u32 workSize); 3905 3906 /** 3907 * Sets video data in the posting applet. <br /> 3908 * This setting is not required. <br /> 3909 * Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br /> 3910 * 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. <br /> 3911 * The combined size of video information and stamp data must not exceed 900 KB. <br /> 3912 * Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB. 3913 * 3914 * @param[in] movieData The video information data. 3915 * @param[in] movieDataSize The size of the video information data. 3916 * 3917 * @retval ResultSuccess Indicates success. 3918 * @retval ResultTooMuchData Indicates that you cannot add any more data. 3919 * @retval ResultInvalidPointer Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured. 3920 * @retval ResultInvalidSize Indicates that data could not be inserted. (For example, there was not enough remaining memory.) 3921 3922 */ AddYoutubeMovieData(const u8 * movieData,const u32 movieDataSize)3923 nn::Result AddYoutubeMovieData(const u8* movieData , const u32 movieDataSize) 3924 { 3925 if(GetDataTypeNum(DATA_TYPE_YOUTUBE_MOVIE_DATA) >= YOUTUBE_MOVIE_DATA_MAX_NUM) 3926 { 3927 // A video has already been added. 3928 return nn::olv::ResultTooMuchData(); 3929 } 3930 return AddCommonData(DATA_TYPE_YOUTUBE_MOVIE_DATA, movieData, movieDataSize) ; 3931 } 3932 3933 /** 3934 * Adds a stamp used by the posting applet. <br /> 3935 * This setting is not required. <br /> 3936 * Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br /> 3937 * Stamp data set using this member function is compressed at the time it is added. <br /> 3938 * The combined size of the compressed stamp data and video information data must not exceed 900 KB. <br /> 3939 * Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB. 3940 * 3941 * @param[in] stampData Specifies the stamp data. 3942 * @param[in] stampDataSize Specifies the size of the stamp data. 3943 * @param[in] stampFlags Flags (<tt>STAMP_FLAG_*</tt>) that represent attributes of stamps defined in the <tt>@ref UploadPostDataByPostAppParam</tt> class. <br /> 3944 * If you specify <tt>@ref STAMP_FLAG_INVALID</tt>, stamps cannot be selected in the posting applet. 3945 * 3946 * @retval ResultSuccess Indicates success. 3947 * @retval ResultTooMuchData Indicates that you cannot add any more data. 3948 * @retval ResultInvalidPointer Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured. 3949 * @retval ResultInvalidSize Indicates that data could not be inserted. (For example, there was not enough remaining memory.) 3950 * @retval ResultInvalidParameter Indicates that unusable data was passed in. 3951 * @retval ResultInvalidFormat Indicates that the stamp format is invalid. 3952 */ 3953 nn::Result SetStampData(const u8* stampData, const u32 stampDataSize, const u32 stampFlags = 0) 3954 { 3955 return UploadParamBase::SetStampData(stampData, stampDataSize, stampFlags); 3956 } 3957 3958 /** 3959 * Gets the number of stamps configured. 3960 * 3961 * @param[in] stampFlags Flags (<tt>STAMP_FLAG_*</tt>) that represent attributes of stamps defined in the <tt>@ref UploadPostDataByPostAppParam</tt> class. 3962 * 3963 * @return Returns the number of pieces of stamp data that are set, or <tt>0</tt> if the flags are invalid. 3964 */ GetStampDataNum(const u32 stampFlags)3965 u32 GetStampDataNum(const u32 stampFlags) const 3966 { 3967 return UploadParamBase::GetStampDataNum(stampFlags); 3968 } 3969 3970 private: 3971 /// @cond 3972 /** 3973 * Gets the number of stamps configured. 3974 * 3975 * @return Returns the number of stamps configured. 3976 */ 3977 u32 GetStampDataNum() const; 3978 3979 /** 3980 * Gets the amount of memory being used by configured stamps. 3981 * 3982 * @return Returns the amount of memory being used by configured stamps. 3983 */ 3984 u32 GetStampDataListSize() const; 3985 3986 /** 3987 * Adds a stamp used by the posting applet. <br /> 3988 * Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br /> 3989 * Stamp data set using this member function is compressed at the time it is added. <br /> 3990 * Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br /> 3991 * Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB. 3992 * 3993 * @param[in] stampData Specifies the stamp data. 3994 * @param[in] stampDataSize Specifies the size of the stamp data. 3995 * 3996 * @retval ResultSuccess Indicates success. 3997 * @retval ResultTooMuchData Indicates that you cannot add any more data. 3998 * @retval ResultInvalidPointer Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured. 3999 * @retval ResultInvalidSize Indicates that data could not be inserted. (For example, there was not enough remaining memory.) 4000 * @retval ResultInvalidParameter Indicates that unusable data was passed in. 4001 * @retval ResultInvalidFormat Indicates that the stamp format is invalid. 4002 */ 4003 nn::Result AddStampData(const u8* stampData, const u32 stampDataSize); 4004 /// @endcond 4005 4006 private: 4007 /// @cond 4008 u8 reserved[508]; 4009 4010 friend class internal::Main; 4011 /// @endcond 4012 }; 4013 4014 /** 4015 * Parameters used when uploading comments via the posting applet. 4016 * 4017 * Note that the post application does not support line breaks. When using <tt>@ref SetBodyText()</tt> to set the initial value of text data, do not include any line breaks. <br /> 4018 * All member functions can be called, even in offline mode. <br /> 4019 * All member functions are thread-safe. 4020 */ 4021 class UploadCommentDataByPostAppParam : public UploadCommentDataParam 4022 { 4023 public: 4024 /** Flags to specify with <tt>UploadCommentDataByPostAppParam::SetFlags</tt>. */ 4025 enum 4026 { 4027 FLAG_NONE = 0, /*!< The default flag value. */ 4028 FLAG_ONLY_SPOILER = UPLOAD_FLAG_VALUE_SPOILER, /*!< The flag specified when the post includes spoilers. */ 4029 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. */ 4030 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. */ 4031 }; 4032 4033 /** Flags to specify with <tt>@ref SetStampData</tt>. */ 4034 enum 4035 { 4036 STAMP_FLAG_NONE = STAMP_FLAG_VALUE_NONE, /*!< The state when no flags are specified. */ 4037 STAMP_FLAG_INVALID = STAMP_FLAG_VALUE_INVALID /*!< The flag that indicates that the stamp is invalid (and cannot be selected). */ 4038 }; 4039 4040 public: 4041 /** Instantiates an object. */ 4042 UploadCommentDataByPostAppParam(); 4043 4044 /** 4045 * Specifies the maximum length of the text string. <br /> 4046 * This setting is not required. <br /> 4047 * 4048 * @param[in] bodyTextMaxLength The length of the string being set for text data. <br /> 4049 * You can specify a value in the range of <tt>1</tt> to <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>. 4050 * 4051 * @retval ResultSuccess Indicates success. 4052 * @retval ResultInvalidParameter Indicates that the size is greater than <tt>@ref nn::olv::BODY_TEXT_MAX_LENGTH</tt>. 4053 */ 4054 nn::Result SetBodyTextMaxLength(const u32 bodyTextMaxLength); 4055 4056 /** 4057 * Sets flags. <br /> 4058 * This setting is not required. 4059 * 4060 * @param[in] flags Flags defined in the <tt>@ref UploadCommentDataByPostAppParam</tt> class.<br/> 4061 * The following flags can be used. 4062 * @li <tt>@ref UploadCommentDataByPostAppParam::FLAG_ONLY_SPOILER</tt> 4063 * @li <tt>@ref UploadCommentDataByPostAppParam::FLAG_ONLY_BODY_TEXT</tt> 4064 * @li <tt>@ref UploadCommentDataByPostAppParam::FLAG_ONLY_BODY_MEMO</tt> 4065 * 4066 * @retval ResultSuccess Indicates success. 4067 * @retval ResultInvalidParameter Indicates that one or more flags are invalid. 4068 4069 */ 4070 nn::Result SetFlags(const u32 flags); 4071 4072 /** 4073 * Sets the work buffers used to set data in the posting applet. <br /> 4074 * This setting is required if additional information is being added with <tt>@ref SetStampData</tt>. <br /> 4075 * 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 /> 4076 * 4077 * @param[in] work Specifies the start address of the work buffer. 4078 * @param[in] workSize Specifies the work buffer size. (Specify <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>.) 4079 * 4080 * @retval ResultSuccess Indicates success. 4081 * @retval ResultNotInitialized Indicates that the library is not initialized. 4082 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 4083 * @retval ResultInvalidSize Indicates that the <var>workSize</var> parameter is set to something other than <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>. 4084 */ 4085 nn::Result SetWork(u8* work, const u32 workSize); 4086 4087 /** 4088 * Adds a stamp used by the posting applet. <br /> 4089 * This setting is not required. <br /> 4090 * Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br /> 4091 * Stamp data set using this member function is compressed at the time it is added. <br /> 4092 * Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br /> 4093 * Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB. 4094 * 4095 * @param[in] stampData Specifies the stamp data. 4096 * @param[in] stampDataSize Specifies the size of the stamp data. 4097 * @param[in] stampFlags Flags (<tt>STAMP_FLAG_*</tt>) that represent attributes of stamps defined in the <tt>@ref UploadCommentDataByPostAppParam</tt> class. <br /> 4098 * If you specify <tt>@ref STAMP_FLAG_INVALID</tt>, stamps cannot be selected in the posting applet. 4099 * 4100 * @retval ResultSuccess Indicates success. 4101 * @retval ResultTooMuchData Indicates that you cannot add any more data. 4102 * @retval ResultInvalidPointer Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured. 4103 * @retval ResultInvalidSize Indicates that data could not be inserted. (For example, there was not enough remaining memory.) 4104 * @retval ResultInvalidParameter Indicates that unusable data was passed in. 4105 * @retval ResultInvalidFormat Indicates that the stamp format is invalid. 4106 */ 4107 nn::Result SetStampData(const u8* stampData, const u32 stampDataSize, const u32 stampFlags = 0) 4108 { 4109 return UploadParamBase::SetStampData(stampData, stampDataSize, stampFlags); 4110 } 4111 4112 /** 4113 * Gets the number of stamps configured. 4114 * 4115 * @param[in] stampFlags Flags that represent the stamp attributes (<tt>STAMP_FLAG_*</tt>) to get. 4116 * 4117 * @return Returns the number of pieces of stamp data that are set, or <tt>0</tt> if the flags are invalid. 4118 */ GetStampDataNum(const u32 stampFlags)4119 u32 GetStampDataNum(const u32 stampFlags) const 4120 { 4121 return UploadParamBase::GetStampDataNum(stampFlags); 4122 } 4123 4124 private: 4125 /// @cond 4126 /** 4127 * Gets the number of stamps configured. 4128 * 4129 * @return Returns the number of stamps configured. 4130 */ 4131 u32 GetStampDataNum() const; 4132 4133 /** 4134 * Gets the amount of memory being used by configured stamps. 4135 * 4136 * @return Returns the amount of memory being used by configured stamps. 4137 */ 4138 u32 GetStampDataListSize() const; 4139 4140 /** 4141 * Adds a stamp used by the posting applet. <br /> 4142 * Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br /> 4143 * Stamp data set using this member function is compressed at the time it is added. <br /> 4144 * Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br /> 4145 * Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB. 4146 * 4147 * @param[in] stampData Specifies the stamp data. 4148 * @param[in] stampDataSize Specifies the size of the stamp data. 4149 * 4150 * @retval ResultSuccess Indicates success. 4151 * @retval ResultTooMuchData Indicates that you cannot add any more data. 4152 * @retval ResultInvalidPointer Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured. 4153 * @retval ResultInvalidSize Indicates that data could not be inserted. (For example, there was not enough remaining memory.) 4154 * @retval ResultInvalidParameter Indicates that unusable data was passed in. 4155 * @retval ResultInvalidFormat Indicates that the stamp format is invalid. 4156 */ 4157 nn::Result AddStampData(const u8* stampData, const u32 stampDataSize); 4158 /// @endcond 4159 4160 private: 4161 /// @cond 4162 u8 reserved[476]; 4163 4164 friend class internal::Main; 4165 /// @endcond 4166 }; 4167 4168 /** 4169 * Represents parameters used when uploading direct messages via the posting application. 4170 * 4171 * Note that the post application does not support line breaks. When using <tt>@ref SetBodyText()</tt> to set the initial value of text data, do not include any line breaks. <br /> 4172 * All member functions can be called, even in offline mode. <br /> 4173 * All member functions are thread-safe. 4174 4175 */ 4176 class UploadDirectMessageDataByPostAppParam : public UploadPostDataByPostAppParam 4177 { 4178 public: 4179 /** The following flags cannot currently be used. */ 4180 enum 4181 { 4182 FLAG_NONE = 0 /*!< The default flag value. */ 4183 }; 4184 4185 /** Flags to specify with <tt>UploadDirectMessageDataByPostAppParam::SetStampData</tt>. */ 4186 enum 4187 { 4188 STAMP_FLAG_NONE = STAMP_FLAG_VALUE_NONE, /*!< The state when no flags are specified. */ 4189 STAMP_FLAG_INVALID = STAMP_FLAG_VALUE_INVALID /*!< The flag indicating that stamps are invalid (and cannot be selected). */ 4190 }; 4191 4192 public: 4193 /** Instantiates an object. */ 4194 UploadDirectMessageDataByPostAppParam(); 4195 4196 /** 4197 * Specifies the principal ID of the recipient. <br /> 4198 * This setting is required. <br /> 4199 * 4200 * @param[in] userPid The principal ID. 4201 * 4202 * @retval ResultSuccess Indicates success. 4203 * @retval ResultInvalidParameter Indicates that a value of 0 was specified. 4204 */ 4205 nn::Result SetUserPid(u32 userPid); 4206 4207 /** 4208 * Sets the work buffers used to set data in the posting applet. <br /> 4209 * This setting is required if additional information is being added with <tt>@ref SetStampData</tt> or <tt>@ref AddYoutubeMovieData</tt>. <br /> 4210 * 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 /> 4211 * 4212 * @param[in] work Specifies the start address of the work buffer. 4213 * @param[in] workSize Specifies the work buffer size. (Specify <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>.) 4214 * 4215 * @retval ResultSuccess Indicates success. 4216 * @retval ResultNotInitialized Indicates that the library is not initialized. 4217 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 4218 * @retval ResultInvalidSize Indicates that the <var>workSize</var> parameter is set to something other than <tt>@ref nn::olv::POST_APP_PARAM_WORK_BUFF_SIZE</tt>. 4219 */ 4220 nn::Result SetWork(u8* work, const u32 workSize); 4221 4222 /** 4223 * Adds a stamp used by the posting applet. <br /> 4224 * This setting is not required. <br /> 4225 * Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br /> 4226 * Stamp data set using this member function is compressed at the time it is added. <br /> 4227 * Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br /> 4228 * Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB. 4229 * 4230 * @param[in] stampData Specifies the stamp data. 4231 * @param[in] stampDataSize Specifies the size of the stamp data. 4232 * @param[in] stampFlags Flags (<tt>STAMP_FLAG_*</tt>) that represent attributes of stamps defined in the <tt>@ref UploadDirectMessageDataByPostAppParam</tt> class. <br /> 4233 * If you specify <tt>@ref STAMP_FLAG_INVALID</tt>, stamps cannot be selected in the posting applet. 4234 * 4235 * @retval ResultSuccess Indicates success. 4236 * @retval ResultTooMuchData Indicates that you cannot add any more data. 4237 * @retval ResultInvalidPointer Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured. 4238 * @retval ResultInvalidSize Indicates that data could not be inserted. (For example, there was not enough remaining memory.) 4239 * @retval ResultInvalidParameter Indicates that unusable data was passed in. 4240 * @retval ResultInvalidFormat Indicates that the stamp format is invalid. 4241 */ 4242 nn::Result SetStampData(const u8* stampData, const u32 stampDataSize, const u32 stampFlags = 0) 4243 { 4244 return UploadParamBase::SetStampData(stampData, stampDataSize, stampFlags); 4245 } 4246 4247 /** 4248 * Gets the number of stamps configured. <br /> 4249 * This setting is not required. <br /> 4250 * 4251 * @param[in] stampFlags Flags that represent the stamp attributes (<tt>STAMP_FLAG_*</tt>) to get. 4252 * 4253 * @return Returns the number of pieces of stamp data that are set, or <tt>0</tt> if the flags are invalid. 4254 */ GetStampDataNum(const u32 stampFlags)4255 u32 GetStampDataNum(const u32 stampFlags) const 4256 { 4257 return UploadParamBase::GetStampDataNum(stampFlags); 4258 } 4259 4260 private: 4261 /// @cond 4262 /** 4263 * Gets the number of stamps configured. 4264 * 4265 * @return Returns the number of stamps configured. 4266 */ 4267 u32 GetStampDataNum() const; 4268 4269 /** 4270 * Gets the amount of memory being used by configured stamps. 4271 * 4272 * @return Returns the amount of memory being used by configured stamps. 4273 */ 4274 u32 GetStampDataListSize() const; 4275 4276 /** 4277 * Adds a stamp used by the posting applet. <br /> 4278 * Before calling this function, the working buffer must be configured using <tt>@ref SetWork</tt>. <br /> 4279 * Stamp data set using this member function is compressed at the time it is added. <br /> 4280 * Adjust the size of the stamp so that the total size stays within 900 KB when compressed. <br /> 4281 * Note that a warning message appears in the DEBUG version if the total size exceeds 900 KB. 4282 * 4283 * @param[in] stampData Specifies the stamp data. 4284 * @param[in] stampDataSize Specifies the size of the stamp data. 4285 * 4286 * @retval ResultSuccess Indicates success. 4287 * @retval ResultTooMuchData Indicates that you cannot add any more data. 4288 * @retval ResultInvalidPointer Indicates that either a required parameter is set to <tt>NULL</tt>, or no work buffer was configured. 4289 * @retval ResultInvalidSize Indicates that data could not be inserted. (For example, there was not enough remaining memory.) 4290 * @retval ResultInvalidParameter Indicates that unusable data was passed in. 4291 * @retval ResultInvalidFormat Indicates that the stamp format is invalid. 4292 */ 4293 nn::Result AddStampData(const u8* stampData, const u32 stampDataSize); 4294 /// @endcond 4295 4296 private: 4297 /// @cond 4298 u32 userPid; /*!< Specifies the principal ID of the target user. */ 4299 u8 reserved[502]; 4300 4301 friend class internal::Main; 4302 /// @endcond 4303 }; 4304 4305 /** 4306 * The parameter storing the data passed from the Miiverse application when there was a jump from the Miiverse application. 4307 * 4308 * All member functions can be called, even in offline mode. <br /> 4309 * All member functions are thread-safe. 4310 4311 */ 4312 class MainAppParam 4313 { 4314 public: 4315 /** Flags to specify with <tt>MainAppParam::TestFlags</tt>. */ 4316 enum { 4317 FLAG_COMMUNITY_ID = (1<<0), /*!< Start from the specified community. */ 4318 FLAG_POST_ID = (1<<1), /*!< Start from the specified post ID (and from the community to which the post belongs). */ 4319 FLAG_WITH_APP_DATA = (1<<2), /*!< The flag for checking whether a post includes application data. */ 4320 }; 4321 4322 public: 4323 /** Instantiates an object. */ 4324 MainAppParam(); 4325 4326 /** 4327 * Checks flags. <br /> 4328 * This function determines which types of data are included. <br /> 4329 * The following data can be downloaded depending on the flags specified. <br /> 4330 * 4331 * @param[in] flags Flags defined in the <tt>@ref MainAppParam</tt> class.<br/> 4332 * The following flags can be used. 4333 * @li <tt>@ref MainAppParam::FLAG_COMMUNITY_ID</tt> 4334 * @li <tt>@ref MainAppParam::FLAG_POST_ID</tt> 4335 * @li <tt>@ref MainAppParam::FLAG_WITH_APP_DATA</tt> 4336 * 4337 * @return Returns <tt>true</tt> if any of the flags are set, and returns <tt>false</tt> otherwise. 4338 4339 */ 4340 bool TestFlags(const u32 flags) const; 4341 4342 /** 4343 * Downloads a community ID. <br /> 4344 * 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. 4345 * 4346 * @return Returns the community ID. 4347 4348 */ 4349 u32 GetCommunityId() const; 4350 4351 /** 4352 * Gets the post ID (a text string used to uniquely identify the post). <br /> 4353 * 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. 4354 * 4355 * @return Returns the post ID. 4356 4357 */ 4358 const char* GetPostId() const; 4359 4360 /** 4361 * Gets application data. <br /> 4362 * 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. 4363 * 4364 * @param[out] appData Specifies the buffer for storing application data. 4365 * @param[out] appDataSize Specifies the number of bytes actually written to the buffer. (It can be <tt>NULL</tt>.) 4366 * @param[in] appDataMaxSize Specifies the size of the buffer for storing the application data. 4367 * 4368 * @retval ResultSuccess Indicates success. 4369 * @retval ResultInvalidPointer Indicates that <tt>NULL</tt> was specified. 4370 * @retval ResultInvalidSize Indicates that <tt>0</tt> was specified for <tt>appDataMaxSize</tt>. 4371 * @retval ResultNotExistData Indicates that the data was not found. 4372 4373 */ 4374 nn::Result GetAppData(u8* appData, u32* appDataSize, const u32 appDataMaxSize) const; 4375 4376 /** 4377 * Gets the size of the application data. 4378 * 4379 * @return Returns the size of the application data. 4380 */ 4381 u32 GetAppDataSize(void) const; 4382 4383 private: 4384 /// @cond 4385 u32 flags; 4386 u32 communityId; 4387 s8 postId[nn::olv::POST_ID_BUFF_LENGTH]; 4388 u8 appData[nn::olv::APP_DATA_MAX_SIZE]; 4389 u32 appDataSize; 4390 u8 reserved[3028]; 4391 4392 friend class internal::Main; 4393 /// @endcond 4394 }; 4395 4396 4397 /** @} */ 4398 4399 } 4400 } // end of namespace 4401 4402 #endif 4403