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

« back to all changes in this revision

Viewing changes to plasma/generic/applets/system-monitor/net.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 (C) 2008 Petri Damsten <damu@iki.fi>
 
3
 *   Copyright (C) 2010 Michel Lafon-Puyo <michel.lafonpuyo@gmail.com>
 
4
 *
 
5
 *   This program is free software; you can redistribute it and/or modify
 
6
 *   it under the terms of the GNU Library General Public License version 2 as
 
7
 *   published by the Free Software Foundation
 
8
 *
 
9
 *   This program is distributed in the hope that it will be useful,
 
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *   GNU General Public License for more details
 
13
 *
 
14
 *   You should have received a copy of the GNU Library General Public
 
15
 *   License along with this program; if not, write to the
 
16
 *   Free Software Foundation, Inc.,
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
 
 
20
#ifndef NET_HEADER
 
21
#define NET_HEADER
 
22
 
 
23
#include <ui_net-config.h>
 
24
#include "applet.h"
 
25
#include <Plasma/DataEngine>
 
26
#include <QStandardItemModel>
 
27
#include <QTimer>
 
28
#include <QRegExp>
 
29
 
 
30
class QStandardItemModel;
 
31
 
 
32
namespace SM {
 
33
 
 
34
class Net : public Applet
 
35
{
 
36
    Q_OBJECT
 
37
    public:
 
38
        Net(QObject *parent, const QVariantList &args);
 
39
        ~Net();
 
40
 
 
41
        virtual void init();
 
42
        virtual bool addVisualization(const QString&);
 
43
        virtual void createConfigurationInterface(KConfigDialog *parent);
 
44
 
 
45
    public slots:
 
46
        void configAccepted();
 
47
        void configChanged();
 
48
        void dataUpdated(const QString &name,
 
49
                         const Plasma::DataEngine::Data &data);
 
50
        void sourceAdded(const QString &name);
 
51
        void sourcesAdded();
 
52
        void sourceRemoved(const QString &name);
 
53
 
 
54
    private:
 
55
        Ui::config ui;
 
56
        QStandardItemModel m_model;
 
57
        QStringList m_interfaces;
 
58
        QMap<QString, QList<double> > m_data;
 
59
        QTimer m_sourceTimer;
 
60
        QRegExp m_rx;
 
61
};
 
62
}
 
63
 
 
64
K_EXPORT_PLASMA_APPLET(sm_net, SM::Net)
 
65
 
 
66
#endif