diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-E56FE736-8D7E-5D98-9F17-BC9DE47F10CB.dita --- a/Symbian3/PDK/Source/GUID-E56FE736-8D7E-5D98-9F17-BC9DE47F10CB.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-E56FE736-8D7E-5D98-9F17-BC9DE47F10CB.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,42 +1,42 @@ - - - - - -Retrieve Call Charge TutorialThis tutorial describes how to retrieve a call charge information from the network using the GSM Advice of Charge supplementary service. Get the phone charge monitoring capabilities using RMobilePhone::GetCostCaps(). Capabilities are described in RMobilePhone::TMobilePhoneCostCaps. Use RMobilePhone::NotifyCostCapsChange() to get the notification of any changes in the phone call cost capabilities. Get a snapshot of the information associated with the call cost services using RMobilePhone::GetCostInfo(). Cost information is described by RMobilePhone::TMobilePhoneCostInfoV1. Use RMobilePhone::NotifyCostInfoChange() to get the notification of any changes in the phone call cost information. Clear the meter for the current call or the accumulated charges using RMobilePhone::ClearCostMeter() Set the maximum value that the call cost meter is allowed to rise using RMobilePhone::SetMaxCostMeter() Set a conversion rate between network units and real monetary values and the currency display string using RMobilePhone::SetPuct(). These settings are described in RMobilePhone::TMobilePhonePuctV1. Call cost retrieval example

The following code declares a class that has functions to get the charging information, and to return the value in real monetary units of the current call, accumulated charge, and maximum charge.

class TCostCalculator - { -public: - // Initialise cost info - void InitialiseL(RMobilePhone& aMobilePhone); - - // Gets current call cost - TReal CurrentCallCost() { - return iCostInfo.iPuct.iPricePerUnit * iCostInfo.iCCM; } - - // Gets accumulated call cost - TReal AccumulatedCallCost() { - return iCostInfo.iPuct.iPricePerUnit * iCostInfo.iACM; } - - // Gets maximum current call cost - TReal MaximumCurrentCallCost() { - return iCostInfo.iPuct.iPricePerUnit * iCostInfo.iACMmax; } - -private: - RMobilePhone::TMobilePhoneCostInfoV1 iCostInfo; - }; - -// Initialise cost info -void TCostCalculator::InitialiseL(RMobilePhone& aMobilePhone) - { - RMobilePhone::TMobilePhoneCostInfoV1Pckg costInfoPckg(iCostInfo); - TRequestStatus status; - aMobilePhone.GetCostInfo(status,costInfoPckg); - User::WaitForRequest(status); - User::LeaveIfError(status.Int()); + + + + + +Retrieve Call Charge TutorialThis tutorial describes how to retrieve a call charge information from the network using the GSM Advice of Charge supplementary service. Get the phone charge monitoring capabilities using RMobilePhone::GetCostCaps(). Capabilities are described in RMobilePhone::TMobilePhoneCostCaps. Use RMobilePhone::NotifyCostCapsChange() to get the notification of any changes in the phone call cost capabilities. Get a snapshot of the information associated with the call cost services using RMobilePhone::GetCostInfo(). Cost information is described by RMobilePhone::TMobilePhoneCostInfoV1. Use RMobilePhone::NotifyCostInfoChange() to get the notification of any changes in the phone call cost information. Clear the meter for the current call or the accumulated charges using RMobilePhone::ClearCostMeter() Set the maximum value that the call cost meter is allowed to rise using RMobilePhone::SetMaxCostMeter() Set a conversion rate between network units and real monetary values and the currency display string using RMobilePhone::SetPuct(). These settings are described in RMobilePhone::TMobilePhonePuctV1. Call cost retrieval example

The following code declares a class that has functions to get the charging information, and to return the value in real monetary units of the current call, accumulated charge, and maximum charge.

class TCostCalculator + { +public: + // Initialise cost info + void InitialiseL(RMobilePhone& aMobilePhone); + + // Gets current call cost + TReal CurrentCallCost() { + return iCostInfo.iPuct.iPricePerUnit * iCostInfo.iCCM; } + + // Gets accumulated call cost + TReal AccumulatedCallCost() { + return iCostInfo.iPuct.iPricePerUnit * iCostInfo.iACM; } + + // Gets maximum current call cost + TReal MaximumCurrentCallCost() { + return iCostInfo.iPuct.iPricePerUnit * iCostInfo.iACMmax; } + +private: + RMobilePhone::TMobilePhoneCostInfoV1 iCostInfo; + }; + +// Initialise cost info +void TCostCalculator::InitialiseL(RMobilePhone& aMobilePhone) + { + RMobilePhone::TMobilePhoneCostInfoV1Pckg costInfoPckg(iCostInfo); + TRequestStatus status; + aMobilePhone.GetCostInfo(status,costInfoPckg); + User::WaitForRequest(status); + User::LeaveIfError(status.Int()); }
\ No newline at end of file