1 /* |
|
2 * Copyright (c) 2008 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: Call Notify |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // Include Files |
|
21 #include "cphcltcomhandrequestmonitor.h" |
|
22 #include "rphcltcallnotify.h" |
|
23 #include <mphcltcomhandrequestobserver.h> |
|
24 #include <e32base.h> |
|
25 |
|
26 |
|
27 // ============================= LOCAL FUNCTIONS =============================== |
|
28 |
|
29 |
|
30 |
|
31 // ============================ MEMBER FUNCTIONS =============================== |
|
32 |
|
33 // ----------------------------------------------------------------------------- |
|
34 // CPhCltComHandRequestMonitor::CPhCltComHandRequestMonitor |
|
35 // C++ constructor can NOT contain any code, that |
|
36 // might leave. |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 CPhCltComHandRequestMonitor::CPhCltComHandRequestMonitor( |
|
40 RPhCltCallNotify& aCallNotify): |
|
41 CActive( EPriorityStandard ), iCallNotify(aCallNotify) |
|
42 { |
|
43 CActiveScheduler::Add( this ); |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CPhCltComHandRequestMonitor::NewL |
|
48 // Two-phased constructor. |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 CPhCltComHandRequestMonitor* CPhCltComHandRequestMonitor::NewL(RPhCltCallNotify& aCallNotify) |
|
52 { |
|
53 CPhCltComHandRequestMonitor* self = new ( ELeave ) CPhCltComHandRequestMonitor(aCallNotify); |
|
54 return self; |
|
55 } |
|
56 |
|
57 // Destructor |
|
58 CPhCltComHandRequestMonitor::~CPhCltComHandRequestMonitor() |
|
59 { |
|
60 Cancel(); |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // CPhCltCallNotify::RespondComHandClient |
|
65 // |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 TInt CPhCltComHandRequestMonitor::RespondComHandClient( |
|
69 const TInt aResultCode ) |
|
70 { |
|
71 return iCallNotify.RespondComHandClient( aResultCode ); |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // CPhCltComHandRequestMonitor::RunL() |
|
76 // |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 void CPhCltComHandRequestMonitor::RunL() |
|
80 { |
|
81 TInt error = iStatus.Int(); |
|
82 if ( !error ) |
|
83 { |
|
84 iObserver->ComHandRequest( ); |
|
85 } |
|
86 } |
|
87 |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CPhCltComHandRequestMonitor::CancelNotifyComHandCommand() |
|
91 // |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 void CPhCltComHandRequestMonitor::DoCancel() |
|
95 { |
|
96 iCallNotify.CancelNotifyComHandCommand(); |
|
97 } |
|
98 |
|
99 |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // CPhCltComHandRequestMonitor::NotifyComHandCommand |
|
103 // |
|
104 // ----------------------------------------------------------------------------- |
|
105 // |
|
106 void CPhCltComHandRequestMonitor::NotifyComHandCommand( |
|
107 MPhCltComHandRequestObserver* aObserver, |
|
108 TDes8& aCommandArgs ) |
|
109 { |
|
110 if ( !IsActive() ) |
|
111 { |
|
112 iObserver = aObserver; |
|
113 iCallNotify.NotifyComHandCommand( |
|
114 iStatus, |
|
115 aCommandArgs ); |
|
116 SetActive(); |
|
117 } |
|
118 } |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 // End of File |
|