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