|
1 /* |
|
2 * Copyright (c) 2005-2006 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 "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: Rights object notification event |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CDRMEVENTTIMECHANGE_H |
|
21 #define CDRMEVENTTIMECHANGE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <DrmTypes.h> |
|
26 #include <DRMEvent.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // MACROS |
|
31 |
|
32 // DATA TYPES |
|
33 |
|
34 // FUNCTION PROTOTYPES |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * DRM Event notification class to notify about changes to |
|
42 * secure time |
|
43 * |
|
44 * @lib DRMCommon.dll |
|
45 * @since S60Rel2.8 |
|
46 */ |
|
47 |
|
48 class CDRMEventTimeChange : public MDRMEvent, public CBase |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 |
|
53 /** |
|
54 * NewLC |
|
55 * |
|
56 * Creates and instance of the CDRMEventTimeChange class and |
|
57 * returns a pointer to it Leaves the object in the cleanup |
|
58 * stack |
|
59 * |
|
60 * @return A functional CDRMEventTimeChange -object |
|
61 * @since S60Rel3.0 |
|
62 */ |
|
63 IMPORT_C static CDRMEventTimeChange* NewLC(); |
|
64 |
|
65 /** |
|
66 * NewL |
|
67 * |
|
68 * Creates and instance of the CDRMEventTimeChange class and |
|
69 * returns a pointer to it |
|
70 * |
|
71 * @return A functional CDRMEventTimeChange -object |
|
72 * @since S60Rel3.0 |
|
73 */ |
|
74 IMPORT_C static CDRMEventTimeChange* NewL(); |
|
75 |
|
76 /** |
|
77 * Destructor |
|
78 */ |
|
79 IMPORT_C virtual ~CDRMEventTimeChange(); |
|
80 |
|
81 public: // new functions |
|
82 |
|
83 |
|
84 // Time |
|
85 /** |
|
86 * SetOldTime |
|
87 * |
|
88 * Sets the time before the change to the given value |
|
89 * |
|
90 * @param aTime : Old time |
|
91 * @since S60Rel2.8 |
|
92 */ |
|
93 IMPORT_C void SetOldTime( const TTime& aTime ); |
|
94 |
|
95 |
|
96 /** |
|
97 * GetOldTime |
|
98 * |
|
99 * Returns what the time was before the time changed |
|
100 * |
|
101 * @since S60Rel2.8 |
|
102 */ |
|
103 IMPORT_C const TTime& GetOldTime() const; |
|
104 |
|
105 |
|
106 /** |
|
107 * SetNewTime |
|
108 * |
|
109 * Sets the time after the change to the given value |
|
110 * |
|
111 * @param aTime : New time |
|
112 * @since S60Rel2.8 |
|
113 */ |
|
114 IMPORT_C void SetNewTime( const TTime& aTime ); |
|
115 |
|
116 |
|
117 /** |
|
118 * GetNewTime |
|
119 * |
|
120 * Returns what the time is after the time changed |
|
121 * |
|
122 * @since S60Rel2.8 |
|
123 */ |
|
124 IMPORT_C const TTime& GetNewTime() const; |
|
125 |
|
126 // Time zone |
|
127 /** |
|
128 * SetOldTimeZone |
|
129 * |
|
130 * Sets the timezone before the change to the given value |
|
131 * in 15 minute intervals |
|
132 * |
|
133 * @param aTime : Old timezone |
|
134 * @since S60Rel2.8 |
|
135 */ |
|
136 IMPORT_C void SetOldTimeZone( const TInt aTimeZone ); |
|
137 |
|
138 |
|
139 /** |
|
140 * GetOldTimeZone |
|
141 * |
|
142 * Returns what the timezone was before the time changed |
|
143 * in 15 minute intervals |
|
144 * |
|
145 * @since S60Rel2.8 |
|
146 */ |
|
147 IMPORT_C TInt GetOldTimeZone() const; |
|
148 |
|
149 |
|
150 /** |
|
151 * SetNewTimeZone |
|
152 * |
|
153 * Sets the timezone after the change to the given value |
|
154 * |
|
155 * @param aTimeZone : New timezone |
|
156 * @since S60Rel2.8 |
|
157 */ |
|
158 IMPORT_C void SetNewTimeZone( const TInt aTimeZone ); |
|
159 |
|
160 |
|
161 /** |
|
162 * GetNewTimeZone |
|
163 * |
|
164 * Returns what the timezone is after the time changed |
|
165 * |
|
166 * @since S60Rel2.8 |
|
167 */ |
|
168 IMPORT_C TInt GetNewTimeZone() const; |
|
169 |
|
170 // Security level |
|
171 |
|
172 /** |
|
173 * SetOldSecurityLevel |
|
174 * |
|
175 * Sets the security level before the change to the given value |
|
176 * |
|
177 * @param aTime : Old security level |
|
178 * @since S60Rel2.8 |
|
179 */ |
|
180 IMPORT_C void SetOldSecurityLevel( const DRMClock::ESecurityLevel aSecLevel ); |
|
181 |
|
182 |
|
183 /** |
|
184 * GetOldSecurityLevel |
|
185 * |
|
186 * Returns what the security level was before the time changed |
|
187 * |
|
188 * @since S60Rel2.8 |
|
189 */ |
|
190 IMPORT_C DRMClock::ESecurityLevel GetOldSecurityLevel() const; |
|
191 |
|
192 |
|
193 /** |
|
194 * SetNewSecurityLevel |
|
195 * |
|
196 * Sets the security level after the change to the given value |
|
197 * |
|
198 * @param aSecLevel : New security level |
|
199 * @since S60Rel2.8 |
|
200 */ |
|
201 IMPORT_C void SetNewSecurityLevel( const DRMClock::ESecurityLevel aSecLevel ); |
|
202 |
|
203 |
|
204 /** |
|
205 * GetNewSecurityLevel |
|
206 * |
|
207 * Returns what the security level is after the time changed |
|
208 * |
|
209 * @since S60Rel2.8 |
|
210 */ |
|
211 IMPORT_C DRMClock::ESecurityLevel GetNewSecurityLevel() const; |
|
212 |
|
213 public: // Functions from base classes |
|
214 |
|
215 /** |
|
216 * ExternalizeL |
|
217 * |
|
218 * Writes the objects data into a stream |
|
219 * |
|
220 * @param aOutput : an output stream where to write |
|
221 * @since S60Rel2.8 |
|
222 */ |
|
223 IMPORT_C virtual void ExternalizeL(RWriteStream& aOutput); |
|
224 |
|
225 /** |
|
226 * InternalizeL |
|
227 * |
|
228 * Reads the objects data from a stream |
|
229 * |
|
230 * @param aInput : an input stream where to read from |
|
231 * @since S60Rel2.8 |
|
232 */ |
|
233 IMPORT_C virtual void InternalizeL(RReadStream& aInput); |
|
234 |
|
235 |
|
236 /** |
|
237 * WriteInt64L |
|
238 * |
|
239 * Writes the 64 bit integer to the stream |
|
240 * |
|
241 * @since 3.0 |
|
242 * @param aWrite : the 64 bit integer to write |
|
243 * @param aStream : the output stream to write to |
|
244 * @return The function leaves with Symbian OS error code if an |
|
245 * error occurs |
|
246 */ |
|
247 void WriteInt64L( const TInt64& aWrite, RWriteStream& aStream ) const; |
|
248 |
|
249 /** |
|
250 * ReadInt64L |
|
251 * |
|
252 * Reads the 64 bit integer from the stream |
|
253 * |
|
254 * @since 3.0 |
|
255 * @param aRead : the 64 bit integer read |
|
256 * @param aStream : the output stream to write to |
|
257 * @return The function leaves with Symbian OS error code if an |
|
258 * error occurs |
|
259 */ |
|
260 void ReadInt64L( TInt64& aRead, RReadStream& aStream ); |
|
261 |
|
262 private: |
|
263 |
|
264 /** |
|
265 * C++ default constructor. |
|
266 */ |
|
267 CDRMEventTimeChange( void ); |
|
268 |
|
269 /** |
|
270 * First Phase constructor |
|
271 */ |
|
272 void ConstructL(); |
|
273 |
|
274 // Prohibit copy constructor |
|
275 CDRMEventTimeChange( const CDRMEventTimeChange& ); |
|
276 |
|
277 // Prohibit assigment operator |
|
278 CDRMEventTimeChange& operator=( const CDRMEventTimeChange& ); |
|
279 |
|
280 // The old time before the change |
|
281 TTime iOldTime; |
|
282 |
|
283 // The new time after the change |
|
284 TTime iNewTime; |
|
285 |
|
286 // The old timezone before the change |
|
287 TInt iOldTimeZone; |
|
288 |
|
289 // The new timezone after the change |
|
290 TInt iNewTimeZone; |
|
291 |
|
292 // The old security level before the change |
|
293 DRMClock::ESecurityLevel iOldSecurityLevel; |
|
294 |
|
295 // The new security level after the change |
|
296 DRMClock::ESecurityLevel iNewSecurityLevel; |
|
297 |
|
298 }; |
|
299 |
|
300 #endif // CDRMEVENTTIMECHANGE_H |
|
301 |
|
302 // End of File |