/*---------------------------------------------------------------------------* Copyright (C) Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ #ifndef NN_EC_CART_H_ #define NN_EC_CART_H_ #include namespace nn { namespace ec { //! @addtogroup nn_ec_class //! @{ /*! @brief Class for handling a cart. */ class Cart : public ItemList { public: NN_EC_DECLARE_ACCESSOR; NN_EC_DECLARE_IMPL; public: /*! @brief Instantiates an object. */ Cart(); /*! @brief Destroys the object. */ virtual ~Cart(); // pure-virtual: virtual nn::Result AddItem(const Item* pItem) = 0; // pure-virtual: virtual nn::Result RemoveItem(u32 index) = 0; // pure-virtual: virtual nn::Result CheckItem(const Item* pItem) const = 0; // pure-virtual: virtual void SynchronizeCurrentRights() = 0; /*! @brief Removes an item from the cart. The reference counter of the deleted item is decremented by 1. @param[in] id Specifies the NS-UID of the item to remove. @return The result of processing. @retval Result::IsSuccess Indicates success. @retval ResultNotFound There is no item with that specified NS-UID. */ nn::Result RemoveItemById(NsUniqueId id); /*! @brief Determines whether the specified item is in the cart. @param[in] pItem Specifies the item. @return Returns true if the item has been added to the cart, or false otherwise. */ bool ContainsItem(const Item* pItem) const; }; //! @} }} // namespace nn::ec #endif // NN_EC_CART_H_