|
1 /* |
|
2 * Copyright (c) 2002-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: CallControl command handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCALLCONTROLHANDLER_H |
|
21 #define CCALLCONTROLHANDLER_H |
|
22 |
|
23 #include <etelsat.h> |
|
24 #include "CSatCommandHandler.h" |
|
25 #include "SatSTypes.h" |
|
26 |
|
27 class MSatUtils; |
|
28 class CCallControlRequestHandler; |
|
29 |
|
30 /** |
|
31 * Command handler for CallControl command. |
|
32 * |
|
33 * @lib CallControlCmd.lib |
|
34 * @since Series 60 3.0 |
|
35 */ |
|
36 class CCallControlHandler : public CSatCommandHandler |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * @param aUtils Utils inteface |
|
43 */ |
|
44 static CCallControlHandler* NewL( MSatUtils* aUtils ); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 virtual ~CCallControlHandler(); |
|
50 |
|
51 public: // Functions from base classes |
|
52 |
|
53 /** |
|
54 * From MSatCommand. |
|
55 */ |
|
56 void ClientResponse(); |
|
57 |
|
58 public:// New Functions |
|
59 |
|
60 /** |
|
61 * Processes the Cc Request Complete. |
|
62 * |
|
63 * @param aErrCode Result of ETelMM Api calling. |
|
64 */ |
|
65 void DispatchCcRequestComplete( const TInt aErrCode ); |
|
66 |
|
67 /** |
|
68 * TCcStatus |
|
69 * Call control status, when there is an asynchronous |
|
70 * operation is handling by the CCallControlRequestHandler |
|
71 * we will save some status information |
|
72 */ |
|
73 enum TCcStatus |
|
74 { |
|
75 ECcIdle = 0, |
|
76 ECcDialWaiting, |
|
77 ECcSendSsWaiting, |
|
78 ECcSendUssdWaiting |
|
79 }; |
|
80 |
|
81 protected: // Functions from base classes |
|
82 |
|
83 /** |
|
84 * From CActive Cancels the usat request. |
|
85 */ |
|
86 void DoCancel(); |
|
87 |
|
88 /** |
|
89 * From CSatCommandHandler Requests the command notification. |
|
90 * @param aStatus Request status to active object notification |
|
91 */ |
|
92 void IssueUSATRequest( TRequestStatus& aStatus ); |
|
93 |
|
94 /** |
|
95 * From CSatCommandHandler Precheck before executing the command. |
|
96 * @return Boolean indicating is this command allowed to execute. |
|
97 */ |
|
98 TBool CommandAllowed(); |
|
99 |
|
100 /** |
|
101 * From CSatCommandHandler Need for ui session. |
|
102 * @return Boolean indicating does this command need UI session. |
|
103 */ |
|
104 TBool NeedUiSession(); |
|
105 |
|
106 /** |
|
107 * From CSatCommandHandler Called when USAT API notifies that command. |
|
108 */ |
|
109 void HandleCommand(); |
|
110 |
|
111 /** |
|
112 * From CSatCommandHandler. Indicates the failure of launching ui client |
|
113 */ |
|
114 void UiLaunchFailed(); |
|
115 |
|
116 private: |
|
117 |
|
118 /** |
|
119 * C++ default constructor. |
|
120 */ |
|
121 CCallControlHandler(); |
|
122 |
|
123 /** |
|
124 * By default Symbian 2nd phase constructor is private. |
|
125 */ |
|
126 void ConstructL(); |
|
127 |
|
128 |
|
129 /** |
|
130 * If it is needed that sat makes a no FDN check call or |
|
131 * send SS or send USSD we should perform these operation |
|
132 */ |
|
133 void CallControlClientOperation(); |
|
134 |
|
135 /** |
|
136 * If SAT needs to do Call Control next action, |
|
137 * i.e. Call Control has modified the type of request, |
|
138 * then this method should be called |
|
139 */ |
|
140 TInt DialNumber(); |
|
141 |
|
142 /** |
|
143 * Make a no FDN check Send SS |
|
144 */ |
|
145 TInt SendSs(); |
|
146 |
|
147 /** |
|
148 * Make a no FDN check Send USSD |
|
149 */ |
|
150 TInt SendUssd(); |
|
151 |
|
152 /** |
|
153 * Notify session done, start recieve more command. |
|
154 */ |
|
155 void CompleteCallControlCmd( TInt aErrCode ); |
|
156 |
|
157 private: // Data |
|
158 |
|
159 // CallControl command data. |
|
160 RSat::TCallControlV6 iCallControlData; |
|
161 // CallControl command package. |
|
162 RSat::TCallControlV6Pckg iCallControlPckg; |
|
163 // CallControl send data |
|
164 TSatNotificationV1 iCallControlSendData; |
|
165 // CallControl SendData package |
|
166 TSatNotificationV1Pckg iCallControlSendDataPckg; |
|
167 // CallControl UI Response data |
|
168 TSatNotificationRspV1 iCallControlUiRespData; |
|
169 // CallControl UI Response package |
|
170 TSatNotificationRspV1Pckg iCallControlUiRespDataPckg; |
|
171 // Indicates is UI needed or not |
|
172 TBool iNeedUiSession; |
|
173 // Handing the asynchronous request |
|
174 CCallControlRequestHandler* iRequestHandler; |
|
175 // Current status |
|
176 TCcStatus iCcStatus; |
|
177 |
|
178 }; |
|
179 |
|
180 #endif // CCALLCONTROLHANDLER_H |
|
181 |
|
182 |