videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/inc/VcxMyVideosMdsDbTest.h
branchRCL_3
changeset 15 8f0df5c82986
child 16 67eb01668b0e
equal deleted inserted replaced
14:55fa1ec415c6 15:8f0df5c82986
       
     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: STIF testclass declaration
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef VCXMYVIDEOSMDSDBTEST_H
       
    19 #define VCXMYVIDEOSMDSDBTEST_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <StifLogger.h>
       
    23 #include <TestScripterInternal.h>
       
    24 #include <StifTestModule.h>
       
    25 #include <TestclassAssert.h>
       
    26 #include <f32file.h>
       
    27 
       
    28 
       
    29 #include <mpxcollectionplugin.h>
       
    30 #include <mpxcollectionpath.h>
       
    31 #include <mpxcollectionmessagedefs.h>
       
    32 #include <vcxmyvideosdefs.h>
       
    33 
       
    34 //#include <mpxmedia.h>
       
    35 #include "vcxmyvideosmdsdb.h"
       
    36 #include "vcxmyvideosactivetask.h"
       
    37 
       
    38 
       
    39 // MACROS
       
    40 //#define ?macro ?macro_def
       
    41 #define TEST_CLASS_VERSION_MAJOR 0
       
    42 #define TEST_CLASS_VERSION_MINOR 0
       
    43 #define TEST_CLASS_VERSION_BUILD 0
       
    44 
       
    45 // Logging path
       
    46 _LIT( KVcxMyVideosMdsDbTestLogPath, "\\logs\\testframework\\VcxMyVideosMdsDbTest\\" ); 
       
    47 // Log file
       
    48 _LIT( KVcxMyVideosMdsDbTestLogFile, "VcxMyVideosMdsDbTest.txt" ); 
       
    49 _LIT( KVcxMyVideosMdsDbTestLogFileWithTitle, "VcxMyVideosMdsDbTest_[%S].txt" );
       
    50 
       
    51 // FUNCTION PROTOTYPES
       
    52 //?type ?function_name(?arg_list);
       
    53 
       
    54 // FORWARD DECLARATIONS
       
    55 //class ?FORWARD_CLASSNAME;
       
    56 class CVcxMyVideosMdsDbTest;
       
    57 //class CVcxMyVideosMdsDb;
       
    58 //class CMPXMedia;
       
    59 
       
    60 // DATA TYPES
       
    61 //enum ?declaration
       
    62 //typedef ?declaration
       
    63 //extern ?data_type;
       
    64 extern CVcxMyVideosMdsDbTest* test;
       
    65 
       
    66 // CLASS DECLARATION
       
    67 
       
    68 /**
       
    69 *  CVcxMyVideosMdsDbTest test class for STIF Test Framework TestScripter.
       
    70 *  ?other_description_lines
       
    71 *
       
    72 *  @lib ?library
       
    73 *  @since ?Series60_version
       
    74 */
       
    75 NONSHARABLE_CLASS(CVcxMyVideosMdsDbTest) : public CScriptBase, public MVcxMyVideosMdsDbObserver
       
    76     {
       
    77     public:  // Constructors and destructor
       
    78 
       
    79 
       
    80         /**
       
    81         * Two-phased constructor.
       
    82         */
       
    83         static CVcxMyVideosMdsDbTest* NewL( CTestModuleIf& aTestModuleIf );
       
    84 
       
    85         /**
       
    86         * Destructor.
       
    87         */
       
    88         virtual ~CVcxMyVideosMdsDbTest();
       
    89         
       
    90     // FROM MVcxMyVideosMdsDbObserver
       
    91         
       
    92         /**
       
    93         * Handler function for database events.
       
    94         *
       
    95         * @param aEvent Event type.
       
    96         * @param aId    Array of IDs in database.
       
    97         */
       
    98         void HandleMyVideosDbEvent( TMPXChangeEventType aEvent, RArray<TUint32>& aId ){};
       
    99 
       
   100         /**
       
   101         * Handler function for list fetching events. This callback is called as a response
       
   102         * to CreateVideoList( aSync = EFalse ).
       
   103         *
       
   104         * @param aVideoList          List of videos fetched from MDS.
       
   105         * @param aNewItemsStartIndex Start position for the new items added. If -1, then no new
       
   106         *                            items were added.
       
   107         * @param aComplete           ETrue if list is complete and no more items are expected,
       
   108         *                            EFalse if there are more to come.
       
   109         */
       
   110         void HandleCreateVideoListResp( CMPXMedia* aVideoList,
       
   111                 TInt aNewItemsStartIndex, TBool aComplete ){};
       
   112 
       
   113         /**
       
   114         * Handler function for media remove/insert events. This is called every time
       
   115         * media is removed or inserted (objects become present or non present).
       
   116         */
       
   117         void HandleObjectPresentNotification(){};
       
   118 
       
   119     public: // New functions
       
   120 
       
   121         /**
       
   122         * ?member_description.
       
   123         * @since ?Series60_version
       
   124         * @param ?arg1 ?description
       
   125         * @return ?description
       
   126         */
       
   127         //?type ?member_function( ?type ?arg1 );
       
   128 
       
   129     public: // Functions from base classes
       
   130 
       
   131         /**
       
   132         * From CScriptBase Runs a script line.
       
   133         * @since ?Series60_version
       
   134         * @param aItem Script line containing method name and parameters
       
   135         * @return Symbian OS error code
       
   136         */
       
   137         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   138 
       
   139     protected:  // New functions
       
   140 
       
   141         /**
       
   142         * ?member_description.
       
   143         * @since ?Series60_version
       
   144         * @param ?arg1 ?description
       
   145         * @return ?description
       
   146         */
       
   147         //?type ?member_function( ?type ?arg1 );
       
   148 
       
   149     protected:  // Functions from base classes
       
   150 
       
   151         /**
       
   152         * From ?base_class ?member_description
       
   153         */
       
   154         //?type ?member_function();
       
   155 
       
   156     private:
       
   157 
       
   158         /**
       
   159         * C++ default constructor.
       
   160         */
       
   161         CVcxMyVideosMdsDbTest( CTestModuleIf& aTestModuleIf );
       
   162 
       
   163         /**
       
   164         * By default Symbian 2nd phase constructor is private.
       
   165         */
       
   166         void ConstructL();
       
   167 
       
   168         /**
       
   169         * Frees all resources allocated from test methods.
       
   170         * @since ?Series60_version
       
   171         */
       
   172         void Delete();
       
   173 
       
   174         /**
       
   175         * Test methods are listed below. 
       
   176         */
       
   177 
       
   178         virtual TInt CreateL( CStifItemParser& aItem );
       
   179 
       
   180         virtual TInt DeleteL( CStifItemParser& aItem );
       
   181 
       
   182         virtual TInt CancelL( CStifItemParser& aItem );
       
   183 
       
   184         virtual TInt AddVideoL( CStifItemParser& aItem );
       
   185 
       
   186         virtual TInt RemoveVideoL( CStifItemParser& aItem );
       
   187 
       
   188         virtual TInt UpdateVideoL( CStifItemParser& aItem );
       
   189 
       
   190         virtual TInt CreateVideoListL( CStifItemParser& aItem );
       
   191 
       
   192         virtual TInt CreateVideoL( CStifItemParser& aItem );
       
   193         
       
   194         /**
       
   195          * Method used to log version of test class
       
   196          */
       
   197         void SendTestClassVersion();
       
   198         
       
   199         void PrepareMdsL(  CStifItemParser& aItem  ) ;
       
   200 
       
   201     private:    // Data
       
   202         
       
   203         CVcxMyVideosMdsDb* iMdsDb;
       
   204 
       
   205         RFs iFs;
       
   206         
       
   207     public:
       
   208     
       
   209         TInt mdssessionerror,  mdssessionasyncerror,
       
   210         mdsoperationleaves, mdsoperationreturns ;
       
   211         
       
   212     };
       
   213 
       
   214 
       
   215 
       
   216 #endif      // VCXMYVIDEOSMDSDBTEST_H