Music Hub ..
A session-wide music playback service
Loading...
Searching...
No Matches
state_controller.h
Go to the documentation of this file.
1/*
2 * Copyright © 2014 Canonical Ltd.
3 * Copyright © 2022 UBports Foundation.
4 *
5 * Contact: Alberto Mardegan <mardy@users.sourceforge.net>
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License version 3,
9 * as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Authored by: Thomas Voß <thomas.voss@canonical.com>
20 */
21#ifndef LOMIRI_MEDIAHUBSERVICE_POWER_STATE_CONTROLLER_H
22#define LOMIRI_MEDIAHUBSERVICE_POWER_STATE_CONTROLLER_H
23
24#include <QObject>
25#include <QScopedPointer>
26#include <QSharedPointer>
27
28namespace lomiri
29{
30namespace MediaHubService
31{
32namespace power
33{
34Q_NAMESPACE
35
36// Enumerates known power states of the system.
37enum class SystemState
38{
39 // Note that callers will be notified of suspend state changes
40 // but may not request this state.
42 // The Active state will prevent system suspend
43 active = 1,
44 // Substate of Active with disabled proximity based blanking
46};
47Q_ENUM_NS(SystemState)
48
49// Interface that enables observation of the system power state.
50class StateControllerPrivate;
52{
53 Q_OBJECT
54
55public:
56 typedef QSharedPointer<StateController> Ptr;
57 static QSharedPointer<StateController> instance();
59
60 void requestDisplayOn();
61 void releaseDisplayOn();
62
65
66Q_SIGNALS:
69
72
73protected:
75
76private:
77 Q_DECLARE_PRIVATE(StateController)
78 QScopedPointer<StateControllerPrivate> d_ptr;
79};
80
81}
82}
83}
84
85#endif // LOMIRI_MEDIAHUBSERVICE_POWER_STATE_CONTROLLER_H
static QSharedPointer< StateController > instance()