Symbian3/SDK/Source/GUID-A8130D83-E684-5B6C-BDFE-EB6EE3CD49E8.dita
changeset 2 ebc84c812384
parent 0 89d6a7a84779
--- a/Symbian3/SDK/Source/GUID-A8130D83-E684-5B6C-BDFE-EB6EE3CD49E8.dita	Fri Jan 22 18:26:19 2010 +0000
+++ b/Symbian3/SDK/Source/GUID-A8130D83-E684-5B6C-BDFE-EB6EE3CD49E8.dita	Thu Mar 11 15:24:26 2010 +0000
@@ -1,4 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
+<!--Arbortext, Inc., 1988-2004, v.4002-->
+<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
+ "concept.dtd">
 <!-- 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, 
@@ -7,13 +10,18 @@
     Nokia Corporation - initial contribution.
 Contributors: 
 -->
-<!DOCTYPE concept
-  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
 <concept id="GUID-A8130D83-E684-5B6C-BDFE-EB6EE3CD49E8" xml:lang="en"><title>Writing
-a UPS Dialog Creator</title><prolog><metadata><keywords/></metadata></prolog><conbody>
-<section><title>Introduction</title> <p>Dialog creators are EComplug-ins that
-device creators can write to generate the dialogs containing prompts for phone
-users. </p> <p>The plug-in has an API that consists of two asynchronous functions: </p> <ul>
+a UPS Dialog Creator</title>
+<prolog>
+<metadata>
+<keywords></keywords>
+</metadata>
+</prolog>
+<conbody>
+<section><title>Introduction</title> <p>Dialog creators are ECom <?Pub Caret?>plug-ins
+that device creators can write to generate the dialogs containing prompts
+for phone users. </p> <p>The plug-in has an API that consists of two asynchronous
+functions: </p> <ul>
 <li id="GUID-96CBCE79-4F5D-5F87-AC6B-C366346447AB"><p>The <codeph>PrepareDialog()</codeph> function.
 This function is called first by the UPS server. It enables the dialog creator
 to query other system servers such as AppArc or the SIS registry to retrieve
@@ -27,7 +35,8 @@
 </ul> <p>The UPS displays only one prompt at a time so it is possible for
 there to be a delay between calling the function to prepare the dialog and
 the function to display the dialog. It is also possible for other dialogs
-to be displayed between the dialog being prepared and its being displayed. </p> <p>Both <codeph>PrepareDialog()</codeph> and <codeph>DisplayDialog()</codeph> are asynchronous and must support cancellation through <codeph>CActive::Cancel</codeph>.
+to be displayed between the dialog being prepared and its being displayed. </p> <p>Both <codeph>PrepareDialog()</codeph> and <codeph>DisplayDialog()</codeph
+> are asynchronous and must support cancellation through <codeph>CActive::Cancel</codeph>.
 If either function is cancelled, the dialog creator instance is destroyed
 without calling further methods. </p> <p>The work split between <codeph>PrepareDialog()</codeph> and <codeph>DisplayDialog()</codeph> described
 above is a recommendation, and some of the functionality could be implemented
@@ -48,7 +57,8 @@
 the dialog</b> </p> <p>The parameters to <codeph>PrepareDialog()</codeph> are
 mostly <codeph>const</codeph> pointers and references to the data that has
 already been generated by the UPS or policy evaluator. </p> <p>The following
-table describes the parameters for the <codeph>PrepareDialog()</codeph> function: </p> <table id="GUID-6D139216-B6A8-55A1-8D9B-C15134198198">
+table describes the parameters for the <codeph>PrepareDialog()</codeph> function: </p> <table
+id="GUID-6D139216-B6A8-55A1-8D9B-C15134198198">
 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/>
 <thead>
 <row>
@@ -89,7 +99,7 @@
 </row>
 </tbody>
 </tgroup>
-</table> <p><note/> The UPS does not allow any responses to be returned
+</table> <p><note></note> The UPS does not allow any responses to be returned
 to the system server except those defined in the UPS policy file. If the dialog
 creator returns an option that was not specified in the policy, the request
 is rejected and <codeph>EUpsDecNo</codeph> is returned. </p><p>Your implementation
