|
1 /* |
|
2 * Copyright (c) 2007 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: Blid engine object. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // SYSTEM INCLUDE |
|
21 #include <lbs.h> |
|
22 #include <lbscommon.h> |
|
23 |
|
24 //USER INCLUDE |
|
25 #include "cblidmoduleinfoobserver.h" |
|
26 #include "MBlidLocation.h" |
|
27 |
|
28 //CONSTANTS |
|
29 |
|
30 |
|
31 // ============================ MEMBER FUNCTIONS ============================== |
|
32 // ---------------------------------------------------------------------------- |
|
33 // CBlidModuleinfoObserver::CBlidModuleinfoObserver |
|
34 // C++ default constructor can NOT contain any code, that |
|
35 // might leave. |
|
36 // ---------------------------------------------------------------------------- |
|
37 // |
|
38 CBlidModuleinfoObserver::CBlidModuleinfoObserver( RPositionServer& aServer, |
|
39 MBlidLocation& aObserver ) |
|
40 :CActive(EPriorityStandard) |
|
41 ,iServer( aServer ) |
|
42 ,iObserver( aObserver ) |
|
43 { |
|
44 CActiveScheduler::Add( this ); |
|
45 } |
|
46 |
|
47 |
|
48 // ---------------------------------------------------------------------------- |
|
49 // CBlidModuleinfoObserver::ConstructL |
|
50 // Symbian 2nd phase constructor can leave. |
|
51 // ---------------------------------------------------------------------------- |
|
52 // |
|
53 void CBlidModuleinfoObserver::ConstructL( ) |
|
54 { |
|
55 |
|
56 } |
|
57 |
|
58 |
|
59 // ---------------------------------------------------------------------------- |
|
60 // CBlidModuleinfoObserver::NewL |
|
61 // Two-phased constructor. |
|
62 // ---------------------------------------------------------------------------- |
|
63 // |
|
64 CBlidModuleinfoObserver* CBlidModuleinfoObserver::NewL( RPositionServer& aServer, |
|
65 MBlidLocation& aObserver ) |
|
66 { |
|
67 CBlidModuleinfoObserver* self = new( ELeave ) CBlidModuleinfoObserver( aServer, aObserver); |
|
68 CleanupStack::PushL( self ); |
|
69 self->ConstructL(); |
|
70 CleanupStack::Pop( self ); |
|
71 return self; |
|
72 } |
|
73 |
|
74 |
|
75 // ---------------------------------------------------------------------------- |
|
76 // CBlidModuleinfoObserver::~CBlidModuleinfoObserver |
|
77 // ---------------------------------------------------------------------------- |
|
78 // |
|
79 CBlidModuleinfoObserver::~CBlidModuleinfoObserver() |
|
80 { |
|
81 Cancel(); |
|
82 } |
|
83 |
|
84 |
|
85 // ---------------------------------------------------------------------------- |
|
86 // CBlidModuleinfoObserver::RunL |
|
87 // ---------------------------------------------------------------------------- |
|
88 // |
|
89 void CBlidModuleinfoObserver::RunL() |
|
90 { |
|
91 switch( iStatus.Int() ) |
|
92 { |
|
93 case KErrNone: |
|
94 { |
|
95 StartNotification(); |
|
96 iObserver.GetModuleInfoNotificationL(); |
|
97 break; |
|
98 } |
|
99 default: |
|
100 { |
|
101 break; |
|
102 } |
|
103 } |
|
104 } |
|
105 |
|
106 |
|
107 // ---------------------------------------------------------------------------- |
|
108 // CBlidModuleinfoObserver::DoCancel |
|
109 // ---------------------------------------------------------------------------- |
|
110 // |
|
111 void CBlidModuleinfoObserver::DoCancel() |
|
112 { |
|
113 iServer.CancelRequest(EPositionServerNotifyModuleStatusEvent); |
|
114 } |
|
115 |
|
116 // ---------------------------------------------------------------------------- |
|
117 // CBlidModuleinfoObserver::StartNotification |
|
118 // ---------------------------------------------------------------------------- |
|
119 // |
|
120 void CBlidModuleinfoObserver::StartNotification() |
|
121 { |
|
122 SetActive(); |
|
123 TPositionModuleStatusEvent aStatusEvent; |
|
124 iServer.NotifyModuleStatusEvent(aStatusEvent,iStatus); |
|
125 } |
|
126 |
|
127 //End of File |
|
128 |