|
1 /* |
|
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * As specified in SGL.GT0188.251 |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @publishedPartner |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef __SISDATETIME_H__ |
|
27 #define __SISDATETIME_H__ |
|
28 |
|
29 #include "sisdate.h" |
|
30 #include "sistime.h" |
|
31 |
|
32 |
|
33 class CSISDateTime : public CStructure <CSISFieldRoot::ESISDateTime> |
|
34 { |
|
35 public: |
|
36 /** |
|
37 * Default constructor. |
|
38 */ |
|
39 CSISDateTime (); |
|
40 /** |
|
41 * Copy constructor. |
|
42 */ |
|
43 CSISDateTime (const CSISDateTime& aInitialiser); |
|
44 /** |
|
45 * Class name |
|
46 */ |
|
47 virtual std::string Name () const; |
|
48 /** |
|
49 * Set the current date and time. |
|
50 */ |
|
51 void SetNow (); |
|
52 /** |
|
53 * Set a new date. |
|
54 * @param aYear New value of year. |
|
55 * @param aYear New value of month. |
|
56 * @param aYear New value of day. |
|
57 */ |
|
58 inline void SetDate (const TUint16 aYear, const TUint8 aMonth, const TUint8 aDay); |
|
59 /** |
|
60 * Set a new time. |
|
61 * @param aHours New value of Hours. |
|
62 * @param aMinutes New value of minutes. |
|
63 * @param aSeconds New value of seconds. |
|
64 */ |
|
65 inline void SetTime (const TUint8 aHours, const TUint8 aMinutes, const TUint8 aSeconds); |
|
66 /** |
|
67 * Adds the write the package details into the stream. |
|
68 * @param aStream - Stream in which the package entries need to be written. |
|
69 * @param aVerbose - If this option is set then detail description of pkg |
|
70 * will be written into the stream. |
|
71 */ |
|
72 void AddPackageEntry(std::wostream& aStream, bool aVerbose) const; |
|
73 /** |
|
74 * Get the date (CSISDate). |
|
75 */ |
|
76 inline const CSISDate& Date() const; |
|
77 /** |
|
78 * Get the time (CSISTime). |
|
79 */ |
|
80 inline const CSISTime& Time() const; |
|
81 |
|
82 private: |
|
83 void InsertMembers (); |
|
84 |
|
85 private: |
|
86 CSISDate iDate; |
|
87 CSISTime iTime; |
|
88 }; |
|
89 |
|
90 |
|
91 inline void CSISDateTime::SetDate (const TUint16 aYear, const TUint8 aMonth, const TUint8 aDay) |
|
92 { |
|
93 iDate.Set(aYear, aMonth, aDay); |
|
94 } |
|
95 |
|
96 inline void CSISDateTime::SetTime (const TUint8 aHours, const TUint8 aMinutes, const TUint8 aSeconds) |
|
97 { |
|
98 iTime.Set(aHours, aMinutes, aSeconds); |
|
99 } |
|
100 |
|
101 inline const CSISDate& CSISDateTime::Date() const |
|
102 { |
|
103 return iDate; |
|
104 } |
|
105 |
|
106 inline const CSISTime& CSISDateTime::Time() const |
|
107 { |
|
108 return iTime; |
|
109 } |
|
110 |
|
111 |
|
112 #endif // __SISDATETIME_H__ |
|
113 |