00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "CCallForwardingStatus.h"
00017
00025 CCallForwardingStatus* CCallForwardingStatus::NewL(MExecAsync* aController)
00026 {
00027 CCallForwardingStatus* self = new(ELeave) CCallForwardingStatus(aController);
00028 CleanupStack::PushL(self);
00029 self->ConstructL();
00030 CleanupStack::Pop(self);
00031 return self;
00032 }
00033
00037 CCallForwardingStatus::~CCallForwardingStatus()
00038 {
00039 Cancel();
00040 }
00041
00045 void CCallForwardingStatus::ConstructL()
00046 {
00047 iSecondCondition = EFalse;
00048 }
00049
00053 void CCallForwardingStatus::DoStartRequestL()
00054 {
00055 _LIT( KNotifyPanic, "CCallForwardingStatus Get Method" );
00056 __ASSERT_ALWAYS( !IsActive(), User::Panic( KNotifyPanic, 1 ));
00057 iRequestNotify = EFalse;
00058 if (iSecondCondition)
00059 {
00060 iSecondCondition = EFalse;
00061 CTelephony::TCallForwardingCondition condition2 = CTelephony::ECallForwardingUnconditional;
00062
00063
00064 iTelephony->GetCallForwardingStatus(iStatus,
00065 condition2,
00066 iCallForwardingStatus2V1Pckg);
00067 }
00068 else
00069 {
00070 iSecondCondition = ETrue;
00071 CTelephony::TCallForwardingCondition condition1 = CTelephony::ECallForwardingNoReply;
00072
00073
00074 iTelephony->GetCallForwardingStatus(iStatus,
00075 condition1,
00076 iCallForwardingStatus1V1Pckg);
00077 }
00078 SetActive();
00079 }
00080
00087 CCallForwardingStatus::CCallForwardingStatus(MExecAsync* aController)
00088 : CISVAPIAsync(aController, KCallForwardingStatus),
00089 iCallForwardingStatus1V1Pckg(iCallForwardingStatus1V1),
00090 iCallForwardingStatus2V1Pckg(iCallForwardingStatus2V1)
00091 {
00092
00093 }
00094
00099 void CCallForwardingStatus::RunL()
00100 {
00101 if(iStatus != KErrNone)
00102 {
00103 iConsole->Printf(KError);
00104
00105
00106 iConsole->Printf(_L("%d\n"), iStatus.Int());
00107 }
00108 else
00109 {
00110 if (!iSecondCondition)
00111 {
00112 iConsole->Printf(KCallForwardingStatusMsg);
00113 switch(iCallForwardingStatus1V1.iCallForwarding)
00114 {
00115 case CTelephony::EStatusActive:
00116
00117
00118
00119 iConsole->Printf(_L("Call Forwarding impinges on incoming calls!\n"));
00120 iConsole->Printf(_L("Recify this to remove this delay\n"));
00121 User::After(5000000);
00122 case CTelephony::ENotActive:
00123 case CTelephony::ENotProvisioned:
00124 case CTelephony::ENotAvailable:
00125 case CTelephony::EUnknown:
00126 break;
00127 }
00128 switch(iCallForwardingStatus2V1.iCallForwarding)
00129 {
00130 case CTelephony::EStatusActive:
00131
00132
00133
00134 iConsole->Printf(_L("Call Forwarding impinges on incoming calls!\n"));
00135 iConsole->Printf(_L("Recify this to remove this delay\n"));
00136 User::After(5000000);
00137 case CTelephony::ENotActive:
00138 case CTelephony::ENotProvisioned:
00139 case CTelephony::ENotAvailable:
00140 case CTelephony::EUnknown:
00141 ExampleComplete();
00142 break;
00143 }
00144 }
00145 else
00146 {
00147 ExampleNotify();
00148 }
00149 }
00150 }
00151
00155 void CCallForwardingStatus::DoCancel()
00156 {
00157
00158 iTelephony->CancelAsync(CTelephony::EGetCallForwardingStatusCancel);
00159 }