perfapps/memspyui/ui/hb/inc/memspywindowgroupsview.h
changeset 52 36d60d12b4af
equal deleted inserted replaced
51:b048e15729d6 52:36d60d12b4af
       
     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 MEMSPYWINDOWGROUPSVIEW_H_
       
    19 #define MEMSPYWINDOWGROUPSVIEW_H_
       
    20 
       
    21 #include <QAbstractListModel>
       
    22 
       
    23 #include "memspylistview.h"
       
    24 #include "enginewrapper.h"
       
    25 
       
    26 
       
    27 class MemSpyWindowGroupsModel : public QAbstractListModel
       
    28 {
       
    29 public:
       
    30     MemSpyWindowGroupsModel(EngineWrapper &engine, QObject *parent = 0);
       
    31     
       
    32     ~MemSpyWindowGroupsModel();
       
    33     
       
    34     int rowCount(const QModelIndex &parent = QModelIndex()) const;
       
    35     
       
    36     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
       
    37     
       
    38     void refresh();
       
    39     
       
    40 private:
       
    41     int mInterfaceId;
       
    42     
       
    43     EngineWrapper& mEngine;
       
    44     
       
    45     QList<MemSpyWindowGroup*> mData;
       
    46 };
       
    47 
       
    48 class MemSpyWindowGroupsView : public MemSpyListView
       
    49 {
       
    50     
       
    51     Q_OBJECT
       
    52     
       
    53 public:
       
    54     MemSpyWindowGroupsView(EngineWrapper &engine, ViewManager &viewManager) : 
       
    55             MemSpyListView(engine, viewManager),
       
    56             mModel(0)
       
    57         {}
       
    58     
       
    59 public slots:
       
    60     virtual void refresh();
       
    61     
       
    62 protected:
       
    63     void initialize(const QVariantMap& params);
       
    64     
       
    65 protected:
       
    66     virtual bool isRefreshable() const { return true; }
       
    67     
       
    68 private slots:
       
    69     void itemClicked(const QModelIndex& index);
       
    70     
       
    71 private:
       
    72     MemSpyWindowGroupsModel* mModel;
       
    73 };
       
    74 
       
    75 #endif /* MEMSPYWINDOWGROUPSVIEW_H_ */