@@ -118,28 +128,16 @@
 is called through a <codeph>switch</codeph> statement, which can be seen in
 the full code sample at the end of this section: </p> </section>
 <section><title>Example</title> <p>The following code shows an example of
-a full implementation of the dialog creator file: </p> <codeblock id="GUID-314673F2-BBA0-56C0-A76D-07862BB4592F" xml:space="preserve">// Copyright (c) 2006-2009 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 "Symbian Foundation License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-
-// refdialogcreator.cpp
-
-
-#include "refdialogcreator.h"
-#include &lt;ecom/implementationproxy.h&gt;
-#include &lt;apaid.h&gt;
-#include &lt;apgcli.h&gt;
-#include &lt;ups/promptrequest.h&gt;
-#include &lt;swi/sisregistrypackage.h&gt;
-#include &lt;swi/sisregistrysession.h&gt;
-#include &lt;scs/nullstream.h&gt;
-#include &lt;s32mem.h&gt;
+a full implementation of the dialog creator file: </p> <codeblock id="GUID-314673F2-BBA0-56C0-A76D-07862BB4592F"
+xml:space="preserve">#include "refdialogcreator.h"
+#include &lt;ecom/implementationproxy.h>
+#include &lt;apaid.h>
+#include &lt;apgcli.h>
+#include &lt;ups/promptrequest.h>
+#include &lt;swi/sisregistrypackage.h>
+#include &lt;swi/sisregistrysession.h>
+#include &lt;scs/nullstream.h>
+#include &lt;s32mem.h>
 
 static const TUint KRefDialogCreatorImplementationId = 0x10283694;
 
@@ -154,7 +152,7 @@
     {
     CRefDialogCreator* self = new (ELeave)CRefDialogCreator();
     CleanupStack::PushL(self);
-    self-&gt;ConstructL();
+    self->ConstructL();
     CleanupStack::Pop(self);
     return self;
     }
@@ -249,31 +247,31 @@
     // Only one state at the moment but more should be
     // added for long running operators e.g. querying the SIS registry
     // or resolving the client entity.
-    ResolveClientNameL(iRequest-&gt;ClientSid());
+    ResolveClientNameL(iRequest->ClientSid());
     
     // Get the vendor name for the client process
-    ResolveVendorNameL(iRequest-&gt;ClientVid());
+    ResolveVendorNameL(iRequest->ClientVid());
     
     // Server / Service localized names generated in notifier plug-in. 
-    iPromptData-&gt;iServerSid = iRequest-&gt;ServerSid();
-    iPromptData-&gt;iServiceId = iRequest-&gt;ServiceId();
+    iPromptData->iServerSid = iRequest->ServerSid();
+    iPromptData->iServiceId = iRequest->ServiceId();
     
     // Different dialog text is displayed depending on whether the client application
     // is signed.
     // N.B. Protected SID is assumed to be signed or included at ROM build.
-    if (iRequest-&gt;IsClientSidProtected()) iPromptData-&gt;iFlags |= ETrustedClient;
+    if (iRequest->IsClientSidProtected()) iPromptData->iFlags |= ETrustedClient;
     
     // Use the options specified by the policy
-    iPromptData-&gt;iOptions = iPolicy-&gt;Options();
+    iPromptData->iOptions = iPolicy->Options();
     
     // Add the descriptions of the fingerprints. This could be used
     // to allow the user to grant access to all destinations 
     // or a single destination.
-    TInt count = iFingerprints-&gt;Count();
+    TInt count = iFingerprints->Count();
     for (TInt i = 0; i &lt; count; ++i)
         {
-        HBufC* description = (*iFingerprints)[i]-&gt;Description().AllocLC();
-        iPromptData-&gt;iDescriptions.AppendL(description);
+        HBufC* description = (*iFingerprints)[i]->Description().AllocLC();
+        iPromptData->iDescriptions.AppendL(description);
         CleanupStack::Pop(description);
         }
     
