Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/searchsortexample_8h_source.html
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 13 Aug 2010 16:47:46 +0100
changeset 14 578be2adaf3e
parent 6 43e37759235e
permissions -rw-r--r--
Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>TB9.2 Example Applications: examples/Messaging/SearchSortExample/searchsortexample.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2 -->
<h1>examples/Messaging/SearchSortExample/searchsortexample.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).</span>
<a name="l00002"></a>00002 <span class="comment">// All rights reserved.</span>
<a name="l00003"></a>00003 <span class="comment">// This component and the accompanying materials are made available</span>
<a name="l00004"></a>00004 <span class="comment">// under the terms of &quot;Eclipse Public License v1.0&quot;</span>
<a name="l00005"></a>00005 <span class="comment">// which accompanies this distribution, and is available</span>
<a name="l00006"></a>00006 <span class="comment">// at the URL &quot;http://www.eclipse.org/legal/epl-v10.html&quot;.</span>
<a name="l00007"></a>00007 <span class="comment">//</span>
<a name="l00008"></a>00008 <span class="comment">// Initial Contributors:</span>
<a name="l00009"></a>00009 <span class="comment">// Nokia Corporation - initial contribution.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// Contributors:</span>
<a name="l00012"></a>00012 <span class="comment">//</span>
<a name="l00013"></a>00013 <span class="comment">// Description:</span>
<a name="l00014"></a>00014 <span class="comment">//</span>
<a name="l00015"></a>00015 
<a name="l00016"></a>00016 <span class="preprocessor">#ifndef SEARCHSORTEXAMPLE_H</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define SEARCHSORTEXAMPLE_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;mtclreg.h&gt;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;pop3set.h&quot;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &quot;popcmtm.h&quot;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;mtclbase.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;e32std.h&gt;</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;msvsearchsortquery.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;msvsearchsortoperation.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;msvstd.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;msvids.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;msvuids.h&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;msvapi.h&gt;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;iapprefs.h&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;cemailaccounts.h&gt;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;es_sock.h&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;commdb.h&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;cdbpreftable.h&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;commdbconnpref.h&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;commsdattypesv1_1.h&gt;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;commsdat.h&gt;</span>
<a name="l00041"></a>00041 <span class="keyword">using namespace </span>CommsDat;
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(LDD_NAME,<span class="stringliteral">&quot;ECOMM&quot;</span>);
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="preprocessor">#if defined (__WINS__)</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(PDD_NAME,<span class="stringliteral">&quot;ECDRV&quot;</span>);
<a name="l00047"></a>00047 <span class="preprocessor">#else</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span><a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(PDD_NAME,<span class="stringliteral">&quot;ECUART1&quot;</span>);
<a name="l00049"></a>00049 <span class="preprocessor">#endif</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span>
<a name="l00051"></a>00051 <span class="preprocessor">#define KMaxEntryCount 5</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#define KPortValue 110</span>
<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define KSmtpPortValue 25</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#define KSize 100</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span>
<a name="l00056"></a>00056 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KPopServer, <span class="stringliteral">&quot;nokia.com&quot;</span>);
<a name="l00057"></a>00057 _LIT8(KPopPassword,<span class="stringliteral">&quot;ban-User1&quot;</span>);
<a name="l00058"></a>00058 _LIT8(KPopLoginName,<span class="stringliteral">&quot;ban-User1&quot;</span>);
<a name="l00059"></a>00059 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KTxtAccountName, <span class="stringliteral">&quot;PopAccount&quot;</span>);
<a name="l00060"></a>00060 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KSmtpServerAddress, <span class="stringliteral">&quot;nokia.com&quot;</span>);
<a name="l00061"></a>00061 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KEmailAlias, <span class="stringliteral">&quot;Messaging example&quot;</span>);
<a name="l00062"></a>00062 
<a name="l00063"></a>00063 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KSmtpEmailAddress, <span class="stringliteral">&quot;exampleUser1@nokia.com&quot;</span>);
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 _LIT8(KFrom1, <span class="stringliteral">&quot;exampleUser0@nokia.com&quot;</span>);
<a name="l00066"></a>00066 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KTo1, <span class="stringliteral">&quot;exampleUser1@nokia.com&quot;</span>);
<a name="l00067"></a>00067 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KSubject1, <span class="stringliteral">&quot;SimpleEmail&quot;</span>);
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KBodyContents, <span class="stringliteral">&quot;This is a very simple mail&quot;</span>);
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 _LIT8(KFrom2, <span class="stringliteral">&quot;exampleUser2@nokia.com&quot;</span>);
<a name="l00072"></a>00072 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KTo2, <span class="stringliteral">&quot;exampleUser3@nokia.com&quot;</span>);
<a name="l00073"></a>00073 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KSubject2, <span class="stringliteral">&quot;FunEmail&quot;</span>);
<a name="l00074"></a>00074 
<a name="l00075"></a>00075 _LIT8(KFrom3, <span class="stringliteral">&quot;exampleUser4@nokia.com&quot;</span>);
<a name="l00076"></a>00076 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KTo3, <span class="stringliteral">&quot;exampleUser5@nokia.com&quot;</span>);
<a name="l00077"></a>00077 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KSubject3, <span class="stringliteral">&quot;SimpleEmail&quot;</span>);
<a name="l00078"></a>00078 
<a name="l00079"></a>00079 _LIT8(KFrom4, <span class="stringliteral">&quot;exampleUser6@nokia.com&quot;</span>);
<a name="l00080"></a>00080 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KTo4, <span class="stringliteral">&quot;exampleUser7@nokia.com&quot;</span>);
<a name="l00081"></a>00081 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KSubject4, <span class="stringliteral">&quot;TestingMail&quot;</span>);
<a name="l00082"></a>00082 
<a name="l00083"></a>00083 _LIT8(KFrom5, <span class="stringliteral">&quot;exampleUser8@nokia.com&quot;</span>);
<a name="l00084"></a>00084 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KTo5, <span class="stringliteral">&quot;exampleUser9@nokia.com&quot;</span>);
<a name="l00085"></a>00085 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KSubject5, <span class="stringliteral">&quot;GoodEmail&quot;</span>);
<a name="l00086"></a>00086 
<a name="l00087"></a>00087 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KSubjectSearch,<span class="stringliteral">&quot;GoodEmail&quot;</span>);
<a name="l00088"></a>00088 
<a name="l00089"></a>00089 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KFormat1,<span class="stringliteral">&quot;%D%M%Y%/0%1%/1%2%/2%3%/3&quot;</span>);
<a name="l00090"></a>00090 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KFormat2,<span class="stringliteral">&quot;%-B%:0%J%:1%T%:3%+B&quot;</span>);
<a name="l00091"></a>00091 <a class="code" href="secureclientandserver_8h.html#a5eadd4429627d82193b37536d4faa03a">_LIT</a>(KUserPanic,<span class="stringliteral">&quot;Failed to complete&quot;</span>);
<a name="l00092"></a>00092 
<a name="l00097"></a><a class="code" href="struct_t_query_table.html">00097</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct_t_query_table.html">TQueryTable</a>
<a name="l00098"></a>00098         {
<a name="l00099"></a>00099         TInt iQueryId;
<a name="l00100"></a>00100         TMsvSearchSortResultType iResultType;
<a name="l00101"></a>00101         }<a class="code" href="struct_t_query_table.html">TQueryTable</a>;
<a name="l00102"></a>00102 
<a name="l00103"></a>00103 
<a name="l00107"></a><a class="code" href="struct_t_result_summary.html">00107</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct_t_result_summary.html">TResultSummary</a>
<a name="l00108"></a>00108         {
<a name="l00109"></a>00109         TBuf&lt;30&gt; iToText;
<a name="l00110"></a>00110         TBuf&lt;30&gt; iSubjectText;
<a name="l00111"></a>00111         TBuf&lt;30&gt; iDatestring;
<a name="l00112"></a>00112         TBuf&lt;30&gt; iTimestring;
<a name="l00113"></a>00113         TInt iSize;
<a name="l00114"></a>00114         }<a class="code" href="struct_t_result_summary.html">TResultSummary</a>;
<a name="l00115"></a>00115 
<a name="l00120"></a><a class="code" href="class_c_searchsort_example.html">00120</a> <span class="keyword">class </span><a class="code" href="class_c_searchsort_example.html">CSearchsortExample</a> : <span class="keyword">public</span>  CBase,<span class="keyword">public</span> MMsvSessionObserver
<a name="l00121"></a>00121         {
<a name="l00122"></a>00122 <span class="keyword">public</span>:
<a name="l00123"></a>00123         <span class="keyword">static</span> <a class="code" href="class_c_searchsort_example.html">CSearchsortExample</a>* <a class="code" href="class_c_searchsort_example.html#aaeca65d7c16e40059e14ac32acc1ebc1">NewL</a>();
<a name="l00124"></a>00124 
<a name="l00125"></a>00125         <span class="comment">// Destructor.</span>
<a name="l00126"></a>00126         <a class="code" href="class_c_searchsort_example.html#a236c530105277e1ec161254e8c064c69">~CSearchsortExample</a>();
<a name="l00127"></a>00127 
<a name="l00128"></a>00128         <span class="comment">// Creating client registry.</span>
<a name="l00129"></a>00129         <span class="keywordtype">void</span> <a class="code" href="class_c_searchsort_example.html#ae676fe6d363a9f673c13a86c03bcd69a">CreateClientRegistryL</a>();
<a name="l00130"></a>00130 
<a name="l00131"></a>00131         <span class="comment">//Creating pop and Smtp accounts and doing various server settings.</span>
<a name="l00132"></a>00132         <span class="keywordtype">void</span> <a class="code" href="class_c_searchsort_example.html#a19da4c2573c1558cdc7e4ceeece87619">CreatePopAndSmtpAccountL</a>();
<a name="l00133"></a>00133 
<a name="l00134"></a>00134         <span class="comment">// Creating Smtp messages.</span>
<a name="l00135"></a>00135         <span class="keywordtype">void</span> <a class="code" href="class_c_searchsort_example.html#a318c96ba87df0b169eed493743b8efb4">CreateSmtpMessageL</a>(TInt aindex,TDes&amp; aFrominfo,TDes&amp; aToinfo,TDes&amp; aSubjectinfo);
<a name="l00136"></a>00136 
<a name="l00137"></a>00137         <span class="comment">// Function for search-sort using non-iterative mechanism.</span>
<a name="l00138"></a>00138         <span class="keywordtype">void</span> <a class="code" href="class_c_searchsort_example.html#a47c885dcc5fbbbea3914ea4a957eeed0">SearchSortRequestWithoutIteratorL</a>(TDes&amp; aSender,TBool aCaseSensitivity,TBool aWholeWordSearch,TBool aCombinedSearch,TInt&amp; aResultCount);
<a name="l00139"></a>00139 
<a name="l00140"></a>00140         <span class="comment">// Function for search-sort using iterative mechanism.</span>
<a name="l00141"></a>00141         <span class="keywordtype">void</span> <a class="code" href="class_c_searchsort_example.html#a1cac2e1191acf6e6de435c0ce7d23931">SearchSortRequestWithIteratorL</a>(TInt&amp; aResultCount);
<a name="l00142"></a>00142 
<a name="l00143"></a>00143         <span class="comment">// Function for search-sort by QueryID.</span>
<a name="l00144"></a>00144         <span class="keywordtype">void</span> <a class="code" href="class_c_searchsort_example.html#ac01f2c133c9f693889a8f28c6a29352e">SearchSortRequestByQueryIdL</a>(TInt&amp; aResultCount);
<a name="l00145"></a>00145 
<a name="l00146"></a>00146         <span class="comment">//  Overriden function of session event.</span>
<a name="l00147"></a>00147         <span class="keywordtype">void</span> HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
<a name="l00148"></a>00148 
<a name="l00149"></a>00149         <span class="comment">//Function for Smtp message entries deletion.</span>
<a name="l00150"></a>00150         <span class="keywordtype">void</span> <a class="code" href="class_c_searchsort_example.html#a627ac5a3ce29ab0581780e2e0eddd0aa">DeleteSmtpMessageL</a>(); 
<a name="l00151"></a>00151         
<a name="l00152"></a>00152         <span class="comment">//Function for email account deletion.</span>
<a name="l00153"></a>00153         <span class="keywordtype">void</span> DeleteAccountsL() ;
<a name="l00154"></a>00154 <span class="keyword">private</span>:
<a name="l00155"></a>00155 
<a name="l00156"></a>00156         <span class="comment">// Constructor.</span>
<a name="l00157"></a>00157         <a class="code" href="class_c_searchsort_example.html">CSearchsortExample</a>();
<a name="l00158"></a>00158 
<a name="l00159"></a>00159         <span class="comment">// 2nd phase construction.</span>
<a name="l00160"></a>00160         <span class="keywordtype">void</span> ConstructL();
<a name="l00161"></a>00161 <span class="keyword">public</span>:
<a name="l00162"></a>00162 
<a name="l00163"></a>00163         <span class="comment">//Array for storing the search result.</span>
<a name="l00164"></a>00164         RArray&lt;TResultSummary&gt; iTResultSummary;
<a name="l00165"></a>00165 <span class="keyword">private</span>:
<a name="l00166"></a>00166 
<a name="l00167"></a>00167         <span class="comment">// Pointer to the Client-side MTM registry.</span>
<a name="l00168"></a>00168         CClientMtmRegistry* iClientRegistry;
<a name="l00169"></a>00169         <span class="comment">// Pointer to the channel of communication between a client thread and the Message Server thread.</span>
<a name="l00170"></a>00170         CMsvSession*            iSession;
<a name="l00171"></a>00171         <span class="comment">// ointer to the CBase MTM.</span>
<a name="l00172"></a>00172         CBaseMtm*                       iMtm;
<a name="l00173"></a>00173         <span class="comment">// ID of the entry to access.</span>
<a name="l00174"></a>00174         TMsvId                          iPopServiceId;
<a name="l00175"></a>00175         <span class="comment">// POP account Name.</span>
<a name="l00176"></a>00176         TPopAccount                     iPopAccount;
<a name="l00177"></a>00177         <span class="comment">// SMTP account Name.</span>
<a name="l00178"></a>00178         TSmtpAccount            iSmtpAccount;
<a name="l00179"></a>00179         <span class="comment">// Variable for storing the QueryID.</span>
<a name="l00180"></a>00180         TInt iQueryId;
<a name="l00181"></a>00181         <span class="comment">// Pointer to search sort operation.</span>
<a name="l00182"></a>00182         CMsvSearchSortOperation* iSearch;
<a name="l00183"></a>00183 
<a name="l00184"></a>00184         <span class="comment">// TQueryTable member variable.</span>
<a name="l00185"></a>00185         <a class="code" href="struct_t_query_table.html">TQueryTable</a> iExampleTQueryTable;
<a name="l00186"></a>00186         <span class="comment">//Array for storing Query information.</span>
<a name="l00187"></a>00187         RArray&lt;TQueryTable&gt; iQueryIdTable;
<a name="l00188"></a>00188         
<a name="l00189"></a>00189         };
<a name="l00190"></a>00190 
<a name="l00191"></a>00191 <span class="preprocessor">#endif // SEARCHSORTEXAMPLE_H</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
</body>
</html>