00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "CIdentityServiceStatus.h"
00018
00026 CIdentityServiceStatus* CIdentityServiceStatus::NewL(MExecAsync* aController)
00027 {
00028 CIdentityServiceStatus* self = new(ELeave) CIdentityServiceStatus(aController);
00029 CleanupStack::PushL(self);
00030 self->ConstructL();
00031 CleanupStack::Pop(self);
00032 return self;
00033 }
00034
00039 CIdentityServiceStatus::~CIdentityServiceStatus()
00040 {
00041 Cancel();
00042 }
00043
00047 void CIdentityServiceStatus::DoStartRequestL()
00048 {
00049 _LIT(KDummyAnswerPanic, "CIdentityServiceStatus Get Method");
00050 __ASSERT_ALWAYS(!IsActive(), User::Panic(KDummyAnswerPanic, 1));
00051 iRequestNotify = EFalse;
00052 CTelephony::TIdentityService condition = CTelephony::EIdServiceCallerPresentation;
00053
00054
00055 iTelephony->GetIdentityServiceStatus( iStatus,
00056 condition,
00057 iIdentityServiceStatusV1Pckg);
00058 SetActive();
00059 }
00060
00067 CIdentityServiceStatus::CIdentityServiceStatus(MExecAsync* aController)
00068 : CISVAPIAsync(aController, KIdentityServiceStatus),
00069 iIdentityServiceStatusV1Pckg(iIdentityServiceStatusV1)
00070 {
00071
00072 }
00073
00077 void CIdentityServiceStatus::ConstructL()
00078 {
00079
00080 }
00081
00086 void CIdentityServiceStatus::RunL()
00087 {
00088 if(iStatus != KErrNone)
00089 {
00090 iConsole->Printf(KError);
00091
00092
00093 iConsole->Printf(_L("%d\n"), iStatus.Int());
00094 }
00095 else
00096 {
00097
00098 iConsole->Printf(KIdentityServiceStatusMsg);
00099 switch(iIdentityServiceStatusV1.iIdentityStatus)
00100 {
00101 case CTelephony::EIdServiceActivePermanent:
00102 case CTelephony::EIdServiceActiveDefaultAllowed:
00103 iConsole->Printf(_L("Incoming Callers number Displayed\n"));
00104 break;
00105 case CTelephony::EIdServiceActiveDefaultRestricted:
00106 case CTelephony::EIdServiceNotProvisioned:
00107 case CTelephony::EIdServiceUnknown:
00108 iConsole->Printf(_L("Incoming Caller's number NOT Displayed\n"));
00109 break;
00110 }
00111 }
00112 ExampleComplete();
00113 }
00114
00118 void CIdentityServiceStatus::DoCancel()
00119 {
00120
00121 iTelephony->CancelAsync(CTelephony::EGetIdentityServiceStatusCancel);
00122 }