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_RAWDLTASKSETTING_H_
14 #define NN_BOSS_BOSS_RAWDLTASKSETTING_H_
15 
16 #include <nn/boss/boss_Const.h>
17 #include <nn/boss/boss_Result.h>
18 #include <nn/boss/boss_Types.h>
19 #include <nn/boss/boss_NetTaskSetting.h>
20 
21 #ifdef __cplusplus
22 
23 namespace nn {
24 namespace boss {
25 
26 /*!
27 @addtogroup  nn_boss_api
28   @{
29 */
30 
31 /*!
32 @brief  Represents settings for <tt>RawDL</tt> tasks. Used when registering tasks (passed as an argument to <tt>@ref Task::Register</tt>).
33 */
34 class RawDlTaskSetting : public NetTaskSetting
35 {
36 public:
37 /*!
38 @brief  Instantiates an object.
39 */
40     explicit RawDlTaskSetting(void);
41 
42 /*!
43 @brief  Destroys the object.
44 */
45     virtual ~RawDlTaskSetting(void);
46 
47 /*!
48 @brief  Initializes settings for a <tt>RawDL</tt> task. If initialization succeeds, you can register the information using the <tt>@ref Task::Register</tt> function.
49 
50 @param[in] url  Specifies the connection URL.
51 @param[in] isNewArrivalFlagOn  Specifies whether to set the "new arrival" flag when new data arrives.
52 @param[in] isLedOn  Specifies whether to turn on the LED when new data arrives.
53 @param[in] fileName  Specifies the name of the file to download. If omitted, the function uses the default filename. (<b>Note:</b> If the filename starts with a period ('.'), the <tt>@ref Storage::GetDataList</tt> function fails to retrieve the file, even if it exists. In this case, you can access the data by specifying the filename directly in the <tt>@ref NsData::Initialize</tt> function.)
54 @param[in] directoryName  Specifies the directory that stores the data. If omitted, the task name is used for the directory name.
55 The <tt>@ref Storage</tt> class uses this directory name when retrieving a list of files.
56 
57 @return  Returns the result of execution. Returns one of the following <tt>Result</tt> values.
58 @retval Result::IsSuccess  Indicates successful retrieval.
59 @retval ResultInvalidParameter  Indicates an invalid parameter.
60 */
61     nn::Result Initialize(const char* url, bool isNewArrivalFlagOn = false, bool isLedOn = false, const char* fileName = RAWDL_DEFAULT_FILE_NAME, const char* directoryName = NULL);
62 
63 /*!
64 @brief  Adds the <tt>RawDL</tt> custom header to the request for sending by HTTP.
65 This function can add headers to an HTTP request that are larger than the maximum value allowed by the <tt>AddHttpHeader</tt> function for ordinary custom headers (512 bytes).
66 The maximum number that can be added is 1.
67 
68 @param[in] label  Specifies the label string for the <tt>RawDL</tt> custom header being added.
69 @param[in] value  Specifies the value string for the <tt>RawDL</tt> custom header being added.
70 @return  Returns the result of execution. Returns one of the following <tt>Result</tt> values.
71 @retval Result::IsSuccess  Indicates successful retrieval.
72 @retval ResultInvalidParameter  Indicates an invalid parameter.
73 @retval ResultAlreadyExist  Indicates that a custom header has already been added.
74 */
75     nn::Result AddLargeHttpHeader(const char* label, const char* value);
76 
77 /*!
78 @brief  Clears the <tt>RawDL</tt> custom header previously added to the HTTP request headers.
79 */
80     void ClearLargeHttpHeader(void);
81 };
82 
83 //! @}
84 
85 } // end of namespace boss
86 } // end of namespace nn
87 
88 #endif // __cplusplus
89 
90 #endif /* NN_BOSS_BOSS_RAWDLTASKSETTING_H_ */
91