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_BOSS_BOSS_DATASTOREDOWNLOADSETTING_H_
14 #define NN_BOSS_BOSS_DATASTOREDOWNLOADSETTING_H_
15 
16 #include <nn/boss/boss_Const.h>
17 #include <nn/boss/boss_DataStoreConst.h>
18 #include <nn/boss/boss_Result.h>
19 #include <nn/boss/boss_Types.h>
20 #include <nn/boss/boss_NetTaskSetting.h>
21 
22 #ifdef __cplusplus
23 
24 namespace nn {
25 namespace boss {
26 
27 /*!
28 @addtogroup  nn_boss_api
29   @{
30 */
31 
32 /*!
33 @brief  Represents settings for <tt>DataStore</tt> download tasks. Used when registering tasks (passed as an argument to <tt>@ref Task::Register</tt>).
34 */
35 class DataStoreDownloadSetting : public NetTaskSetting
36 {
37 public:
38 /*!
39 @brief  Instantiates an object.
40 */
41     explicit DataStoreDownloadSetting(void);
42 
43 /*!
44 @brief  Destroys the object.
45 */
46     virtual ~DataStoreDownloadSetting(void);
47 
48 /*!
49 @brief  Initializes settings for a <tt>DataStore</tt> download task. If initialization succeeds, you can register the information using the <tt>@ref Task::Register</tt> function.
50 
51 @param[in] gameId  Specifies the ID for the game server. (For more information, see the documentation in the NEX library.)
52 @param[in] accessKey  Specifies the key for accessing the game server. (Specify no more than 8 characters. For more information, see the documentation in the NEX library.)
53 @param[in] downloadDataMaxTotalCount  Specifies the maximum count of all download data. BOSS controls the number of pieces of data, so it does not exceed this value. When a task is executed, if downloading new data would cause the total data count to exceed this value, the download does not take place. When this occurs, task execution results in a <tt>TR_FULL</tt> or <tt>COUNT_FULL</tt> error. Values from 1 to <tt>@ref datastore::DOWNLOAD_DATA_MAX_COUNT</tt> are valid.
54 @param[in] downloadDataMaxTotalSize  Specifies the maximum total size of all download data. BOSS controls the total size of all data so it does not exceed this value. When a task is executed, if downloading new data would cause the total size to exceed this value, the download does not take place. When this occurs, task execution results in a <tt>TR_FULL</tt> or <tt>SIZE_FULL</tt> error. If <tt>0</tt> is specified, BOSS skips this check.
55 @param[in] enableNewArrivalFlag  Specifies whether to set the new arrival flag when the new data is downloaded. When set to <tt>false</tt> (or omitted), the new arrival flag is not set.
56 @param[in] enableLed  Specifies whether to turn on the LED when new data is downloaded. When set to <tt>false</tt> (or omitted), the LED is not turned on.
57 @param[in] directoryName  Specifies the directory that stores the data. When omitted, the task ID is used for the directory name.
58 The <tt>@ref Storage</tt> class uses this directory name when retrieving a list of files.
59 @return  Returns the execution result of the function. Returns one of the following <tt>Result</tt> values.
60 @retval Result::IsSuccess  Indicates successful retrieval.
61 @retval ResultInvalidParameter  Indicates an invalid parameter.
62 */
63     nn::Result Initialize( u32 gameId, const wchar_t accessKey[], u32 downloadDataMaxTotalCount, u64 downloadDataMaxTotalSize, bool enableNewArrivalFlag = false, bool enableLed = false, const char* directoryName = NULL);
64 
65 /*!
66 @brief  Specifies the check token that is used during the initial download.
67 
68 @param[in] initialCheckToken  Check token that is used for the initial download.
69 */
70     void SetInitialCheckToken( u8 initialCheckToken[datastore::CHECK_TOKEN_SIZE] );
71 };
72 
73 //! @}
74 
75 } // end of namespace boss
76 } // end of namespace nn
77 
78 #endif // __cplusplus
79 
80 #endif /* NN_BOSS_BOSS_DATASTOREDOWNLOADSETTING_H_ */
81