~alan-griffiths/miral/fix-1645284

« back to all changes in this revision

Viewing changes to miral-qt/src/modules/Unity/Application/sharedwakelock.h

  • Committer: Alan Griffiths
  • Date: 2016-11-07 17:59:19 UTC
  • mfrom: (436.1.1 miral2)
  • Revision ID: alan@octopull.co.uk-20161107175919-stbb64i7j1htgog2
[miral-qt] delete all as qtmir work on MirAL has shifted to lp:~unity-team/qtmir/miral-qt-integration and this is a needless distration

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2015 Canonical, Ltd.
3
 
 *
4
 
 * This program is free software: you can redistribute it and/or modify it under
5
 
 * the terms of the GNU Lesser General Public License version 3, as published by
6
 
 * the Free Software Foundation.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 
 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
 
 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11
 
 * Lesser General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU Lesser General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 * Author: Gerry Boland <gerry.boland@canonical.com>
17
 
 */
18
 
 
19
 
#ifndef WAKELOCK_H
20
 
#define WAKELOCK_H
21
 
 
22
 
#include <QDBusConnection>
23
 
#include <QSet>
24
 
#include <QScopedPointer>
25
 
 
26
 
namespace qtmir {
27
 
 
28
 
class Wakelock;
29
 
class SharedWakelock : public QObject
30
 
{
31
 
    Q_OBJECT
32
 
    Q_PROPERTY(bool enabled READ enabled NOTIFY enabledChanged)
33
 
public:
34
 
    SharedWakelock(const QDBusConnection& connection = QDBusConnection::systemBus());
35
 
    virtual ~SharedWakelock();
36
 
 
37
 
    virtual bool enabled() const;
38
 
 
39
 
    virtual void acquire(const QObject *caller);
40
 
    Q_SLOT virtual void release(const QObject *caller);
41
 
 
42
 
Q_SIGNALS:
43
 
    void enabledChanged(bool enabled);
44
 
 
45
 
protected:
46
 
    QScopedPointer<Wakelock> m_wakelock;
47
 
    QSet<const QObject *> m_owners;
48
 
 
49
 
private:
50
 
    Q_DISABLE_COPY(SharedWakelock)
51
 
};
52
 
 
53
 
} // namespace qtmir
54
 
 
55
 
#endif // WAKELOCK_H