Nintendo 3DS Miiverse Library  1.3.2
(OLV/Olive)
olv_TypesUploadEmpathyToPostData.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*
2 Project: OLV
3 File: olv_TypesUploadEmpathyToPostData.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_UPLOAD_EMPATHY_TO_POSTDATA_H_
15 #define __OLV_TYPES_UPLOAD_EMPATHY_TO_POSTDATA_H_
16 
17 /*! @file
18 @brief Declaration of types related to giving a Yeah to or removing a Yeah from OLV post data.
19 */
20 
21 #include <nn/config.h>
22 #include <nn/types.h>
23 #include <nn/olv/olv_Const.h>
24 
25 /// <span>nn</span>
26 namespace nn {
27 
28 /// <span>olv</span>
29 namespace olv {
30 
31 namespace internal
32 {
33 class Main;
34 }
35 
36 /*/* @defgroup class Classes
37  * @{
38  */
39 
40 /*!
41 @brief The class representing the parameters used when uploading a Yeah to a post or removing a Yeah.
42 */
44 {
45 public:
46  /*!
47 @brief Flags that can be specified in the <tt>@ref SetFlags</tt> function.
48  */
49  enum
50  {
51  FLAG_NONE = 0, //!< This is the state when no flags are specified.
52  FLAG_REMOVE = (1<<0) //!< Specify this flag when removing a Yeah.
53  };
54 
55  /*!
56 @brief Instantiates the object.
57  */
59 
60  /*!
61 @brief Reverts parameters to their initial state.
62  */
63  void Reset();
64 
65  /*!
66 @brief Sets flags.
67 
68 Specifying this option is not required.
69 
70 @param[in] flags Flags (<tt>FLAG_*</tt>).
71  */
72  void SetFlags(u32 flags);
73 
74  /*!
75 @brief Sets the post ID.
76 
77 You must specify this option.
78 
79 @param[in] postId The post ID. <br />
80 The maximum number of characters that can be specified is <tt>@ref nn::olv::POST_ID_BUFF_LENGTH - 1</tt>.
81  */
82  void SetPostId(const char* postId);
83 
84  /*!
85 @brief Gets the size of the working buffer used by the <tt>@ref nn::olv::UploadEmpathyToPostData</tt> function.
86 
87 Call this function after all of the various parameters have been specified, with the exception of the <tt>@ref SetWork</tt> function. <br />
88 This function returns fixed values.
89 
90 @return Returns the size of the working buffer used by the <tt>@ref nn::olv::UploadEmpathyToPostData</tt> function.
91  */
92  u32 GetWorkSize() const;
93 
94  /*!
95 @brief Sets the size of the working buffer used by the <tt>@ref nn::olv::UploadEmpathyToPostData</tt> function.
96 
97 You must specify this option. <br />
98 Specify a buffer of at least the size obtained with the <tt>@ref GetWorkSize</tt> function. <br />
99 
100 @param[in] work The working buffer.
101 @param[in] workSize The size of the working buffer.
102  */
103  void SetWork(u8* work, u32 workSize);
104 
105 private:
106  u32 m_Flags;
107  u8* m_Work;
108  u32 m_WorkSize;
109  char m_PostId[POST_ID_BUFF_LENGTH];
110  u8 m_Reserved[64-44];
111 
112  friend class nn::olv::internal::Main;
113 };
114 
115 /** @} */
116 
117 } // namespace olv
118 } // namespace nn
119 #endif