|
1 /* |
|
2 * Copyright (c) 2010 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: Implementation of connection timer class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "posrevgeocodeconnectiontimer.h" |
|
19 #include "posrevgeocodelogger.h" |
|
20 |
|
21 //------------------------------------------------------------------------------ |
|
22 // CPosRevGeoCodeConnectionTimer::NewL |
|
23 //------------------------------------------------------------------------------ |
|
24 CPosRevGeoCodeConnectionTimer* CPosRevGeoCodeConnectionTimer::NewL( |
|
25 MPosRevGeoCodeTimeoutObserver& aConnectionTimeoutObserver ) |
|
26 { |
|
27 FUNC("CPosRevGeoCodeConnectionTimer::NewL"); |
|
28 CPosRevGeoCodeConnectionTimer* self = new ( ELeave ) |
|
29 CPosRevGeoCodeConnectionTimer( aConnectionTimeoutObserver ); |
|
30 CleanupStack::PushL( self ); |
|
31 self->ConstructL(); |
|
32 CleanupStack::Pop(); |
|
33 return self; |
|
34 } |
|
35 |
|
36 //------------------------------------------------------------------------------ |
|
37 // CPosRevGeoCodeConnectionTimer::CPosRevGeoCodeConnectionTimer |
|
38 //------------------------------------------------------------------------------ |
|
39 CPosRevGeoCodeConnectionTimer::CPosRevGeoCodeConnectionTimer( |
|
40 MPosRevGeoCodeTimeoutObserver& aConnectionTimeoutObserver ): |
|
41 CTimer( EPriorityStandard ), |
|
42 iConnectionTimeoutObserver ( aConnectionTimeoutObserver ) |
|
43 { |
|
44 FUNC("CPosRevGeoCodeConnectionTimer::CPosRevGeoCodeConnectionTimer"); |
|
45 CActiveScheduler::Add(this); |
|
46 } |
|
47 |
|
48 //------------------------------------------------------------------------------ |
|
49 // CPosRevGeoCodeConnectionTimer::~CPosRevGeoCodeConnectionTimer |
|
50 //------------------------------------------------------------------------------ |
|
51 CPosRevGeoCodeConnectionTimer::~CPosRevGeoCodeConnectionTimer() |
|
52 { |
|
53 FUNC("CPosRevGeoCodeConnectionTimer::~CPosRevGeoCodeConnectionTimer"); |
|
54 Cancel(); |
|
55 } |
|
56 |
|
57 |
|
58 //------------------------------------------------------------------------------ |
|
59 // CPosRevGeoCodeConnectionTimer::ConstructL |
|
60 //------------------------------------------------------------------------------ |
|
61 |
|
62 void CPosRevGeoCodeConnectionTimer::ConstructL() |
|
63 { |
|
64 FUNC("CPosRevGeoCodeConnectionTimer::ConstructL"); |
|
65 CTimer::ConstructL(); |
|
66 } |
|
67 |
|
68 //------------------------------------------------------------------------------ |
|
69 // CPosRevGeoCodeConnectionTimer::StartTimer |
|
70 //------------------------------------------------------------------------------ |
|
71 TInt CPosRevGeoCodeConnectionTimer::StartTimer(const TInt aTimeoutVal) |
|
72 { |
|
73 FUNC("CPosRevGeoCodeConnectionTimer::StartTimer"); |
|
74 if( IsActive() ) |
|
75 { |
|
76 // If the timer is already running, return error code. |
|
77 return KErrInUse; |
|
78 } |
|
79 After(aTimeoutVal); |
|
80 return KErrNone; |
|
81 } |
|
82 |
|
83 //------------------------------------------------------------------------------ |
|
84 // CPosRevGeoCodeConnectionTimer::NewL |
|
85 //------------------------------------------------------------------------------ |
|
86 |
|
87 void CPosRevGeoCodeConnectionTimer::RunL( ) |
|
88 { |
|
89 FUNC("CPosRevGeoCodeConnectionTimer::RunL"); |
|
90 iConnectionTimeoutObserver.HandleTimedoutEvent( iStatus.Int() ); |
|
91 } |
|
92 |
|
93 // End of file |