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