| 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 |
* Authored by: Nick Dedekind <[email protected] |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifndef MOCKCALLMANAGER_H |
| 20 |
#define MOCKCALLMANAGER_H |
| 21 |
|
| 22 |
#include <QObject> |
| 23 |
|
| 24 |
class MockCallManager : public QObject |
| 25 |
{ |
| 26 |
Q_OBJECT |
| 27 |
Q_DISABLE_COPY(MockCallManager) |
| 28 |
|
| 29 |
Q_PROPERTY(QObject *foregroundCall READ foregroundCall WRITE setForegroundCall NOTIFY foregroundCallChanged) |
| 30 |
Q_PROPERTY(QObject *backgroundCall READ backgroundCall WRITE setBackgroundCall NOTIFY backgroundCallChanged) |
| 31 |
Q_PROPERTY(bool hasCalls READ hasCalls NOTIFY hasCallsChanged) |
| 32 |
Q_PROPERTY(bool callIndicatorVisible READ callIndicatorVisible WRITE setCallIndicatorVisible NOTIFY callIndicatorVisibleChanged) |
| 33 |
|
| 34 |
public: |
| 35 |
explicit MockCallManager(QObject *parent = 0); |
| 36 |
|
| 37 |
static MockCallManager *instance(); |
| 38 |
|
| 39 |
QObject* foregroundCall() const; |
| 40 |
QObject* backgroundCall() const; |
| 41 |
bool hasCalls() const; |
| 42 |
bool callIndicatorVisible() const; |
| 43 |
|
| 44 |
void setForegroundCall(QObject* foregroundCall); |
| 45 |
void setBackgroundCall(QObject* backgroundCall); |
| 46 |
void setCallIndicatorVisible(bool callIndicatorVisible); |
| 47 |
|
| 48 |
Q_SIGNALS: |
| 49 |
void foregroundCallChanged(); |
| 50 |
void backgroundCallChanged(); |
| 51 |
void hasCallsChanged(); |
| 52 |
void callIndicatorVisibleChanged(); |
| 53 |
|
| 54 |
private: |
| 55 |
QObject* m_foregroundCall; |
| 56 |
QObject* m_backgroundCall; |
| 57 |
bool m_callIndicatorVisible; |
| 58 |
}; |
| 59 |
|
| 60 |
#endif // MOCKCALLMANAGER_H |