|
1 /* |
|
2 * Copyright (c) 2002-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 "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 #ifndef MOVETIMER_H |
|
19 #define MOVETIMER_H |
|
20 |
|
21 #include <e32base.h> // For CActive, link against: euser.lib |
|
22 #include <e32std.h> // For RTimer, link against: euser.lib |
|
23 |
|
24 // FORWARD DECLARATION |
|
25 class CHarvesterData; |
|
26 |
|
27 class MMoveTimerObserver |
|
28 { |
|
29 public: |
|
30 virtual void NotMoveEvent(RPointerArray<CHarvesterData>& aHDArray) = 0; |
|
31 }; |
|
32 |
|
33 class CMoveTimer : public CActive |
|
34 { |
|
35 public: |
|
36 // Cancel and destroy |
|
37 ~CMoveTimer(); |
|
38 |
|
39 // Two-phased constructor. |
|
40 static CMoveTimer* NewL( MMoveTimerObserver* aObserver = NULL); |
|
41 |
|
42 // Two-phased constructor. |
|
43 static CMoveTimer* NewLC( MMoveTimerObserver* aObserver = NULL); |
|
44 |
|
45 public: // New functions |
|
46 |
|
47 void AddHarvesterDataL( CHarvesterData* aHD ); |
|
48 |
|
49 CHarvesterData* CheckUriL( const TDesC& aUri ); |
|
50 |
|
51 private: |
|
52 // C++ constructor |
|
53 CMoveTimer( MMoveTimerObserver* aObserver = NULL ); |
|
54 |
|
55 // Second-phase constructor |
|
56 void ConstructL(); |
|
57 |
|
58 // Function for making the initial request |
|
59 void StartL(); |
|
60 |
|
61 private: // From CActive |
|
62 // Handle completion |
|
63 void RunL(); |
|
64 |
|
65 // How to cancel me |
|
66 void DoCancel(); |
|
67 |
|
68 // Override to handle leaves from RunL(). Default implementation causes |
|
69 // the active scheduler to panic. |
|
70 TInt RunError( TInt aError ); |
|
71 |
|
72 private: |
|
73 RTimer iTimer; // Provides async timing service |
|
74 MMoveTimerObserver* iObserver; |
|
75 RPointerArray<CHarvesterData> iHDArray; |
|
76 }; |
|
77 |
|
78 #endif // MOVETIMER_H |