~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy-backports

« back to all changes in this revision

Viewing changes to ksysguard/libksysguard/processui/ProcessFilter.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-09-05 20:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20070905204514-632hhspl0nvrc84i
Tags: upstream-3.93.0
ImportĀ upstreamĀ versionĀ 3.93.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    KSysGuard, the KDE System Guard
 
3
 
 
4
        Copyright (c) 1999, 2000 Chris Schlaeger <cs@kde.org>
 
5
        Copyright (c) 2006 John Tapsell <john.tapsell@kdemail.net>
 
6
 
 
7
    This program is free software; you can redistribute it and/or
 
8
    modify it under the terms of version 2 of the GNU General Public
 
9
    License as published by the Free Software Foundation.
 
10
 
 
11
    This program is distributed in the hope that it will be useful,
 
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
14
    GNU General Public License for more details.
 
15
 
 
16
    You should have received a copy of the GNU General Public License
 
17
    along with this program; if not, write to the Free Software
 
18
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
19
 
 
20
*/
 
21
 
 
22
#ifndef PROCESSFILTER_H_
 
23
#define PROCESSFILTER_H_
 
24
 
 
25
#include <QSortFilterProxyModel>
 
26
#include <QObject>
 
27
#include <kdemacros.h>
 
28
 
 
29
class QModelIndex;
 
30
 
 
31
class KDE_EXPORT ProcessFilter : public QSortFilterProxyModel
 
32
{
 
33
        Q_OBJECT
 
34
        Q_ENUMS(State)
 
35
 
 
36
  public:
 
37
        enum State {AllProcesses=0,AllProcessesInTreeForm, SystemProcesses, UserProcesses, OwnProcesses};
 
38
        ProcessFilter(QObject *parent=0) : QSortFilterProxyModel(parent) {mFilter = AllProcesses;}
 
39
        virtual ~ProcessFilter() {}
 
40
        bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
 
41
        State filter() const {return mFilter; }
 
42
 
 
43
 
 
44
  public slots:
 
45
        void setFilter(State index);
 
46
        
 
47
  protected:
 
48
        virtual bool filterAcceptsRow( int source_row, const QModelIndex & source_parent ) const;
 
49
        
 
50
        State mFilter;
 
51
};
 
52
 
 
53
#endif
 
54