~ci-train-bot/unity8/ubuntu-rtm-14.09-proposed

« back to all changes in this revision

Viewing changes to tests/mocks/Lights/Lights.h

  • Committer: CI Train Bot
  • Author(s): Nick Dedekind
  • Date: 2015-01-20 11:18:06 UTC
  • mfrom: (1410.2.8 rtm-20150113)
  • Revision ID: ci-train-bot@canonical.com-20150120111806-98c0xuq7cncqfiw7
Unhook Lights interface from indicator widgets
Approved by: Albert Astals Cid Fixes: #1385331

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2014 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
#ifndef UNITY_MOCK_LIGHTS_H
 
18
#define UNITY_MOCK_LIGHTS_H
 
19
 
 
20
#include <QtCore/QObject>
 
21
#include <QtGui/QColor>
 
22
 
 
23
class Lights: public QObject
 
24
{
 
25
    Q_OBJECT
 
26
    Q_ENUMS(State)
 
27
    Q_PROPERTY(State state READ state  WRITE setState NOTIFY stateChanged)
 
28
    Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
 
29
    Q_PROPERTY(int onMillisec READ onMillisec WRITE setOnMillisec NOTIFY onMillisecChanged)
 
30
    Q_PROPERTY(int offMillisec READ offMillisec WRITE setOffMillisec NOTIFY offMillisecChanged)
 
31
 
 
32
public:
 
33
    enum State {
 
34
        Off,
 
35
        On,
 
36
    };
 
37
 
 
38
    explicit Lights(QObject *parent = 0);
 
39
    ~Lights();
 
40
 
 
41
    void setState(State newState);
 
42
    State state() const;
 
43
 
 
44
    void setColor(const QColor &color);
 
45
    QColor color() const;
 
46
 
 
47
    int onMillisec() const;
 
48
    void setOnMillisec(int onMs);
 
49
 
 
50
    int offMillisec() const;
 
51
    void setOffMillisec(int offMs);
 
52
 
 
53
Q_SIGNALS:
 
54
    void stateChanged(State newState);
 
55
    void colorChanged(const QColor &color);
 
56
    void onMillisecChanged(int onMs);
 
57
    void offMillisecChanged(int offMs);
 
58
 
 
59
private:
 
60
    QColor m_color;
 
61
    State m_state;
 
62
    int m_onMs;
 
63
    int m_offMs;
 
64
};
 
65
 
 
66
#endif