~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to plasma/desktop/applets/kickoff/core/systemmodel.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright 2007 Robert Knight <robertknight@gmail.com>
 
3
    Copyright 2007 Kevin Ottens <ervin@kde.org>
 
4
 
 
5
    This library is free software; you can redistribute it and/or
 
6
    modify it under the terms of the GNU Library General Public
 
7
    License as published by the Free Software Foundation; either
 
8
    version 2 of the License, or (at your option) any later version.
 
9
 
 
10
    This library is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
    Library General Public License for more details.
 
14
 
 
15
    You should have received a copy of the GNU Library General Public License
 
16
    along with this library; see the file COPYING.LIB.  If not, write to
 
17
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
18
    Boston, MA 02110-1301, USA.
 
19
*/
 
20
 
 
21
#ifndef SYSTEMMODEL_H
 
22
#define SYSTEMMODEL_H
 
23
 
 
24
#include "core/kickoff_export.h"
 
25
#include "core/kickoffproxymodel.h"
 
26
 
 
27
namespace Kickoff
 
28
{
 
29
 
 
30
/**
 
31
 * Model which provides a tree of items for important system setup tools (eg. System Settings) ,
 
32
 * folders (eg. the user's home folder and the local network) and fixed and removable storage.
 
33
 */
 
34
class KICKOFF_EXPORT SystemModel : public KickoffProxyModel
 
35
{
 
36
    Q_OBJECT
 
37
 
 
38
public:
 
39
    /** Constructs a new SystemModel with the specified parent. */
 
40
    SystemModel(QObject *parent = 0);
 
41
    virtual ~SystemModel();
 
42
 
 
43
    virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const;
 
44
    virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const;
 
45
    virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
 
46
    virtual QModelIndex parent(const QModelIndex &item) const;
 
47
    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
 
48
    virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
 
49
    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
 
50
    virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
 
51
    void refreshUsageInfo();
 
52
    void stopRefreshingUsageInfo();
 
53
 
 
54
private Q_SLOTS:
 
55
    void refreshNextUsageInfo();
 
56
    void reloadApplications();
 
57
    void sourceDataChanged(const QModelIndex &start, const QModelIndex &end);
 
58
    void sourceRowsAboutToBeInserted(const QModelIndex &parent, int start, int end);
 
59
    void sourceRowsInserted(const QModelIndex &parent, int start, int end);
 
60
    void sourceRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
 
61
    void sourceRowsRemoved(const QModelIndex &parent, int start, int end);
 
62
 
 
63
private:
 
64
    class Private;
 
65
    Private * const d;
 
66
};
 
67
 
 
68
}
 
69
 
 
70
#endif // SYSTEMMODEL_H
 
71