00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "CCallBarringStatus.h"
00018
00026 CCallBarringStatus* CCallBarringStatus::NewL(MExecAsync* aController)
00027 {
00028 CCallBarringStatus* self = new(ELeave) CCallBarringStatus(aController);
00029 CleanupStack::PushL(self);
00030 self->ConstructL();
00031 CleanupStack::Pop(self);
00032 return self;
00033 }
00034
00039 CCallBarringStatus::~CCallBarringStatus()
00040 {
00041 Cancel();
00042 }
00043
00048 void CCallBarringStatus::DoStartRequestL()
00049 {
00050 _LIT( KNotifyPanic, "CCallBarringStatus Get Method" );
00051 __ASSERT_ALWAYS( !IsActive(), User::Panic( KNotifyPanic, 1 ));
00052 iRequestNotify = EFalse;
00053 CTelephony::TCallBarringCondition condition = CTelephony::EBarAllIncoming;
00054
00055
00056 iTelephony->GetCallBarringStatus( iStatus,
00057 condition,
00058 iCallBarringStatusV1Pckg);
00059 SetActive();
00060 }
00061
00068 CCallBarringStatus::CCallBarringStatus(MExecAsync* aController)
00069 : CISVAPIAsync(aController, KCallBarringStatus),
00070 iCallBarringStatusV1Pckg(iCallBarringStatusV1)
00071 {
00072
00073 }
00074
00078 void CCallBarringStatus::ConstructL()
00079 {
00080
00081 }
00082
00087 void CCallBarringStatus::RunL()
00088 {
00089 if(iStatus != KErrNone)
00090 {
00091 iConsole->Printf(KError);
00092
00093
00094 iConsole->Printf(_L("%d\n"), iStatus.Int());
00095 }
00096 else
00097 {
00098
00099 iConsole->Printf(KCallBarringStatusMsg);
00100 switch(iCallBarringStatusV1.iCallBarring)
00101 {
00102 case CTelephony::EStatusActive:
00103 iConsole->Printf(_L("Call barring status is active.\n"));
00104 break;
00105 case CTelephony::ENotActive:
00106 iConsole->Printf(_L("Call barring status is not active.\n"));
00107 break;
00108 case CTelephony::ENotProvisioned:
00109 iConsole->Printf(_L("Call barring status is not provisioned.\n"));
00110 break;
00111 case CTelephony::ENotAvailable:
00112 iConsole->Printf(_L("Call barring status is not available.\n"));
00113 break;
00114 case CTelephony::EUnknown:
00115 default:
00116 iConsole->Printf(_L("Call barring status is unknown.\n"));
00117 break;
00118 }
00119 }
00120 ExampleComplete();
00121 }
00122
00126 void CCallBarringStatus::DoCancel()
00127 {
00128
00129 iTelephony->CancelAsync(CTelephony::EGetCallBarringStatusCancel);
00130 }
00131