|
1 /* |
|
2 * Copyright (c) 2002 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 // INCLUDE FILES |
|
20 #include "BTSProgresstimer.h" |
|
21 #include "BTServiceStarter.h" |
|
22 #include "BTSUDebug.h" |
|
23 |
|
24 // ============================ MEMBER FUNCTIONS =============================== |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // C++ default constructor can NOT contain any code, that |
|
28 // might leave. |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 CBTSProgressTimer::CBTSProgressTimer( MBTServiceObserver* aProgressObserverPtr) |
|
32 : CTimer( EPriorityLow ), |
|
33 iProgressObserverPtr( aProgressObserverPtr ) |
|
34 { |
|
35 CActiveScheduler::Add( this ); |
|
36 } |
|
37 |
|
38 // ----------------------------------------------------------------------------- |
|
39 // CObexUtilsDialogTimer::ConstructL |
|
40 // Symbian OS default constructor can leave. |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 void CBTSProgressTimer::ConstructL() |
|
44 { |
|
45 FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::ConstructL()")); |
|
46 |
|
47 CTimer::ConstructL(); |
|
48 |
|
49 FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::ConstructL() completed")); |
|
50 } |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // CObexUtilsDialogTimer::NewL |
|
54 // ----------------------------------------------------------------------------- |
|
55 CBTSProgressTimer* CBTSProgressTimer::NewL( MBTServiceObserver* aProgressObserverPtr) |
|
56 { |
|
57 CBTSProgressTimer* self = |
|
58 new( ELeave ) CBTSProgressTimer( aProgressObserverPtr ); |
|
59 |
|
60 CleanupStack::PushL( self ); |
|
61 self->ConstructL(); |
|
62 CleanupStack::Pop( self ); |
|
63 return self; |
|
64 } |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // Destructor |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 CBTSProgressTimer::~CBTSProgressTimer() |
|
71 { |
|
72 Cancel(); |
|
73 } |
|
74 |
|
75 // ----------------------------------------------------------------------------- |
|
76 // CObexUtilsDialogTimer::Tickle |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 void CBTSProgressTimer::Tickle() |
|
80 { |
|
81 FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::Tickle()")); |
|
82 |
|
83 Cancel(); |
|
84 After( iTimeout ); |
|
85 |
|
86 FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::Tickle() completed")); |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CObexUtilsDialogTimer::RunL |
|
91 // ----------------------------------------------------------------------------- |
|
92 // |
|
93 void CBTSProgressTimer::RunL() |
|
94 { |
|
95 FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunL()")); |
|
96 if (iProgressObserverPtr) |
|
97 { |
|
98 iProgressObserverPtr->UpdateProgressInfoL(); |
|
99 } |
|
100 |
|
101 FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunL() completed")); |
|
102 } |
|
103 |
|
104 TInt CBTSProgressTimer::RunError( TInt aError ) |
|
105 { |
|
106 FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunError()")); |
|
107 (void) aError; |
|
108 FLOG(_L("[OBEXUTILS]\t CBTSProgressTimer::RunError() - completed")); |
|
109 return KErrNone; |
|
110 } |
|
111 |
|
112 // ----------------------------------------------------------------------------- |
|
113 // CObexUtilsDialogTimer::SetTimeout |
|
114 // ----------------------------------------------------------------------------- |
|
115 // |
|
116 void CBTSProgressTimer::SetTimeout( TTimeIntervalMicroSeconds32 aTimeout ) |
|
117 { |
|
118 iTimeout = aTimeout; |
|
119 } |
|
120 |
|
121 // End of File |