messagingfw/biomsgfw/cbcp/CBusinessCardParser class.htm
branchRCL_3
changeset 22 d2c4c66342f3
parent 21 e5b3a2155e1a
child 23 d51193d814ea
equal deleted inserted replaced
21:e5b3a2155e1a 22:d2c4c66342f3
     1 <html>
       
     2 
       
     3 <head>
       
     4 <meta http-equiv="Content-Type"
       
     5 content="text/html; charset=iso-8859-1">
       
     6 <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
       
     7 <title>CBusinessCardParser class</title>
       
     8 </head>
       
     9 
       
    10 <body bgcolor="#FFFFFF">
       
    11 
       
    12 <h2><a name="CBusinessCardParser"><font size="4"><tt>CBusinessCardParser</tt></font><font
       
    13 face="Times New Roman"> class &#151;</font></a><font
       
    14 face="Times New Roman"> Compact Business Card Parser</h2>
       
    15 
       
    16 <p></font><b><i>Section Contents</i></b></p>
       
    17 
       
    18 <ul>
       
    19     <li><a href="#e32.eudsccls-004-001"><b>Overview</b></a> </li>
       
    20     <li><a
       
    21         href="#e32.desc-concrete.HBufC.allocation-and-construction"><b>Allocation
       
    22         and construction</b></a> <ul>
       
    23             <li><a href="#e32.desc-concrete.new"><font size="4"><b><tt>NewL()</tt></b></font><b>
       
    24                 &#151; Create new CBusinessCardParser</b></a> </li>
       
    25         </ul>
       
    26     </li>
       
    27     <li><a href="#API"><strong>API &#151; Public functions</strong></a><ul>
       
    28             <li><a href="#ParseL"><strong>ParseL &#151; Parse a
       
    29                 Compact Business Card message.</strong></a></li>
       
    30             <li><a href="#ProcessL"><strong>ProcessL &#151; Parse
       
    31                 a Compact Business Card message.</strong></a></li>
       
    32         </ul>
       
    33     </li>
       
    34 </ul>
       
    35 
       
    36 <hr size="3">
       
    37 
       
    38 <h3><a name="e32.eudsccls-004-001">Overview</a></h3>
       
    39 
       
    40 <h5><a name="e32.eudsccls-004-002"><font size="3">Derivation</font></a></h5>
       
    41 
       
    42 <table border="1" cellpadding="2">
       
    43     <tr>
       
    44         <td valign="top"><a href="eutype.html#e32.class.CBase"><font
       
    45         color="#000000" size="4"><tt>CBase</tt></font></a></td>
       
    46         <td valign="top">Abstract: <a
       
    47         href="eutype.html#e32.class.CBase"><font color="#000000"
       
    48         size="4"><tt>CBase</tt></font></a> behaviour</td>
       
    49     </tr>
       
    50     <tr>
       
    51         <td valign="top"><a href="#e32.class.CActive"><font
       
    52         color="#000000" size="4"><tt>CActive</tt></font></a></td>
       
    53         <td valign="top">Abstract: active object: provides
       
    54         facilities to encapsulate an asynchronous service, and to
       
    55         handle its completion using <font size="4"><tt>RunL()</tt></font></td>
       
    56     </tr>
       
    57     <tr>
       
    58         <td valign="top"><a href="#CBusinessCardParser"><font
       
    59         color="#000000" size="4"><tt>CBaseScriptParser</tt></font></a></td>
       
    60         <td valign="top">Abstract: parser implementation.</td>
       
    61     </tr>
       
    62 </table>
       
    63 
       
    64 <h5><a name="e32.eudsccls-004-003"><font size="3">Defined in</font></a></h5>
       
    65 
       
    66 <p><code>cbcp.h</code><font size="4"><tt>&nbsp;&nbsp;&nbsp;</tt></font></p>
       
    67 
       
    68 <h5><a name="e32.eudsccls-004-004"><font size="3">Link against</font></a></h5>
       
    69 
       
    70 <p><code>cbcp.lib</code></p>
       
    71 
       
    72 <h5><a name="e32.eudsccls-004-005"><font size="3">Description</font></a></h5>
       
    73 
       
    74 <p>This class provides functions to parse a Compact Business Card
       
    75 message. The parser creates an informative message body for the
       
    76 user and generates a vCard in the store associated with the
       
    77 message.</p>
       
    78 
       
    79 <hr size="3">
       
    80 
       
    81 <h3><a name="e32.desc-concrete.HBufC.allocation-and-construction">Allocation
       
    82 and construction</a></h3>
       
    83 
       
    84 <hr size="1">
       
    85 
       
    86 <h4><a name="e32.desc-concrete.new"><font size="4"><tt>NewL()</tt></font>
       
    87 &#151; Create new <font size="4"><tt>CBusinessCardParser</tt></font></a></h4>
       
    88 
       
    89 <p><tt>static CBusinessCardParser* NewL(CRegisteredParserDll&amp;
       
    90 aRegisteredParserDll, CMsvServerEntry&amp; aEntry, RFs&amp; aFs);</tt></p>
       
    91 
       
    92 <h5><a name="e32.eudsccls-004-006"><font size="3">Description</font></a></h5>
       
    93 
       
    94 <p>Use these functions to construct a new <a
       
    95 href="#CBusinessCardParser"><font color="#000000" size="4"><tt>CBusinessCardParser</tt></font></a>
       
    96 descriptor on the heap. Code should be provided to ensure that a
       
    97 single copy of the DLL is loaded and is released when no longer
       
    98 required.</p>
       
    99 
       
   100 <p>If there is insufficient memory available to create the
       
   101 descriptor,<font size="4"><tt> NewL()</tt></font> leaves. See <a
       
   102 href="euclnp.html#e32.exception.intro"><b>Motivating E32
       
   103 exception facilities</b></a> for more information on leave
       
   104 processing.</p>
       
   105 
       
   106 <h5><font size="3">Arguments</font></h5>
       
   107 
       
   108 <table border="1">
       
   109     <tr>
       
   110         <td valign="top"><a href="#CBusinessCardParser"><tt>CRegisteredParserDll&amp;</tt></a><tt>
       
   111         aRegisteredParserDll</tt></td>
       
   112         <td valign="top">A </td>
       
   113     </tr>
       
   114     <tr>
       
   115         <td><a href="#CBusinessCardParser"><tt>CMsvServerEntry&amp;</tt></a><tt>
       
   116         aEntry</tt></td>
       
   117         <td>A message server entry containing the CBC message.</td>
       
   118     </tr>
       
   119     <tr>
       
   120         <td><a href="#CBusinessCardParser"><tt>RFs&amp;</tt></a><tt>
       
   121         aFs</tt></td>
       
   122         <td>Handle of a file server session.</td>
       
   123     </tr>
       
   124 </table>
       
   125 
       
   126 <h5><font size="3">Return value</font></h5>
       
   127 
       
   128 <table border="1">
       
   129     <tr>
       
   130         <td valign="top"><a href="#CBusinessCardParser"><font
       
   131         color="#000000" size="4"><tt>CBusinessCardParser*</tt></font></a></td>
       
   132         <td valign="top">The address of the newly created <a
       
   133         href="#CBusinessCardParser"><font color="#000000"
       
   134         size="4"><tt>CBusinessCardParser</tt></font></a>
       
   135         descriptor.<p><font size="4"><tt>NewL()</tt></font>
       
   136         leaves if there is insufficient memory.</p>
       
   137         </td>
       
   138     </tr>
       
   139 </table>
       
   140 
       
   141 <h5><a name="e32.eudsccls-004-009"><font size="3">Example</font></a></h5>
       
   142 
       
   143 <p>This code fragment illustrates how an <a
       
   144 href="#CBusinessCardParser"><font color="#000000" size="4"><tt>CBusinessCardParser</tt></font></a>
       
   145 descriptor can be constructed:</p>
       
   146 
       
   147 <p>Use of <font size="4"><tt>NewL()</tt></font>:</p>
       
   148 
       
   149 <blockquote>
       
   150     <p>iRegisteredParserDll =
       
   151     CRegisteredParserDll::NewL(uidType);<br>
       
   152     RLibrary parserlibrary;<br>
       
   153     User::LeaveIfError(iRegisteredParserDll-&gt;GetLibrary(gFs,parserlibrary));<br>
       
   154     typedef CBaseScriptParser*
       
   155     (*NewParserL)(CRegisteredParserDll&amp; aRegisteredParserDll,
       
   156     CMsvServerEntry&amp; aEntry, RFs&amp; aFs);<br>
       
   157     TInt entrypointordinalnumber=1; // The one and only entry
       
   158     point.<br>
       
   159     TLibraryFunction
       
   160     libFunc=parserlibrary.Lookup(entrypointordinalnumber);<br>
       
   161     if (libFunc==NULL)<br>
       
   162     User::Leave(KErrBadLibraryEntryPoint);<br>
       
   163     NewParserL pFunc=(NewParserL) libFunc;<br>
       
   164     CBaseScriptParser* parser=NULL;<br>
       
   165     TInt refcount=iRegisteredParserDll-&gt;DllRefCount();<br>
       
   166     TRAPD(ret,parser=((*pFunc)(*iRegisteredParserDll, *iEntry,
       
   167     gFs)));<br>
       
   168     if ((ret!=KErrNone) &amp;&amp;
       
   169     (iRegisteredParserDll-&gt;DllRefCount()==refcount))<br>
       
   170     iRegisteredParserDll-&gt;ReleaseLibrary();</p>
       
   171 </blockquote>
       
   172 
       
   173 <hr size="3">
       
   174 
       
   175 <h3><a name="API">API &#151; Public functions</a></h3>
       
   176 
       
   177 <p><a name="ParseL"><strong>ParseL</strong></a><strong> &#151;
       
   178 Parse a </strong><a href="#CBusinessCardParser"><strong>Compact
       
   179 Business Card</strong></a><strong> message.</strong></p>
       
   180 
       
   181 <p>void ParseL(TRequestStatus&amp; aStatus, const TDesC&amp;
       
   182 aSms);</p>
       
   183 
       
   184 <h5><a name="e32.eudsccls-004-006"><font size="3">Description</font></a></h5>
       
   185 
       
   186 <p>Use this function to parse the Compact Business Card message
       
   187 aSms, stored in the TDesC. The parser creates an informative
       
   188 message body for the user and generates a vCard in the store
       
   189 associated with the message.</p>
       
   190 
       
   191 <h5><font size="3">Arguments</font></h5>
       
   192 
       
   193 <table border="1">
       
   194     <tr>
       
   195         <td valign="top">TRequestStatus&amp; aStatus</td>
       
   196         <td valign="top">The request status of the active object.</td>
       
   197     </tr>
       
   198     <tr>
       
   199         <td>const TDesC&amp; aSms</td>
       
   200         <td>An SMS message.</td>
       
   201     </tr>
       
   202 </table>
       
   203 
       
   204 <h5><font size="3">Return value</font></h5>
       
   205 
       
   206 <table border="1">
       
   207     <tr>
       
   208         <td valign="top"><font color="#000000" size="4"><tt>void</tt></font></td>
       
   209     </tr>
       
   210 </table>
       
   211 
       
   212 <h5><a name="e32.eudsccls-004-009"><font size="3">Example</font></a></h5>
       
   213 
       
   214 <p>This code fragment illustrates how the parser is called:</p>
       
   215 
       
   216 <blockquote>
       
   217     <p>iParser-&gt;ParseL(iStatus,iSms);</p>
       
   218 </blockquote>
       
   219 
       
   220 <hr size="1">
       
   221 
       
   222 <p><a name="ProcessL"><font face="Times New Roman"><strong>ProcessL</strong></font></a><font
       
   223 face="Times New Roman"><strong> &#151; Parse a </strong></font><a
       
   224 href="#CBusinessCardParser"><font face="Times New Roman"><strong>Compact
       
   225 Business Card</strong></font></a><font face="Times New Roman"><strong>
       
   226 message.</strong></font></p>
       
   227 
       
   228 <p>void ProcessL(TRequestStatus&amp; aStatus);</p>
       
   229 
       
   230 <h5><a name="e32.eudsccls-004-006"><font size="3">Description</font></a></h5>
       
   231 
       
   232 <p>This function is not implemented in the current version of the
       
   233 parser. It may be used to implement further actions with the
       
   234 parsed message.</p>
       
   235 
       
   236 <h5><font size="3">Arguments</font></h5>
       
   237 
       
   238 <table border="1">
       
   239     <tr>
       
   240         <td valign="top">TRequestStatus&amp; aStatus</td>
       
   241         <td valign="top">The request status of the active object.</td>
       
   242     </tr>
       
   243 </table>
       
   244 
       
   245 <h5><font size="3">Return value</font></h5>
       
   246 
       
   247 <table border="1">
       
   248     <tr>
       
   249         <td valign="top"><font color="#000000" size="4"><tt>void</tt></font></td>
       
   250     </tr>
       
   251 </table>
       
   252 
       
   253 <h5><a name="e32.eudsccls-004-009"><font size="3">Example</font></a></h5>
       
   254 
       
   255 <p>This code fragment illustrates how the message process stage
       
   256 of the parser is called:</p>
       
   257 
       
   258 <blockquote>
       
   259     <p>iParser-&gt;ProcessL(iStatus)</p>
       
   260 </blockquote>
       
   261 
       
   262 <p>This interface currently returns after issuing a
       
   263 User::RequestComplete(iReport, KErrNotSupported).</p>
       
   264 
       
   265 <hr size="3">
       
   266 
       
   267 <p>&nbsp;</p>
       
   268 </body>
       
   269 </html>