20
#ifndef CORE_UBUNTU_MEDIA_TELEPHONY_CALL_MONITOR_H_
21
#define CORE_UBUNTU_MEDIA_TELEPHONY_CALL_MONITOR_H_
23
#include <core/signal.h>
23
25
#include <functional>
25
class CallMonitorPrivate;
30
enum State { OffHook, OnHook };
35
void on_change(const std::function<void(CallMonitor::State)>& func);
38
CallMonitorPrivate *d;
36
// CallMonitor models the ability to observe and react
37
// to changes of the overall call state of the system.
40
// Save us some typing.
41
typedef std::shared_ptr<CallMonitor> Ptr;
43
// All known call states
52
CallMonitor() = default;
53
virtual ~CallMonitor() = default;
55
// Emitted whenever the current call state of the system changes.
56
virtual const core::Signal<State>& on_call_state_changed() const = 0;
41
#endif // CALLMONITOR_H
59
// Returns a platform default implementation of CallMonitor.
60
CallMonitor::Ptr make_platform_default_call_monitor();
66
#endif // CORE_UBUNTU_MEDIA_TELEPHONY_CALL_MONITOR_H_