00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef SEARCHSORTEXAMPLE_H
00032 #define SEARCHSORTEXAMPLE_H
00033
00034 #include <mtclreg.h>
00035 #include "pop3set.h"
00036 #include "popcmtm.h"
00037 #include <mtclbase.h>
00038 #include <e32std.h>
00039
00040 #include <msvsearchsortquery.h>
00041 #include <msvsearchsortoperation.h>
00042 #include <msvstd.h>
00043 #include <msvids.h>
00044 #include <msvuids.h>
00045 #include <msvapi.h>
00046
00047 #include <iapprefs.h>
00048 #include <cemailaccounts.h>
00049
00050 #include <es_sock.h>
00051 #include <commdb.h>
00052 #include <cdbpreftable.h>
00053 #include <commdbconnpref.h>
00054 #include <commsdattypesv1_1.h>
00055 #include <commsdat.h>
00056 using namespace CommsDat;
00057
00058 _LIT(LDD_NAME,"ECOMM");
00059
00060 #if defined (__WINS__)
00061 _LIT(PDD_NAME,"ECDRV");
00062 #else
00063 _LIT(PDD_NAME,"ECUART1");
00064 #endif
00065
00066 #define KMaxEntryCount 5
00067 #define KPortValue 110
00068 #define KSmtpPortValue 25
00069 #define KSize 100
00070
00071 _LIT(KPopServer, "nokia.com");
00072 _LIT8(KPopPassword,"ban-User1");
00073 _LIT8(KPopLoginName,"ban-User1");
00074 _LIT(KTxtAccountName, "PopAccount");
00075 _LIT(KSmtpServerAddress, "nokia.com");
00076 _LIT(KEmailAlias, "Messaging example");
00077
00078 _LIT(KSmtpEmailAddress, "[email protected]");
00079
00080 _LIT8(KFrom1, "[email protected]");
00081 _LIT(KTo1, "[email protected]");
00082 _LIT(KSubject1, "SimpleEmail");
00083
00084 _LIT(KBodyContents, "This is a very simple mail");
00085
00086 _LIT8(KFrom2, "[email protected]");
00087 _LIT(KTo2, "[email protected]");
00088 _LIT(KSubject2, "FunEmail");
00089
00090 _LIT8(KFrom3, "[email protected]");
00091 _LIT(KTo3, "[email protected]");
00092 _LIT(KSubject3, "SimpleEmail");
00093
00094 _LIT8(KFrom4, "[email protected]");
00095 _LIT(KTo4, "[email protected]");
00096 _LIT(KSubject4, "TestingMail");
00097
00098 _LIT8(KFrom5, "[email protected]");
00099 _LIT(KTo5, "[email protected]");
00100 _LIT(KSubject5, "GoodEmail");
00101
00102 _LIT(KSubjectSearch,"GoodEmail");
00103
00104 _LIT(KFormat1,"%D%M%Y%/0%1%/1%2%/2%3%/3");
00105 _LIT(KFormat2,"%-B%:0%J%:1%T%:3%+B");
00106 _LIT(KUserPanic,"Failed to complete");
00107
00112 typedef struct TQueryTable
00113 {
00114 TInt iQueryId;
00115 TMsvSearchSortResultType iResultType;
00116 }TQueryTable;
00117
00118
00122 typedef struct TResultSummary
00123 {
00124 TBuf<30> iToText;
00125 TBuf<30> iSubjectText;
00126 TBuf<30> iDatestring;
00127 TBuf<30> iTimestring;
00128 TInt iSize;
00129 }TResultSummary;
00130
00135 class CSearchsortExample : public CBase,public MMsvSessionObserver
00136 {
00137 public:
00138 static CSearchsortExample* NewL();
00139
00140
00141 ~CSearchsortExample();
00142
00143
00144 void CreateClientRegistryL();
00145
00146
00147 void CreatePopAndSmtpAccountL();
00148
00149
00150 void CreateSmtpMessageL(TInt aindex,TDes& aFrominfo,TDes& aToinfo,TDes& aSubjectinfo);
00151
00152
00153 void SearchSortRequestWithoutIteratorL(TDes& aSender,TBool aCaseSensitivity,TBool aWholeWordSearch,TBool aCombinedSearch,TInt& aResultCount);
00154
00155
00156 void SearchSortRequestWithIteratorL(TInt& aResultCount);
00157
00158
00159 void SearchSortRequestByQueryIdL(TInt& aResultCount);
00160
00161
00162 void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
00163
00164
00165 void DeleteSmtpMessageL();
00166
00167
00168 void DeleteAccountsL() ;
00169 private:
00170
00171
00172 CSearchsortExample();
00173
00174
00175 void ConstructL();
00176 public:
00177
00178
00179 RArray<TResultSummary> iTResultSummary;
00180 private:
00181
00182
00183 CClientMtmRegistry* iClientRegistry;
00184
00185 CMsvSession* iSession;
00186
00187 CBaseMtm* iMtm;
00188
00189 TMsvId iPopServiceId;
00190
00191 TPopAccount iPopAccount;
00192
00193 TSmtpAccount iSmtpAccount;
00194
00195 TInt iQueryId;
00196
00197 CMsvSearchSortOperation* iSearch;
00198
00199
00200 TQueryTable iExampleTQueryTable;
00201
00202 RArray<TQueryTable> iQueryIdTable;
00203
00204 };
00205
00206 #endif // SEARCHSORTEXAMPLE_H