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