Symbian3/PDK/Source/GUID-402B5633-1E3A-5F24-8C4F-DA5F04D2557C.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 13 Aug 2010 16:47:46 +0100
changeset 14 578be2adaf3e
parent 5 f345bda72bc4
permissions -rw-r--r--
Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     6
<!-- Initial Contributors:
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     7
    Nokia Corporation - initial contribution.
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     8
Contributors: 
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     9
-->
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    10
<!DOCTYPE concept
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    12
<concept xml:lang="en" id="GUID-402B5633-1E3A-5F24-8C4F-DA5F04D2557C"><title>Querying URIs from the URI List</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>The <xref href="GUID-6F5E2A42-5047-3AB2-9929-D893B88F2BD2.dita"><apiname>RInetUriList</apiname></xref> class provides the following APIs for retrieving the information of URIs present in the list: </p> <ul><li id="GUID-6F99901E-B8A4-5E42-B874-066171E88A69"><p>API for retrieving the number of URIs present in the list, based on a given service type and list type: </p> <p> <codeph>TInt Count ( InetUriList::TServiceType aServiceType,
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    13
             InetUriList::TListType aListType )</codeph>  </p> <p>If the URI count of both the lists is required, then set <codeph>aListType</codeph> parameter to <codeph>EBlackList</codeph> and <codeph>EWhiteList</codeph>. </p> </li> <li id="GUID-F4E514BF-BF07-5A4C-8A0D-9121536FB178"><p>API for retrieving the list type of a given URI: </p> <p> <codeph>TInt GetListType ( const TDesC8&amp; aUri,
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    14
             InetUriList::TServiceType aServiceType, InetUriList::TListType&amp; aListType
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    15
             )</codeph>  </p> <p>The list type will be returned through <codeph>aListType</codeph> as an out parameter. If the URI is not found, then return type will be <codeph>KErrUriNotFound</codeph>. </p> </li> <li id="GUID-50D349EE-CA38-54D8-96AB-FA2AAF4AA6F6"><p>API for querying URIs in the list: </p> <p> <codeph>void QueryUriL ( const TQueryArgs&amp; aArgs,
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    16
             MQueryResultsCallback* aQueryCallback, MUriCustomiser* aUriCustomiser =NULL
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    17
             )</codeph>  </p> <p>Based on the the <codeph>TQueryArgs</codeph> parameter, this API supports different query operations. <codeph>TQueryArgs</codeph> is template class which provides four constructors. The argument types for <codeph>TQueryArgs</codeph> can be a combination of URI, service type, list type, and match type. The service type is mandatory for the query operation. Based on the <codeph>TQueryArgs</codeph> parameter combination, the following types of queries can be performed: </p> <ul><li id="GUID-EDB3E659-648E-52C5-AB8C-D572675163F1"><p>Find existence of a URI of a given service type. </p> </li> <li id="GUID-76B6918F-6085-5DF1-946C-A6899EA61E4C"><p>Find all URIs matching the path of a specified URI and service type. </p> </li> <li id="GUID-733C2073-4619-544E-8E40-66E62D96A9C1"><p>Find all URIs matching the domain name of a specified URI and service type. </p> </li> <li id="GUID-5582DFC2-0C78-5D61-B13A-099F1F185AC7"><p>Find all the URIs matching the prefix path of a specified URI and service type. </p> </li> <li id="GUID-6B6427C9-2099-566C-87E6-D6E9C856B5A6"><p>Find all the URIs matching the suffix path of a specified URI and service type. </p> </li> <li id="GUID-3F62B201-A0AB-599F-BB8E-A287401E2495"><p>Find all the URIs of a specified service type and list type. </p> </li> </ul> </li> </ul> <p>The <xref href="GUID-82F7F1DC-127F-3111-A7F0-9F32744A1CA3.dita"><apiname>aQueryCallback</apiname></xref> parameter of the <xref href="GUID-F57CA961-6151-3FBB-9FAB-4D8F507248E7.dita"><apiname>QueryUriL</apiname></xref> API provides a callback interface that needs to be implemented by the calling client. The calling client class should derive from the <xref href="GUID-5D5672DF-DDB0-336B-9A96-DE7D55B937FE.dita"><apiname>MQueryResultsCallback</apiname></xref> class and provide implementation for the <xref href="GUID-5D5672DF-DDB0-336B-9A96-DE7D55B937FE.dita#GUID-5D5672DF-DDB0-336B-9A96-DE7D55B937FE/GUID-399C8754-C6F0-3ED0-A0E9-12EA1B91068A"><apiname>MQueryResultsCallback::OnQueryResultsL()</apiname></xref> function. The optional <xref href="GUID-AC04057D-75D3-3214-86BD-F20AD98AD6A0.dita"><apiname>aUriCustomiser</apiname></xref> parameter of the <xref href="GUID-F57CA961-6151-3FBB-9FAB-4D8F507248E7.dita"><apiname>QueryUriL</apiname></xref> API provides a callback interface for URI customisation by scheme/protocol normalization. The calling client should be derived from the <xref href="GUID-B29E0EB7-BB4C-3E54-A844-182EBC4B159D.dita"><apiname>MUriCustomiser</apiname></xref> class and provide implementation for the <xref href="GUID-B29E0EB7-BB4C-3E54-A844-182EBC4B159D.dita#GUID-B29E0EB7-BB4C-3E54-A844-182EBC4B159D/GUID-5ECB0068-0EFD-3FB6-B229-C911C912ADA5"><apiname>MUriCustomiser::OnUriCustomisationL()</apiname></xref> function. Given below are some code samples for performing different queries. </p> <codeblock id="GUID-4BAAEEC7-50F9-5561-8322-23956F596A29" xml:space="preserve">//Create a Uri
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    18
_LIT8(KUri, “http://www.symbian.com/symbianos/email/index.html”);
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    19
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    20
//Create a session with the server.
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    21
    RInetUriList uriListObj;
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    22
    uriListObj.OpenL();
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    23
    CleanupClosePushL(uriListObj);
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    24
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    25
//Construct TQueryArgs object with Uri, service type
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    26
//and match type. 
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    27
    TQueryArgs uriArgs(KUri, EBrowser, EDomain);
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    28
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    29
//Query the Uri and close the session. 
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    30
    uriListObj. QueryUriL(uriArgs, this);
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    31
    CleanupStack::PopAndDestroy(&amp;uriListObj);
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    32
</codeblock> <p>In the above code sample, all the browsing URIs matching with the domain name <i>www.symbian.com</i> is searched from both BlackList and WhiteList, as list type is not specified. The second parameter is a pointer to the client class that implements the <xref href="GUID-5987B8E8-0036-375A-842A-3D424E655593.dita"><apiname>OnQueryResultsL()</apiname></xref> call back function. For each matching URI that is found, the <xref href="GUID-F57CA961-6151-3FBB-9FAB-4D8F507248E7.dita"><apiname>QueryUriL</apiname></xref> function calls the <xref href="GUID-F79918C2-87E2-34CC-915C-E4D322F747F5.dita"><apiname>OnQueryResultsL</apiname></xref> callback function until it returns <codeph>EFalse</codeph>, or until all matching URIs are passed to it. </p> <p>The match type is a value of enumeration <xref href="GUID-BCEF56E7-FB35-385E-8F22-82F13249E524.dita"><apiname>TURIMatch</apiname></xref>. The searching criteria can be changed by changing the match type. </p> <ul><li id="GUID-E7924DE0-462B-5222-B395-7C31DE9348CA"><p>If the match type is <codeph>EExact</codeph> in the above code sample, only one URI would be returned. </p> </li> <li id="GUID-94D88299-BAF1-52D9-A5E3-1C6DB13D7A2E"><p>If the match type is <codeph>ExactPath</codeph>, all the URIs that have the same scheme, domain name, and path would be returned. These URIs might be different only in fragments. </p> </li> <li id="GUID-646AFE86-0B4B-5684-A12F-7857F5D94825"><p>If the match type is <codeph>EPartialPrefixPath</codeph>, all the URIs matching the prefix path and scheme will be returned. </p> <p>For example, if the incoming URI is http://www.symbian.com/symbianos/, then the following URIs would match if match type is <codeph>EPartialPrefixPath</codeph>: </p> <ul><li id="GUID-ED7958FE-3A49-5416-92D3-4C322961D8E7"><p>http://www.symbian.com/symbianos/email/index.html </p> </li> <li id="GUID-7EA3DA47-FAD8-5662-91D8-4451152F12CA"><p>http://www.symbian.com/symbianos/solutions/solutions.html </p> </li> </ul> </li> <li id="GUID-19E488B2-2213-5D16-AF0E-9EBA3927D5FC"><p>If the match type is <codeph>EPartialSuffixPath</codeph>, then all the URIs matching suffix path and scheme will be returned. </p> <p>For example, if the incoming URI is http://www.symbian.com/index.html, then the following URIs would match if match type is <codeph>EPartialSuffixPath</codeph>: </p> <ul><li id="GUID-B4E59EAA-E080-5CC0-B5DA-51F536ABF814"><p>http://www.symbian.com/symbianos/email/index.html </p> </li> <li id="GUID-38EC342F-BEA0-5E71-8C2F-BDFFA46B8315"><p>http://www.symbian.com/symbianos/index.html </p> </li> </ul> </li> </ul> <codeblock id="GUID-6F662156-4B35-5147-8650-8E8A374DBA0D" xml:space="preserve">//Create a session with the server.
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    33
    RInetUriList uriListObj;
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    34
    uriListObj.OpenL();
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    35
    CleanupClosePushL(uriListObj);
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    36
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    37
//Construct TQueryArgs object with service type and 
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    38
//match type.
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    39
    TQueryArgs uriArgs(EBrowser);
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    40
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    41
//Query the Uri and close the session. 
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    42
    uriListObj. QueryUriL(uriArgs, this, this);
578be2adaf3e Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    43
    CleanupStack::PopAndDestroy(&amp;uriListObj);
1
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    44
</codeblock> <p>The above code sample retrieves all browser URIs of both BlackList and WhiteList types. To retrieve all the URIs for all service types, the caller has to loop for all service types. The third argument of <xref href="GUID-F57CA961-6151-3FBB-9FAB-4D8F507248E7.dita"><apiname>QueryUriL</apiname></xref> indicates that the caller has implemented the <xref href="GUID-422B212E-FE6B-369F-8A6C-ADF8D3D9A1E2.dita"><apiname>OnUriCustomisationL()</apiname></xref> callback function, and so the URI will be passed to this callback function for normalization before being passed for a query. </p> </conbody></concept>