customization/tsrc/tarmcustomization/inc/TestParams.h
changeset 0 3ce708148e4d
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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: Implementation of customization components
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __TESTPARAMS_H
       
    21 #define __TESTPARAMS_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <smldmadapter.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CStifLogger;
       
    29 class CStifItemParser;
       
    30 class CTestDmCallback;
       
    31 class CTestDmDDFObject;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 *  ?one_line_short_description.
       
    37 *  ?other_description_lines
       
    38 *
       
    39 *  @lib ?library
       
    40 *  @since Series ?XX ?SeriesXX_version
       
    41 */
       
    42 class CTestParamsBase : public CBase
       
    43     {
       
    44     public:  // Constructors and destructor
       
    45 
       
    46         /**
       
    47         * Destructor.
       
    48         */
       
    49 		virtual ~CTestParamsBase();
       
    50 
       
    51     public: // New functions
       
    52         
       
    53 		TInt CheckStatusL( TInt aStatus );
       
    54 		TInt CheckDataL( CBufBase& aObject );
       
    55 		TInt CheckTypeL( const TDesC8 &aType );
       
    56 
       
    57 		TInt CheckL( CTestDmCallback* aCallback );
       
    58 		TInt CheckAllL( CTestDmCallback* aCallback );
       
    59 
       
    60 		TInt CheckResultsRefL( TInt resultsRef );
       
    61 		TInt CheckStatusRefL( TInt statusRef );
       
    62 
       
    63     public: // Functions from base classes
       
    64 
       
    65 		virtual TInt SetParam( TInt xxx ) = 0;	
       
    66 		
       
    67     protected:  // New functions
       
    68 
       
    69         /**
       
    70         * Symbian 2nd phase constructor
       
    71         */
       
    72 		void ConstructL( CStifItemParser& aItem );
       
    73 
       
    74     private:
       
    75 
       
    76         /**
       
    77         * C++ default constructor.
       
    78         */
       
    79 		CTestParamsBase( CStifLogger *aLog );
       
    80 
       
    81     protected:  // Data
       
    82 
       
    83 		CStifLogger* iLog;
       
    84     };
       
    85 
       
    86 /**
       
    87 *  ?one_line_short_description.
       
    88 *  ?other_description_lines
       
    89 *
       
    90 *  @lib ?library
       
    91 *  @since Series ?XX ?SeriesXX_version
       
    92 */
       
    93 class CTestParams : public CBase
       
    94     {
       
    95     public:  // Constructors and destructor
       
    96         
       
    97         /**
       
    98         * Two-phased constructor.
       
    99         */
       
   100 		static CTestParams* NewL( CStifLogger *aLog, CStifItemParser& aItem );
       
   101 		static CTestParams* NewLC( CStifLogger *aLog, CStifItemParser& aItem );
       
   102         
       
   103         /**
       
   104         * Destructor.
       
   105         */
       
   106 		virtual ~CTestParams();
       
   107 
       
   108     public: // New functions
       
   109         
       
   110 		const TDesC8& Uri();
       
   111 		const TDesC8& Data();
       
   112 		const TDesC8& DataType();
       
   113 		
       
   114 		void SetResultsRef( TInt resultsRef );
       
   115 		void SetStatusRef( TInt statusRef );
       
   116 
       
   117 		TInt CheckStatusL( TInt aStatus );
       
   118 		TInt CheckDataL( CBufFlat& aObject );
       
   119 		TInt CheckDataL( const TDesC8& aObject );
       
   120 		TInt CheckTypeL( const TDesC8 &aType );
       
   121 
       
   122 		TInt CheckL( CTestDmCallback* aCallback );
       
   123 		TInt CheckAllL( CTestDmCallback* aCallback );
       
   124 
       
   125 		TInt CheckResultsRefL( TInt resultsRef );
       
   126 		TInt CheckStatusRefL( TInt statusRef );
       
   127 
       
   128     protected:  // Functions from base classes
       
   129         
       
   130         /**
       
   131         * From ?base_class ?member_description
       
   132         */
       
   133         //?type ?member_function();
       
   134 
       
   135     private:
       
   136 
       
   137         /**
       
   138         * C++ default constructor.
       
   139         */
       
   140 		CTestParams( CStifLogger *aLog );
       
   141 
       
   142         /**
       
   143         * By default Symbian 2nd phase constructor is private.
       
   144         */
       
   145 		void ConstructL( CStifItemParser& aItem );
       
   146 
       
   147     protected:  // Data
       
   148 
       
   149 		CStifLogger* iLog;
       
   150 
       
   151     private:    // Data
       
   152 
       
   153 		TPtrC iStr;
       
   154 
       
   155 		HBufC8* iUri;
       
   156 		HBufC8* iData;
       
   157 		HBufC8* iDataType;
       
   158 
       
   159 		HBufC8* iOutputFile;
       
   160 
       
   161 		TInt iExpectedStatus;
       
   162 		HBufC8* iExpectedData;
       
   163 		HBufC8* iExpectedType;
       
   164 
       
   165 		TInt iStatusRef;
       
   166 		TInt iResultsRef;
       
   167 
       
   168     };
       
   169 
       
   170 /**
       
   171 *  ?one_line_short_description.
       
   172 *  ?other_description_lines
       
   173 *
       
   174 *  @lib ?library
       
   175 *  @since Series ?XX ?SeriesXX_version
       
   176 */
       
   177 class CDDFTestParams : public CBase
       
   178     {
       
   179     public:  // Constructors and destructor
       
   180         
       
   181         /**
       
   182         * Two-phased constructor.
       
   183         */
       
   184 		static CDDFTestParams* NewL( CStifLogger *aLog, CStifItemParser& aItem );
       
   185 		static CDDFTestParams* NewLC( CStifLogger *aLog, CStifItemParser& aItem );
       
   186         
       
   187         /**
       
   188         * Destructor.
       
   189         */
       
   190 		virtual ~CDDFTestParams();
       
   191 
       
   192     public: // New functions
       
   193 
       
   194 		TInt GetAccessTypesL( TSmlDmAccessTypes& aAccessTypes );
       
   195 		TInt GetDefaultValueL( TPtrC8& aDefaultValue );
       
   196 		TInt GetDescriptionL( TPtrC8& aDescription );
       
   197 		TInt GetDFFormatL( MSmlDmDDFObject::TDFFormat& aFormat );
       
   198 		TInt GetOccurenceL( MSmlDmDDFObject::TOccurence& aOccurence );
       
   199 		TInt GetScopeL( MSmlDmDDFObject::TScope& aScope );
       
   200 		TInt GetDFTitleL( TPtrC8& aTitle );
       
   201 		TInt GetDFTypeMimeTypeL( TPtrC8& aMimeType );
       
   202 
       
   203 		TInt NodeCount();
       
   204 		TAny* Node( TInt aIndex );
       
   205 
       
   206 		const TDesC8& Uri();
       
   207 		const TDesC8& Data();
       
   208 		const TDesC8& DataType();
       
   209 
       
   210 		void SetResultsRef( TInt resultsRef );
       
   211 		void SetStatusRef( TInt statusRef );
       
   212 
       
   213 		TInt CheckL( CTestDmDDFObject* aDdfRoot );
       
   214 
       
   215     private:
       
   216 
       
   217         /**
       
   218         * C++ default constructor.
       
   219         */
       
   220 		CDDFTestParams( CStifLogger *aLog );
       
   221 
       
   222         /**
       
   223         * By default Symbian 2nd phase constructor is private.
       
   224         */
       
   225 		void ConstructL( CStifItemParser& aItem );
       
   226 
       
   227     protected:  // Data
       
   228 
       
   229 		CStifLogger* iLog;
       
   230 
       
   231     private:    // Data
       
   232         // ?one_line_short_description_of_data
       
   233         //?data_declaration;
       
   234 		HBufC8* iUri;
       
   235 		TSmlDmAccessTypes iAccessTypes;
       
   236 		HBufC8* iDefaultValue;
       
   237 		HBufC8* iDescription;
       
   238 		MSmlDmDDFObject::TDFFormat iFormat;
       
   239 		MSmlDmDDFObject::TOccurence iOccurence;
       
   240 		MSmlDmDDFObject::TScope iScope;
       
   241 		HBufC8* iTitle;
       
   242 		HBufC8* iMimeType;
       
   243 		TInt iObjectGroup;
       
   244     };
       
   245 
       
   246 
       
   247 
       
   248 
       
   249 /**
       
   250 *  ?one_line_short_description.
       
   251 *  ?other_description_lines
       
   252 *
       
   253 *  @lib ?library
       
   254 *  @since Series ?XX ?SeriesXX_version
       
   255 */
       
   256 class TTestParamVar
       
   257     {
       
   258     public:  // Constructors and destructor
       
   259 
       
   260         /**
       
   261         * Constructors.
       
   262         */
       
   263 		TTestParamVar( const TDesC8 &aStr );
       
   264 
       
   265         /**
       
   266         * Two-phased constructor.
       
   267         */
       
   268 //		static CTestParams* NewL( CStifLogger *aLog, CStifItemParser& aItem );
       
   269 //		static CTestParams* NewLC( CStifLogger *aLog, CStifItemParser& aItem );
       
   270         
       
   271         /**
       
   272         * Destructor.
       
   273         */
       
   274 //		virtual ~TTestParamVar();
       
   275 
       
   276     public: // New functions
       
   277         
       
   278         /**
       
   279         * ?member_description.
       
   280         * @since Series ?XX ?SeriesXX_version
       
   281         * @param ?arg1 ?description
       
   282         * @return ?description
       
   283         */
       
   284         //?type ?member_function( ?type ?arg1 );
       
   285 		TBool Next();
       
   286 		const TDesC8& Name();
       
   287 		const TDesC8& Value();
       
   288 		TBool ValueExist();
       
   289 
       
   290     public: // Functions from base classes
       
   291 
       
   292     protected:  // New functions
       
   293         
       
   294         /**
       
   295         * ?member_description.
       
   296         * @since Series ?XX ?SeriesXX_version
       
   297         * @param ?arg1 ?description
       
   298         * @return ?description
       
   299         */
       
   300         //?type ?member_function( ?type ?arg1 );
       
   301 		TChar GetChar();
       
   302 		void UnGetChar();
       
   303 		TPtrC8 GetWord();
       
   304 
       
   305     protected:  // Functions from base classes
       
   306         
       
   307         /**
       
   308         * From ?base_class ?member_description
       
   309         */
       
   310         //?type ?member_function();
       
   311 
       
   312     private:
       
   313 
       
   314         /**
       
   315         * C++ default constructor.
       
   316         */
       
   317 		TTestParamVar();
       
   318 
       
   319         /**
       
   320         * By default Symbian 2nd phase constructor is private.
       
   321         */
       
   322 //		void ConstructL( CStifItemParser& aItem );
       
   323 
       
   324         // Prohibit copy constructor if not deriving from CBase.
       
   325         // CTestParams( const CTestParams& );
       
   326         // Prohibit assigment operator if not deriving from CBase.
       
   327         // CTestParams& operator=( const CTestParams& );
       
   328 
       
   329     public:     // Data
       
   330         // ?one_line_short_description_of_data
       
   331         //?data_declaration;
       
   332 		CStifLogger* iLog;
       
   333     
       
   334     protected:  // Data
       
   335         // ?one_line_short_description_of_data
       
   336         //?data_declaration;
       
   337 
       
   338     private:    // Data
       
   339         // ?one_line_short_description_of_data
       
   340         //?data_declaration;
       
   341 		TLex8 iLex;
       
   342 //sf-		TPtrC8 iStr;
       
   343 //sf-		TInt iPos;
       
   344 		TPtrC8 iName;
       
   345 		TPtrC8 iValue;
       
   346 		TBool iValueExist;
       
   347 
       
   348         // Reserved pointer for future extension
       
   349         //TAny* iReserved;
       
   350 
       
   351     public:     // Friend classes
       
   352         //?friend_class_declaration;
       
   353     protected:  // Friend classes
       
   354         //?friend_class_declaration;
       
   355     private:    // Friend classes
       
   356         //?friend_class_declaration;
       
   357     };
       
   358 
       
   359 #endif      // __TESTPARAMS_H
       
   360             
       
   361 // End of File