mpdata/tsrc/unittest_mpcollectiondatamodel/stub/inc/mpmpxcollectiondata.h
changeset 22 ecf06a08d4d9
child 29 8192e5b5c935
equal deleted inserted replaced
20:82baf59ce8dd 22:ecf06a08d4d9
       
     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: MpMpxCollectionData stub for testing MpCollectionDataModel
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPMPXCOLLECTIONDATA_H
       
    19 #define MPMPXCOLLECTIONDATA_H
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 #include "mpmpxcollectionviewdefs.h"
       
    24 
       
    25 
       
    26 class MpMpxCollectionData : public QObject
       
    27 {
       
    28     Q_OBJECT
       
    29 
       
    30 public:
       
    31 
       
    32     enum DataType {
       
    33         Title,
       
    34         Artist,
       
    35         Album,
       
    36         Count,
       
    37         AlbumArtUri
       
    38     };
       
    39 
       
    40     // Test utility functions
       
    41     static int getInitCounter();
       
    42     static void resetInitCounter();
       
    43     static int getItemDataCounter();
       
    44     static void resetItemDataCounter();
       
    45     static int getremoveItemCounter();
       
    46     static void resetremoveItemCounter();
       
    47     static void setCachedItemId (int id);
       
    48     static int getInsertCachedItemCounter();
       
    49     static void resetInsertCachedItemCounter();
       
    50     
       
    51     // Stub functions
       
    52     explicit MpMpxCollectionData( QObject *parent=0 );
       
    53     virtual ~MpMpxCollectionData();
       
    54 
       
    55     TCollectionContext context() const;
       
    56     int count() const;
       
    57     QString itemData( int index, MpMpxCollectionData::DataType type ) const;
       
    58     int containerId();
       
    59     int itemId(int index);
       
    60     void removeItem(int index);
       
    61     bool testCachedItem( int itemId );
       
    62     void insertCachedItem(int index);
       
    63 
       
    64 signals:
       
    65 
       
    66     void contextChanged( TCollectionContext context );
       
    67 
       
    68 public:
       
    69 
       
    70     TCollectionContext      mContext;
       
    71     int                     mCount;
       
    72     bool                    mItemDataReturn;
       
    73 
       
    74 };
       
    75 
       
    76 #endif // MPMPXCOLLECTIONDATA_H
       
    77