idlefw/tsrc/ai_utilities_api/inc/mt_apiaipluginsettings.h
branchRCL_3
changeset 28 053c6c7c14f3
equal deleted inserted replaced
27:2c7f27287390 28:053c6c7c14f3
       
     1 /*
       
     2 * Copyright (c) 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 
       
    18 #ifndef __MT_ApiAiPluginSettings_H__
       
    19 #define __MT_ApiAiPluginSettings_H__
       
    20 
       
    21 //  EXTERNAL INCLUDES
       
    22 #include <digia/eunit/ceunittestsuiteclass.h>
       
    23 #include <aipluginsettings.h>
       
    24 
       
    25 //  INTERNAL INCLUDES
       
    26 
       
    27 
       
    28 //  FORWARD DECLARATIONS
       
    29 class MAiPluginSettings;
       
    30 class MAiPluginSettingsItem;
       
    31 class MAiPluginContentItem;
       
    32 class MAiPluginConfigurationItem;
       
    33 
       
    34 
       
    35 #include <e32def.h>
       
    36 #ifndef NONSHARABLE_CLASS
       
    37     #define NONSHARABLE_CLASS(x) class x
       
    38 #endif
       
    39 
       
    40 //  CLASS DEFINITION
       
    41 /**
       
    42  *
       
    43  * EUnitWizard generated test class. 
       
    44  *
       
    45  */
       
    46 NONSHARABLE_CLASS( MT_ApiAiPluginSettings )
       
    47      : public CEUnitTestSuiteClass
       
    48     {
       
    49     public:     // Constructors and destructors
       
    50 
       
    51         /**
       
    52          * Two phase construction
       
    53          */
       
    54         static MT_ApiAiPluginSettings* NewL();
       
    55         static MT_ApiAiPluginSettings* NewLC();
       
    56         /**
       
    57          * Destructor
       
    58          */
       
    59         ~MT_ApiAiPluginSettings();
       
    60 
       
    61     private:    // Constructors and destructors
       
    62 
       
    63         MT_ApiAiPluginSettings();
       
    64         void ConstructL();
       
    65 
       
    66     public:     // From observer interface
       
    67 
       
    68         
       
    69 
       
    70     private:    // New methods
       
    71 
       
    72          void SetupL();
       
    73          
       
    74          void Teardown();
       
    75         
       
    76          void TestAiPluginSettingsItemL();
       
    77          
       
    78          void TestAiPluginContentItemL();
       
    79          
       
    80          void TestAiPluginConfigurationItemL();
       
    81          
       
    82          void TestAiPluginSettingsStorerBasicL();
       
    83 
       
    84     private:    // Data
       
    85 
       
    86         EUNIT_DECLARE_TEST_TABLE; 
       
    87         MAiPluginSettings* iAiPluginSettings;
       
    88 
       
    89     };
       
    90 
       
    91 /**
       
    92  *
       
    93  * Additional test class.
       
    94  * Emulates basic storing functionality
       
    95  * 
       
    96  */
       
    97 NONSHARABLE_CLASS( TStorer ): public MAiPluginSettingsStorer
       
    98     {
       
    99     public:    
       
   100         TStorer( );
       
   101         ~TStorer( );
       
   102         
       
   103         // derived from MAiPluginSettingsStorer
       
   104         void SaveL( TInt32 aKey, const TDesC& aValue );
       
   105         void ReadL( TInt32 aKey, TDes& aValue );
       
   106         // functions to set and read values
       
   107         void SetKey( TInt32 aKey );
       
   108         void SetValue( const TDesC aValue );
       
   109         void GetKey( TInt32& aKey );
       
   110         void GetValue( TDes& aValue );
       
   111     private:
       
   112         TInt32 iKey;
       
   113         TBuf<40> iValue;
       
   114     };
       
   115 
       
   116 #endif      //  __MT_ApiAiPluginSettings_H__
       
   117 
       
   118 // End of file