uiservicetab/vimpststorage/tsrc/vimpststorage_ut/inc/vimpststorage_test.h
branchRCL_3
changeset 30 2b4be3554d30
equal deleted inserted replaced
29:9a48e301e94b 30:2b4be3554d30
       
     1 /*
       
     2 * Copyright (c) 2002 - 2007 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 "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 
       
    22 #ifndef VIMPSTSTORAGE_TEST_H
       
    23 #define VIMPSTSTORAGE_TEST_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <StifLogger.h>
       
    27 #include <TestScripterInternal.h>
       
    28 #include <StifTestModule.h>
       
    29 #include <cntdef.h>
       
    30 
       
    31 #include "mvimpststoragecontactsobserver.h"
       
    32 #include "MVIMPSTStorageContactManagementObserver.h"
       
    33 #include "mvimpststoragecontact.h"
       
    34 #include <MVPbkContactObserver.h>
       
    35 
       
    36 //const ?type ?constant_var = ?constant;
       
    37 
       
    38 // MACROS
       
    39 //#define ?macro ?macro_def
       
    40 // Logging path
       
    41 _LIT( Kvimpststorage_testLogPath, "\\logs\\testframework\\vimpststorage_test\\" ); 
       
    42 // Log file
       
    43 _LIT( Kvimpststorage_testLogFile, "vimpststorage_test.txt" ); 
       
    44 _LIT( Kvimpststorage_testLogFileWithTitle, "vimpststorage_test_[%S].txt" );
       
    45 
       
    46 // FUNCTION PROTOTYPES
       
    47 //?type ?function_name(?arg_list);
       
    48 
       
    49 // FORWARD DECLARATIONS
       
    50 //class ?FORWARD_CLASSNAME;
       
    51 class Cvimpststorage_test;
       
    52 class MVIMPSTStorageContacts;
       
    53 class MVIMPSTStorageContactList;
       
    54 class MVIMPSTStorageItemModel;
       
    55 // DATA TYPES
       
    56 //enum ?declaration
       
    57 //typedef ?declaration
       
    58 //extern ?data_type;
       
    59 
       
    60 // CLASS DECLARATION
       
    61 class CContactDatabase;
       
    62 class CContactIdArray;
       
    63 /**
       
    64 *  Cvimpststorage_test test class for STIF Test Framework TestScripter.
       
    65 *  ?other_description_lines
       
    66 *
       
    67 *  @lib ?library
       
    68 *  @since ?Series60_version
       
    69 */
       
    70 NONSHARABLE_CLASS(Cvimpststorage_test) : public CScriptBase,
       
    71 										public MVIMPSTStorageContactsObserver,
       
    72 										public MVIMPSTStorageContactManagementObserver,
       
    73 										public MVPbkContactObserver,
       
    74 										public MVIMPSTContactOperationCompleteObserver
       
    75     {
       
    76     public:  // Constructors and destructor
       
    77 
       
    78         /**
       
    79         * Two-phased constructor.
       
    80         */
       
    81         static Cvimpststorage_test* NewL( CTestModuleIf& aTestModuleIf );
       
    82 
       
    83         /**
       
    84         * Destructor.
       
    85         */
       
    86         virtual ~Cvimpststorage_test();
       
    87 
       
    88     public: // New functions
       
    89 
       
    90         /**
       
    91         * ?member_description.
       
    92         * @since ?Series60_version
       
    93         * @param ?arg1 ?description
       
    94         * @return ?description
       
    95         */
       
    96         //?type ?member_function( ?type ?arg1 );
       
    97 
       
    98     public: // Functions from base classes
       
    99 
       
   100         /**
       
   101         * From CScriptBase Runs a script line.
       
   102         * @since ?Series60_version
       
   103         * @param aItem Script line containing method name and parameters
       
   104         * @return Symbian OS error code
       
   105         */
       
   106         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   107 
       
   108     protected:  // New functions
       
   109 
       
   110         /**
       
   111         * ?member_description.
       
   112         * @since ?Series60_version
       
   113         * @param ?arg1 ?description
       
   114         * @return ?description
       
   115         */
       
   116         //?type ?member_function( ?type ?arg1 );
       
   117 
       
   118     protected:  // Functions from base classes
       
   119 
       
   120         /**
       
   121         * From ?base_class ?member_description
       
   122         */
       
   123         //?type ?member_function();
       
   124 
       
   125     private:
       
   126 
       
   127         /**
       
   128         * C++ default constructor.
       
   129         */
       
   130         Cvimpststorage_test( CTestModuleIf& aTestModuleIf );
       
   131 
       
   132         /**
       
   133         * By default Symbian 2nd phase constructor is private.
       
   134         */
       
   135         void ConstructL();
       
   136 
       
   137         // Prohibit copy constructor if not deriving from CBase.
       
   138         // ?classname( const ?classname& );
       
   139         // Prohibit assigment operator if not deriving from CBase.
       
   140         // ?classname& operator=( const ?classname& );
       
   141 
       
   142         /**
       
   143         * Frees all resources allocated from test methods.
       
   144         * @since ?Series60_version
       
   145         */
       
   146         void Delete();                           
       
   147         
       
   148         TInt InitialiseLibraryTestL( CStifItemParser& aItem  );
       
   149              
       
   150         TInt InitialiseViewTestL( CStifItemParser& aItem  );
       
   151         
       
   152         TInt CVIMPSTStorageContactTestCase1L();
       
   153         
       
   154         TInt CVIMPSTStorageContactTestCase2L();
       
   155         
       
   156         TInt CVIMPSTStorageContactTestCase3L();
       
   157 		
       
   158 		TInt CVIMPSTStorageContactTestCase4L();			
       
   159 		
       
   160 		TInt CVIMPSTStorageContactTestCase6L();
       
   161 		
       
   162 		TInt CVIMPSTStorageContactTestCase7L();
       
   163 		
       
   164 		TInt CVIMPSTStorageContactTestCase8L();
       
   165 		
       
   166 		TInt CVIMPSTStorageContactTestCase9L();
       
   167 		
       
   168 		TInt CVIMPSTStorageContactTestCase10L();
       
   169 		
       
   170 		TInt CVIMPSTStorageContactTestCase11L();
       
   171 		TInt CVIMPSTStorageContactTestCase12L();
       
   172 		TInt CVIMPSTStorageContactTestCase13L();
       
   173 		TInt CVIMPSTStorageContactTestCase14L();
       
   174 		TInt CVIMPSTStorageContactTestCase15L();
       
   175 		TInt CVIMPSTStorageContactListTestCase16L();
       
   176 		TInt CVIMPSTStorageContactListTestCase17L();
       
   177 		TInt CVIMPSTStorageContactListTestCase18L();
       
   178 		TInt CVIMPSTStorageContactListTestCase19L();
       
   179 		TInt CVIMPSTStorageContactListTestCase20L();
       
   180 		
       
   181 		TInt CVIMPSTStorageContactListTestCase21L();
       
   182 		
       
   183 		TInt CVIMPSTStorageXSPStoreHandlerTestCase01L();
       
   184         //[TestMethods] - Do not remove
       
   185 
       
   186     public: // New functions
       
   187 
       
   188         /**
       
   189          * Called when a contact is deleted.
       
   190          * @param aId The ID of the deleted contact
       
   191          * @param aFromPEC, ETrue, if event is coming from PEC
       
   192          */
       
   193          void HandleContactDeleteL( const TDesC& aContactId );
       
   194 
       
   195         /**
       
   196          * Called when a contact is added.
       
   197          * @param aList. List for contact that was added.
       
   198          * @param aContact The contact which was added
       
   199          * @param aFromPEC, ETrue, if event is coming from PEC
       
   200          */
       
   201          void HandleAdditionL( MVIMPSTStorageContactList& aList, MVIMPSTStorageContact& aContact );
       
   202 
       
   203         /**
       
   204          * Called when a contact or list is about to change, or has been changed.
       
   205          * @param aList List that is changed. Can be NULL if contact is changed.
       
   206          * @param aContact Contact that is changed. Can be NULL if list is changed
       
   207          * @param aEventType The type of event: EStorageEventPreChange before
       
   208          * the change (contact still has the old information), or
       
   209          * EStorageEventPostChange after the change took place 
       
   210          * (contact has new information)
       
   211          */
       
   212          void HandleChangeL( MVIMPSTStorageContactList* aList, MVIMPSTStorageContact* aContact,
       
   213                 TVIMPSTEnums::TCAObserverEventType aEventType,
       
   214                 TBool aUserIdChanged );
       
   215 
       
   216 	public:
       
   217 		/**
       
   218          * Called when all the contacts are fetched
       
   219          */
       
   220         void HandleContactAddedL(RPointerArray<HBufC>& aServiceDetails);  
       
   221         
       
   222         /**
       
   223          * Called when all the contacts are fetched
       
   224          */
       
   225         void HandleContactDeletedL(RPointerArray<HBufC>& aServiceDetails);  
       
   226         
       
   227         void HandleContactOperationCompleteL( MVIMPSTStorageContact& aContact, TInt aError = KErrNone );        
       
   228         				
       
   229         /**
       
   230          * From  MVPbkContactObserver
       
   231          */
       
   232         void ContactOperationCompleted(TContactOpResult aResult);
       
   233 
       
   234         /**
       
   235          * From MVPbkContactObserver
       
   236          */
       
   237         void ContactOperationFailed
       
   238             (TContactOp aOpCode, TInt aErrorCode, TBool aErrorNotified);
       
   239 
       
   240 
       
   241     protected:  // Data
       
   242         // ?one_line_short_description_of_data
       
   243         //?data_declaration;
       
   244 
       
   245     private:    // Data
       
   246         
       
   247         // ?one_line_short_description_of_data
       
   248         //?data_declaration;
       
   249 
       
   250         // Reserved pointer for future extension
       
   251         //TAny* iReserved;
       
   252 
       
   253     public:     // Friend classes
       
   254         //?friend_class_declaration;
       
   255     protected:  // Friend classes
       
   256         //?friend_class_declaration;
       
   257     private:    // Friend classes
       
   258         //?friend_class_declaration;
       
   259 
       
   260         CActiveScheduler*    		iActive;  
       
   261         
       
   262         TBool iObserverReceivedNotification;  
       
   263     };
       
   264 
       
   265 #endif      // VIMPSTSTORAGE_TEST_H
       
   266 
       
   267 // End of File