|
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Hangup a ongoning call |
|
15 |
|
16 #ifndef ATHANGUP_H_ |
|
17 #define ATHANGUP_H_ |
|
18 |
|
19 //system include |
|
20 |
|
21 //user include |
|
22 #include "atcommandbase.h" |
|
23 |
|
24 //class forward |
|
25 class MAllCallReleaseCompleteObserver; |
|
26 |
|
27 class CATHangUp : public CAtCommandBase |
|
28 { |
|
29 public: |
|
30 /** |
|
31 * Factory function |
|
32 * |
|
33 */ |
|
34 static CATHangUp* NewL(CGlobalPhonemanager& aGloblePhone, |
|
35 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
36 |
|
37 /** |
|
38 * Factory function |
|
39 * |
|
40 */ |
|
41 static CATHangUp* NewLC(CGlobalPhonemanager& aGloblePhone, |
|
42 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
43 |
|
44 /** |
|
45 * Destrctor |
|
46 * |
|
47 */ |
|
48 virtual ~CATHangUp(); |
|
49 |
|
50 /** |
|
51 * From CAtCommandBase |
|
52 * |
|
53 */ |
|
54 virtual void ExecuteCommand(); |
|
55 |
|
56 /** |
|
57 * From CAtCommandBase |
|
58 * |
|
59 */ |
|
60 virtual void EventSignal(TAtEventSource aEventSource, TInt aStatus); |
|
61 |
|
62 /** |
|
63 * From CAtCommandBase |
|
64 * |
|
65 */ |
|
66 virtual void ParseResponseL(const TDesC8& aResponseBuf); |
|
67 |
|
68 /** |
|
69 * From CRequestBase |
|
70 * |
|
71 */ |
|
72 virtual void StartRequest(); |
|
73 |
|
74 /** |
|
75 * Add the call release observer |
|
76 */ |
|
77 void AddAllCallReleaseObserver(MAllCallReleaseCompleteObserver* aObserver); |
|
78 |
|
79 /** |
|
80 * Reset the internal states |
|
81 */ |
|
82 void InitVariable(); |
|
83 |
|
84 public: |
|
85 |
|
86 /** |
|
87 * Define the hungup opertion |
|
88 * |
|
89 */ |
|
90 enum THangupOperator |
|
91 { |
|
92 EUnknownAPI, |
|
93 ECustomAPI, |
|
94 ERMobilePhoneAPI |
|
95 }; |
|
96 |
|
97 /** |
|
98 * Set the hangup opertion type |
|
99 * |
|
100 */ |
|
101 void SetHangupOperator(THangupOperator aOperator); |
|
102 |
|
103 protected: |
|
104 /** |
|
105 * Constructor |
|
106 * |
|
107 */ |
|
108 CATHangUp(CGlobalPhonemanager& aGloblePhone, |
|
109 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
110 |
|
111 /** |
|
112 * 2nd constructor |
|
113 * |
|
114 */ |
|
115 void ConstructL(); |
|
116 |
|
117 /** |
|
118 * From CAtCommandBase |
|
119 * |
|
120 */ |
|
121 virtual void Complete(); |
|
122 |
|
123 private: |
|
124 /** |
|
125 * Handle IO errors |
|
126 * |
|
127 */ |
|
128 void HandleIOError(); |
|
129 |
|
130 /** |
|
131 * Handle response error |
|
132 * |
|
133 */ |
|
134 void HandleResponseError(); |
|
135 |
|
136 /** |
|
137 * Handle response OK |
|
138 * |
|
139 */ |
|
140 void HandleDisconnectedComplete(); |
|
141 |
|
142 private: |
|
143 /** |
|
144 * Define the states for hanging up a call |
|
145 * |
|
146 */ |
|
147 enum THangUpStep |
|
148 { |
|
149 EATHangUpNotInProgress, |
|
150 EATHangUpWaitForWriteComplete, |
|
151 EATHangUpReadComplete |
|
152 }; |
|
153 |
|
154 private: |
|
155 /** |
|
156 * I/O error when Read or Write |
|
157 * include timeout |
|
158 */ |
|
159 TInt iIOStatus; |
|
160 |
|
161 /** |
|
162 * At command return errors |
|
163 * |
|
164 */ |
|
165 TInt iATResult; |
|
166 |
|
167 /** |
|
168 * Identifier step |
|
169 * |
|
170 */ |
|
171 THangUpStep iHangupStep; |
|
172 |
|
173 /** |
|
174 * The hangup opertion type |
|
175 * |
|
176 */ |
|
177 THangupOperator iHangupOperator; |
|
178 |
|
179 /** |
|
180 * Notify all release |
|
181 * |
|
182 */ |
|
183 MAllCallReleaseCompleteObserver* iAllCallReleaseObserver; |
|
184 |
|
185 }; |
|
186 |
|
187 #endif /*ATHANGUP_H_*/ |