email/testutils/inc/T_UtilsEnumConverter.h
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     1 /**
       
     2 * Copyright (c) 2006-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 "Symbian Foundation License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * This is the header file which contains the utility to map the string to the 
       
    16 * corresponding enumerator value
       
    17 * 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 /**
       
    26  @file
       
    27 */
       
    28 
       
    29 
       
    30 #ifndef __T_UTILS_ENUM_CONVERTER_H__
       
    31 #define __T_UTILS_ENUM_CONVERTER_H__
       
    32 
       
    33 
       
    34 // User Include
       
    35 #include <t_testinstrumentation.h>
       
    36 
       
    37 // epoc inlcudes
       
    38 #include <cdbcols.h>
       
    39 #include <imapset.h>
       
    40 #include <smtpset.h>
       
    41 #include <pop3set.h>
       
    42 #include <imapcmds.h>
       
    43 #include <smtpcmds.h>
       
    44 
       
    45 // STR_SWITCH... STR_CASE... STR_SWITCH_END macro can be used as 
       
    46 // switch case that would take string.
       
    47 #define STR_SWITCH(str)  {\
       
    48         TBuf<100> __ps(str);\
       
    49         while(1) {
       
    50 
       
    51 #define STR_SWITCH_END()  break; } }
       
    52 
       
    53 #define STR_CASE(str) if(__ps == str)
       
    54 
       
    55 #define DEFAULT_CASE()
       
    56 
       
    57 
       
    58 /**
       
    59 CT_MsgUtilsEnumConverter is utility class used to map the string to the 
       
    60 corresponding enumerator value.
       
    61 */
       
    62 class CT_MsgUtilsEnumConverter
       
    63 	{
       
    64 public:
       
    65 	IMPORT_C CT_MsgUtilsEnumConverter();
       
    66 	~CT_MsgUtilsEnumConverter();
       
    67 	
       
    68 	//Utility functions
       
    69 
       
    70 	// Maps the local folder names to the corresponding folder Ids
       
    71 	IMPORT_C static TMsvId FindFolderIdByName( TDesC& aFolderName );
       
    72 
       
    73 	// Maps the  pop3 command names with the corresponding values
       
    74 	IMPORT_C static TPop3Cmds ConvertDesToTPop3Cmds( const TDesC& aPopCmdName );
       
    75 
       
    76 	// Maps the  Imap4 command names with the corresponding values
       
    77 	IMPORT_C static TImap4Cmds ConvertDesToTImap4Cmds(TDesC& aImapCmdName);
       
    78 	
       
    79 	// Maps the  SMTP command names with the corresponding values
       
    80 	IMPORT_C static TSmtpCmds ConvertDesToTSmtpCmdsL(TDesC& aSmtpCmdName);
       
    81 
       
    82 	// Maps the TCommDbDialogPref enumerations		
       
    83 	IMPORT_C static TCommDbDialogPref ConvertDesToTCommDbDialogPref( TDesC& aDialogPrefStr );
       
    84 	
       
    85 	// Maps the TImap4GetMailOptions enumerations	
       
    86 	IMPORT_C static TImap4GetMailOptions ConvertDesToTImap4GetMailOptions( TDesC& aMailOption );
       
    87 
       
    88 	// Maps the TFolderSyncType Enumerations	
       
    89 	IMPORT_C static TFolderSyncType ConvertDesToTFolderSyncType( TDesC& aFolderSyncType );
       
    90 	
       
    91 	// Maps the TFolderSubscribeType Enumerations	
       
    92 	IMPORT_C static TFolderSubscribeType ConvertDesToTFolderSubscribeType( TDesC& aFolderSubscriberType );
       
    93 
       
    94 	// Maps the TImImap4PartialMailOptions Enumerations
       
    95 	IMPORT_C static TImImap4PartialMailOptions ConvertDesToTImImap4PartialMailOptions( TDesC& aPartialMailOption );
       
    96 
       
    97 	// Maps the TMsgOutboxBodyEncoding enumerations							
       
    98 	IMPORT_C static TMsgOutboxBodyEncoding ConvertDesToTMsgOutboxBodyEncoding( TDesC& aOutboxBodyEncoding );  
       
    99 
       
   100 	// Maps the TImSMTPSendMessageOption Enumerations
       
   101 	IMPORT_C static TImSMTPSendMessageOption ConvertDesToTImSMTPSendMessageOption( TDesC& aSendMsgOption );
       
   102 
       
   103 	// Maps the TImSMTPSendCopyToSelf Enumerations
       
   104 	IMPORT_C static TImSMTPSendCopyToSelf ConvertDesToTImSMTPSendCopyToSelf( TDesC& aSmtpCopyToSelf );
       
   105 	
       
   106 	// Maps the TPop3GetMailOptions Enumerations
       
   107 	IMPORT_C static TPop3GetMailOptions ConvertDesToTPop3GetMailOptions( TDesC& aPop3MailOption );
       
   108 
       
   109 	// Maps the Eventcode strings to their numeric value
       
   110 	IMPORT_C static TInstrumentationPoint ConvertDesToEventCode(TDesC& aEventCodeString);
       
   111 
       
   112 	// Maps bearer types strings to their numeric values
       
   113 	IMPORT_C static TUint32 ConvertDesToBearerTypes(const TDesC& aBearerTypesString);
       
   114 	};
       
   115 #endif //__T_UTILS_ENUM_CONVERTER_H__