00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #include <supservices_symbian.h>
00041 #include <etel3rdparty.h>
00042 #include <supservices.h>
00043
00047 SupServicesPrivate* SupServicesPrivate::NewL(SupServices *aPublicInterface)
00048 {
00049 SupServicesPrivate* self = new (ELeave) SupServicesPrivate(aPublicInterface);
00050 CleanupStack::PushL(self);
00051 self->ConstructL();
00052 CleanupStack::Pop(self);
00053 return self;
00054 }
00055
00059 void SupServicesPrivate::ConstructL()
00060 {
00061 iTelephony = CTelephony::NewL();
00062 }
00063
00064
00065
00066 SupServicesPrivate::SupServicesPrivate(SupServices *aPublicInterface)
00067 : iPublic(aPublicInterface), CActive(CActive::EPriorityStandard),
00068 iCallBarringSupplServicesV1Pckg(iCallBarringSupplServicesV1),
00069 iCallForwardingSupplServicesV1Pckg(iCallForwardingSupplServicesV1),
00070 iCallWaitingSupplServicesV1Pckg(iCallWaitingSupplServicesV1),
00071 iTIdentityServiceV1Pckg(iTIdentityServiceV1)
00072 {
00073
00074
00075 CActiveScheduler::Add(this);
00076 }
00077
00081 SupServicesPrivate::~SupServicesPrivate()
00082 {
00083
00084
00085
00086 Cancel();
00087 if( iTelephony )
00088 {
00089 delete iTelephony;
00090 iTelephony = NULL;
00091 }
00092
00093 }
00094
00099 void SupServicesPrivate::GetCallBarringStatus()
00100 {
00101
00102 CTelephony::TCallBarringCondition condition = CTelephony::EBarAllOutgoing;
00103
00104
00105
00106
00107
00108 iTelephony->GetCallBarringStatus(iStatus, condition, iCallBarringSupplServicesV1Pckg);
00109 iSupServiceType = ECallBarred;
00110 SetActive();
00111
00112 }
00113
00117 void SupServicesPrivate::GetCallForwardingStatus()
00118 {
00119 CTelephony::TCallForwardingCondition condition = CTelephony::ECallForwardingNoReply;
00120
00121
00122
00123
00124
00125 iTelephony->GetCallForwardingStatus(iStatus, condition, iCallForwardingSupplServicesV1Pckg);
00126 iSupServiceType = ECallForwarded;
00127 SetActive();
00128
00129 }
00130
00134 void SupServicesPrivate::GetCallWaitingStatus()
00135 {
00136
00137
00138
00139
00140 iTelephony->GetCallWaitingStatus(iStatus, iCallWaitingSupplServicesV1Pckg);
00141 iSupServiceType = ECallWaiting;
00142 SetActive();
00143 }
00144
00148 void SupServicesPrivate::GetCallerIdentityStatus()
00149 {
00150 CTelephony::TIdentityService condition = CTelephony::EIdServiceCallerPresentation;
00151
00152
00153
00154
00155
00156
00157 iTelephony->GetIdentityServiceStatus(iStatus, condition, iTIdentityServiceV1Pckg);
00158 iSupServiceType = ECallerIdentification;
00159 SetActive();
00160 }
00161
00166 void SupServicesPrivate::RunL()
00167 {
00168 if( iStatus == KErrNone )
00169 {
00170 switch( iSupServiceType )
00171 {
00172 case ECallBarred:
00173 {
00174 if( iCallBarringSupplServicesV1.iCallBarringCondition == CTelephony::EBarAllOutgoing)
00175 {
00176 _LIT(KCallBarMessage,"Bar Outgoing calls");
00177
00178 TBuf<64> message(KCallBarMessage);
00179
00180
00181 message.Append(GetSupServiceStatus(iCallBarringSupplServicesV1.iCallBarring));
00182 iPublic->getMessage(message);
00183 }
00184 else
00185 {
00186 _LIT(KNoCallBarMessage,"Outgoing calls not barred");
00187
00188
00189 TBuf<64> message(KNoCallBarMessage);
00190 iPublic->getMessage(message);
00191 }
00192 break;
00193 }
00194
00195 case ECallForwarded:
00196 {
00197 if( iCallForwardingSupplServicesV1.iCallForwardingCondition == CTelephony::ECallForwardingNoReply )
00198 {
00199 _LIT(KCallForwardMessage,"Call forward on noReply");
00200
00201 TBuf<64> message(KCallForwardMessage);
00202
00203
00204 message.Append(GetSupServiceStatus(iCallForwardingSupplServicesV1.iCallForwarding));
00205 iPublic->getMessage(message);
00206 }
00207
00208 else
00209 {
00210 _LIT(KNoCallForwardMessage,"Call forward on noReply not set");
00211
00212 TBuf<64> message(KNoCallForwardMessage);
00213 iPublic->getMessage(message);
00214 }
00215 break;
00216 }
00217
00218 case ECallWaiting:
00219 {
00220 _LIT(KCallWaitMessage,"Call waiting");
00221
00222 TBuf<64> message(KCallWaitMessage);
00223
00224
00225 message.Append(GetSupServiceStatus(iCallWaitingSupplServicesV1.iCallWaiting));
00226 iPublic->getMessage(message);
00227 break;
00228 }
00229
00230 case ECallerIdentification:
00231 {
00232
00233 TBuf<64> message;
00234
00235 switch(iTIdentityServiceV1.iIdentityStatus)
00236 {
00237 case CTelephony::EIdServiceActivePermanent:
00238 {
00239 _LIT(KCLIPActiveMessage,"CLIP is permanently active");
00240 message.Append(KCLIPActiveMessage);
00241 break;
00242 }
00243 case CTelephony::EIdServiceActiveDefaultRestricted:
00244 {
00245 _LIT(KCLIPRestrictedMessage,"CLIP is restricted");
00246 message.Append(KCLIPRestrictedMessage);
00247 break;
00248 }
00249 case CTelephony::EIdServiceActiveDefaultAllowed:
00250 {
00251 _LIT(KCLIPAllowedMessage,"CLIP is Allowed");
00252 message.Append(KCLIPAllowedMessage);
00253 break;
00254 }
00255 case CTelephony::EIdServiceNotProvisioned:
00256 {
00257 _LIT(KCLIPNotProvisionedMessage,"CLIP is NotProvisioned");
00258 message.Append(KCLIPNotProvisionedMessage);
00259 break;
00260 }
00261 case CTelephony::EIdServiceUnknown:
00262 default:
00263 {
00264 _LIT(KCLIPUnknownMessage,"CLIP service is Unknown");
00265 message.Append(KCLIPUnknownMessage);
00266 break;
00267 }
00268
00269 }
00270 iPublic->getMessage(message);
00271 break;
00272 }
00273
00274 default:
00275 break;
00276 }
00277
00278 }
00279
00280
00281 emit iPublic->printMessage();
00282 }
00283
00289 TDes& SupServicesPrivate::GetSupServiceStatus(CTelephony::TSupplServiceStatus aStatus)
00290 {
00291 imessage.Delete(0,imessage.Length());
00292 switch( aStatus )
00293 {
00294 case CTelephony::EStatusActive:
00295 _LIT(KActiveMessage," active.");
00296 imessage.Append(KActiveMessage);
00297 break;
00298 case CTelephony::ENotActive:
00299 _LIT(KNotActiveMessage," not active.");
00300 imessage.Append(KNotActiveMessage);
00301 break;
00302 case CTelephony::ENotProvisioned:
00303 _LIT(KNotProvisionedMessage," not provisioned.");
00304 imessage.Append(KNotProvisionedMessage);
00305 break;
00306 case CTelephony::ENotAvailable:
00307 _LIT(KNotAvailableMessage," not available.");
00308 imessage.Append(KNotAvailableMessage);
00309 break;
00310 case CTelephony::EUnknown:
00311 default:
00312 _LIT(KUnknownMessage," unknown.");
00313 imessage.Append(KUnknownMessage);
00314 break;
00315 }
00316 return imessage;
00317
00318 }
00319
00323 void SupServicesPrivate::DoCancel()
00324 {
00325
00326 iTelephony->CancelAsync(CTelephony::EGetCallBarringStatusCancel);
00327
00328
00329 iTelephony->CancelAsync(CTelephony::EGetCallForwardingStatusCancel);
00330
00331
00332 iTelephony->CancelAsync(CTelephony::EGetCallWaitingStatusCancel);
00333
00334
00335 iTelephony->CancelAsync(CTelephony::EGetIdentityServiceStatusCancel);
00336
00337 }
00338