2
0

temp.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * <one line to give the library's name and an idea of what it does.>
  3. * Copyright 2015 Malte Veerman maldela@halloarsch.de
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License or (at your option) version 3 or any later version
  9. * accepted by the membership of KDE e.V. (or its successor approved
  10. * by the membership of KDE e.V.), which shall act as a proxy
  11. * defined in Section 14 of version 3 of the license.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #ifndef TEMP_H
  23. #define TEMP_H
  24. #include "sensor.h"
  25. class QTextStream;
  26. namespace Fancontrol
  27. {
  28. class Temp : public Sensor
  29. {
  30. Q_OBJECT
  31. Q_PROPERTY(QString label READ label NOTIFY labelChanged)
  32. Q_PROPERTY(int value READ value NOTIFY valueChanged)
  33. public:
  34. explicit Temp(uint index, Hwmon *parent = Q_NULLPTR);
  35. virtual ~Temp();
  36. QString label() const { return m_label; }
  37. int value() const { return m_value; }
  38. QString name() const Q_DECL_OVERRIDE;
  39. void setName(const QString &name) Q_DECL_OVERRIDE;
  40. void reset() Q_DECL_OVERRIDE;
  41. bool isValid() const Q_DECL_OVERRIDE;
  42. public slots:
  43. void update() Q_DECL_OVERRIDE;
  44. signals:
  45. void labelChanged();
  46. void valueChanged();
  47. protected:
  48. QTextStream *m_valueStream;
  49. private:
  50. QString m_label;
  51. int m_value;
  52. };
  53. }
  54. #endif // TEMP_H