contacts_plat/phonebook_2_contact_related_icon_customization_api/tsrc/inc/CIconCustomApiTestModule.h
branchRCL_3
changeset 6 e8e3147d53eb
equal deleted inserted replaced
5:81f8547efd4f 6:e8e3147d53eb
       
     1 /*
       
     2 * Copyright (c) 2008-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 "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 #ifndef CICONCUSTOMAPITESTMODULE_H
       
    18 #define CICONCUSTOMAPITESTMODULE_H
       
    19 
       
    20 //  INCLUDES
       
    21 #include <fbs.h>
       
    22 
       
    23 #include <StifLogger.h>
       
    24 #include <StifTestModule.h>
       
    25 #include <TestScripterInternal.h>
       
    26 #include <MCustomIconChangeObserver.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CContactCustomIconPluginBase;
       
    30 class CCustomIconIdMap;
       
    31 class CGulIcon;
       
    32 
       
    33 // CONSTANTS
       
    34 // Logging
       
    35 _LIT( KTestModuleLogPath, "\\logs\\testframework\\" );
       
    36 _LIT( KTestModuleLogFile, "IconCustomizationApiTest.log" );
       
    37 
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  CIconCustomApiTestModule test class for STIF Test Framework TestScripter.
       
    43 *
       
    44 *  @lib ?library
       
    45 *  @since ?Series60_version
       
    46 */
       
    47 class CIconCustomApiTestModule : public CScriptBase,
       
    48                                  public MCustomIconChangeObserver
       
    49     {
       
    50     public:  // Public construction and destruction
       
    51 
       
    52         /**
       
    53         * Two-phased constructor.
       
    54         */
       
    55         static CIconCustomApiTestModule* NewL( CTestModuleIf& aTestModuleIf );
       
    56 
       
    57         /**
       
    58         * Destructor.
       
    59         */
       
    60         virtual ~CIconCustomApiTestModule();
       
    61 
       
    62     public: // Functions from base CScriptBase
       
    63 
       
    64         /**
       
    65         * From CScriptBase Runs a script line.
       
    66         * @since ?Series60_version
       
    67         * @param aItem Script line containing method name and parameters
       
    68         * @return Symbian OS error code
       
    69         */
       
    70         virtual TInt RunMethodL( CStifItemParser& aItem );
       
    71 
       
    72     public: // Functions from MCustomIconChangeObserver
       
    73 
       
    74         /**
       
    75          * Icon change notification handler
       
    76          */
       
    77         void CustomIconEvent( CContactCustomIconPluginBase& aPlugin,
       
    78             TEventType aEventType,
       
    79             const TArray<TCustomIconId>& aIconIds );
       
    80 
       
    81     private: // Private construction
       
    82 
       
    83         /**
       
    84         * C++ default constructor.
       
    85         */
       
    86         CIconCustomApiTestModule( CTestModuleIf& aTestModuleIf );
       
    87 
       
    88         /**
       
    89         * By default Symbian 2nd phase constructor is private.
       
    90         */
       
    91         void ConstructL();
       
    92 
       
    93     private: // Test methods
       
    94 
       
    95         TInt LoadTestPluginL( CStifItemParser& aItem );
       
    96         TInt LoadIconsL( CStifItemParser& aItem );
       
    97         TInt LoadIconL( CStifItemParser& aItem );
       
    98         TInt UpdateIconsWithLastIconIdsL( CStifItemParser& aItem );
       
    99         TInt DeleteIconsL( CStifItemParser& aItem );
       
   100         TInt DeleteIconL( CStifItemParser& aItem );
       
   101         TInt IconChoiceL( CStifItemParser& aItem );
       
   102         TInt SetPsProperty( CStifItemParser& aItem );
       
   103         TInt DeletePsProperty( CStifItemParser& aItem );
       
   104         TInt SetTestCaseAsObserverL( CStifItemParser& aItem );
       
   105         TInt CheckIfHasExtensionL( CStifItemParser& aItem );
       
   106 
       
   107     private: // Helpers
       
   108         void CleanupPsKeys();
       
   109 
       
   110     private: // Members
       
   111         CContactCustomIconPluginBase* iTestPlugin;
       
   112         CCustomIconIdMap* iIcons;
       
   113         CGulIcon* iIcon;
       
   114         RFbsSession iFbsSession; // For CFbsBitmap loading/handling support in the plugin        
       
   115         RArray<TInt> iPublishedPsKeys;
       
   116         MCustomIconChangeObserver::TEventType iLastEventType;
       
   117         RArray<TCustomIconId> iLastIconIds;
       
   118     };
       
   119 
       
   120 #endif // CICONCUSTOMAPITESTMODULE_H
       
   121 
       
   122 // End of File