|
1 /* |
|
2 * Copyright (c) 2008 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PUSHTIMERUTILS_H |
|
20 #define PUSHTIMERUTILS_H |
|
21 |
|
22 #include "timerserverinterface.h" |
|
23 |
|
24 namespace java |
|
25 { |
|
26 namespace util |
|
27 { |
|
28 class Uid; |
|
29 } |
|
30 |
|
31 namespace push |
|
32 { |
|
33 |
|
34 class PushTimerListener; |
|
35 |
|
36 class PushTimerUtils |
|
37 { |
|
38 public: |
|
39 virtual ~PushTimerUtils() {} |
|
40 |
|
41 /** |
|
42 * Checks whether timer has expired. This operation calls PushTimerListener::deleteAlarm() |
|
43 * or PushTimerListener::timerExpired() callback operation depending expiration time. |
|
44 * @param aListener PushTimerListener object. |
|
45 * @param aUid UID of the application. |
|
46 * @param aAlarmTime Alram time in milliseconds since since 00:00:00 UTC |
|
47 * (Coordinated Universal Time), January 1 1970. |
|
48 * @param aTimerInterface instance of TimerServerInterface |
|
49 * @return 'true' if expiration occurred. |
|
50 * 'false' if expiration not occurred. |
|
51 * @throws PushException with following error code: |
|
52 * INIT_OF_ALARM_TIMER_FAILED: |
|
53 * - Getting current time failed. |
|
54 */ |
|
55 static bool isTimerExpired(PushTimerListener& aListener,const java::util::Uid& aUid, |
|
56 const java::captain::JavaTime& aAlarmTime, |
|
57 java::captain::TimerServerInterface& aTimerInterface); |
|
58 |
|
59 static bool isTimeOlderThanTwoWeeks(java::captain::TimerServerInterface& aTimerInterface, |
|
60 const java::captain::JavaTime& aCurrentTime, |
|
61 const java::captain::JavaTime& aAlarmTime); |
|
62 |
|
63 }; |
|
64 |
|
65 } //end namespace push |
|
66 } //end namespace java |
|
67 |
|
68 #endif // PUSHTIMERUTILS_H |