|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Sends responses to RemCon FW. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "PhoneHandlerResponse.h" |
|
21 #include "PhoneHandlerControl.h" |
|
22 #include "PhoneHandlerActive.h" |
|
23 #include "PhoneHandlerDebug.h" |
|
24 #include <RemConCallHandlingTarget.h> |
|
25 |
|
26 // EXTERNAL DATA STRUCTURES |
|
27 |
|
28 // EXTERNAL FUNCTION PROTOTYPES |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // MACROS |
|
33 |
|
34 // LOCAL CONSTANTS AND MACROS |
|
35 |
|
36 // MODULE DATA STRUCTURES |
|
37 |
|
38 // LOCAL FUNCTION PROTOTYPES |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 |
|
42 // ============================= LOCAL FUNCTIONS =============================== |
|
43 |
|
44 // ============================ MEMBER FUNCTIONS =============================== |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CPhoneHandlerResponse::CPhoneHandlerResponse |
|
48 // C++ default constructor can NOT contain any code, that |
|
49 // might leave. |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 CPhoneHandlerResponse::CPhoneHandlerResponse( CPhoneHandlerControl& aControl ) |
|
53 : iControl( aControl ) |
|
54 { |
|
55 } |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CPhoneHandlerResponse::ConstructL |
|
59 // Symbian 2nd phase constructor can leave. |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 void CPhoneHandlerResponse::ConstructL() |
|
63 { |
|
64 COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerResponse::ConstructL() start" ); |
|
65 |
|
66 iActive = CPhoneHandlerActive::NewL( *this ); |
|
67 |
|
68 COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerResponse::ConstructL() end" ); |
|
69 } |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // CPhoneHandlerResponse::NewL |
|
73 // Two-phased constructor. |
|
74 // ----------------------------------------------------------------------------- |
|
75 // |
|
76 CPhoneHandlerResponse* CPhoneHandlerResponse::NewL( |
|
77 CPhoneHandlerControl& aControl ) |
|
78 { |
|
79 COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerResponse::NewL() start" ); |
|
80 |
|
81 CPhoneHandlerResponse* self = |
|
82 new( ELeave ) CPhoneHandlerResponse( aControl ); |
|
83 |
|
84 CleanupStack::PushL( self ); |
|
85 self->ConstructL(); |
|
86 CleanupStack::Pop( self ); |
|
87 |
|
88 COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerResponse::NewL() end" ); |
|
89 |
|
90 return self; |
|
91 } |
|
92 |
|
93 // Destructor |
|
94 CPhoneHandlerResponse::~CPhoneHandlerResponse() |
|
95 { |
|
96 COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerResponse::~CPhoneHandlerResponse()" ); |
|
97 |
|
98 delete iActive; |
|
99 } |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // CPhoneHandlerResponse::SendResponse |
|
103 // Sends response to RemCon FW. |
|
104 // (other items were commented in a header). |
|
105 // ----------------------------------------------------------------------------- |
|
106 // |
|
107 void CPhoneHandlerResponse::SetResponse( |
|
108 TRemConExtCallHandlingApiOperationId aOperation, TInt aError ) |
|
109 { |
|
110 COM_TRACE_2( "[PHONECMDHANDLER] CPhoneHandlerResponse::Process(aOperation=%d,aError=%d)",aOperation, aError ); |
|
111 |
|
112 iOperation = aOperation; |
|
113 iError = aError; |
|
114 } |
|
115 |
|
116 // ----------------------------------------------------------------------------- |
|
117 // CPhoneHandlerResponse::SendResponse |
|
118 // Sends response to RemCon FW. |
|
119 // (other items were commented in a header). |
|
120 // ----------------------------------------------------------------------------- |
|
121 // |
|
122 void CPhoneHandlerResponse::Process() |
|
123 { |
|
124 COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerResponse::Process()" ); |
|
125 |
|
126 iControl.CommandInitiator().SendResponse( iActive->iStatus, |
|
127 iOperation, |
|
128 iError ); |
|
129 iActive->SetActive(); |
|
130 } |
|
131 |
|
132 // ----------------------------------------------------------------------------- |
|
133 // CPhoneHandlerLastNumberRedial::Delete |
|
134 // (other items were commented in a header). |
|
135 // ----------------------------------------------------------------------------- |
|
136 // |
|
137 void CPhoneHandlerResponse::Delete() |
|
138 { |
|
139 COM_TRACE_( "[PHONECMDHANDLER] CPhoneHandlerResponse::Delete()" ); |
|
140 |
|
141 delete this; |
|
142 } |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // CPhoneHandlerResponse::RequestCompleted |
|
146 // Handler for completed asynchronous calls. |
|
147 // (other items were commented in a header). |
|
148 // ----------------------------------------------------------------------------- |
|
149 // |
|
150 void CPhoneHandlerResponse::RequestCompleted( const TInt aError ) |
|
151 { |
|
152 COM_TRACE_1( "[PHONECMDHANDLER] CPhoneHandlerResponse::RequestCompleted() aError=%d", aError ); |
|
153 |
|
154 (void)aError; // avoid warning in WINSCW urel build |
|
155 |
|
156 // Think about adding value to TRemConExtCallHandlingApiOperationId |
|
157 // in RemConExtensionApi.h like "ERemConExtNoCallHandlingOperation". |
|
158 // In this method iOperation should be set to that value. |
|
159 iError = KErrNone; |
|
160 } |
|
161 |
|
162 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
163 |
|
164 // End of File |