contentmgmt/referencedrmagent/tcaf/source/ManagerStep.h
changeset 15 da2ae96f639b
child 45 030c4fbc13d7
equal deleted inserted replaced
10:afc583cfa176 15:da2ae96f639b
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #if (!defined __MANAGER_STEP_H__)
       
    22 #define __MANAGER_STEP_H__
       
    23 #include <test/testexecutestepbase.h>
       
    24 
       
    25 #include "cafstep.h"
       
    26 #include <caf/dirstreamable.h>
       
    27 #include "contentIterator.h"
       
    28 
       
    29 // Constants used to name test cases 
       
    30 _LIT(KCAFDeleteStep,"CAFDeleteStep");
       
    31 _LIT(KCAFCopyFileStep,"CAFCopyFileStep");
       
    32 _LIT(KCAFRenameFileStep,"CAFRenameFileStep");
       
    33 _LIT(KCAFMkDirStep,"CAFMkDirStep");
       
    34 _LIT(KCAFMkDirAllStep,"CAFMkDirAllStep");
       
    35 _LIT(KCAFRmDirStep,"CAFRmDirStep");
       
    36 _LIT(KCAFGetDirStep,"CAFGetDirStep");
       
    37 _LIT(KCAFManagerNotifyStep,"CAFManagerNotifyStep");
       
    38 _LIT(KCAFManagerSetPropertyStep,"CAFManagerSetPropertyStep");
       
    39 _LIT(KCAFManagerDisplayInfoStep,"CAFManagerDisplayInfoStep");
       
    40 _LIT(KCAFManagerListAgentsStep,"CAFManagerListAgentsStep");
       
    41 _LIT(KCAFManagerAgentSpecificStep,"CAFManagerAgentSpecificStep");
       
    42 _LIT(KCAFManagerDisplayConfigStep,"CAFManagerDisplayConfigStep");
       
    43 _LIT(KCAFManagerAttributeStep,"CAFManagerAttributeStep");
       
    44 _LIT(KCAFManagerAttributeSetStep,"CAFManagerAttributeSetStep");
       
    45 _LIT(KCAFManagerStringAttributeStep,"CAFManagerStringAttributeStep");
       
    46 _LIT(KCAFManagerStringAttributeSetStep,"CAFManagerStringAttributeSetStep");
       
    47 _LIT(KCAFManagerDisplayInfoByFileHandleStep,"CAFManagerDisplayInfoByFileHandleStep");
       
    48 _LIT(KCAFManagerAttributeByFileHandleStep,"CAFManagerAttributeByFileHandleStep");
       
    49 _LIT(KCAFManagerAttributeSetByFileHandleStep,"CAFManagerAttributeSetByFileHandleStep");
       
    50 _LIT(KCAFManagerStringAttributeByFileHandleStep,"CAFManagerStringAttributeByFileHandleStep");
       
    51 _LIT(KCAFManagerStringAttributeSetByFileHandleStep,"CAFManagerStringAttributeSetByFileHandleStep");
       
    52 
       
    53 
       
    54 class CCAFServer;
       
    55 
       
    56 
       
    57 /* 
       
    58 * Used to test CManager::DeleteFile()
       
    59 * The INI file specifies the file to delete and the expected return code.
       
    60 * For instance this can be used to try and delete a file that does not exist or a file
       
    61 * that is read-only or has rights that don't allow it to be deleted
       
    62 * INI file paramerters
       
    63 *
       
    64 * filename - the file to delete
       
    65 *
       
    66 * result - the expected return code
       
    67 *
       
    68 * @internalComponent Exposure internally
       
    69 */
       
    70 class CCAFDeleteStep : public CCAFStep
       
    71 	{
       
    72 public:
       
    73 	CCAFDeleteStep(CCAFServer& aParent);
       
    74 	~CCAFDeleteStep();
       
    75 	virtual TVerdict doTestStepL();
       
    76 private:
       
    77 	CCAFServer& iParent;
       
    78 	};
       
    79 
       
    80 /* 
       
    81 * Used to test CManager::CopyFile()
       
    82 * The INI file specifies the file to delete and the expected return code.
       
    83 * For instance this can be used to try and delete a file that does not exist or a file
       
    84 * that is read-only or has rights that don't allow it to be deleted
       
    85 * INI file paramerters
       
    86 *
       
    87  source - the source file
       
    88  destination - the destination file
       
    89  result - the expected return code
       
    90 *
       
    91 * @internalComponent Exposure internally
       
    92 */
       
    93 class CCAFCopyFileStep : public CCAFStep
       
    94 	{
       
    95 public:
       
    96 	CCAFCopyFileStep(CCAFServer& aParent);
       
    97 	~CCAFCopyFileStep();
       
    98 	virtual TVerdict doTestStepL();
       
    99 private:
       
   100 	CCAFServer& iParent;
       
   101 	};
       
   102 
       
   103 /* 
       
   104 * Used to test CManager::RenameFile()
       
   105 * The INI file specifies the file to delete and the expected return code.
       
   106 * For instance this can be used to try and delete a file that does not exist or a file
       
   107 * that is read-only or has rights that don't allow it to be deleted
       
   108 * INI file paramerters
       
   109 *
       
   110  source - the source file
       
   111  destination - the destination file
       
   112  result - the expected return code
       
   113 *
       
   114 * @internalComponent Exposure internally
       
   115 */
       
   116 class CCAFRenameFileStep : public CCAFStep
       
   117 	{
       
   118 public:
       
   119 	CCAFRenameFileStep(CCAFServer& aParent);
       
   120 	~CCAFRenameFileStep();
       
   121 	virtual TVerdict doTestStepL();
       
   122 private:
       
   123 	CCAFServer& iParent;
       
   124 	};
       
   125 
       
   126 /* 
       
   127 * Used to test CManager::MkDir()
       
   128 * The INI file specifies the file to delete and the expected return code.
       
   129 * For instance this can be used to try and delete a file that does not exist or a file
       
   130 * that is read-only or has rights that don't allow it to be deleted
       
   131 * INI file paramerters
       
   132 *
       
   133   path - the directory to create
       
   134   result - the expected return code
       
   135 *
       
   136 * @internalComponent Exposure internally
       
   137 */
       
   138 class CCAFMkDirStep : public CCAFStep
       
   139 	{
       
   140 public:
       
   141 	CCAFMkDirStep(CCAFServer& aParent);
       
   142 	~CCAFMkDirStep();
       
   143 	virtual TVerdict doTestStepL();
       
   144 private:
       
   145 	CCAFServer& iParent;
       
   146 	};
       
   147 
       
   148 /* 
       
   149 * Used to test CManager::MkDirAll()
       
   150 * The INI file specifies the file to delete and the expected return code.
       
   151 * For instance this can be used to try and delete a file that does not exist or a file
       
   152 * that is read-only or has rights that don't allow it to be deleted
       
   153 * INI file paramerters
       
   154 *
       
   155   path - the directory to create
       
   156   result - the expected return code
       
   157 *
       
   158 * @internalComponent Exposure internally
       
   159 */
       
   160 class CCAFMkDirAllStep : public CCAFStep
       
   161 	{
       
   162 public:
       
   163 	CCAFMkDirAllStep(CCAFServer& aParent);
       
   164 	~CCAFMkDirAllStep();
       
   165 	virtual TVerdict doTestStepL();
       
   166 private:
       
   167 	CCAFServer& iParent;
       
   168 	};
       
   169 
       
   170 /* 
       
   171 * Used to test CManager::RmDir()
       
   172 * The INI file specifies the file to delete and the expected return code.
       
   173 * For instance this can be used to try and delete a file that does not exist or a file
       
   174 * that is read-only or has rights that don't allow it to be deleted
       
   175 * INI file paramerters
       
   176 *
       
   177   path - the directory to create
       
   178   result - the expected return code
       
   179 *
       
   180 * @internalComponent Exposure internally
       
   181 */
       
   182 class CCAFRmDirStep : public CCAFStep
       
   183 	{
       
   184 public:
       
   185 	CCAFRmDirStep(CCAFServer& aParent);
       
   186 	~CCAFRmDirStep();
       
   187 	virtual TVerdict doTestStepL();
       
   188 private:
       
   189 	CCAFServer& iParent;
       
   190 	};
       
   191 
       
   192 /* 
       
   193 * Used to test CManager::GetDir()
       
   194 * The INI file specifies the file to delete and the expected return code.
       
   195 * For instance this can be used to try and delete a file that does not exist or a file
       
   196 * that is read-only or has rights that don't allow it to be deleted
       
   197 * INI file paramerters
       
   198 *
       
   199   path - the directory to list
       
   200   result - the expected return code
       
   201 *
       
   202 * @internalComponent Exposure internally
       
   203 */
       
   204 class CCAFGetDirStep : public CCAFStep
       
   205 	{
       
   206 public:
       
   207 	CCAFGetDirStep(CCAFServer& aParent);
       
   208 	~CCAFGetDirStep();
       
   209 	virtual TVerdict doTestStepL();
       
   210 private:
       
   211 	void DisplayList(CDir& aDir);
       
   212 	CCAFServer& iParent;
       
   213 	};
       
   214 
       
   215 
       
   216 /* 
       
   217 * Used to test CManager::NotifyStatusChange()
       
   218 * The INI file specifies the file to delete and the expected return code.
       
   219 * For instance this can be used to try and delete a file that does not exist or a file
       
   220 * that is read-only or has rights that don't allow it to be deleted
       
   221 * INI file paramerters
       
   222 *
       
   223   
       
   224   
       
   225 *
       
   226 * @internalComponent Exposure internally
       
   227 */
       
   228 class CCAFManagerNotifyStep : public CCAFStep
       
   229 	{
       
   230 public:
       
   231 	CCAFManagerNotifyStep(CCAFServer& aParent);
       
   232 	~CCAFManagerNotifyStep();
       
   233 	virtual TVerdict doTestStepL();
       
   234 private:
       
   235 	CCAFServer& iParent;
       
   236 	};
       
   237 
       
   238 /* 
       
   239 * Used to test CManager::SetProperty()
       
   240 * The INI file specifies the file to delete and the expected return code.
       
   241 * For instance this can be used to try and delete a file that does not exist or a file
       
   242 * that is read-only or has rights that don't allow it to be deleted
       
   243 * INI file paramerters
       
   244 *
       
   245   
       
   246   
       
   247 *
       
   248 * @internalComponent Exposure internally
       
   249 */
       
   250 class CCAFManagerSetPropertyStep : public CCAFStep
       
   251 	{
       
   252 public:
       
   253 	CCAFManagerSetPropertyStep(CCAFServer& aParent);
       
   254 	~CCAFManagerSetPropertyStep();
       
   255 	virtual TVerdict doTestStepL();
       
   256 private:
       
   257 	CCAFServer& iParent;
       
   258 	};
       
   259 
       
   260 /* 
       
   261 * Used to test CManager::DisplayInfo()
       
   262 * The INI file specifies the file to delete and the expected return code.
       
   263 * For instance this can be used to try and delete a file that does not exist or a file
       
   264 * that is read-only or has rights that don't allow it to be deleted
       
   265 * INI file paramerters
       
   266 *
       
   267   
       
   268   
       
   269 *
       
   270 * @internalComponent Exposure internally
       
   271 */
       
   272 class CCAFManagerDisplayInfoStep : public CCAFStep
       
   273 	{
       
   274 public:
       
   275 	CCAFManagerDisplayInfoStep(CCAFServer& aParent);
       
   276 	~CCAFManagerDisplayInfoStep();
       
   277 	virtual TVerdict doTestStepL();
       
   278 private:
       
   279 	CCAFServer& iParent;
       
   280 	};
       
   281 
       
   282 
       
   283 /* 
       
   284 * Used to test CManager::ListAgents()
       
   285 * The INI file specifies the file to delete and the expected return code.
       
   286 * For instance this can be used to try and delete a file that does not exist or a file
       
   287 * that is read-only or has rights that don't allow it to be deleted
       
   288 * INI file paramerters
       
   289 *
       
   290   
       
   291   
       
   292 *
       
   293 * @internalComponent Exposure internally
       
   294 */
       
   295 class CCAFManagerListAgentsStep : public CCAFStep
       
   296 	{
       
   297 public:
       
   298 	CCAFManagerListAgentsStep(CCAFServer& aParent);
       
   299 	~CCAFManagerListAgentsStep();
       
   300 	virtual TVerdict doTestStepL();
       
   301 private:
       
   302 	CCAFServer& iParent;
       
   303 	};
       
   304 
       
   305 
       
   306 
       
   307 /* 
       
   308 * Used to test CManager::AgentSpecificCommand()
       
   309 * The INI file specifies the file to delete and the expected return code.
       
   310 * For instance this can be used to try and delete a file that does not exist or a file
       
   311 * that is read-only or has rights that don't allow it to be deleted
       
   312 * INI file paramerters
       
   313 *
       
   314   
       
   315   
       
   316 *
       
   317 * @internalComponent Exposure internally
       
   318 */
       
   319 class CCAFManagerAgentSpecificStep : public CCAFStep
       
   320 	{
       
   321 public:
       
   322 	CCAFManagerAgentSpecificStep(CCAFServer& aParent);
       
   323 	~CCAFManagerAgentSpecificStep();
       
   324 	virtual TVerdict doTestStepL();
       
   325 private:
       
   326 	CCAFServer& iParent;
       
   327 	};
       
   328 
       
   329 
       
   330 /* 
       
   331 * Used to test CManager::DisplayManagentInfoL()
       
   332 * The INI file specifies the file to delete and the expected return code.
       
   333 * For instance this can be used to try and delete a file that does not exist or a file
       
   334 * that is read-only or has rights that don't allow it to be deleted
       
   335 * INI file paramerters
       
   336 *
       
   337   
       
   338   
       
   339 *
       
   340 * @internalComponent Exposure internally
       
   341 */
       
   342 class CCAFManagerDisplayConfigStep : public CCAFStep
       
   343 	{
       
   344 public:
       
   345 	CCAFManagerDisplayConfigStep(CCAFServer& aParent);
       
   346 	~CCAFManagerDisplayConfigStep();
       
   347 	virtual TVerdict doTestStepL();
       
   348 private:
       
   349 	CCAFServer& iParent;
       
   350 	};
       
   351 
       
   352 
       
   353 /* 
       
   354 * Used to test CManager::GetAttribute()
       
   355 * The INI file specifies the file to delete and the expected return code.
       
   356 * For instance this can be used to try and delete a file that does not exist or a file
       
   357 * that is read-only or has rights that don't allow it to be deleted
       
   358 * INI file paramerters
       
   359 *
       
   360   
       
   361   
       
   362 *
       
   363 * @internalComponent Exposure internally
       
   364 */
       
   365 class CCAFManagerAttributeStep : public CCAFStep
       
   366 	{
       
   367 public:
       
   368 	CCAFManagerAttributeStep(CCAFServer& aParent);
       
   369 	~CCAFManagerAttributeStep();
       
   370 	virtual TVerdict doTestStepL();
       
   371 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
       
   372     TVerdict doWmdrmTestStepL();     
       
   373 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT 
       
   374 private:
       
   375 	CCAFServer& iParent;
       
   376 	};
       
   377 
       
   378 /* 
       
   379 * Used to test CManager::GetAttributeSet()
       
   380 * The INI file specifies the file to delete and the expected return code.
       
   381 * For instance this can be used to try and delete a file that does not exist or a file
       
   382 * that is read-only or has rights that don't allow it to be deleted
       
   383 * INI file paramerters
       
   384 *
       
   385   
       
   386   
       
   387 *
       
   388 * @internalComponent Exposure internally
       
   389 */
       
   390 class CCAFManagerAttributeSetStep : public CCAFStep
       
   391 	{
       
   392 public:
       
   393 	CCAFManagerAttributeSetStep(CCAFServer& aParent);
       
   394 	~CCAFManagerAttributeSetStep();
       
   395 	virtual TVerdict doTestStepL();
       
   396 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
       
   397     TVerdict doWmdrmTestStepL();     
       
   398 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
       
   399   
       
   400 private:
       
   401 	CCAFServer& iParent;
       
   402 	};
       
   403 
       
   404 /* 
       
   405 * Used to test CManager::GetAttribute()
       
   406 * The INI file specifies the file to delete and the expected return code.
       
   407 * For instance this can be used to try and delete a file that does not exist or a file
       
   408 * that is read-only or has rights that don't allow it to be deleted
       
   409 * INI file paramerters
       
   410 *
       
   411   
       
   412   
       
   413 *
       
   414 * @internalComponent Exposure internally
       
   415 */
       
   416 class CCAFManagerStringAttributeStep : public CCAFStep
       
   417 	{
       
   418 public:
       
   419 	CCAFManagerStringAttributeStep(CCAFServer& aParent);
       
   420 	~CCAFManagerStringAttributeStep();
       
   421 	virtual TVerdict doTestStepL();
       
   422 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
       
   423     TVerdict doWmdrmTestStepL();     
       
   424 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
       
   425   
       
   426 private:
       
   427 	CCAFServer& iParent;
       
   428 	};
       
   429 
       
   430 /* 
       
   431 * Used to test CManager::GetStringAttributeSet()
       
   432 * The INI file specifies the file to delete and the expected return code.
       
   433 * For instance this can be used to try and delete a file that does not exist or a file
       
   434 * that is read-only or has rights that don't allow it to be deleted
       
   435 * INI file paramerters
       
   436 *
       
   437   
       
   438   
       
   439 *
       
   440 * @internalComponent Exposure internally
       
   441 */
       
   442 class CCAFManagerStringAttributeSetStep : public CCAFStep
       
   443 	{
       
   444 public:
       
   445 	CCAFManagerStringAttributeSetStep(CCAFServer& aParent);
       
   446 	~CCAFManagerStringAttributeSetStep();
       
   447 	virtual TVerdict doTestStepL();
       
   448 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
       
   449     TVerdict doWmdrmTestStepL();     
       
   450 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
       
   451   
       
   452 private:
       
   453 	CCAFServer& iParent;
       
   454 	};
       
   455 
       
   456 
       
   457 _LIT(KCAFContentIteratorStep,"CAFContentIteratorStep");
       
   458 
       
   459 
       
   460 /* 
       
   461 * Used to test CContentIterator
       
   462 * The INI file specifies the file to delete and the expected return code.
       
   463 * For instance this can be used to try and delete a file that does not exist or a file
       
   464 * that is read-only or has rights that don't allow it to be deleted
       
   465 * INI file paramerters
       
   466 *
       
   467   
       
   468   
       
   469 *
       
   470 * @internalComponent Exposure internally
       
   471 */
       
   472 class CCAFContentIteratorStep : public CCAFStep
       
   473 	{
       
   474 public:
       
   475 	CCAFContentIteratorStep(CCAFServer& aParent);
       
   476 	~CCAFContentIteratorStep();
       
   477 	virtual TVerdict doTestStepL();
       
   478 	void PrintResult(const TDesC& aFileName, const TDesC& aUniqueId, const TDesC& aMimeType);
       
   479 	
       
   480 private:
       
   481 	CCAFServer& iParent;
       
   482 	};
       
   483 
       
   484 
       
   485 /** Used by CCAFContentIteratorStep 
       
   486 */
       
   487 class CIteratorTestStateMachine : public CActive
       
   488 	{
       
   489 public:
       
   490 	CIteratorTestStateMachine(CCAFContentIteratorStep *aParent);
       
   491 	virtual ~CIteratorTestStateMachine();
       
   492 	
       
   493 	void RunTestL(const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType);
       
   494 		
       
   495 	// From CActive
       
   496 	virtual void RunL();
       
   497 	virtual void DoCancel();
       
   498 
       
   499 
       
   500 private:
       
   501 	HBufC *iPath;
       
   502 	HBufC8 *iMimeType;
       
   503 	TBool iRecursive;
       
   504 	ContentAccess::CContentIterator *iter;
       
   505 	CCAFContentIteratorStep *iParent;
       
   506 	TInt iState;
       
   507 	};
       
   508 
       
   509 
       
   510 /* 
       
   511 * Used to test CManager::DisplayInfo() (file handle overload)
       
   512 *
       
   513 * @internalComponent 
       
   514 */
       
   515 class CCAFManagerDisplayInfoByFileHandleStep : public CCAFStep
       
   516 	{
       
   517 public:
       
   518 	CCAFManagerDisplayInfoByFileHandleStep(CCAFServer& aParent);
       
   519 	~CCAFManagerDisplayInfoByFileHandleStep();
       
   520 	virtual TVerdict doTestStepL();
       
   521 private:
       
   522 	CCAFServer& iParent;
       
   523 	};
       
   524 
       
   525 /* 
       
   526 * Used to test CManager::GetAttribute() (file handle overload)
       
   527 *
       
   528 * @internalComponent Exposure internally
       
   529 */
       
   530 class CCAFManagerAttributeByFileHandleStep : public CCAFStep
       
   531 	{
       
   532 public:
       
   533 	CCAFManagerAttributeByFileHandleStep(CCAFServer& aParent);
       
   534 	~CCAFManagerAttributeByFileHandleStep();
       
   535 	virtual TVerdict doTestStepL();
       
   536 private:
       
   537 	CCAFServer& iParent;
       
   538 	};
       
   539 
       
   540 /* 
       
   541 * Used to test CManager::GetAttributeSet() (file handle overload)
       
   542 *
       
   543 * @internalComponent Exposure internally
       
   544 */
       
   545 class CCAFManagerAttributeSetByFileHandleStep : public CCAFStep
       
   546 	{
       
   547 public:
       
   548 	CCAFManagerAttributeSetByFileHandleStep(CCAFServer& aParent);
       
   549 	~CCAFManagerAttributeSetByFileHandleStep();
       
   550 	virtual TVerdict doTestStepL();
       
   551 private:
       
   552 	CCAFServer& iParent;
       
   553 	};
       
   554 
       
   555 /* 
       
   556 * Used to test CManager::GetAttribute() (file handle overload)
       
   557 *
       
   558 * @internalComponent Exposure internally
       
   559 */
       
   560 class CCAFManagerStringAttributeByFileHandleStep : public CCAFStep
       
   561 	{
       
   562 public:
       
   563 	CCAFManagerStringAttributeByFileHandleStep(CCAFServer& aParent);
       
   564 	~CCAFManagerStringAttributeByFileHandleStep();
       
   565 	virtual TVerdict doTestStepL();
       
   566 private:
       
   567 	CCAFServer& iParent;
       
   568 	};
       
   569 
       
   570 /* 
       
   571 * Used to test CManager::GetStringAttributeSet() (file handle overload)
       
   572 *
       
   573 * @internalComponent Exposure internally
       
   574 */
       
   575 class CCAFManagerStringAttributeSetByFileHandleStep : public CCAFStep
       
   576 	{
       
   577 public:
       
   578 	CCAFManagerStringAttributeSetByFileHandleStep(CCAFServer& aParent);
       
   579 	~CCAFManagerStringAttributeSetByFileHandleStep();
       
   580 	virtual TVerdict doTestStepL();
       
   581 private:
       
   582 	CCAFServer& iParent;
       
   583 	};
       
   584 
       
   585 #endif
       
   586