Debian Codegraph @

tests/mocks/Lomiri/Telephony/MockCallEntry.h

raw
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 MOCKCALLENTRY_H
20 #define MOCKCALLENTRY_H
21
22 #include <QObject>
23
24 class MockCallEntry : public QObject
25 {
26 Q_OBJECT
27 Q_DISABLE_COPY(MockCallEntry)
28
29 Q_PROPERTY(QString phoneNumber READ phoneNumber WRITE setPhoneNumber NOTIFY phoneNumberChanged)
30 Q_PROPERTY(bool isConference READ isConference WRITE setIsConference NOTIFY isConferenceChanged)
31 Q_PROPERTY(int elapsedTime READ elapsedTime WRITE setElapsedTime NOTIFY elapsedTimeChanged)
32
33 // For mock use only
34 Q_PROPERTY(bool elapsedTimerRunning READ elapsedTimerRunning WRITE setSlapsedTimerRunning NOTIFY elapsedTimerRunningChanged)
35
36 public:
37 MockCallEntry(QObject *parent = 0);
38
39 QString phoneNumber() const;
40 bool isConference() const;
41 int elapsedTime() const;
42 bool elapsedTimerRunning() const;
43
44 void setPhoneNumber(const QString& phoneNumber);
45 void setIsConference(bool isConference);
46 void setElapsedTime(int elapsedTime);
47 void setSlapsedTimerRunning(bool elapsedTimerRunning);
48
49 Q_SIGNALS:
50 void phoneNumberChanged();
51 void isConferenceChanged();
52 void elapsedTimeChanged();
53 void elapsedTimerRunningChanged();
54
55 protected:
56 void timerEvent(QTimerEvent * event) override;
57
58 private:
59 QString m_phoneNumber;
60 bool m_conference;
61 int m_elapsed;
62 int m_timer;
63 };
64
65 #endif // MOCKCALLENTRY_H