Symbian3/PDK/Source/GUID-B120F909-251E-5209-901F-CAC0BE416C7C.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 14 578be2adaf3e
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="GUID-B120F909-251E-5209-901F-CAC0BE416C7C" xml:lang="en"><title>Phone
Storage Tutorial</title><shortdesc>A phone can have storage for different types of item, for example,
SMS messages, and phone book entries. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<context><p> This storage can be in different locations. It can be in the
phoneitself, or in the SIM card for GSM networks .  
</p></context>
<steps id="GUID-CDED1EEE-7371-4696-9F61-23DBF0686895">
<step id="GUID-8CDBBB88-3ECE-4DAD-A3B0-36B2C01C0137"><cmd>Use <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita#GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8/GUID-4ED4344E-741F-38C9-BE8D-C450313F5E89"><apiname>RMobilePhone::GetPhoneStoreInfo()</apiname></xref></cmd>
<stepresult><p>Queries the
storage is available and its status information like the number of slots in
use. 
</p></stepresult>
</step>
</steps>


<result><p>Storage information is returned in a packaged <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhoneStore::TMobilePhoneStoreInfoV1</apiname></xref> object. </p> </result>
<example id="GUID-DF7F6C44-EEF3-538E-BC8D-518E0CE39DE7"><title>Phone storage
example</title> <p>The following code stores the number of free slots for
the SMS messages in the variable <codeph>free. </codeph> The combination of
the type of storage and location to query is indicated by <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>KETelMeSmsStore</apiname></xref> flag
. </p> <p>The code assumes <codeph>iMobilePhone</codeph> is an <xref href="GUID-AA81AFA4-6FAC-3B0D-A082-BE0AEC58CCA8.dita"><apiname>RMobilePhone</apiname></xref> object. </p> <codeblock id="GUID-9CE6827A-C261-501E-A622-8460732D4A85" xml:space="preserve">TRequestStatus status;

RMobilePhoneStore::TMobilePhoneStoreInfoV1 mobilePhoneStoreInfo;
RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg mobilePhoneStoreInfoPckg(mobilePhoneStoreInfo);
iMobilePhone.GetPhoneStoreInfo(status, mobilePhoneStoreInfoPckg, KETelMeSmsStore);
User::WaitForRequest(status);
User::LeaveIfError(status.Int());

TInt free = mobilePhoneStoreInfo.iTotalEntries - mobilePhoneStoreInfo.iUsedEntries;
</codeblock> </example>
</taskbody></task>