1 /*---------------------------------------------------------------------------*
2 
3 Copyright (C) Nintendo.  All rights reserved.
4 
5 These coded instructions, statements, and computer programs contain
6 proprietary information of Nintendo of America Inc. and/or Nintendo
7 Company Ltd., and are protected by Federal copyright law.  They may
8 not be disclosed to third parties or copied or duplicated in any form,
9 in whole or in part, without the prior written consent of Nintendo.
10 
11  *---------------------------------------------------------------------------*/
12 
13 #ifndef NN_EC_PRICE_H_
14 #define NN_EC_PRICE_H_
15 
16 #include <nn/ec/ec_Types.h>
17 #include <nn/ec/ec_Money.h>
18 
19 namespace nn { namespace ec {
20 
21 //! @addtogroup  nn_ec_class
22 //! @{
23 
24 /*!
25 @brief  Class for handling a price.
26 
27 @see  <a class="el" href="../../Doc/EcdkProgrammingManual/contents/Pages/Page_48711722.html#PageId_48924365">Programming Manual</a>
28 */
29 class Price : public RootObject, private NonCopyable<Price>
30 {
31 public:
32     NN_EC_DECLARE_ACCESSOR;
33     NN_EC_DECLARE_IMPL;
34 
35 public:
36     /*!
37 @brief  Specifies the maximum length of the discount description.
38 */
39     static const size_t DISCOUNT_DESCRIPTION_LENGTH_MAX = 4000;
40     /*!
41 @brief  Specifies the size of the discount description.
42 */
43     static const size_t DISCOUNT_DESCRIPTION_SIZE = DISCOUNT_DESCRIPTION_LENGTH_MAX + 1;
44 
45 public:
46     /*!
47 @brief  Instantiates an object.
48 */
49     Price();
50 
51     /*!
52 @brief  Destroys the object.
53 */
54     ~Price();
55 
56     /*!
57 @brief  Gets the price ID.
58 
59 @return  Returns the price ID.
60 */
61     s64 GetId() const;
62 
63     /*!
64 @brief  Gets the sale price.
65 
66 If the price is currently discounted, the discounted price is returned. @n
67 Usually the regular price is returned.
68 
69 @return  Returns the sale price.
70 */
71     const Money* GetSalesPrice() const;
72 
73     /*!
74 @brief  Gets the regular price.
75 
76 @return  Returns the regular price.
77 */
78     const Money* GetRegularPrice() const;
79 
80     /*!
81 @brief  Determines whether it is discounted.
82 
83 @return  Returns <tt>true</tt> if it is discounted, or <tt>false</tt> otherwise.
84 */
85     bool IsDiscounted() const;
86 
87     /*!
88 @brief  Gets the discount price ID.
89 
90 @return  Returns the discount price ID.
91 */
92     s64 GetDiscountId() const;
93 
94     /*!
95 @brief  Gets the percentage of the discount when the price is discounted.
96 
97 @return  Returns the percentage.
98 */
99     s32 GetDiscountPercentage() const;
100 
101     /*!
102 @brief  Gets the discount description.
103 
104 If no description exists, an empty string is returned.
105 
106 @return  Returns the discount description.
107 */
108     const char* GetDiscountDescription() const;
109 
110 private:
111     //
112     NN_EC_IMPL;
113 };
114 
115 //! @}
116 
117 }} // namespace nn::ec
118 
119 #endif // NN_EC_PRICE_H_
120