Nintendo 3DS Miiverse Library  1.3.2
(OLV/Olive)
olv_TypesDownloadedDataBase.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*
2 Project: OLV
3 File: olv_TypesDownloadedDataBase.h
4 
5 Copyright (C) 2009-2013 Nintendo. All rights reserved.
6 
7 These coded instructions, statements, and computer programs contain
8 proprietary information of Nintendo of America Inc. and/or Nintendo
9 Company Ltd., and are protected by Federal copyright law. They may
10 not be disclosed to third parties or copied or duplicated in any form,
11 in whole or in part, without the prior written consent of Nintendo.
12 
13  *---------------------------------------------------------------------------*/
14 #ifndef __OLV_TYPES_DOWNLOADED_DATABASE_H_
15 #define __OLV_TYPES_DOWNLOADED_DATABASE_H_
16 
17 /*! @file
18 @brief Base class declarations related to OLV download data.
19 */
20 
21 #include <nn/config.h>
22 #include <nn/types.h>
23 #include <nn/mii/mii_StoreData.h>
24 #include <nn/olv/olv_Const.h>
25 #include <nn/olv/olv_Result.h>
26 #include <nn/fnd/fnd_DateTime.h>
27 
28 /// <span>nn</span>
29 namespace nn {
30 
31 /// <span>olv</span>
32 namespace olv {
33 
34 namespace internal
35 {
36 class Main;
37 }
38 
39 /*/* @defgroup class Classes
40  * @{
41  */
42 
43 /// @cond
44 /*!
45 @brief A base class for the class that stores the downloaded post data. <br />
46 This class cannot be used directly in applications.
47 */
48 class DownloadedDataBase
49 {
50 protected:
51  enum
52  {
53  FLAG_NONE = 0,
54  FLAG_WITH_BODY_TEXT = DOWNLOAD_FLAG_VALUE_WITH_BODY_TEXT,
55  FLAG_WITH_BODY_MEMO = DOWNLOAD_FLAG_VALUE_WITH_BODY_MEMO,
56  FLAG_WITH_EXTERNAL_IMAGE_DATA = DOWNLOAD_FLAG_VALUE_WITH_EXTERNAL_IMAGE_DATA,
57  FLAG_WITH_MII_DATA = DOWNLOAD_FLAG_VALUE_WITH_MII_DATA,
58  FLAG_WITH_EXTERNAL_URL = DOWNLOAD_FLAG_VALUE_WITH_EXTERNAL_URL,
59  FLAG_WITH_APP_DATA = DOWNLOAD_FLAG_VALUE_WITH_APP_DATA,
60  FLAG_EMPATHY_ADDED = DOWNLOAD_FLAG_VALUE_EMPATHY_ADDED,
61  FLAG_FREE_FORMAT = DOWNLOAD_FLAG_VALUE_FREE_FORMAT,
62  FLAG_SPOILER = DOWNLOAD_FLAG_VALUE_SPOILER
63  };
64 
65  DownloadedDataBase();
66  bool TestFlags(u32 flags) const;
67  u32 GetUserPid() const;
68  nn::fnd::DateTime GetPostDate() const;
69  s8 GetFeeling() const;
70  u32 GetRegionId() const;
71  u8 GetPlatformId() const;
72  u8 GetLanguageId() const;
73  u8 GetCountryId() const;
74  void GetExternalUrl(char* externalUrl, u32 externalUrlMaxLength) const;
75  void GetMiiData(nn::mii::StoreData* storeData) const;
76  void GetMiiNickname(wchar_t* miiNickname, u32 miiNicknameMaxLength) const;
77  void GetBodyText(wchar_t* bodyText, u32 bodyTextMaxLength) const;
78  void GetBodyMemo(u8* bodyMemo, u32* bodyMemoSize, u32 bodyMemoMaxSize) const;
79  void GetTopicTag(wchar_t* topicTag, u32 topicTagMaxLength) const;
80  void GetAppData(u8* appData, u32* appDataSize, u32 appDataMaxSize) const;
81  u32 GetAppDataSize() const;
82  u32 GetExternalImageDataSize() const;
83  nn::olv::Result DownloadExternalImageData(void* externalImageData, u32* externalImageDataSize, u32 externalImageDataMaxSize) const;
84  u32 GetCommunityId() const;
85  u32 GetEmpathyCount() const;
86  u32 GetCommentCount() const;
87  void GetPostId(char* postId, u32 postIdMaxLength) const;
88 
89  u32 m_Flags;
90  u32 m_UserPid;
91  nn::fnd::DateTime m_PostDate;
92  char m_PostId[POST_ID_BUFF_LENGTH];
93  u32 m_RegionId;
94  s8 m_Feeling;
95  u8 m_PlatformId;
96  u8 m_LanguageId;
97  u8 m_CountryId;
98  wchar_t m_BodyText[BODY_TEXT_BUFF_LENGTH];
99  u8 m_BodyMemo[BODY_MEMO_BUFF_LENGTH];
100  u32 m_BodyMemoSize;
101  wchar_t m_TopicTag[TOPIC_TAG_BUFF_LENGTH];
102  u8 m_AppData[APP_DATA_BUFF_LENGTH];
103  u32 m_AppDataSize;
104  char m_ExternalImageUrl[EXTERNAL_URL_BUFF_LENGTH];
105  u32 m_ExternalImageSize;
106  char m_ExternalUrl[EXTERNAL_URL_BUFF_LENGTH];
107  u8 m_MiiData[MII_DATA_BUFF_LENGTH];
108  wchar_t m_MiiNickname[MII_NICKNAME_BUFF_LENGTH];
109  u32 m_CommunityId;
110  u32 m_EmpathyCount;
111  u32 m_CommentCount;
112  u8 m_Reserved[8192-7456];
113 
114  friend class nn::olv::internal::Main;
115 };
116 /// @endcond
117 
118 /** @} */
119 
120 } // namespace olv
121 } // namespace nn
122 #endif