1 /*---------------------------------------------------------------------------* 2 3 Project: OLV 4 File: olv_Const.h 5 6 Copyright (C) 2009-2013 Nintendo. All rights reserved. 7 8 These coded instructions, statements, and computer programs contain 9 proprietary information of Nintendo of America Inc. and/or Nintendo 10 Company Ltd., and are protected by Federal copyright law. They may 11 not be disclosed to third parties or copied or duplicated in any form, 12 in whole or in part, without the prior written consent of Nintendo. 13 14 *---------------------------------------------------------------------------*/ 15 //------------------------------------------------------------------------------ 16 /** @file olv_Const.h 17 * 18 * @brief Defines data used by the Olive library (OLV). 19 * 20 */ 21 //------------------------------------------------------------------------------ 22 #ifndef __OLV_CONST_H_ 23 #define __OLV_CONST_H_ 24 25 #define OLV_ERROR_CODE_BASE (1150000U) 26 #define OLV_ERROR_CODE_UNKNOWN (OLV_ERROR_CODE_BASE + 9999U) 27 28 /// <span>nn</span> 29 namespace nn { 30 31 /// <span>olv</span> 32 namespace olv { 33 34 35 /** @defgroup enum Enumerations 36 * @{ 37 */ 38 39 /// Moods. 40 enum Feeling 41 { 42 FEELING_NORMAL, /*!< Not specified. */ 43 FEELING_HAPPY, /*!< Fun. */ 44 FEELING_LIKE, /*!< Cool. */ 45 FEELING_SURPRISED, /*!< Surprised. */ 46 FEELING_FRUSTRATED, /*!< Frustrated. */ 47 FEELING_PUZZLED, /*!< Stuck. */ 48 }; 49 50 // Minimum working-memory size definitions. 51 static const int WORK_MIN_SIZE = 64 * 1024; /*!< Minimum work size required to initialize the OLV library. */ 52 53 // Handwritten memo data size definitions. 54 static const int BODY_MEMO_WIDTH = 320; /*!< Handwritten memo data width. */ 55 static const int BODY_MEMO_HEIGHT = 120; /*!< Handwritten memo data height. */ 56 static const int BODY_MEMO_BPP = 4; /*!< Handwritten memo data bit size. */ 57 // Image attachment definitions. 58 static const int EXTERNAL_IMAGE_DATA_WIDTH = 800; /*!< Width of images that can be specified as attachments. */ 59 static const int EXTERNAL_IMAGE_DATA_HEIGHT = 450; /*!< Height of images that can be specified as attachments. */ 60 61 // Defines maximum values in specifications. 62 static const int BODY_TEXT_MAX_LENGTH = 255; /*!< Maximum number of characters that can be included as text data (not including the terminating character). */ 63 static const int BODY_MEMO_MAX_SIZE = BODY_MEMO_WIDTH * BODY_MEMO_HEIGHT * BODY_MEMO_BPP + 44; /*!< Size of the handwritten memo data that can be specified in a post. */ 64 static const int COMPRESSED_BODY_MEMO_MAX_SIZE = 40 * 1024; /*!< Maximum handwritten memo data size (allowed by the library) after compression. */ 65 static const int TOPIC_TAG_MAX_LENGTH = 50; /*!< Maximum number of characters that can be specified as a topic tag (not including the terminating character). */ 66 static const int SEARCH_KEY_MAX_LENGTH = 50; /*!< Maximum number of characters that can be included in a search key (not including the terminating character). */ 67 static const int SEARCH_KEY_MAX_NUM = 5; /*!< Maximum number of search keys that can be specified. */ 68 static const int EXTERNAL_URL_MAX_LENGTH = 255; /*!< Maximum number of characters that can be included in an external URL (not including the terminating character). */ 69 static const int MII_DATA_SIZE = 96; /*!< Mii character data size. */ 70 static const int POST_ID_MAX_LENGTH = 22; /*!< Maximum number of characters for the post ID. */ 71 static const int DIRECT_MESSAGE_ID_MAX_LENGTH = 22; /*!< Maximum number of characters for the direct message ID. */ 72 static const int COMMENT_ID_MAX_LENGTH = 22; /*!< Maximum number of characters for the comment ID. */ 73 static const int APP_DATA_MAX_SIZE = 1024; /*!< Maximum application data size. */ 74 static const int APP_DATA_BY_POST_APP_MAX_SIZE = 1024; /*!< Maximum application data size (via the Miiverse service). */ 75 static const int EXTERNAL_IMAGE_DATA_MAX_SIZE = 512 * 1024; /*!< Maximum size of images that can be specified as attachments. */ 76 static const int EXTERNAL_THUMBNAIL_IMAGE_DATA_MAX_SIZE = 128 * 1024; /*!< The maximum size of an image that can be specified as thumbnail attachment data. */ 77 static const int EXTERNAL_IMAGE_DATA_BY_POST_APP_MAX_SIZE = 512 * 1024; /*!< Maximum size of an image that can be specified as an attachment (via the Miiverse service). */ 78 static const int EXTERNAL_THUMBNAIL_IMAGE_DATA_BY_POST_APP_MAX_SIZE = 128 * 1024; /*!< The maximum size of an image that can be specified as thumbnail attachment data (via the Miiverse service). */ 79 static const int EXTERNAL_IMAGE_DATA_TOTAL_MAX_SIZE = 512 * 1024; /*!< The maximum total size of image attachment data and thumbnail attachment data. */ 80 static const int EXTERNAL_BINARY_DATA_BY_POST_APP_MAX_SIZE = 1 * 1024 * 1024; /*!< Maximum size of binary data that can be specified as an attachment (via the Miiverse service). */ 81 static const int DIRECT_MESSAGE_PID_MAX_NUM = 1; /*!< Maximum number of recipients of a direct message. */ 82 static const int TITLE_TEXT_MAX_LENGTH = 127; /*!< Maximum number of characters that can be specified as a community data title name. */ 83 static const int DESCRIPTION_TEXT_MAX_LENGTH = 255; /*!< Define the maximum number of characters that can be specified in a community description. */ 84 static const int ICON_DATA_MAX_SIZE = 64 * 1024 + 44; /*!< Maximum size of the community icon. */ 85 static const int COMMUNITY_CODE_LENGTH = 12; /*!< Size of the community code. */ 86 static const int STAMP_DATA_MAX_NUM = 100; /*!< Maximum number of stamps that can be set. */ 87 static const int STAMP_DATA_100_100_MAX_SIZE = 40044; /*!< Maximum size of stamp data (100x100). */ 88 static const int STAMP_DATA_200_200_MAX_SIZE = 160044; /*!< Maximum size of stamp data (200x200). */ 89 static const int POST_ID_MAX_NUM = 20; /*!< Maximum number of post IDs that can be set. */ 90 static const int COMMUNITY_ID_MAX_NUM = 20; /*!< Define the maximum number of post IDs that can be set. */ 91 static const int FAVORITE_COMMUNITY_MAX_NUM = 16; /*!< The maximum number of Favorite communities per title. */ 92 static const int SELF_COMMUNITY_MAX_NUM = 4; /*!< The maximum number of communities that can be created per title. */ 93 static const int UPLOADED_COMMON_DATA_MAX_SIZE = 4 * 1024; /*!< The maximum size of common data that can be retrieved from <tt>UploadedPostData</tt>. */ 94 static const int YOUTUBE_MOVIE_DATA_MAX_NUM = 1; /*!< Maximum number of movies that can be set. */ 95 96 // Define the required buffer sizes. 97 static const int BODY_TEXT_BUFF_LENGTH = 256; /*!< Text data storage buffer size. */ 98 static const int COMPRESSED_BODY_MEMO_BUFF_SIZE = 40 * 1024; /*!< Maximum handwritten memo data size after compression. */ 99 static const int TOPIC_TAG_BUFF_LENGTH = 151 + 1; /*!< Size of the buffer for storing topic tags. */ 100 static const int SEARCH_KEY_BUFF_LENGTH = 151 + 1; /*!< Size of the buffer for storing search keys. */ 101 static const int EXTERNAL_URL_BUFF_LENGTH = 256; /*!< Size of the buffer for storing URLs. */ 102 static const int MII_NICKNAME_BUFF_LENGTH = 32; /*!< Size of the buffer for storing Mii character nicknames. */ 103 static const int POST_ID_BUFF_LENGTH = 32; /*!< Size of the buffer for storing post IDs. */ 104 static const int DIRECT_MESSAGE_ID_BUFF_LENGTH = 32; /*!< Size of the buffer for storing direct message IDs. */ 105 static const int COMMENT_ID_BUFF_LENGTH = 32; /*!< Size of the buffer for storing comment IDs. */ 106 static const int TITLE_TEXT_BUFF_LENGTH = 128; /*!< The maximum number of characters that can be specified as a community data title name. */ 107 static const int DESCRIPTION_TEXT_BUFF_LENGTH = 256; /*!< Define the maximum number of characters that can be specified in a community description. */ 108 static const int COMPRESSED_ICON_DATA_BUFF_SIZE = ICON_DATA_MAX_SIZE; /*!< Size of the buffer for storing community icons. */ 109 static const int SEARCH_PID_BUFF_NUM = 12; /*!< Size of the buffer for storing principal ID searches. */ 110 static const int URL_BUFF_LENGTH = 2048; /*!< URL buffer length. */ 111 static const int USER_AGENT_BUFF_LENGTH = 64; /*!< USER AGENT buffer length. */ 112 static const int PARAM_PACK_BUFF_LENGTH = 512; /*!< Parameter pack buffer length. */ 113 static const int HOST_NAME_BUFF_LENGTH = 256; /*!< Host name buffer length.*/ 114 static const int POST_APP_PARAM_WORK_BUFF_SIZE = 1 * 1024 * 1024; /*!< Work size for parameters used to upload posts via the post application. */ 115 static const int COMMUNITY_ID_BUFF_NUM = 30; /*!< Define the buffer size for community IDs that can be set. */ 116 117 // Other definitions. 118 static const unsigned int COMMUNITY_ID_ALL_OFFICIAL = 0xFFFFFFFF; /*!< IDs indicating all official communities. */ 119 static const unsigned char LANGUAGE_ID_ALL = 0xFE; /*!< IDs representing all languages. */ 120 121 /// Debug output control level. 122 enum ReportType 123 { 124 REPORT_TYPE_PUBLIC = (1<<0), /*!< All related processes. */ 125 REPORT_TYPE_INIT = (1<<1), /*!< Initialization. */ 126 REPORT_TYPE_DEBUG = (1<<2), /*!< Debugging. */ 127 REPORT_TYPE_POST = (1<<3), /*!< Post. */ 128 REPORT_TYPE_GET = (1<<4), /*!< Get. */ 129 REPORT_TYPE_CONNECT = (1<<5), /*!< Connection-related action. */ 130 REPORT_TYPE_FRIEND = (1<<6), /*!< Friend-related action. */ 131 REPORT_TYPE_MEMORY = (1<<7), /*!< Memory-related action. */ 132 REPORT_TYPE_TEST = (1<<8), /*!< Tests and test codes. */ 133 REPORT_TYPE_XML_PARSER = (1<<9), /*!< Raw data. */ 134 REPORT_TYPE_RESPONSE = (1<<10), /*!< Response data. */ 135 REPORT_TYPE_ERROR = (1<<11), /*!< Error-related stuff. */ 136 REPORT_TYPE_INFO = (1<<12), /*!< Information that is always output. */ 137 REPORT_TYPE_ALL = 138 REPORT_TYPE_PUBLIC | 139 REPORT_TYPE_INIT | 140 REPORT_TYPE_DEBUG | 141 REPORT_TYPE_POST | 142 REPORT_TYPE_GET | 143 REPORT_TYPE_CONNECT | 144 REPORT_TYPE_FRIEND | 145 REPORT_TYPE_MEMORY | 146 REPORT_TYPE_TEST | 147 REPORT_TYPE_XML_PARSER | 148 REPORT_TYPE_RESPONSE | 149 REPORT_TYPE_ERROR | 150 REPORT_TYPE_INFO, 151 }; 152 153 /// @cond 154 /*!< Type definition for data sent by a post application. */ 155 enum 156 { 157 DATA_TYPE_STAMP = 0, 158 DATA_TYPE_YOUTUBE_MOVIE_DATA, 159 DATA_TYPE_INVALID_STAMP 160 }; 161 162 /*!< Type definition for the result data obtained by the post application. */ 163 enum 164 { 165 RESULT_COMMON_DATA_TYPE_YOUTUBE = 0 166 }; 167 /// @endcond 168 169 /// @cond 170 // Definitions for the constants used in the OLV library (<b>Note:</b> do not use these constants directly in your application.) 171 static const unsigned int UPLOAD_FLAG_VALUE_SPOILER = (1<<0); /*!< Flag specified when the post includes spoilers. */ 172 static const unsigned int UPLOAD_FLAG_VALUE_RESERVED1 = (1<<1); /*!< Reserved to maintain compatibility. */ 173 static const unsigned int UPLOAD_FLAG_VALUE_RESERVED2 = (1<<2); /*!< Reserved to maintain compatibility. */ 174 static const unsigned int UPLOAD_FLAG_VALUE_RESERVED3 = (1<<3); /*!< Reserved to maintain compatibility. */ 175 static const unsigned int UPLOAD_FLAG_VALUE_APP_STARTABLE = (1<<4); /*!< Flag specified when an application can be started from the post. */ 176 static const unsigned int UPLOAD_FLAG_VALUE_FREE_FORMAT = (1<<5); /*!< Flag specified for free format posts. */ 177 static const unsigned int UPLOAD_FLAG_VALUE_DELETE = (1<<6); /*!< Flag specified when deleting a post. */ 178 static const unsigned int UPLOAD_FLAG_VALUE_ONLY_BODY_TEXT = (1<<16); /*!< Flag for restricting posts to text data (for the post application only). */ 179 static const unsigned int UPLOAD_FLAG_VALUE_ONLY_BODY_MEMO = (1<<17); /*!< Flag for restricting posts to handwritten memo data (for the post application only). */ 180 static const unsigned int UPLOAD_FLAG_VALUE_RESERVED4 = (1<<18); /*!< Reserved to maintain compatibility (for the post application only). */ 181 static const unsigned int DOWNLOAD_FLAG_VALUE_WITH_BODY_TEXT = (1<<0); /*!< Flag for checking whether a post includes body text. */ 182 static const unsigned int DOWNLOAD_FLAG_VALUE_WITH_BODY_MEMO = (1<<1); /*!< Flag for checking whether a post includes handwritten memo data. */ 183 static const unsigned int DOWNLOAD_FLAG_VALUE_WITH_EXTERNAL_IMAGE_DATA = (1<<2); /*!< Flag for checking whether a post has image attachments. */ 184 static const unsigned int DOWNLOAD_FLAG_VALUE_WITH_EXTERNAL_BINARY_DATA = (1<<3); /*!< Flag for checking whether a post includes binary attachments. */ 185 static const unsigned int DOWNLOAD_FLAG_VALUE_WITH_MII_DATA = (1<<4); /*!< Flag for checking whether a post includes Mii character data. */ 186 static const unsigned int DOWNLOAD_FLAG_VALUE_WITH_EXTERNAL_URL = (1<<5); /*!< Flag for checking whether a post includes an external URL. */ 187 static const unsigned int DOWNLOAD_FLAG_VALUE_WITH_APP_DATA = (1<<6); /*!< Flag for checking whether a post includes application data. */ 188 static const unsigned int DOWNLOAD_FLAG_VALUE_EMPATHY_ADDED = (1<<7); /*!< Flag for checking whether the user has given a Yeah. */ 189 static const unsigned int DOWNLOAD_FLAG_VALUE_RESERVED1 = (1<<8); /*!< Reserved to maintain compatibility. */ 190 static const unsigned int DOWNLOAD_FLAG_VALUE_SPOILER = (1<<9); /*!< Flag for checking whether the post contains a spoiler. */ 191 static const unsigned int DOWNLOAD_FLAG_VALUE_FREE_FORMAT = (1<<10); /*!< Flag for checking whether post data is free format. */ 192 static const unsigned int UPLOADED_FLAG_VALUE_WITH_BODY_TEXT = (1<<0); /*!< Flag for checking whether a post includes body text. */ 193 static const unsigned int UPLOADED_FLAG_VALUE_WITH_BODY_MEMO = (1<<1); /*!< Flag for checking whether a post includes handwritten memo data. */ 194 static const unsigned int UPLOADED_FLAG_VALUE_WITH_APP_DATA = (1<<2); /*!< Flag for checking whether a post includes application data. */ 195 static const unsigned int UPLOADED_FLAG_VALUE_SPOILER = (1<<3); /*!< Flag for checking whether the data contains a spoiler. */ 196 static const unsigned int STAMP_FLAG_VALUE_NONE = 0; /*!< Flag that represents the normal stamp state. (If no flag is specified, the standard state is used.) */ 197 static const unsigned int STAMP_FLAG_VALUE_INVALID = (1<<0); /*!< Flag that indicates that the stamp is invalid. (It cannot be selected.) */ 198 /// @endcond 199 200 /// @cond 201 // These definitions were retained to maintain compatibility with earlier versions. 202 // Do not use them. They have been deprecated. 203 static const int TGA_HEADER_SIZE = 44; /*!< Size of the TGA header and footer. (Do not use.) */ 204 static const int BODY_MEMO_SIZE = BODY_MEMO_WIDTH * BODY_MEMO_HEIGHT * BODY_MEMO_BPP + TGA_HEADER_SIZE; /*!< Size of the handwritten memo data that can be specified as the post body. (Use <tt>BODY_MEMO_MAX_SIZE</tt> instead.) */ 205 /// @endcond 206 207 /** @} */ 208 209 } 210 } 211 212 #endif 213