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 #include "CCallForwardingStatus.h"
00033
00041 CCallForwardingStatus* CCallForwardingStatus::NewL(MExecAsync* aController)
00042 {
00043 CCallForwardingStatus* self = new(ELeave) CCallForwardingStatus(aController);
00044 CleanupStack::PushL(self);
00045 self->ConstructL();
00046 CleanupStack::Pop(self);
00047 return self;
00048 }
00049
00053 CCallForwardingStatus::~CCallForwardingStatus()
00054 {
00055 Cancel();
00056 }
00057
00061 void CCallForwardingStatus::DoStartRequestL()
00062 {
00063 _LIT( KNotifyPanic, "CCallForwardingStatus Get Method" );
00064 __ASSERT_ALWAYS( !IsActive(), User::Panic( KNotifyPanic, 1 ));
00065 iRequestNotify = EFalse;
00066 if (iSecondCondition)
00067 {
00068 iSecondCondition = EFalse;
00069 CTelephony::TCallForwardingCondition condition2;
00070 condition2 = CTelephony::ECallForwardingUnconditional;
00071
00072
00073 iTelephony->GetCallForwardingStatus(iStatus,
00074 condition2,
00075 iCallForwardingStatus2V1Pckg);
00076 }
00077 else
00078 {
00079 iSecondCondition = ETrue;
00080 CTelephony::TCallForwardingCondition condition1;
00081 condition1 = CTelephony::ECallForwardingNoReply;
00082
00083
00084 iTelephony->GetCallForwardingStatus(iStatus,
00085 condition1,
00086 iCallForwardingStatus1V1Pckg);
00087 }
00088 SetActive();
00089 }
00090
00097 CCallForwardingStatus::CCallForwardingStatus(MExecAsync* aController)
00098 : CISVAPIAsync(aController, KCallForwardingStatus),
00099 iCallForwardingStatus1V1Pckg(iCallForwardingStatus1V1),
00100 iCallForwardingStatus2V1Pckg(iCallForwardingStatus2V1)
00101 {
00102
00103 }
00104
00108 void CCallForwardingStatus::ConstructL()
00109 {
00110 iSecondCondition = EFalse;
00111 }
00112
00117 void CCallForwardingStatus::RunL()
00118 {
00119 if(iStatus != KErrNone)
00120 {
00121 iConsole->Printf(KError);
00122
00123
00124 iConsole->Printf(_L("%d\n"), iStatus.Int());
00125 }
00126 else
00127 {
00128 if (!iSecondCondition)
00129 {
00130 iConsole->Printf(KCallForwardingStatusMsg);
00131 switch(iCallForwardingStatus1V1.iCallForwarding)
00132 {
00133 case CTelephony::EStatusActive:
00134 iConsole->Printf(_L("Call forwarding status 1 is active.\n"));
00135 break;
00136 case CTelephony::ENotActive:
00137 iConsole->Printf(_L("Call forwarding status 2 is not active.\n"));
00138 break;
00139 case CTelephony::ENotProvisioned:
00140 iConsole->Printf(_L("Call forwarding status 3 is not provisioned.\n"));
00141 break;
00142 case CTelephony::ENotAvailable:
00143 iConsole->Printf(_L("Call forwarding status 4 is not available.\n"));
00144 break;
00145 case CTelephony::EUnknown:
00146 default:
00147 iConsole->Printf(_L("Call forwarding status 5 is unknown.\n"));
00148 break;
00149 }
00150 switch(iCallForwardingStatus2V1.iCallForwarding)
00151 {
00152 case CTelephony::EStatusActive:
00153 iConsole->Printf(_L("Call forwarding status 2 is active.\n"));
00154 break;
00155 case CTelephony::ENotActive:
00156 iConsole->Printf(_L("Call forwarding status 2 is not active.\n"));
00157 break;
00158 case CTelephony::ENotProvisioned:
00159 iConsole->Printf(_L("Call forwarding status 2 is not provisioned.\n"));
00160 break;
00161 case CTelephony::ENotAvailable:
00162 iConsole->Printf(_L("Call forwarding status 2 is not available.\n"));
00163 break;
00164 case CTelephony::EUnknown:
00165 default:
00166 iConsole->Printf(_L("Call forwarding status 2 is unknown.\n"));
00167 break;
00168 }
00169 ExampleComplete();
00170 }
00171 else
00172 {
00173 ExampleNotify();
00174 }
00175 }
00176 }
00177
00181 void CCallForwardingStatus::DoCancel()
00182 {
00183
00184 iTelephony->CancelAsync(CTelephony::EGetCallForwardingStatusCancel);
00185 }
00186