perfapps/memspyui/ui/hb/inc/memspyserverview.h
changeset 48 da3ec8478e66
equal deleted inserted replaced
47:11fa016241a4 48:da3ec8478e66
       
     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 MEMSPYSERVERVIEW_H_
       
    19 #define MEMSPYSERVERVIEW_H_
       
    20 
       
    21 #include <QAbstractListModel>
       
    22 
       
    23 #include "memspylistview.h"
       
    24 #include "enginewrapper.h"
       
    25 
       
    26 
       
    27 class MemSpyServerModel : public QAbstractListModel
       
    28 {
       
    29 public:
       
    30     MemSpyServerModel(EngineWrapper &engine, QObject *parent = 0);
       
    31     
       
    32     ~MemSpyServerModel();
       
    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     EngineWrapper& mEngine;
       
    42     
       
    43     QList<MemSpyServer*> mServers;
       
    44 };
       
    45 
       
    46 class MemSpyServerView : public MemSpyListView
       
    47 {
       
    48     
       
    49     Q_OBJECT
       
    50     
       
    51 public:
       
    52     MemSpyServerView(EngineWrapper &engine, ViewManager &viewManager) : 
       
    53             MemSpyListView(engine, viewManager),
       
    54             mModel(0)
       
    55         {}
       
    56     
       
    57 public slots:
       
    58     virtual void refresh();
       
    59     
       
    60 protected:
       
    61     void initialize(const QVariantMap& params);
       
    62     
       
    63 protected:
       
    64     virtual bool isRefreshable() const { return true; }
       
    65     
       
    66 private slots:
       
    67     void itemClicked(const QModelIndex& index);
       
    68     
       
    69 private:
       
    70     MemSpyServerModel* mModel;
       
    71 };
       
    72 
       
    73 #endif /* MEMSPYSERVERVIEW_H_ */