|
1 /*------------------------------------------------------------------ |
|
2 - |
|
3 * Software Name : UserEmulator |
|
4 * Version : v4.2.1309 |
|
5 * |
|
6 * Copyright (c) 2009 France Telecom. All rights reserved. |
|
7 * This software is distributed under the License |
|
8 * "Eclipse Public License - v 1.0" the text of which is available |
|
9 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
10 * |
|
11 * Initial Contributors: |
|
12 * France Telecom |
|
13 * |
|
14 * Contributors: |
|
15 *------------------------------------------------------------------ |
|
16 - |
|
17 * File Name: CameraAppTimer.cpp |
|
18 * |
|
19 * Created: 13/08/2009 |
|
20 * Author(s): Marcell Kiss |
|
21 * |
|
22 * Description: |
|
23 * Camera app's timer CActive class |
|
24 *------------------------------------------------------------------ |
|
25 - |
|
26 * |
|
27 */ |
|
28 |
|
29 // User Includes |
|
30 #include "CameraAppTimer.h" |
|
31 |
|
32 // ======== MEMBER FUNCTIONS ======== |
|
33 |
|
34 CCameraAppTimer::CCameraAppTimer(MCameraAppObserver& aNotify) |
|
35 :CActive(EPriorityNormal),iNotify(aNotify) |
|
36 { |
|
37 } |
|
38 |
|
39 CCameraAppTimer::~CCameraAppTimer() |
|
40 { |
|
41 Cancel(); |
|
42 iTimer.Close(); |
|
43 } |
|
44 |
|
45 CCameraAppTimer* CCameraAppTimer::NewL(MCameraAppObserver& aNotify) |
|
46 { |
|
47 CCameraAppTimer* me = new (ELeave) CCameraAppTimer(aNotify); |
|
48 CleanupStack::PushL(me); |
|
49 me->ConstructL(); |
|
50 CleanupStack::Pop(me); |
|
51 return me; |
|
52 } |
|
53 // ---------------------------------------------------------- |
|
54 // Second phase constructor |
|
55 // ---------------------------------------------------------- |
|
56 // |
|
57 void CCameraAppTimer::ConstructL(void) |
|
58 { |
|
59 CActiveScheduler::Add(this); |
|
60 iTimer.CreateLocal(); |
|
61 } |
|
62 |
|
63 // ---------------------------------------------------------- |
|
64 // Set timer |
|
65 // ---------------------------------------------------------- |
|
66 // |
|
67 void CCameraAppTimer::After(TTimeIntervalMicroSeconds32 aInterval) |
|
68 { |
|
69 Cancel(); |
|
70 iTimer.After(iStatus,aInterval); |
|
71 SetActive(); |
|
72 } |
|
73 // ---------------------------------------------------------- |
|
74 // Cancel timer |
|
75 // ---------------------------------------------------------- |
|
76 // |
|
77 void CCameraAppTimer::DoCancel() |
|
78 { |
|
79 iTimer.Cancel(); |
|
80 } |
|
81 |
|
82 // ---------------------------------------------------------- |
|
83 // Notifies AppUi that timer expired |
|
84 // ---------------------------------------------------------- |
|
85 // |
|
86 void CCameraAppTimer::RunL() |
|
87 { |
|
88 iNotify.CheckCameraAppL(); |
|
89 } |