/*---------------------------------------------------------------------------* 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_DOWNLOAD_CATALOG_H_ #define NN_EC_DOWNLOAD_CATALOG_H_ #include #include namespace nn { namespace ec { //! @addtogroup nn_ec_class //! @{ /*! @brief Class for handling a download catalog. @see Programming Manual */ class DownloadCatalog : public Catalog { public: NN_EC_DECLARE_ACCESSOR; NN_EC_DECLARE_IMPL; public: /*! @brief The maximum number of items you want to get. */ static const u32 ITEM_NUM_MAX = 100; public: /*! @brief Instantiates an object. */ DownloadCatalog(); /*! @brief Destroys the object. */ ~DownloadCatalog(); /*! @brief Gets a list of downloadable content that can be redownloaded. This function calls @ref Clear before retrieving the list. @n The reference counters of previously retrieved items are decremented by 1, so make note of the persistence of items retrieved with @ref GetItem. The following information cannot be obtained for items obtained by this function. @li Sales status. @li Price. This function blocks because it involves communication. @param[in] pQuery Specifies the query. @n Specify NULL if you are not using a query. @n Values other than @ref Query::Select are ignored. @param[in] startIndex Specifies the start position. @param[in] num Specifies the number of items to retrieve. @n The maximum number that can be specified is @ref ITEM_NUM_MAX. @return The result of processing. @retval Result::IsSuccess Indicates success. @retval ResultNotInitialized Indicates that the library is not initialized. @retval ResultNotLoggedIn Not logged in to the eShop server. @retval ResultInvalidArgument Indicates that an argument is invalid. @retval ResultOutOfMemory Insufficient memory. @retval ResultNotConnected Not connected to the Internet. @retval ResultCanceled The communication process was canceled. @retval ResultExcluded The EC applet is running. @retval ResultResponseError A response error occurred. @retval ResultCurlError A communication error occurred. @retval ResultServerError A server error occurred. @retval Other Sometime an error generated by @ref Login is returned. */ nn::Result RetrieveAocs(const Query* pQuery, u32 startIndex, u32 num); /*! @brief Gets the total number of items that can be retrieved. The value returned by this function does not depend on the number of items to retrieve as specified in RetrieveAocs. You must call RetrieveAocs before calling this function. @n This function returns 0 if an item list could not be retrieved with RetrieveAocs. @return Returns the total number of retrievable items. */ u32 GetTotal() const; private: // Impl* CreateImpl(u32 num); }; //! @} }} // namespace nn::ec #endif // NN_EC_DOWNLOAD_CATALOG_H_