@@ -316,7 +314,7 @@
         // 
         // In this implementation a copy of the original fingerprint is returned. However,
         // it is permitted to return a different fingerprint e.g. a modifier description.        
-        if (iPromptResult.iDestination &gt;= 0 &amp;&amp; iPromptResult.iDestination &lt; iFingerprints-&gt;Count())        
+        if (iPromptResult.iDestination >= 0 &amp;&amp; iPromptResult.iDestination &lt; iFingerprints->Count())        
             {
             *iFingerprint = (*iFingerprints)[iPromptResult.iDestination];
             }
@@ -333,14 +331,14 @@
 void CRefDialogCreator::ResolveVendorNameL(const TVendorId&amp; aVid)
 /**
 Looks up the localized vendor name for the client process and writes
-this to iPromptData-&gt;iVendorName.
+this to iPromptData->iVendorName.
 
 Typically, this would be resolved from the SIS registry or a lookup table.
 
 @param aVid    The vendor id of the client process.
 */
     {
-    if (iPromptData-&gt;iVendorName.Length() != 0)
+    if (iPromptData->iVendorName.Length() != 0)
         {
         // already obtained vendor name from SIS registry
         return;
@@ -349,12 +347,12 @@
     if (aVid.iId == 0x70000001)
         {
         _LIT(KSymbian, "Symbian Foundation");
-        iPromptData-&gt;iVendorName.Create(KSymbian);
+        iPromptData->iVendorName.Create(KSymbian);
         }
     else 
         {
         _LIT(KUnknown, "Unknown vendor");
-        iPromptData-&gt;iVendorName.Create(KUnknown);
+        iPromptData->iVendorName.Create(KUnknown);
         }
     }
     
@@ -389,9 +387,9 @@
     if (! found)
         {            
         RProcess clientProcess;
-        User::LeaveIfError(clientProcess.Open(iRequest-&gt;ClientProcessId()));
+        User::LeaveIfError(clientProcess.Open(iRequest->ClientProcessId()));
         CleanupClosePushL(clientProcess);
-        iPromptData-&gt;iClientName.Create(clientProcess.FileName());        
+        iPromptData->iClientName.Create(clientProcess.FileName());        
         CleanupStack::PopAndDestroy(&amp;clientProcess); 
         }
     }
@@ -417,8 +415,8 @@
         err = apa.GetAppInfo(*info, TUid::Uid(aSid));
         if (err == KErrNone)
             {
-            iPromptData-&gt;iClientName.Close();
-            iPromptData-&gt;iClientName.Create(info-&gt;iCaption);
+            iPromptData->iClientName.Close();
+            iPromptData->iClientName.Create(info->iCaption);
             found = ETrue;
             }
         else if (err != KErrNotFound)
@@ -454,8 +452,8 @@
     TRAPD(err, p = r.SidToPackageL(TUid::Uid(aSid.iId)));
     if (err == KErrNone)
         {
-        iPromptData-&gt;iClientName.Create(p-&gt;Name());
-        iPromptData-&gt;iVendorName.Create(p-&gt;Vendor());
+        iPromptData->iClientName.Create(p->Name());
+        iPromptData->iVendorName.Create(p->Vendor());
         found = ETrue;
         delete p;
         }
@@ -466,7 +464,7 @@
 // From CDialogCreator
 void CRefDialogCreator::PrepareDialog(
     const UserPromptService::CPromptRequest&amp; aRequest, const CPolicy&amp; aPolicy,            
-    const RPointerArray&lt;CFingerprint&gt;&amp; aFingerprints, const CClientEntity* aClientEntity,
+    const RPointerArray&lt;CFingerprint>&amp; aFingerprints, const CClientEntity* aClientEntity,
     const TAny* aEvalPrivateData, TRequestStatus&amp; aStatus)
     {
     aStatus = KRequestPending;
@@ -506,4 +504,6 @@
     User::RequestComplete(status, KErrNone);
     }
 </codeblock> </section>
-</conbody></concept>
\ No newline at end of file
+</conbody>
+</concept>
+<?Pub *0000019622?>