messagingappbase/obexmtms/TObexMTM/testutils/msgth/inc/commands.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __COMMANDS_H
       
    17 #define __COMMANDS_H
       
    18 #include "harness.h"
       
    19 
       
    20 const TInt KMaxTestBodyTxt = 200;
       
    21 
       
    22 //
       
    23 //
       
    24 // CCleanMessageFolder
       
    25 //
       
    26 
       
    27 class CCleanMessageFolder : public CBase, public MBaseTestState
       
    28 	{
       
    29 public:
       
    30 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
    31 	IMPORT_C CCleanMessageFolder(CMsvTestUtils& aTestUtils);
       
    32 
       
    33 protected:
       
    34 	CMsvTestUtils& iTestUtils;
       
    35 	};
       
    36 
       
    37 
       
    38 //
       
    39 //
       
    40 // CAddComment
       
    41 //
       
    42 
       
    43 class CAddComment : public CBase, public MBaseTestState
       
    44 	{
       
    45 public:
       
    46 	IMPORT_C static CAddComment* NewL(const CDesCArrayFlat& aComment, CMsvTestUtils& aTestUtils);
       
    47 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
    48 	IMPORT_C ~CAddComment();
       
    49 
       
    50 private:
       
    51 	CAddComment(CMsvTestUtils& aTestUtils);
       
    52 	void ConstructL(const CDesCArrayFlat& aComment);
       
    53 
       
    54 protected:
       
    55 	CMsvTestUtils& iTestUtils;
       
    56 	HBufC* iComment;
       
    57 	};
       
    58 
       
    59 
       
    60 //
       
    61 //
       
    62 // CGoClientSide
       
    63 //
       
    64 
       
    65 class CGoClientSide : public CBase, public MBaseTestState
       
    66 	{
       
    67 public:
       
    68 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
    69 	IMPORT_C CGoClientSide(CMsvTestUtils& aTestUtils);
       
    70 
       
    71 protected:
       
    72 	CMsvTestUtils& iTestUtils;
       
    73 	};
       
    74 
       
    75 
       
    76 
       
    77 //
       
    78 //
       
    79 // CGoServerSide
       
    80 //
       
    81 
       
    82 class CGoServerSide : public CBase, public MBaseTestState
       
    83 	{
       
    84 public:
       
    85 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
    86 	IMPORT_C CGoServerSide(CMsvTestUtils& aTestUtils);
       
    87 
       
    88 protected:
       
    89 	CMsvTestUtils& iTestUtils;
       
    90 	};
       
    91 
       
    92 
       
    93 
       
    94 //
       
    95 //
       
    96 // CResetMessageServer
       
    97 //
       
    98 
       
    99 class CResetMessageServer : public CBase, public MBaseTestState
       
   100 	{
       
   101 public:
       
   102 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   103 	IMPORT_C CResetMessageServer(CMsvClientTest& aParentTestHarness);
       
   104 
       
   105 protected:
       
   106 	CMsvClientTest& iParentTestHarness;
       
   107 	};
       
   108 
       
   109 
       
   110 
       
   111 
       
   112 //
       
   113 //
       
   114 // CCheckMessageFolder
       
   115 //
       
   116 
       
   117 class CCheckMessageFolder : public CBase, public MBaseTestState
       
   118 	{
       
   119 public:
       
   120 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   121 	IMPORT_C CCheckMessageFolder(const TDesC& aFileName, CMsvTestUtils& aTestUtils);
       
   122 
       
   123 protected:
       
   124 	CMsvTestUtils& iTestUtils;
       
   125 	TFileName iFileName;
       
   126 	};
       
   127 
       
   128 
       
   129 
       
   130 //
       
   131 //
       
   132 // CSelectEntry
       
   133 //
       
   134 
       
   135 class CSelectEntry : public CBase, public MBaseTestState
       
   136 	{
       
   137 public:
       
   138 	IMPORT_C static CSelectEntry* NewL(const TDesC& aName, const TMsvId& aCurrentFolderId, TMsvId* aEntryId, CMsvTestUtils& aTestUtils);
       
   139 	IMPORT_C static CSelectEntry* NewL(const TDesC& aName, const TMsvId& aCurrentFolderId, CMsvEntrySelection* aSelection, CMsvTestUtils& aTestUtils);
       
   140 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   141 	IMPORT_C ~CSelectEntry();
       
   142 
       
   143 private:
       
   144 	CSelectEntry(const TMsvId& aCurrentFolderId, TMsvId* aEntryId, CMsvTestUtils& aTestUtils);
       
   145 	CSelectEntry(const TMsvId& aCurrentFolderId, CMsvEntrySelection* aSelection, CMsvTestUtils& aTestUtils);
       
   146 	void ConstructL(const TDesC& aName);
       
   147 
       
   148 private:
       
   149 	CMsvTestUtils& iTestUtils;
       
   150 	const TMsvId& iCurrentFolderId;
       
   151 	TMsvId* iEntryId;
       
   152 	CMsvEntrySelection* iEntrySelection;
       
   153 	HBufC* iEntryName;
       
   154 	};
       
   155 
       
   156 /*
       
   157 class CSelectEntry : public CBase, public MBaseTestState
       
   158 	{
       
   159 public:
       
   160 	static CSelectEntry* NewL(const TDesC& aName, const TMsvId& aCurrentFolderId, TMsvId& aEntryId, CMsvTestUtils& aTestUtils);
       
   161 	void StartL(TRequestStatus& aStatus);
       
   162 	~CSelectEntry();
       
   163 
       
   164 private:
       
   165 	CSelectEntry(const TMsvId& aCurrentFolderId, TMsvId& aEntryId, CMsvTestUtils& aTestUtils);
       
   166 	void ConstructL(const TDesC& aName);
       
   167 
       
   168 private:
       
   169 	CMsvTestUtils& iTestUtils;
       
   170 	const TMsvId& iCurrentFolderId;
       
   171 	TMsvId& iEntryId;
       
   172 	HBufC* iEntryName;
       
   173 	};
       
   174 */
       
   175 
       
   176 //`//
       
   177 //
       
   178 // CCheckSelectionCount
       
   179 //
       
   180 
       
   181 class CCheckSelectionCount : public CBase, public MBaseTestState
       
   182 	{
       
   183 public:
       
   184 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   185 	IMPORT_C CCheckSelectionCount(TInt aCount, CMsvEntrySelection& aSelection, CMsvTestUtils& aTestUtils); 
       
   186 
       
   187 private:
       
   188 	void LogCommentFormatL(TRefByValue<const TDesC> format,...);
       
   189 
       
   190 private:
       
   191 	CMsvTestUtils& iTestUtils;
       
   192 	CMsvEntrySelection& iSelection;
       
   193 	TInt iTestCount;
       
   194 	};
       
   195 
       
   196 //
       
   197 //
       
   198 // CDumpMessageStore
       
   199 //
       
   200 
       
   201 class CDumpMessageStore : public CBase, public MBaseTestState
       
   202 	{
       
   203 public:
       
   204 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   205 	IMPORT_C CDumpMessageStore(CMsvTestUtils& aTestUtils); 
       
   206 
       
   207 private:
       
   208 	CMsvTestUtils& iTestUtils;
       
   209 	};
       
   210 
       
   211 
       
   212 
       
   213 
       
   214 //`//
       
   215 //
       
   216 // CCheckNewFlag
       
   217 //
       
   218 
       
   219 class CCheckNewFlag : public CBase, public MBaseTestState
       
   220 	{
       
   221 public:
       
   222 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   223 	IMPORT_C CCheckNewFlag(TInt aSelectedIndex, TBool aTestNewStatus, 
       
   224 				  CMsvEntrySelection& aSelection, CMsvTestUtils& aTestUtils); 
       
   225 
       
   226 private:
       
   227 	void LogCommentFormatL(TRefByValue<const TDesC> format,...);
       
   228 
       
   229 private:
       
   230 	CMsvTestUtils& iTestUtils;
       
   231 	CMsvEntrySelection& iSelection;
       
   232 	TInt iSelectedIndex;
       
   233 	TBool iTestNewStatus;
       
   234 	};
       
   235 
       
   236 
       
   237 
       
   238 //`//
       
   239 //
       
   240 // CCheckPriority
       
   241 //
       
   242 
       
   243 class CCheckPriority : public CBase, public MBaseTestState
       
   244 	{
       
   245 public:
       
   246 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   247 	IMPORT_C CCheckPriority(TInt aSelectedIndex, TInt aTestPriority, 
       
   248 				   CMsvEntrySelection& aSelection, CMsvTestUtils& aTestUtils); 
       
   249 
       
   250 private:
       
   251 	void LogCommentFormatL(TRefByValue<const TDesC> format,...);
       
   252 
       
   253 private:
       
   254 	CMsvTestUtils& iTestUtils;
       
   255 	CMsvEntrySelection& iSelection;
       
   256 	TInt iSelectedIndex;
       
   257 	TBool iTestPriority;
       
   258 	};
       
   259 
       
   260 
       
   261 //`//
       
   262 //
       
   263 // CCheckAttachment
       
   264 //
       
   265 
       
   266 class CCheckAttachment : public CBase, public MBaseTestState
       
   267 	{
       
   268 public:
       
   269 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   270 	IMPORT_C CCheckAttachment(TInt aSelectedIndex, TBool aTestAttachment, 
       
   271 					 CMsvEntrySelection& aSelection, CMsvTestUtils& aTestUtils); 
       
   272 
       
   273 private:
       
   274 	void LogCommentFormatL(TRefByValue<const TDesC> format,...);
       
   275 
       
   276 private:
       
   277 	CMsvTestUtils& iTestUtils;
       
   278 	CMsvEntrySelection& iSelection;
       
   279 	TInt iSelectedIndex;
       
   280 	TBool iTestAttachment;
       
   281 	};
       
   282 
       
   283 
       
   284 //`//
       
   285 //
       
   286 // CCheckBodyText
       
   287 //
       
   288 
       
   289 class CCheckBodyText : public CBase, public MBaseTestState
       
   290 	{
       
   291 public:
       
   292 	IMPORT_C static CCheckBodyText* NewL(TInt aSelectedIndex, TDesC& aTestBodyText, CMsvEntrySelection& aSelection, CMsvTestUtils& aTestUtils);
       
   293 	
       
   294 	IMPORT_C ~CCheckBodyText();
       
   295 
       
   296 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   297 	
       
   298 private:
       
   299 	void ConstructL(TDesC& aTestBodyText);
       
   300 	CCheckBodyText(TInt aSelectedIndex, CMsvEntrySelection& aSelection, CMsvTestUtils& aTestUtils); 
       
   301 
       
   302 	void LogCommentFormatL(TRefByValue<const TDesC> format,...);
       
   303 
       
   304 private:
       
   305 	CMsvTestUtils& iTestUtils;
       
   306 	CMsvEntrySelection& iSelection;
       
   307 	TInt iSelectedIndex;
       
   308 	HBufC* iTestBodyText;
       
   309 	};
       
   310 
       
   311 //`//
       
   312 //
       
   313 // CCheckRemoteFolderSize
       
   314 //
       
   315 
       
   316 class CCheckRemoteFolderSize : public CBase, public MBaseTestState
       
   317 	{
       
   318 public:
       
   319 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   320 	IMPORT_C CCheckRemoteFolderSize(TInt aCount, CMsvTestUtils& aTestUtils); 
       
   321 
       
   322 private:
       
   323 	void LogCommentFormatL(TRefByValue<const TDesC> format,...);
       
   324 
       
   325 private:
       
   326 	CMsvTestUtils& iTestUtils;
       
   327 	TInt iTestCount;
       
   328 	};
       
   329 
       
   330 //`//
       
   331 //
       
   332 // CSelectPopulatedInSelection
       
   333 //
       
   334 
       
   335 class CSelectPopulatedInSelection : public CBase, public MBaseTestState
       
   336 	{
       
   337 public:
       
   338 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   339 	IMPORT_C CSelectPopulatedInSelection(CMsvEntrySelection& aSelection,CMsvTestUtils& aTestUtils); 
       
   340 
       
   341 private:
       
   342 	CMsvTestUtils& iTestUtils;
       
   343 	CMsvEntrySelection& iSelection;
       
   344 	};
       
   345 
       
   346 //`//
       
   347 //
       
   348 // CSelectLastInSelection
       
   349 //
       
   350 
       
   351 class CSelectLastInSelection : public CBase, public MBaseTestState
       
   352 	{
       
   353 public:
       
   354 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   355 	IMPORT_C CSelectLastInSelection(TInt aCount, CMsvEntrySelection& aSelection, CMsvTestUtils& aTestUtils); 
       
   356 
       
   357 private:
       
   358 	CMsvTestUtils& iTestUtils;
       
   359 	CMsvEntrySelection& iSelection;
       
   360 	TInt iTestCount;
       
   361 	};
       
   362 
       
   363 //`//
       
   364 //
       
   365 // CSelectFirstInSelection
       
   366 //
       
   367 
       
   368 class CSelectFirstInSelection : public CBase, public MBaseTestState
       
   369 	{
       
   370 public:
       
   371 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   372 	IMPORT_C CSelectFirstInSelection(TInt aCount, CMsvEntrySelection& aSelection, CMsvTestUtils& aTestUtils); 
       
   373 
       
   374 private:
       
   375 	CMsvTestUtils& iTestUtils;
       
   376 	CMsvEntrySelection& iSelection;
       
   377 	TInt iTestCount;
       
   378 	};
       
   379 
       
   380 //
       
   381 //
       
   382 // CSelectEntryById
       
   383 //
       
   384 
       
   385 class CSelectEntryById : public CBase, public MBaseTestState
       
   386 	{
       
   387 public:
       
   388 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   389 	IMPORT_C CSelectEntryById(TMsvId aId, TMsvId& aEntryId, CMsvTestUtils& aTestUtils);
       
   390 
       
   391 private:
       
   392 	CMsvTestUtils& iTestUtils;
       
   393 	TMsvId iIdToSelect;
       
   394 	TMsvId& iEntryId;
       
   395 	};
       
   396 
       
   397 //
       
   398 //
       
   399 // CMsvTestEntry
       
   400 //
       
   401 
       
   402 class CMsvTestEntry : public CBase, public MBaseTestState
       
   403 	{
       
   404 public:
       
   405 	IMPORT_C CMsvTestEntry(CMsvClientTest& aParentTestHarness);
       
   406 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   407 	
       
   408 	IMPORT_C void TestVisible(TBool aVisibleValue);
       
   409 	IMPORT_C void TestComplete(TBool aCompleteValue);
       
   410 
       
   411 protected:
       
   412 // What to test
       
   413 	TBool iTestVisible;
       
   414 	TBool iTestComplete;
       
   415 
       
   416 // Expected values
       
   417 	TBool iVisibleValue;
       
   418 	TBool iCompleteValue;
       
   419 
       
   420 protected:
       
   421 	CMsvClientTest& iParentTestHarness;
       
   422 	};
       
   423 
       
   424 //
       
   425 //
       
   426 // CSelectAllMessages
       
   427 //
       
   428 
       
   429 class CSelectAllMessages : public CBase, public MBaseTestState
       
   430 	{
       
   431 public:
       
   432 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   433 	IMPORT_C CSelectAllMessages(TMsvId& aParentFolder, CMsvEntrySelection& aSelection, CMsvTestUtils& aTestUtils);
       
   434 
       
   435 private:
       
   436 	CMsvTestUtils& iTestUtils;
       
   437 	TMsvId& iParentFolder;
       
   438 	CMsvEntrySelection& iSelection;
       
   439 	};
       
   440 
       
   441 
       
   442 
       
   443 //
       
   444 //
       
   445 // CLongWait
       
   446 //
       
   447 
       
   448 class CLongWait : public CActive, public MBaseTestState
       
   449 	{
       
   450 public:
       
   451 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   452 	IMPORT_C CLongWait();
       
   453 	IMPORT_C CLongWait(TInt aWaitTime);
       
   454 	IMPORT_C ~CLongWait();
       
   455 	IMPORT_C void RunL();
       
   456 	IMPORT_C void DoCancel();
       
   457 
       
   458 private:
       
   459 	CTestTimer* iTimer;
       
   460 	TRequestStatus* iReportStatus;
       
   461 	TInt iWaitTime;
       
   462 	};
       
   463 
       
   464 
       
   465 //
       
   466 //
       
   467 // CCopySelection
       
   468 //
       
   469 
       
   470 class CCopySelection : public CActive, public MBaseTestState
       
   471 	{
       
   472 public:
       
   473 	IMPORT_C CCopySelection(CMsvClientTest& aParentTestHarness);
       
   474 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   475 	IMPORT_C void RunL();
       
   476 	IMPORT_C void DoCancel();
       
   477 	IMPORT_C ~CCopySelection();
       
   478 
       
   479 private:
       
   480 	CMsvClientTest& iParentTestHarness;
       
   481 	TRequestStatus* iReportStatus;
       
   482 	};
       
   483 
       
   484 
       
   485 //
       
   486 //
       
   487 // CMoveSelection
       
   488 //
       
   489 
       
   490 class CMoveSelection : public CActive, public MBaseTestState
       
   491 	{
       
   492 public:
       
   493 	IMPORT_C CMoveSelection(CMsvClientTest& aParentTestHarness);
       
   494 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   495 	IMPORT_C void RunL();
       
   496 	IMPORT_C void DoCancel();
       
   497 	IMPORT_C ~CMoveSelection();
       
   498 
       
   499 private:
       
   500 	CMsvClientTest& iParentTestHarness;
       
   501 	TRequestStatus* iReportStatus;
       
   502 	};
       
   503 
       
   504 
       
   505 
       
   506 //
       
   507 //
       
   508 // CDeleteSelection
       
   509 //
       
   510 
       
   511 class CDeleteSelection : public CActive, public MBaseTestState
       
   512 	{
       
   513 public:
       
   514 	IMPORT_C CDeleteSelection(CMsvClientTest& aParentTestHarness);
       
   515 	IMPORT_C void StartL(TRequestStatus& aStatus);
       
   516 	IMPORT_C void RunL();
       
   517 	IMPORT_C void DoCancel();
       
   518 	IMPORT_C ~CDeleteSelection();
       
   519 
       
   520 private:
       
   521 	CMsvClientTest& iParentTestHarness;
       
   522 	TRequestStatus* iReportStatus;
       
   523 	};
       
   524 
       
   525 
       
   526 #endif