homescreenapp/stateplugins/hsapplibrarystateplugin/tsrc/inc/t_hsproxymodeltestmockmodel.h
changeset 90 3ac3aaebaee5
child 97 66b5fe3c07fd
equal deleted inserted replaced
86:e4f038c420f7 90:3ac3aaebaee5
       
     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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef T_HS_MOCK_MODEL_H_EEEEE
       
    19 #define T_HS_MOCK_MODEL_H_EEEEE
       
    20 
       
    21 #include <qstandarditemmodel.h>
       
    22 #include "caentry.h"
       
    23 #include "hsmenuitemmodel.h"
       
    24 
       
    25 class ProxyModelTestMockModel: public HsMenuItemModel
       
    26 {
       
    27     Q_OBJECT
       
    28 public:
       
    29     ProxyModelTestMockModel(int entryId) :
       
    30         HsMenuItemModel(CaQuery()),
       
    31         mEntryId(entryId) {}
       
    32 
       
    33     virtual QModelIndex index(int, int,
       
    34         const QModelIndex &parent = QModelIndex()) const {
       
    35     	Q_UNUSED(parent);
       
    36         return QModelIndex();
       
    37     }
       
    38     virtual QVariant data(const QModelIndex &,
       
    39                               int role = Qt::DisplayRole) const {
       
    40     	Q_UNUSED(role);
       
    41     	return QVariant(mEntryId);
       
    42     }
       
    43 
       
    44     const CaEntry *entry(const QModelIndex &index) const;
       
    45     
       
    46 private:
       
    47     
       
    48     int mEntryId;
       
    49 };
       
    50 
       
    51 
       
    52 #endif