app/tsrc/unittest_mpsongscanner/stub/inc/mpxcollectionutility.h
changeset 20 82baf59ce8dd
parent 19 4e84c994a771
child 22 ecf06a08d4d9
equal deleted inserted replaced
19:4e84c994a771 20:82baf59ce8dd
     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: mmpxcollectionutility stub for testing mpsongscanner
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MMPXCOLLECTIONUTILITY_H
       
    20 #define MMPXCOLLECTIONUTILITY_H
       
    21 
       
    22 
       
    23 #include <mpxcommonframeworkdefs.h>     // TMPXOpenMode
       
    24 #include <mpxattribute.h>               // TMPXAttribute
       
    25 #include <e32base.h>                    // CBase
       
    26 
       
    27 
       
    28 class MpSongScannerPrivate;
       
    29 class CMPXCollectionPath;
       
    30 class CMPXAttributeSpecs;
       
    31 class CMPXFilter;
       
    32 
       
    33 
       
    34 class MMPXCollection : public CBase
       
    35     {
       
    36     
       
    37 public:
       
    38     
       
    39     static void setOpenLLeave();
       
    40     static void OpenLLeaveIfDesiredL();
       
    41     static void setMediaLLeave();
       
    42     static void MediaLLeaveIfDesiredL();
       
    43     
       
    44 public:
       
    45     
       
    46     MMPXCollection();
       
    47     virtual ~MMPXCollection();
       
    48     
       
    49     void OpenL(TMPXOpenMode aMode = EMPXOpenDefault);
       
    50     void MediaL(const CMPXCollectionPath& aPath, const TArray<TMPXAttribute>& aAttrs, CMPXAttributeSpecs* aSpecs=NULL, CMPXFilter* aFilter=NULL);
       
    51     
       
    52     };
       
    53 
       
    54 class MMPXCollectionUtility : public CBase
       
    55     {
       
    56     
       
    57 public:
       
    58     
       
    59     static int getCount();
       
    60     static void setNewLLeave();
       
    61     static void NewLLeaveIfDesiredL();
       
    62     static void setCollectionIDLLeave();
       
    63     static void CollectionIDLLeaveIfDesiredL();
       
    64 
       
    65 public:
       
    66 
       
    67     static MMPXCollectionUtility* NewL(MpSongScannerPrivate* aObs);
       
    68     virtual ~MMPXCollectionUtility();
       
    69 
       
    70     void Close();
       
    71     TUid CollectionIDL(const TArray<TUid>& aUids);
       
    72     MMPXCollection& Collection();
       
    73     
       
    74 // test function
       
    75 public:
       
    76     
       
    77     TInt SendRefreshStartMessage();
       
    78     TInt SendRefreshEndMessage();
       
    79     TInt SendDiskInsertedMessage();
       
    80     TInt SendItemChangedMessage();
       
    81     
       
    82     TInt SendDbCreatedMedia();
       
    83     TInt SendNotDbCreatedMedia();
       
    84     
       
    85 private:
       
    86     
       
    87     MMPXCollectionUtility();
       
    88 
       
    89 // workaround so that iObserver can be set everytime on NewL 
       
    90 public:
       
    91     
       
    92     MpSongScannerPrivate*   iObserver;
       
    93     
       
    94 private:
       
    95     
       
    96     MMPXCollection          iCollection;
       
    97 
       
    98     };
       
    99 
       
   100 #endif      // MMPXCOLLECTIONUTILITY_H
       
   101 
       
   102 // End of File