messagingfw/msgurlhandler/test/basic/inc/MailtoSchemeHandlerStateAccessor.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 1997-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 // The definition of the accessor class upon the CMailtoSchemeHandler
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @SYMCreationDate Created : 24/05/01 15:57:46
       
    21 */
       
    22 
       
    23 #ifndef __MAILTOSCHEMEHANDLERSTATEACCESSOR_H__
       
    24 #define __MAILTOSCHEMEHANDLERSTATEACCESSOR_H__
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <f32file.h>
       
    28 #include <s32stor.h>
       
    29 #include <s32file.h>
       
    30 
       
    31 #include <ecom/test_bed/testutilities.h>
       
    32 #include <ecom/test_bed/testbeddefinitions.h>
       
    33 #include <ecom/test_bed/stateaccessor.h>
       
    34 #include "MTSCHEME.H"
       
    35 
       
    36 // ______________________________________________________________________________
       
    37 //
       
    38 /**
       
    39 	@internalTechnology
       
    40 	@class
       
    41 	Comments : State accessor for the CMailtoSchemeHandler object under test.
       
    42  */
       
    43 class TMailtoSchemeHandler_StateAccessor : public MStateAccessor
       
    44 	{
       
    45 public:
       
    46 	/**
       
    47 		@fn				InvariantTest(TAny* aTestObject)
       
    48 		Intended Usage	:	
       
    49 		@since			6.0
       
    50 		@param			TAny* A pointer to the object under test.
       
    51 		@return			TInt KErrNone if the invariants were valid, error code otherwise.
       
    52 		@pre 			TMailtoSchemeHandler_StateAccessor is fully constructed.
       
    53 		@post			The class under test is set to the state specified.
       
    54 	 */
       
    55 	inline TInt InvariantTest(TAny* aTestObject);
       
    56 
       
    57 	/**
       
    58 		@fn				Internalize(TAny* aTestObject)
       
    59 		Intended Usage	: Implemented by the developer to set the state of the object under test.
       
    60 		@since			6.0
       
    61 		@param			aTestObject The object to be tested
       
    62 		@return			KErrNone if the internalize was successful.
       
    63 		@return			One of the EPOC standard error codes indicating the reason
       
    64 						for the failure	to load the object state.
       
    65 		@pre 			TMailtoSchemeHandler_StateAccessor is fully constructed, and
       
    66 						valid test object must be passed in.
       
    67 		@post			The class under test is set to the state specified
       
    68 	 */
       
    69 	inline virtual TInt Internalize(TAny* aTestObject);
       
    70 
       
    71 	/**
       
    72 		@fn				Externalize(TAny* aTestObject)
       
    73 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
       
    74 		@since			6.0
       
    75 		@param			aTestObject The object to be tested
       
    76 		@return			KErrNone if the internalize was successful.
       
    77 		@return			One of the EPOC standard error codes indicating the reason
       
    78 						for the failure	to externalize the object.
       
    79 		@pre 			TMailtoSchemeHandler_StateAccessor is fully constructed, and
       
    80 						valid test object must be passed in.
       
    81 		@post			Returns an error code dependant on the result of the test
       
    82 	 */
       
    83 	inline virtual TInt Externalize(TAny* aTestObject);
       
    84 
       
    85 	/**
       
    86 		@fn				InternalizeL(RFileReadStream& aStream, CMailtoSchemeHandler* aMailtoSchemeHandler)
       
    87 		Intended Usage	: Implemented by the developer to set the state of the object under test.
       
    88 		Error Condition	: Leaves with an error code.
       
    89 		@since			6.0
       
    90 		@param			aStream The filestream to read from .
       
    91 		@param			aMailtoSchemeHandler A pointer to the CMailtoSchemeHandler object under test.
       
    92 		@return			None.
       
    93 		@pre 			TMailtoSchemeHandler_StateAccessor is fully constructed.
       
    94 		@post			The class under test is set to the state specified.
       
    95 	 */
       
    96 		inline void InternalizeL(RFileReadStream& aStream, CMailtoSchemeHandler* aMailtoSchemeHandler);
       
    97 
       
    98 	/**
       
    99 		@fn				ExternalizeL(RFileWriteStream& aStream, CMailtoSchemeHandler* aMailtoSchemeHandler)
       
   100 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
       
   101 		Error Condition	: Leaves with an error code.
       
   102 		@since			6.0
       
   103 		@param			aStream The filestream to persist into.
       
   104 		@param			aMailtoSchemeHandler A pointer to the CMailtoSchemeHandler object under test.
       
   105 		@return			None.
       
   106 		@pre 			TMailtoSchemeHandler_StateAccessor is fully constructed.
       
   107 		@post			No change to the class under test, its internal state.
       
   108 						is persisted.
       
   109 	*/
       
   110 	inline void ExternalizeL(RFileWriteStream& aStream, CMailtoSchemeHandler* aMailtoSchemeHandler);
       
   111 
       
   112 	inline void ParseUrlL(CMailtoSchemeHandler& aMailTo, const TDesC& aUrl);
       
   113 
       
   114 	inline RArray<TPtrC>& GetRecipientArray(CMailtoSchemeHandler& aMailTo);
       
   115 
       
   116 	inline TPtrC& GetSubject(CMailtoSchemeHandler& aMailTo);
       
   117 
       
   118 	inline TPtrC& GetBody(CMailtoSchemeHandler& aMailTo);
       
   119 
       
   120 
       
   121 private:
       
   122 	/**
       
   123 		@fn				InternalizeL(CMailtoSchemeHandler* aMailtoSchemeHandler)
       
   124 		Intended Usage	: Implemented by the developer to set the state of the object under test.
       
   125 		Error Condition	: Leaves with an error code.
       
   126 		@since			6.0
       
   127 		@param			TAny* A pointer to the object under test.
       
   128 		@return			None.
       
   129 		@pre 			TMailtoSchemeHandler_StateAccessor is fully constructed.
       
   130 		@post			The class under test is set to the state specified.
       
   131 	*/
       
   132 	inline void InternalizeL(CMailtoSchemeHandler* aMailtoSchemeHandler);
       
   133 
       
   134 	/**
       
   135 		@fn				ExternalizeL(CMailtoSchemeHandler* aMailtoSchemeHandler)
       
   136 		Intended Usage	: Implemented by the developer to persist the state of the object under test.
       
   137 		Error Condition	: Leaves with an error code.
       
   138 		@since			6.0
       
   139 		@param			TAny* A pointer to the object under test.
       
   140 		@return			None.
       
   141 		@pre 			TMailtoSchemeHandler_StateAccessor is fully constructed.
       
   142 		@post			No change to the class under test, its internal state.
       
   143 						is persisted.
       
   144 	*/
       
   145 	inline void ExternalizeL(CMailtoSchemeHandler* aMailtoSchemeHandler);
       
   146 	};	// TMailtoSchemeHandler_StateAccessor
       
   147 
       
   148 #include "MailtoSchemeHandlerStateAccessor.inl"
       
   149 
       
   150 #endif // __MAILTOSCHEMEHANDLERSTATEACCESSOR_H__
       
   151