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

« back to all changes in this revision

Viewing changes to plasma/generic/dataengines/soliddevice/hddtemp.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) 2007 Petri Damsten <damu@iki.fi>
 
3
 *   Copyright (C) 2007 Christopher Blauvelt <cblauvelt@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 HDDTEMP_H
 
21
#define HDDTEMP_H
 
22
 
 
23
#include <QObject>
 
24
#include <QMap>
 
25
#include <QString>
 
26
#include <QStringList>
 
27
#include <QVariant>
 
28
#include <QTimer>
 
29
 
 
30
 
 
31
class HddTemp : public QObject
 
32
{
 
33
    Q_OBJECT
 
34
 
 
35
    public:
 
36
        enum DataType {Temperature=0, Unit};
 
37
        
 
38
        HddTemp(QObject *parent=0);
 
39
        ~HddTemp();
 
40
        QStringList sources();
 
41
        QVariant data(const QString source, const DataType type) const;
 
42
 
 
43
    protected:
 
44
        void timerEvent(QTimerEvent *event);
 
45
 
 
46
    private:
 
47
        int m_failCount;
 
48
        bool m_cacheValid;
 
49
        QMap<QString, QList<QVariant> > m_data;
 
50
        bool updateData();
 
51
};
 
52
 
 
53
 
 
54
#endif