videocollection/videocollectionwrapper/tsrc/testvideoproxymodelcontent/stub/src/videolistdatamodel.cpp
changeset 62 0e1e938beb1a
equal deleted inserted replaced
59:a76e86df7ccd 62:0e1e938beb1a
       
     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: Stub model to be used when unit testing the proxy model. 
       
    15 * 
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include "videolistdatamodel.h"
       
    21 
       
    22 TMPXItemId VideoListDataModel::mMediaIdAtIndexReturnValue;
       
    23 int VideoListDataModel::mMediaIdAtIndexCallCount = 0;
       
    24 int VideoListDataModel::mRowCountReturnValue = 0;
       
    25 bool VideoListDataModel::mBelongsToAlbumReturnValue = true;
       
    26 TMPXItemId VideoListDataModel::mAlbumInUseReturnValue = TMPXItemId::InvalidId();
       
    27 
       
    28 // ---------------------------------------------------------------------------
       
    29 // VideoListDataModel
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 VideoListDataModel::VideoListDataModel(QObject *parent)
       
    33 {
       
    34     Q_UNUSED(parent);
       
    35 }
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // ~VideoListDataModel
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 VideoListDataModel::~VideoListDataModel()
       
    42 {
       
    43 
       
    44 }
       
    45 
       
    46 // ---------------------------------------------------------------------------
       
    47 // mediaIdAtIndex
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 TMPXItemId VideoListDataModel::mediaIdAtIndex(int index)
       
    51 {
       
    52     Q_UNUSED(index);
       
    53     mMediaIdAtIndexCallCount++;
       
    54     return mMediaIdAtIndexReturnValue;
       
    55 }
       
    56 
       
    57 // ---------------------------------------------------------------------------
       
    58 // rowCount
       
    59 // ---------------------------------------------------------------------------
       
    60 //
       
    61 const int VideoListDataModel::rowCount() const
       
    62 {
       
    63     return mRowCountReturnValue;
       
    64 }
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // mediaIdAtIndex
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 bool VideoListDataModel::belongsToAlbum(TMPXItemId &id)
       
    71 {
       
    72     return mBelongsToAlbumReturnValue;
       
    73 }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // albumInUse
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 TMPXItemId VideoListDataModel::albumInUse()
       
    80 {
       
    81     return mAlbumInUseReturnValue;
       
    82 }
       
    83 
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // emitAlbumChanged
       
    87 // ---------------------------------------------------------------------------
       
    88 //   
       
    89 void VideoListDataModel::emitAlbumChanged()
       
    90 {
       
    91     emit albumChanged();
       
    92 }
       
    93 // End of file
       
    94