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_ACT_API_TIME_ZONE_H_
14 #define NN_ACT_API_TIME_ZONE_H_
15 
16 
17 #include "act_TypesTimeZone.h"
18 
19 
20 #ifdef __cplusplus
21 
22 namespace nn
23 {
24 namespace act
25 {
26 
27 //! @addtogroup  nn_act_api
28 //! @{
29 
30 //! @name  Getting Current Account Information
31 //! @{
32 
33 /*!
34 @brief  Gets the name of the time zone set for the current account.
35 
36 Gets the time zone name in the <tt>tz database</tt> format for the Nintendo Network Account linked to the current account.
37 Note that this function does not trigger any communication because it retrieves the value from the local cache. @n
38 
39 Pass a pointer to a buffer with at least as many elements as <tt>ACT_TIME_ZONE_ID_SIZE</tt> for <var>pTimeZoneId</var>. @n
40 @n
41 When it is not a network account, the function succeeds and a blank string is copied to <var>pTimeZoneId</var>. @n
42 @n
43 If the function fails, the value set in the buffer is undefined.
44 @param[out] pTimeZoneId  Specifies an out pointer to the buffer that stores the time zone name.
45 @return  Returns the execution result of the function. If the result is used for branching, follow the method described in <tt>@ref nn_act_communication_errorhandling</tt> <i>Error Handling</i>.
46 @retval ResultSuccess  Succeeded. @n
47 @retval ResultNotInitialized  Indicates that the account library has not been initialized. @n
48 @retval ResultInvalidPointer  Indicates that an invalid pointer (such as a <tt>NULL</tt> pointer) was passed as an argument. @n
49 
50 
51 */
52 Result GetTimeZoneId( char* pTimeZoneId );
53 
54 /*!
55 @brief  Gets the time difference for the time zone set for the current account.
56 
57 Gets the time difference from UTC in microseconds for the time zone set in the Nintendo Network Account linked to the current account.
58 Note that this function does not trigger any communication because it retrieves the value from the local cache. @n
59 
60 Daylight Saving Time is taken into consideration in the time difference, but note that depending on when the local cache is updated, the change might not be reflected immediately after the start and end of Daylight Saving Time.
61 Also note that when applied to past and future dates and times, there is a high possibility that the time difference value will not match the value on the actual date.
62 If you require exact time difference data, we recommend using an independent server or other service to resolve the time difference based on the time zone name that can be retrieved with the <tt>@ref nn::act::GetTimeZoneId</tt> function.
63 
64 @return  Returns a value in microseconds for the difference from UTC for the time zone set in the current account.
65 If this function is called on a non-network account or while the account library is uninitialized, <tt>0</tt> is returned.
66 */
67 s64 GetUtcOffset( void );
68 
69 //! @}
70 //! @name  Getting Other Account Information
71 //! @{
72 
73 /*!
74 @brief  Gets the name of the time zone set for the account in the specified slot.
75 
76 Gets the time zone name in the <tt>tz database</tt> format for the Nintendo Network Account linked to the console account in the specified slot.
77 Note that this function does not trigger any communication because it retrieves the value from the local cache. @n
78 
79 Pass a pointer to a buffer with at least as many elements as <tt>ACT_TIME_ZONE_ID_SIZE</tt> for <var>pTimeZoneId</var>. @n
80 @n
81 When it is not a network account, the function succeeds and a blank string is copied to <var>pTimeZoneId</var>. @n
82 @n
83 If the function fails, the value set in the buffer is undefined.
84 
85 @param[out] pTimeZoneId  Specifies an out pointer to the buffer that stores the time zone name.
86 @param[in] slotNo  Specifies the slot number.
87 
88 @return  Returns the execution result of the function. If the result is used for branching, follow the method described in <tt>@ref nn_act_communication_errorhandling</tt> <i>Error Handling</i>.
89 @retval ResultSuccess  Succeeded. @n
90 @retval ResultNotInitialized  Indicates that the account library has not been initialized. @n
91 @retval ResultInvalidPointer  Indicates that an invalid pointer (such as a <tt>NULL</tt> pointer) was passed as an argument. @n
92 @retval ResultAccountNotFound  Indicates that the account was not found in the specified slot. @n
93 */
94 Result GetTimeZoneIdEx( char* pTimeZoneId, u8 slotNo );
95 
96 /*!
97 @brief  Gets the time difference for the time zone set for the account in the specified slot.
98 
99 Gets the time difference from UTC in microseconds for the time zone set in the Nintendo Network Account linked to the console account in the specified slot.
100 Note that this function does not trigger any communication because it retrieves the value from the local cache. @n
101 
102 Daylight Saving Time is taken into consideration in the time difference, but note that depending on when the local cache is updated, the change might not be reflected immediately after the start and end of Daylight Saving Time.
103 Also note that when applied to past and future dates and times, there is a high possibility that the time difference value will not match the value on the actual date.
104 If you require exact time difference data, we recommend using an independent server or other service to resolve the time difference based on the time zone name that can be retrieved with the <tt>@ref nn::act::GetTimeZoneIdEx</tt> function.
105 
106 When it is not a network account, the function succeeds and <tt>0</tt> is copied to <var>pUtcOffset</var>. @n
107 
108 If the function fails, the value set in the buffer is undefined.
109 
110 @param[out] pUtcOffset  Sets an out pointer to the buffer that stores the time difference.
111 @param[in] slotNo  Specifies the slot number.
112 
113 @return  Returns the execution result of the function. If the result is used for branching, follow the method described in <tt>@ref nn_act_communication_errorhandling</tt> <i>Error Handling</i>.
114 @retval ResultSuccess  Succeeded. @n
115 @retval ResultNotInitialized  Indicates that the account library has not been initialized. @n
116 @retval ResultInvalidPointer  Indicates that an invalid pointer (such as a <tt>NULL</tt> pointer) was passed as an argument. @n
117 @retval ResultAccountNotFound  Indicates that the account was not found in the specified slot. @n
118 */
119 Result GetUtcOffsetEx( s64* pUtcOffset, u8 slotNo );
120 
121 //! @}
122 
123 //! @}
124 
125 }
126 }
127 
128 #endif
129 
130 
131 #endif  // NN_ACT_API_PRIVATE_H_
132