Music Hub ..
A session-wide music playback service
call_monitor.h
Go to the documentation of this file.
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 Lesser General Public License version 3 as
6 * published by the Free Software Foundation.
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 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: Justin McPherson <justin.mcpherson@canonical.com>
17 */
18
19
20#ifndef CORE_UBUNTU_MEDIA_TELEPHONY_CALL_MONITOR_H_
21#define CORE_UBUNTU_MEDIA_TELEPHONY_CALL_MONITOR_H_
22
23#include <core/signal.h>
24
25#include <functional>
26#include <memory>
27
28namespace core
29{
30namespace ubuntu
31{
32namespace media
33{
34namespace telephony
35{
36// CallMonitor models the ability to observe and react
37// to changes of the overall call state of the system.
39{
40 // Save us some typing.
41 typedef std::shared_ptr<CallMonitor> Ptr;
42
43 // All known call states
44 enum class State
45 {
46 // No current call.
47 OffHook,
48 // Call in progress.
49 OnHook
50 };
51
52 CallMonitor() = default;
53 virtual ~CallMonitor() = default;
54
55 // Emitted whenever the current call state of the system changes.
56 virtual const core::Signal<State>& on_call_state_changed() const = 0;
57};
58
59// Returns a platform default implementation of CallMonitor.
61}
62}
63}
64}
65
66#endif // CORE_UBUNTU_MEDIA_TELEPHONY_CALL_MONITOR_H_
CallMonitor::Ptr make_platform_default_call_monitor()
Definition: player.h:34
std::shared_ptr< CallMonitor > Ptr
Definition: call_monitor.h:41
virtual const core::Signal< State > & on_call_state_changed() const =0