Nintendo 3DS Miiverse Library  1.3.2
(OLV/Olive)
olv_TypesUploadFavoriteToCommunityData.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*
2 Project: OLV
3 File: olv_TypesUploadFavoriteToCommunityData.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_FAVORITE_TO_COMMUNITYDATA_H_
15 #define __OLV_TYPES_UPLOAD_FAVORITE_TO_COMMUNITYDATA_H_
16 
17 /*! @file
18 @brief Declaration of types related to registering or removing OLV communities as favorites.
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 registering a favorite to a community or removing a favorite.
42 */
44 {
45 public:
46  /*!
47 @brief Flags that can be specified in the <tt>@ref SetFlags</tt> function.
48  */
49  enum Flags
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 favorite.
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 community ID.
76 
77 Specifying this option is not required. You are prohibited from specifying this option when a community code is specified for the <tt>@ref SetCommunityCode</tt> function. <br />
78 If neither a community ID nor a community code is specified, the general community is registered or removed as a favorite by default.
79 
80 @param[in] communityId The community ID.
81  */
82  void SetCommunityId(u32 communityId);
83 
84  /*!
85 @brief Sets the community code.
86 
87 Specifying this option is not required. You are prohibited from specifying this option when a community ID is specified for the <tt>@ref SetCommunityId</tt> function. <br />
88 If neither a community ID nor a community code is specified, the general community is registered or removed as a favorite by default.
89 
90 @param[in] communityCode The community code.
91  */
92  void SetCommunityCode(const char* communityCode);
93 
94  /*!
95 @brief Gets the size of the working buffer used by the <tt>@ref nn::olv::UploadFavoriteToCommunityData</tt> function.
96 
97 Call this function after all of the various parameters have been specified, with the exception of the <tt>@ref SetWork</tt> function. <br />
98 This function returns fixed values.
99 
100 @return Returns the size of the working buffer used by the <tt>@ref nn::olv::UploadFavoriteToCommunityData</tt> function.
101  */
102  u32 GetWorkSize() const;
103 
104  /*!
105 @brief Sets the working buffer used by the <tt>@ref nn::olv::UploadFavoriteToCommunityData</tt> function.
106 
107 You must specify this option. <br />
108 Specify a buffer of at least the size obtained with the <tt>@ref GetWorkSize</tt> function. <br />
109 
110 @param[in] work The working buffer.
111 @param[in] workSize The size of the working buffer.
112  */
113  void SetWork(u8* work, u32 workSize);
114 
115 private:
116  u32 m_Flags;
117  u8* m_Work;
118  u32 m_WorkSize;
119  u32 m_CommunityId;
120  s8 m_IsSetCommunityId;
121  NN_PADDING3;
122  u8 m_Reserved[64-20];
123 
124  friend class nn::olv::internal::Main;
125 };
126 
127 /** @} */
128 
129 } // namespace olv
130 } // namespace nn
131 #endif