|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : IsvTelInfoAppTelephony.h 00004 * Part of : IsvTelInfoApp 00005 * Interface : 00006 * Description : A class that wraps the CTelephony class. 00007 * Version : 00008 * 00009 * Copyright (c) 2005-2006 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================== 00014 */ 00015 00016 #ifndef ISVTELINFOAPP_TELEPHONY_H 00017 #define ISVTELINFOAPP_TELEPHONY_H 00018 00019 // INCLUDES 00020 #include <e32base.h> 00021 #include <e32std.h> 00022 #include <etel3rdparty.h> 00023 #include <charconv.h> 00024 00025 // CONSTANTS 00026 const TInt KMaxCmdSize = 100; 00027 const TInt KMaxTelNumSize = 100; 00028 const TInt KMaxErrMsgSize = 100; 00029 const TInt KMaxDTMFLength = 80; 00030 00031 // FORWARD DECLARATIONS 00032 class MIsvTelInfoAppTelephonyNotify; 00033 class CTelephony; 00034 00035 // CLASS DEFINITIONS 00036 00037 /** 00038 * CIsvTelInfoAppTelephony: This class derives from CActive and wraps the 00039 * CTelephony class. Provides a command table based execution for 00040 * telephony commands with command specific parsing capabilities. 00041 */ 00042 class CIsvTelInfoAppTelephony : public CActive 00043 { 00044 public: 00045 /** 00046 * Default constructor. 00047 * @param aNotify reference to the object that implements the 00048 * MIsvTelInfoAppTelephonyNotify interface. 00049 */ 00050 CIsvTelInfoAppTelephony(MIsvTelInfoAppTelephonyNotify& aNotify); 00051 00052 /** 00053 * Second-phase constructor. 00054 */ 00055 void ConstructL(); 00056 00057 /** 00058 * Two-phased constructor. 00059 * @param aNotify Reference to an object implementing the 00060 * MIsvTelInfoAppTelephonyNotify interface 00061 */ 00062 static CIsvTelInfoAppTelephony* NewL(MIsvTelInfoAppTelephonyNotify& 00063 aNotify); 00064 00065 /** 00066 * Destructor. 00067 */ 00068 ~CIsvTelInfoAppTelephony(); 00069 00070 //Wrapper functions for individual commands 00071 /** 00072 * Wrapper function that calls GetPhoneId of CTelephony class. 00073 */ 00074 void TelApiWrapperGetPhoneIdL( ); 00075 00076 /** 00077 * Wrapper function that calls GetSubscriberId of CTelephony class. 00078 */ 00079 void TelApiWrapperGetSubscriberIdL( ); 00080 00081 /** 00082 * Wrapper function that calls GetNetworkRegistrationStatus of 00083 * CTelephony class. 00084 */ 00085 void TelApiWrapperGetNwRegistrationStatusL( ); 00086 00087 /** 00088 * Wrapper function that calls GetCallBarringStatus of 00089 * CTelephony class. 00090 * @param CTelephony::TCallBarringCondition aBarCondition 00091 * Barring Condition 00092 */ 00093 void TelApiWrapperGetBarringStatusL( 00094 CTelephony::TCallBarringCondition aBarCondition ); 00095 00096 /** 00097 * Wrapper function that calls GetCallWaitingStatus of 00098 * CTelephony class. 00099 */ 00100 void TelApiWrapperGetWaitingStatusL( ); 00101 /** 00102 * Wrapper function that calls GetIdentityServiceStatus of 00103 * CTelephony class. 00104 */ 00105 void TelApiWrapperGetIdentityStatusL( 00106 CTelephony::TIdentityService aIdentityServiceType ); 00107 00108 /** 00109 * Loads error strings from resource files 00110 */ 00111 void LoadErrorStringsFromResource( ); 00112 00113 /** 00114 * Finds the system wide error. 00115 * @param aStatus The system wide error. 00116 * @param aErrMsgBuffer The buffer containing the error message. 00117 */ 00118 void GeneralErrorMessage( 00119 TInt aStatus, 00120 TBuf16<KMaxErrMsgSize> *aErrMsgBuffer); 00121 00122 /** 00123 * Starts the active scheduler wait after testing if it 00124 * is already started 00125 */ 00126 void StartWait( ); 00127 00128 protected: 00129 00130 /** 00131 * From CActive, RunL. 00132 * Handles the active object’s request completion event 00133 */ 00134 void RunL(); 00135 00136 /** 00137 * From CActive, DoCancel. 00138 * Implements cancellation of an outstanding request. 00139 */ 00140 void DoCancel(); 00141 00142 private: 00143 00144 /** 00145 * Command Table. 00146 */ 00147 enum TETelApiCmd 00148 { 00149 /** 00150 Get Phone Identity. 00151 */ 00152 EGetPhoneId = 0, 00153 /** 00154 Get SubscriberId. 00155 */ 00156 EGetSubscriberId, 00157 /** 00158 Get Network registration status. 00159 */ 00160 ENwRegistrationStatus, 00161 /** 00162 Get Call barring status. 00163 */ 00164 EGetBarringStatus, 00165 /** 00166 Get Call waiting status. 00167 */ 00168 EGetWaitingStatus, 00169 /** 00170 Get identity status. 00171 */ 00172 EGetIdentityStatus, 00173 /** 00174 Async commands. 00175 */ 00176 EAsyncEvent, 00177 /** 00178 Maximum number of commands. 00179 */ 00180 EMaxCommands, 00181 /** 00182 Command None 00183 */ 00184 ECommandNone 00185 }; 00186 00187 private: 00188 00189 //Instance of command table. 00190 TETelApiCmd iTelApiCmd; 00191 00192 // Call barring condition. 00193 CTelephony::TCallBarringCondition iBarringCondition; 00194 00195 // Phone ID services. 00196 CTelephony::TIdentityService iIdentityServiceType; 00197 00198 //Instance of scheduler wait class 00199 CActiveSchedulerWait iWait; 00200 00201 //Notification event 00202 CTelephony::TNotificationEvent iEvent; 00203 00204 //Reference to a class implementing MIsvTelInfoAppTelephonyNotify 00205 //interface. 00206 MIsvTelInfoAppTelephonyNotify& iNotify; 00207 00208 //Contains error strings loaded from resource 00209 TBuf16<KMaxErrMsgSize> iErrStrNotFound; 00210 TBuf16<KMaxErrMsgSize> iErrStrGeneral; 00211 TBuf16<KMaxErrMsgSize> iErrStrCancel; 00212 TBuf16<KMaxErrMsgSize> iErrStrNoMemory; 00213 TBuf16<KMaxErrMsgSize> iErrStrNotSupported; 00214 TBuf16<KMaxErrMsgSize> iErrStrArgument; 00215 TBuf16<KMaxErrMsgSize> iErrStrTotalLossOfPrecision; 00216 TBuf16<KMaxErrMsgSize> iErrStrBadHandle; 00217 TBuf16<KMaxErrMsgSize> iErrStrOverflow; 00218 TBuf16<KMaxErrMsgSize> iErrStrUnderflow; 00219 TBuf16<KMaxErrMsgSize> iErrStrAlreadyExists; 00220 TBuf16<KMaxErrMsgSize> iErrStrInUse; 00221 TBuf16<KMaxErrMsgSize> iErrStrServerTerminated; 00222 TBuf16<KMaxErrMsgSize> iErrStrServerBusy; 00223 TBuf16<KMaxErrMsgSize> iErrStrUnknown; 00224 TBuf16<KMaxErrMsgSize> iErrStrCorrupt; 00225 TBuf16<KMaxErrMsgSize> iErrStrAccessDenied; 00226 TBuf16<KMaxErrMsgSize> iErrStrCommsLineFail; 00227 TBuf16<KMaxErrMsgSize> iErrStrTimedOut; 00228 TBuf16<KMaxErrMsgSize> iErrStrCouldNotConnect; 00229 TBuf16<KMaxErrMsgSize> iErrStrCouldNotDisconnect; 00230 TBuf16<KMaxErrMsgSize> iErrStrHardwareNotAvailable; 00231 TBuf16<KMaxErrMsgSize> iErrStrSessionClosed; 00232 TBuf16<KMaxErrMsgSize> iErrStrPermissionDenied; 00233 TBuf16<KMaxErrMsgSize> iErrStrDefault; 00234 TBuf16<KMaxErrMsgSize> iEmuApiNotSupported; 00235 00236 //Contains mobile phone identity. 00237 CTelephony::TPhoneIdV1 iPhoneId; 00238 00239 public: 00240 00241 //Pointer to CTelephony class 00242 //which contains the ETel ISV 3rd party APIs 00243 CTelephony* iTel; 00244 00245 private: 00246 CTelephony::TPhoneIdV1Pckg iPhoneIdPckg; 00247 00248 CTelephony::TSubscriberIdV1 iSubscriberId; 00249 CTelephony::TSubscriberIdV1Pckg iSubscriberIdPckg; 00250 00251 CTelephony::TNetworkRegistrationV1 iNwRegistrationStatus; 00252 CTelephony::TNetworkRegistrationV1Pckg iNwRegistrationStatusPckg; 00253 00254 CTelephony::TCallBarringSupplServicesV1 iCallBarringServices; 00255 CTelephony::TCallBarringSupplServicesV1Pckg iCallBarringServicesPckg; 00256 00257 CTelephony::TCallWaitingSupplServicesV1 iCallWaitingServices; 00258 CTelephony::TCallWaitingSupplServicesV1Pckg iCallWaitingServicesPckg; 00259 00260 CTelephony::TIdentityServiceV1 iIdentityService; 00261 CTelephony::TIdentityServiceV1Pckg iIdentityServicePckg; 00262 }; 00263 00264 #endif // ISVTELINFOAPP_TELEPHONY_H
|
© Nokia 2006 |