/*---------------------------------------------------------------------------*
Project: OLV
File: olv_Api.h
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.
*---------------------------------------------------------------------------*/
//------------------------------------------------------------------------------
/** @file olv_Api.h
*
* @brief The main header for the OLV library.
*
*/
//------------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// standard header here
// -----------------------------------------------------------------------------
#ifndef __OLV_API_H_
#define __OLV_API_H_
/// nn
namespace nn {
/// olv
namespace olv {
/** @defgroup function Static Functions
* @{
*/
//------------------------------------------------------------------------------
/**
* Initialization.
*
* Initializes the Olive library (OLV).
* Call this function before using the Olive library.
*
* If this function is called with nn::olv::InitializeParam specified in its default state, the library is initialized in online mode.
* If this function is called with @ref nn::olv::InitializeParam::FLAG_OFFLINE_MODE specified by nn::olv::InitializeParam::SetFlags, the library is initialized in offline mode.
* The difference between online mode and offline mode is described below.
*
* Online Mode
* @li At initialization, the service token is obtained, a connection is made to the server, and it prepares the online APIs to be available.
* @li If initialized in online mode, you can use all the features of the OLV library.
* @li When this function is called in online mode, processing is temporarily blocked so that it can search for a server to connect to.
* (The server stores the URLs that the OLV library needs to send and receive data.)
* @li The @ref nn::olv::SwitchToOnlineMode function is called if the library is initialized in online mode.
* @li Also refer to the errors from that function.
*
* Offline Mode
* @li Performs minimal initialization, such as initializing a work buffer, that does not require communication to be established.
* @li The function finishes quickly because it does not establish communication. However, API functions for use in online mode are not available.
* @li If the library is initialized in offline mode, you can switch to online mode at any time by calling the @ref nn::olv::SwitchToOnlineMode function.
*
* When this function is called, it also initializes other OLV modules.
*
* @param[in] param Specifies parameters used for initialization.
*
* @retval ResultSuccess Indicates success.
* @retval ResultInitialized Indicates that the library is already initialized.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInitializeError Indicates that initialization failed.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultLibraryRestrictedByParentalControl Indicates that posting and viewing are blocked by Parental Controls.
* @retval ResultAcpError Indicates that the ACP function failed.
* @retval ResultSciError Indicates that the SCI function failed.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultInternalError Indicates an internal error in the library.
*
* This function calls the following functions in the nn::act namespace.
* @li nn::act::Initialize
* @li nn::act::GetSlotNo
* @li nn::act::GetTransferableIdEx
* @li nn::act::GetTimeZoneId
* @li nn::act::GetUtcOffset
* If initialized in online mode
* @li nn::act::AcquireIndependentServiceToken
*
* All of these functions except for nn::act::GetSlotNo and nn::act::GetUtcOffset may return an error.
* An nn::act error is returned. For information, see the nn::act error codes.
*
* @note If the library was initialized in offline mode, this function makes an internal call to @ref nn::olv::SwitchToOnlineMode. If the function fails, the application is prohibited from automatically trying to call the function again.
*/
nn::Result Initialize(const nn::olv::InitializeParam* param);
//------------------------------------------------------------------------------
/**
* Initializes the version that gets the parameters passed at the time of the application jump from the system parameters.
*
* If initialization succeeds, the information passed at the time of the application jump is stored in @ref nn::olv::MainAppParam and can be used by the application.
*
* If the parameters passed at the time of the application jump failed to be stored, the @ref nn::olv::Initialize function is called internally to perform the normal initialization process without bothering to return an error.
* (If this happens, values inside @ref nn::olv::MainAppParam are undefined.)
*
* The initialization process is otherwise the same as the @ref nn::olv::Initialize function. However, initialization is faster because communications does not take place, even when the library is being initialized in online mode to use the parameters passed at the time of the application jump that are necessary for communications.
* Also, see the description of the @ref nn::olv::Initialize function.
*
* @note You cannot call this function in offline mode.
* @note If this function is called in offline mode, @ref nn::olv::ResultInvalidParameter is returned.
*
* @param[out] mainAppParam Specifies the parameter storing the parameters passed at the time of the application jump.
* @param[in] param Specifies parameters used for initialization.
*
* @retval ResultSuccess Indicates success.
* @retval ResultInitialized Indicates that the library is already initialized.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInitializeError Indicates that initialization failed.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultLibraryRestrictedByParentalControl Indicates that posting and viewing are blocked by Parental Controls.
* @retval ResultAcpError Indicates that the ACP function failed.
* @retval ResultSciError Indicates that the SCI function failed.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInternalError Indicates an internal error in the library.
*
* This function may call the following functions in the nn::act namespace.
* @li nn::act::Initialize
* @li nn::act::GetSlotNo
* @li nn::act::GetTransferableIdEx
* @li nn::act::GetTimeZoneId
* @li nn::act::GetUtcOffset
* @li nn::act::AcquireIndependentServiceToken
*
* All of these functions, except for nn::act::GetSlotNo and nn::act::GetUtcOffset, may return an error. In such cases, the nn::act error is returned. Refer to the nn::act error codes.
*
* @note This function makes an internal call to @ref nn::olv::SwitchToOnlineMode. If the function fails, the application is prohibited from automatically trying to call the function again.
*/
nn::Result Initialize(nn::olv::MainAppParam* mainAppParam, const nn::olv::InitializeParam* param);
//------------------------------------------------------------------------------
/**
* Finalization.
*
* Finalizes the OLV library.
* Call this function when you are finished using the OLV library.
*
* Works in offline mode.
*
* When this function is called, it also finalizes other OLV modules.
*/
void Finalize();
//------------------------------------------------------------------------------
/**
* Returns whether the OLV library is available.
*
* Works in offline mode.
* This function is thread-safe.
*
* @return Returns true if it is available, and false if it is not.
*/
bool IsInitialized();
//------------------------------------------------------------------------------
/**
* Switches the OLV library to online mode.
* This results in communications to get a service token and search for a server to connect to.
* (The server stores the URLs that the OLV library needs to send and receive data.)
*
* @retval ResultSuccess Indicates success.
* @retval ResultInitializeError Indicates that initialization failed.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultInitialized Indicates that the object is already initialized in online mode.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultInternalError Indicates an internal error in the library.
*
* This function can return an error because it internally calls nn::act::AcquireIndependentServiceToken.
* An nn::act error is returned. See the nn::act error codes.
*
* @note If this function fails, the application is prohibited from automatically trying to call the function again.
*/
nn::Result SwitchToOnlineMode();
//------------------------------------------------------------------------------
/**
* Forcibly terminate the current send/receive operation.
* Call this function if you want to cancel a send/receive operation and perform a different operation, or if an operation blocks and does not return for a long period of time.
* You can also call this function when the OLV library is not initialized.
*
* Works in offline mode.
* This function is thread-safe.
*
* @note Calling this function also cancels the processing of the following functions called by the application.
* (The function also calls the nn::act::Cancel function, but does not return that function's return values.)
*
* @li nn::nex::NgsFacade::Login
* @li nn::act::AcquireIndependentServiceToken
* @li nn::act::AcquireEcServiceToken
*
* @retval nn::ResultSuccess Indicates success.
* @retval nn::olv::ResultNotCanceled Indicates that there was no action to cancel.
*
*/
nn::Result Cancel();
//------------------------------------------------------------------------------
/**
* Uploads a post.
* Calling this function triggers communication.
*
* @note Contact Nintendo support if you plan on using this function for anything other than debugging. (Its use is normally prohibited in retail versions of products.)
* @note In addition, the resulting posts uploaded with this function are not shown in the community in the Miiverse application. To check on the display of the posts, use the Activity Feed.
* @note To delete the posts, use @ref nn::olv::DeletePostData.
*
* @param[out] uploadedData Buffer storing the result of sending the post. (Specify NULL if it is not needed.)
* @param[in] uploadParam Parameters for uploading the post.
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultNotEnoughMemory Indicates a failure to allocate memory.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultInvalidSize Indicates an invalid post size.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultLibraryRestrictedToUploadByParentalControl Indicates that posting is restricted.
* @retval ResultInternalError Indicates an internal error in the library.
*/
nn::Result UploadPostData(nn::olv::UploadedPostData* uploadedData, const nn::olv::UploadPostDataParam* uploadParam);
//------------------------------------------------------------------------------
/**
* Deletes posts.
* Calling this function triggers communication.
*
* @param[in] deleteParam Parameters used when deleting posts.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultNotEnoughMemory Indicates a failure to allocate memory.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultInvalidSize Indicates an invalid post size.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultLibraryRestrictedToUploadByParentalControl Indicates that posting is restricted.
* @retval ResultInternalError Indicates an internal error in the library.
*/
inline nn::Result DeletePostData(const DeletePostDataParam* deleteParam)
{
return UploadPostData(NULL, reinterpret_cast(deleteParam));
}
//------------------------------------------------------------------------------
/**
* Downloads posts.
* Calling this function triggers communication.
*
* @param[out] topicData Specifies the location for storing topic data.
* @param[out] postDataList Specifies an array for storing posts.
* @param[out] downloadedPostDataNum Specifies a variable in which to store the actual number of retrieved posts.
* @param[in] downloadPostDataMaxNum Specifies the maximum number of posts to retrieve (the number of elements in the storage array).
* @param[in] downloadParam Specifies parameters for downloading posts.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidSize Indicates that the size specified in the parameter is invalid.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultInternalError Indicates an internal error in the library.
*/
nn::Result DownloadPostDataList(
nn::olv::DownloadedTopicData* topicData,
nn::olv::DownloadedPostData* postDataList,
u32* downloadedPostDataNum,
const u32 downloadPostDataMaxNum,
const nn::olv::DownloadPostDataListParam* downloadParam);
//------------------------------------------------------------------------------
/**
* Uploads a Yeah to a post.
* Calling this function triggers communication.
*
* A Yeah cannot be given to a post by the same user that created the post.
* This function returns ResultHttpError403Forbidden when users try to give Yeahs to one of their own posts.
*
* @param[in] uploadParam Specifies parameters for updating the Yeah on a post.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultLibraryRestrictedToUploadByParentalControl Indicates that posting is restricted.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultInternalError Indicates an internal error in the library.
*/
nn::Result UploadEmpathyToPostData(const nn::olv::UploadEmpathyToPostDataParam* uploadParam);
//------------------------------------------------------------------------------
/**
* Uploads a direct message.
* Calling this function triggers communication.
*
* @note Contact Nintendo support if you plan on using this function for anything other than debugging. (Its use is normally prohibited in retail versions of products.)
* @note To delete the direct messages, use @ref nn::olv::DeleteDirectMessageData.
*
* @param[out] uploadedData Specifies a buffer for storing the result of uploading the direct message. (Specify NULL if it is not needed.)
* @param[in] uploadParam Specifies parameters for uploading the direct message.
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultInvalidSize Indicates an invalid post size.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultInternalError Indicates an internal error in the library.
*/
nn::Result UploadDirectMessageData(nn::olv::UploadedDirectMessageData* uploadedData, const nn::olv::UploadDirectMessageDataParam* uploadParam);
//------------------------------------------------------------------------------
/**
* Deletes a direct message.
* Calling this function triggers communication.
*
* @param[in] deleteParam Parameters used when deleting direct messages.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultInvalidSize Indicates an invalid post size.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultInternalError Indicates an internal error in the library.
*/
inline nn::Result DeleteDirectMessageData(const DeleteDirectMessageDataParam* deleteParam)
{
return UploadDirectMessageData(NULL, reinterpret_cast(deleteParam));
}
//------------------------------------------------------------------------------
/**
* Downloads direct messages.
* Calling this function triggers communication.
*
* @note You can only get direct messages sent from the same application.
* @note You cannot get direct messages sent from Miiverse and other applications.
*
* @param[out] directMessageDataList Specifies the storage array for direct messages.
* @param[out] directMessageDataListSize Specifies where the number of actually retrieved direct messages are stored.
* @param[in] directMessageDataListMaxSize Specifies the maximum number of direct messages to retrieve (the number of elements in the storage array).
* @param[in] downloadParam Specifies parameters for downloading direct messages.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidSize Indicates that the size specified in the parameter is invalid.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultInternalError Indicates an internal error in the library.
*/
nn::Result DownloadDirectMessageDataList(
nn::olv::DownloadedDirectMessageData* directMessageDataList,
u32* directMessageDataListSize,
const u32 directMessageDataListMaxSize,
const nn::olv::DownloadDirectMessageDataListParam* downloadParam);
//------------------------------------------------------------------------------
/**
* Uploads comments.
* Calling this function triggers communication.
*
* @note Contact Nintendo support if you plan on using this function for anything other than debugging. (Its use is normally prohibited in retail versions of products.)
* @note To delete the comments, use @ref nn::olv::DeleteCommentData.
*
* @param[out] uploadedData Specifies the buffer storing the result of uploading the comment data. (Specify NULL if it is not needed.)
* @param[in] uploadParam Specifies parameters for uploading the comment data.
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultInvalidSize Indicates an invalid post size.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultInternalError Indicates an internal error in the library.
*/
nn::Result UploadCommentData(nn::olv::UploadedCommentData* uploadedData, const nn::olv::UploadCommentDataParam* uploadParam);
//------------------------------------------------------------------------------
/**
* Deletes comments.
* Calling this function triggers communication.
*
* @param[in] deleteParam Parameters used when deleting comments.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultInvalidSize Indicates an invalid post size.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultInternalError Indicates an internal error in the library.
*/
inline nn::Result DeleteCommentData(const DeleteCommentDataParam* deleteParam)
{
return UploadCommentData(NULL, reinterpret_cast(deleteParam));
}
//------------------------------------------------------------------------------
/**
* Downloads comments.
* Calling this function triggers communication.
*
* @param[out] commentDataList Specifies an array for storing comments.
* @param[out] commentDataListSize Specifies a variable in which to store the actual number of retrieved comments.
* @param[in] downloadCommentDataMaxNum Specifies the maximum number of comments to retrieve (the number of elements in the storage array).
* @param[in] downloadParam Specifies parameters for downloading comments.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidSize Indicates that the size specified in the parameter is invalid.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultInternalError Indicates an internal error in the library.
*/
nn::Result DownloadCommentDataList(
nn::olv::DownloadedCommentData* commentDataList,
u32* commentDataListSize,
const u32 downloadCommentDataMaxNum,
const nn::olv::DownloadCommentDataListParam* downloadParam);
//------------------------------------------------------------------------------
/**
* Uploads community data.
* Calling this function triggers communication.
*
* This function creates, updates, and deletes communities.
*
* If you set this parameter to a community ID, the function updates that community.
* To delete a community, specify the community ID in the same way and set the delete flag.
*
* @param[out] uploadedData Specifies the buffer storing the result of uploading the community data. (Specify NULL if it is not needed.)
* @param[in] uploadParam Specifies parameters for updating the community data.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidSize Indicates that the size specified in the parameter is invalid.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultLibraryRestrictedToUploadByParentalControl Indicates that posting is restricted.
* @retval ResultInternalError Indicates an internal error in the library.
*/
nn::Result UploadCommunityData(nn::olv::UploadedCommunityData* uploadedData, const nn::olv::UploadCommunityDataParam* uploadParam);
//------------------------------------------------------------------------------
/**
* Downloads community data.
* Calling this function triggers communication.
*
* @param[out] communityDataList Specifies an array for storing the communities.
* @param[out] communityDataListSize Specifies an out parameter to hold the number of communities that were actually downloaded.
* @param[in] communityDataListMaxSize Specifies the maximum number of communities that can be retrieved, based on the size of the storage array.
* @param[in] downloadParam Specifies parameters for downloading community data.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidSize Indicates that the size specified in the parameter is invalid.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultInternalError Indicates an internal error in the library.
*/
nn::Result DownloadCommunityDataList(
nn::olv::DownloadedCommunityData* communityDataList,
u32* communityDataListSize,
const u32 communityDataListMaxSize,
const nn::olv::DownloadCommunityDataListParam* downloadParam);
//------------------------------------------------------------------------------
/**
* Adds a community to, or deletes a community from, favorites.
* Calling this function triggers communication.
*
* @param[in] favoriteParam Specifies parameters for updating favorite community information.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultLibraryRestrictedToUploadByParentalControl Indicates that posting is restricted.
* @retval ResultInternalError Indicates an internal error in the library.
*/
nn::Result UploadFavoriteToCommunityData(const nn::olv::UploadFavoriteToCommunityDataParam* favoriteParam);
//------------------------------------------------------------------------------
/**
* Follows or unfollows a user.
* Calling this function triggers communication.
*
* @param[in] followParam Specifies parameters used when following or unfollowing a user.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that invalid parameters have been set.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultSciError Indicates a failure to retrieve the Parental Controls settings.
* @retval ResultLibraryRestrictedToUploadByParentalControl Indicates that posting is restricted.
*/
nn::Result UploadFollowToUserData(
const nn::olv::UploadFollowToUserDataParam* followParam);
//------------------------------------------------------------------------------
/**
* Downloads user data.
* Calling this function triggers communication.
*
* @param[out] userDataList Specifies an array for storing user data.
* @param[out] userDataListSize Specifies a variable in which to store the actual number of retrieved user data entries.
* @param[in] userDataListMaxSize Specifies the maximum number of communities that can be retrieved, based on the size of the storage array.
* @param[in] downloadParam Specifies parameters for downloading user data.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidSize Indicates that the size specified in the parameter is invalid.
* @retval ResultMemoryAllocateError Indicates a failure to allocate memory.
* @retval ResultXmlParseError Indicates a failure to parse raw data.
* @retval ResultNotEnoughMemory Indicates that the system is out of memory.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultCurlError Indicates that a Curl function failed.
* @retval ResultDataNotFound Indicates that the server did not return any data.
* @retval ResultHttpError Indicates an HTTP error.
* @retval ResultServerError Indicates that an error occurred on the server.
* @retval ResultInternalError Indicates an internal error in the library.
*/
nn::Result DownloadUserDataList(
nn::olv::DownloadedUserData* userDataList,
u32* userDataListSize,
const u32 userDataListMaxSize,
const nn::olv::DownloadUserDataListParam* downloadParam);
//------------------------------------------------------------------------------
/**
* Gets the error code that is shown to users.
*
* Works in offline mode.
* This function is thread-safe.
*
* @param[in] result Specifies the nn::Result value returned by the OLV library.
*
* @return Returns the error code as a seven-digit decimal number.
* Returns OLV_ERROR_CODE_UNKNOWN if the OLV library has not been initialized, or if it is passed a success result or nn::Result value not normally returned by the OLV library.
*/
u32 GetErrorCode(const nn::Result& result);
//------------------------------------------------------------------------------
/**
* Starts the Miiverse service.
*
* Works in offline mode.
*
* @param[in] param Specifies parameters for starting the Miiverse service. Opens the default page if no page is specified.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultSystemUpdateRequired Indicates that a system update is required.
*/
nn::Result StartPortalApp(const nn::olv::StartPortalAppParam* param = NULL);
//------------------------------------------------------------------------------
/**
* Starts the post application in a mode that allows posting data.
*
* @param[in] param Specifies conditions for starting the post application.
* Starts the post application with default settings if not specified.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidSize Indicates that the string is longer than the specified length.
* @retval ResultSystemUpdateRequired Indicates that a system update is required.
* @retval ResultLibraryRestrictedToUploadByParentalControl Indicates that posting is restricted.
* @retval ResultSciError Indicates that the SCI function failed.
* @retval ResultInvalidParameter Indicates that time stamp data is not correctly set.
*/
nn::Result UploadPostDataByPostApp(const nn::olv::UploadPostDataByPostAppParam* param = NULL);
//------------------------------------------------------------------------------
/**
* Starts the post application in a mode that allows posting comments.
*
* @param[in] param Specifies conditions for starting the post application.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidSize Indicates the string is longer than the specified length.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultSystemUpdateRequired Indicates that a system update is required.
* @retval ResultLibraryRestrictedToUploadByParentalControl Indicates that posting is restricted.
* @retval ResultSciError Indicates that the SCI function failed.
*/
nn::Result UploadCommentDataByPostApp(const nn::olv::UploadCommentDataByPostAppParam* param);
//------------------------------------------------------------------------------
/**
* Starts the post application in a mode that allows posting direct comments.
*
* @param[in] param Specifies conditions for starting the post application.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidSize Indicates that the string is longer than the specified length.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultSystemUpdateRequired Indicates that a system update is required.
*/
nn::Result UploadDirectMessageDataByPostApp(const nn::olv::UploadDirectMessageDataByPostAppParam* param);
//------------------------------------------------------------------------------
/**
* Gets the result of updating the post, direct message, or comment using the post application.
* Use this function to get the result of the @ref nn::olv::UploadPostDataByPostApp, @ref nn::olv::UploadDirectMessageDataByPostApp, and @ref nn::olv::UploadCommentDataByPostApp functions.
* If you also want to get the post results, use the functions @ref nn::olv::GetResultWithUploadedPostDataByPostApp, @ref nn::olv::GetResultWithUploadedDirectMessageDataByPostApp, and @ref nn::olv::GetResultWithUploadedCommentDataByPostApp.
*
* Call this function when the application has transitioned from the post application to the main application (that is, when you get a foreground message from the SDK.)
* For more information about usage, see the sample demos UploadPostDataByPostApp, UploadCommentDataByPostApp and UploadDirectMessageDataByPostApp.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultSystemUpdateRequired Indicates that a system update is required.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidFormat The size of the image attachment is invalid.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultUnknown Indicates that the function was called at the wrong time.
*/
nn::Result GetResultByPostApp();
//------------------------------------------------------------------------------
/**
* Gets the result of posting an updated post using the post application.
* Use this function to get the result of the @ref nn::olv::UploadPostDataByPostApp function.
*
* Call this function when the application has transitioned from the post application to the main application (that is, when you get a foreground message from the SDK.)
* For more information about usage, see the UploadPostDataByPostApp sample demo.
*
* @param[out] uploadedData Specifies a variable in which to store the resulting post.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultSystemUpdateRequired Indicates that a system update is required.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidFormat Indicates that the @ref nn::olv::UploadPostDataByPostApp function was not running the post application when this function was called.
* Or it indicates that the size of the image attachment is invalid.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultUnknown Indicates that the function was called at an incorrect time.
*/
nn::Result GetResultWithUploadedPostDataByPostApp(nn::olv::UploadedPostData* uploadedData);
//------------------------------------------------------------------------------
/**
* Gets the result of posting an updated direct message using the post application.
* Use this function to get the result of the @ref nn::olv::UploadDirectMessageDataByPostApp function.
*
* Call this function when the application has transitioned from the post application to the main application (that is, when you get a foreground message from the SDK.)
* For more information about usage, see the UploadDirectMessageDataByPostApp sample demo.
*
* @param[out] uploadedData Specifies a pointer to the location storing the resulting posted direct message.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultSystemUpdateRequired Indicates that a system update is required.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidFormat Indicates that the @ref nn::olv::UploadDirectMessageDataByPostApp function was not running the post application when this function was called.
* Or it indicates that the size of the image attachment is invalid.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultUnknown Indicates that the function was called at an incorrect time.
*/
nn::Result GetResultWithUploadedDirectMessageDataByPostApp(nn::olv::UploadedDirectMessageData* uploadedData);
//------------------------------------------------------------------------------
/**
* Gets the result of posting updated comment data using the post application.
* Use this function to get the result of the @ref nn::olv::UploadCommentDataByPostApp function.
*
* Call this function when the application has transitioned from the post application to the main application (that is, when you get a foreground message from the SDK.)
* For more information about usage, see the UploadCommentDataByPostApp sample demo.
*
* @param[out] uploadedData Specifies a pointer to the location storing the resulting posted comment data.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultSystemUpdateRequired Indicates that a system update is required.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidFormat Indicates that the @ref nn::olv::UploadCommentDataByPostApp function was not running the post application when this function was called.
* Or it indicates that the size of the image attachment is invalid.
* @retval ResultCanceled Indicates that the action was canceled.
* @retval ResultUnknown Indicates that the function was called at an incorrect time.
*/
nn::Result GetResultWithUploadedCommentDataByPostApp(nn::olv::UploadedCommentData* uploadedData);
//------------------------------------------------------------------------------
/**
* Gets the URL for the notification information to retrieve.
*
* @param[out] url Specifies a character array for storing the URL.
* Pass in a buffer of size nn::olv::URL_BUFF_LENGTH.
* @param[in] urlMaxLength Specifies the size of the URL buffer.
* @param[in] param Specifies the parameter for getting the notification URL.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultOfflineMode Indicates that the object was initialized in offline mode.
* @retval ResultInvalidParameter Indicates that a parameter was configured incorrectly.
* @retval ResultInvalidPointer Indicates that a required parameter was set to NULL.
* @retval ResultInvalidSize Indicates that the size specified in the parameter is invalid.
*/
nn::Result GetNotificationsUrl(char* url, const u32 urlMaxLength, const nn::olv::GetNotificationsUrlParam* param);
//------------------------------------------------------------------------------
/**
* Preloads the posting applet.
*
* @note Currently, there is no high-speed function for quickly starting the applet even if it is preloaded using this function.
* @note This function is not recommended for use by applications.
*
* Works in offline mode.
*
* @retval ResultSuccess Indicates success.
* @retval ResultNotInitialized Indicates that the object is not initialized.
* @retval ResultPostappPreloadFailed Indicates that preloading failed.
*/
nn::Result PreloadPostApp(void);
/** @} */
}
}
#endif