on bbbdccd help sign in
58 lines 1.6 kB history raw
1/*
2 * Copyright (C) 2012,2013 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 * Authors: Michael Terry <michael.terry@canonical.com>
17 */
19#ifndef UNITY_MOCK_POWERD_H
20#define UNITY_MOCK_POWERD_H
22#include <QtCore/QObject>
24class Powerd: public QObject
26 Q_OBJECT
27 Q_ENUMS(Status)
28 Q_ENUMS(DisplayStateChangeReason)
29 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
31public:
32 enum DisplayStateChangeReason {
33 Unknown = 0,
34 Inactivity = 1, // Display changed state due to inactivity
35 PowerKey = 2, // Display changed state due to user pressing power key
36 Proximity = 3, // Display changed state due to proximity events
37 };
39 enum Status {
40 Off,
41 On,
42 };
44 explicit Powerd(QObject *parent = 0);
46 Status status() const;
48 // Not exposed via Q_PROPERTY because we need the 'reason' argument too
49 Q_INVOKABLE void setStatus(Status status, DisplayStateChangeReason reason);
51Q_SIGNALS:
52 void statusChanged(DisplayStateChangeReason reason);
54private:
55 Status m_status;
56};
58#endif