ipsservices/tsrc/profiletester/inc/popimapprofiletester.h
branchRCL_3
changeset 80 726fba06891a
parent 70 968773a0b6ef
equal deleted inserted replaced
73:c8382f7b54ef 80:726fba06891a
    39 
    39 
    40 #include "mfsmaileventobserver.h"
    40 #include "mfsmaileventobserver.h"
    41 #include "mfsmailrequestobserver.h"
    41 #include "mfsmailrequestobserver.h"
    42 #include "mfsmailboxsearchobserver.h"
    42 #include "mfsmailboxsearchobserver.h"
    43 
    43 
    44 // CONSTANTS
    44 //#define
    45 #define KIPSSosImap4PluginUid      0x2000e53f
    45 #define KIPSSosImap4PluginUid      0x2000e53f
    46 #define KIPSSosPop3PluginUid       0x2000e53e
    46 #define KIPSSosPop3PluginUid       0x2000e53e
    47 
    47 #define DELANDNULL( a ) { if( a ) { delete a; a = NULL; } }
       
    48 
       
    49 //const
    48 const TUint KTenSecondsTime(10);
    50 const TUint KTenSecondsTime(10);
    49 const TUint KHalfMinuteTime(30);
    51 const TUint KHalfMinuteTime(30);
    50 const TUint KOneMinuteTime(60);
    52 const TUint KOneMinuteTime(60);
    51 
    53 const TUint KMidBufLen(128);
    52 // MACROS
    54 const TUint KMaxBufLen(256); 
    53 #define TEST_CLASS_VERSION_MAJOR 0
    55 
    54 #define TEST_CLASS_VERSION_MINOR 0
    56 //typeof
    55 #define TEST_CLASS_VERSION_BUILD 0
    57 typedef TBuf<KMaxBufLen> TFolderName;
    56 #define DELANDNULL( a ) { if( a ) { delete a; a = NULL; } }
    58 
    57 
    59 //class declaration
    58 class CPopImapProfileTester;
    60 class CPopImapProfileTester;
    59 class CTimeoutTimer;
    61 class CTimeoutTimer;
    60 class CFSMailClient;
    62 class CFSMailClient;
    61 class CFSMailBox;
    63 class CFSMailBox;
    62 class CActiveSchedulerWait;
    64 class CActiveSchedulerWait;
    63 
    65 
       
    66 //enum
    64 enum TWaitingState
    67 enum TWaitingState
    65     {
    68     {
    66     EWaitingNothing = 0,
    69     EWaitingNothing = 0,
    67     EWaitingEvent,
    70     EWaitingEvent,
    68     EWaitingResponse,
    71     EWaitingResponse,
    95     TInt iOperatorPort;
    98     TInt iOperatorPort;
    96 
    99 
    97     TInt iIncomingPort;
   100     TInt iIncomingPort;
    98     TInt iOutgoingPort;
   101     TInt iOutgoingPort;
    99 
   102 
   100     TBuf<10> iAccountType;
   103     TBuf<KMidBufLen> iAccountType;
   101     TBuf<50> iEmailAddress;
   104     TBuf<KMaxBufLen> iEmailAddress;
   102     TBuf<50> iUserName;
   105     TBuf<KMaxBufLen> iUserName;
   103     TBuf<100> iPassWord;
   106     TBuf<KMaxBufLen> iPassWord;
   104     TBuf<50> iIncomingServer;
   107     TBuf<KMaxBufLen> iIncomingServer;
   105     TBuf<50> iOutgoingServer;
   108     TBuf<KMaxBufLen> iOutgoingServer;
   106     TBuf<20> iMailboxName;
   109     TBuf<KMaxBufLen> iMailboxName;
   107 
   110 
   108     /****
   111     /****
   109      * Using the default value
   112      * Using the default value
   110      */
   113      */
   111     TBuf<5> iWizardAccountType;
   114     TBuf<KMidBufLen> iWizardAccountType;
   112     TBuf<2> iOperatorOutgoingServer;
   115     TBuf<KMidBufLen> iOperatorOutgoingServer;
   113     TBool iHideUserNameInSetting;
   116     TBool iHideUserNameInSetting;
   114     TBuf<10> iAccessPoint;
   117     TBuf<KMidBufLen> iAccessPoint;
   115     };
   118     };
   116 
   119 
   117 NONSHARABLE_CLASS(CPopImapProfileTester) : public CScriptBase,
   120 NONSHARABLE_CLASS(CPopImapProfileTester) : public CScriptBase,
   118         public MFSMailEventObserver,
   121         public MFSMailEventObserver,
   119         public MFSMailRequestObserver,
   122         public MFSMailRequestObserver,
   133      * Destructor.
   136      * Destructor.
   134      */
   137      */
   135     virtual ~CPopImapProfileTester();
   138     virtual ~CPopImapProfileTester();
   136 
   139 
   137 public:
   140 public:
   138     // New functions
       
   139 
       
   140 
       
   141 public:
       
   142     // Functions from base classes
   141     // Functions from base classes
   143 
   142 
   144     /**
   143     /**
   145      * From CScriptBase Runs a script line.
   144      * From CScriptBase Runs a script line.
   146      * @since 
   145      * @since 
   162     void ClientRequiredSearchPriority(TInt *apRequiredSearchPriority);
   161     void ClientRequiredSearchPriority(TInt *apRequiredSearchPriority);
   163 
   162 
   164     //from MTimeoutObserver
   163     //from MTimeoutObserver
   165     void TimeoutNotify();
   164     void TimeoutNotify();
   166 
   165 
   167 protected:
       
   168     // New functions
       
   169 
       
   170 
       
   171 protected:
       
   172     // Functions from base classes
       
   173 
       
   174 
       
   175 private:
   166 private:
   176 
   167    
   177     /**
   168     /**
   178      * C++ default constructor.
   169      * C++ default constructor.
   179      */
   170      */
   180     CPopImapProfileTester(CTestModuleIf& aTestModuleIf);
   171     CPopImapProfileTester(CTestModuleIf& aTestModuleIf);
   181 
   172 
   235     TInt GetMessagesFromFolderL(RPointerArray<CFSMailMessage>& aMessages,
   226     TInt GetMessagesFromFolderL(RPointerArray<CFSMailMessage>& aMessages,
   236             CFSMailFolder* aFolder, TFSMailDetails aDet,
   227             CFSMailFolder* aFolder, TFSMailDetails aDet,
   237             TFSMailSortField aSort, TUint aCount);
   228             TFSMailSortField aSort, TUint aCount);
   238 
   229 
   239     TInt WaitForEvent(TFSMailEvent aWaitedEvent, TAny *aEventParam1 = NULL,
   230     TInt WaitForEvent(TFSMailEvent aWaitedEvent, TAny *aEventParam1 = NULL,
   240             TAny *aEventParam2 = NULL, TInt aTimeout = 60);
   231             TAny *aEventParam2 = NULL, TInt aTimeout = KOneMinuteTime);
   241 
   232 
   242     TInt WaitForResponse(TFSProgress::TFSProgressStatus aWaitedResponse,
   233     TInt WaitForResponse(TFSProgress::TFSProgressStatus aWaitedResponse,
   243             TInt aTimeout = 60);
   234             TInt aTimeout = KOneMinuteTime);
   244 
   235 
   245     void OpComplete();
   236     void OpComplete();
   246 
   237 
   247     TInt InitMailboxL();
   238     TInt InitMailboxL();
   248 
   239 
   270     TFSMailMsgId GetFolderIdFromName(const TDesC& aFolderName);
   261     TFSMailMsgId GetFolderIdFromName(const TDesC& aFolderName);
   271 
   262 
   272     TBool ParseEventParams(TAny *aEventParam1, TAny *aEventParam2);
   263     TBool ParseEventParams(TAny *aEventParam1, TAny *aEventParam2);
   273 
   264 
   274     CFSMailFolder* FindFolder(const TDesC& aFolderName);
   265     CFSMailFolder* FindFolder(const TDesC& aFolderName);
   275 
   266     
   276 public:
   267     void LogNewEntriesCount(TDes& aLog,TAny* aParam);
   277     // Data
   268     
   278 
   269     void LogFolderName(TDes& aLog,TAny* aParam);
   279 
       
   280 protected:
       
   281     // Data
       
   282 
       
   283 
   270 
   284 private:
   271 private:
   285     // Data
   272     // Data
   286     TBool iEventSynchronousCall;
   273     TBool iEventSynchronousCall;
   287     CFSMailClient* iMailClient;
   274     CFSMailClient* iMailClient;
   305     TFSMailMsgId iPluginId;
   292     TFSMailMsgId iPluginId;
   306 
   293 
   307     //checking status of searching
   294     //checking status of searching
   308     TBool iSearchOngoing;
   295     TBool iSearchOngoing;
   309     TInt iSearchMatches;
   296     TInt iSearchMatches;
   310 
       
   311 public:
       
   312     // Friend classes
       
   313 
       
   314 protected:
       
   315     // Friend classes
       
   316 
       
   317 private:
       
   318     // Friend classes
       
   319 
       
   320 
       
   321     };
   297     };
   322 
   298 
   323 #endif      // POPIMAPPROFILETESTER_H
   299 #endif      // POPIMAPPROFILETESTER_H
   324 // End of File
   300 // End of File