ring_signal.cpp 4.99 KB
Newer Older
1
/*
2
 *  Copyright (C) 2015-2016 Savoir-faire Linux Inc.
Guillaume Roguez's avatar
Guillaume Roguez committed
3
 *
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 *  Author: Guillaume Roguez <Guillaume.Roguez@savoirfairelinux.com>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
 */

21
#include "ring_signal.h"
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

namespace ring {

SignalHandlerMap&
getSignalHandlers()
{
    static SignalHandlerMap handlers = {
        /* Call */
        exported_callback<DRing::CallSignal::StateChange>(),
        exported_callback<DRing::CallSignal::TransferFailed>(),
        exported_callback<DRing::CallSignal::TransferSucceeded>(),
        exported_callback<DRing::CallSignal::RecordPlaybackStopped>(),
        exported_callback<DRing::CallSignal::VoiceMailNotify>(),
        exported_callback<DRing::CallSignal::IncomingMessage>(),
        exported_callback<DRing::CallSignal::IncomingCall>(),
        exported_callback<DRing::CallSignal::RecordPlaybackFilepath>(),
        exported_callback<DRing::CallSignal::ConferenceCreated>(),
        exported_callback<DRing::CallSignal::ConferenceChanged>(),
        exported_callback<DRing::CallSignal::UpdatePlaybackScale>(),
        exported_callback<DRing::CallSignal::ConferenceRemoved>(),
        exported_callback<DRing::CallSignal::NewCallCreated>(),
        exported_callback<DRing::CallSignal::SipCallStateChanged>(),
        exported_callback<DRing::CallSignal::RecordingStateChanged>(),
        exported_callback<DRing::CallSignal::SecureSdesOn>(),
        exported_callback<DRing::CallSignal::SecureSdesOff>(),
        exported_callback<DRing::CallSignal::RtcpReportReceived>(),
48
        exported_callback<DRing::CallSignal::PeerHold>(),
Eloi Bail's avatar
Eloi Bail committed
49
50
        exported_callback<DRing::CallSignal::VideoMuted>(),
        exported_callback<DRing::CallSignal::AudioMuted>(),
Gasuleg's avatar
Gasuleg committed
51
        exported_callback<DRing::CallSignal::SmartInfo>(),
52
53
54
55
56
57
58

        /* Configuration */
        exported_callback<DRing::ConfigurationSignal::VolumeChanged>(),
        exported_callback<DRing::ConfigurationSignal::AccountsChanged>(),
        exported_callback<DRing::ConfigurationSignal::StunStatusFailed>(),
        exported_callback<DRing::ConfigurationSignal::RegistrationStateChanged>(),
        exported_callback<DRing::ConfigurationSignal::VolatileDetailsChanged>(),
59
60
61
62
        exported_callback<DRing::ConfigurationSignal::CertificatePinned>(),
        exported_callback<DRing::ConfigurationSignal::CertificatePathPinned>(),
        exported_callback<DRing::ConfigurationSignal::CertificateExpired>(),
        exported_callback<DRing::ConfigurationSignal::CertificateStateChanged>(),
63
        exported_callback<DRing::ConfigurationSignal::IncomingAccountMessage>(),
Edric Milaret's avatar
Edric Milaret committed
64
        exported_callback<DRing::ConfigurationSignal::AccountMessageStatusChanged>(),
65
        exported_callback<DRing::ConfigurationSignal::IncomingTrustRequest>(),
66
        exported_callback<DRing::ConfigurationSignal::ExportOnRingEnded>(),
67
        exported_callback<DRing::ConfigurationSignal::KnownDevicesChanged>(),
68
69
        exported_callback<DRing::ConfigurationSignal::NameRegistrationEnded>(),
        exported_callback<DRing::ConfigurationSignal::RegisteredNameFound>(),
70
        exported_callback<DRing::ConfigurationSignal::MediaParametersChanged>(),
71
        exported_callback<DRing::ConfigurationSignal::Error>(),
72
73
#ifdef __ANDROID__
        exported_callback<DRing::ConfigurationSignal::GetHardwareAudioFormat>(),
74
        exported_callback<DRing::ConfigurationSignal::GetAppDataPath>(),
75
#endif
76
77
        /* Debug */
        exported_callback<DRing::DebugSignal::MessageSend>(),
78
79
80
81
82
83
84

        /* Presence */
        exported_callback<DRing::PresenceSignal::NewServerSubscriptionRequest>(),
        exported_callback<DRing::PresenceSignal::ServerError>(),
        exported_callback<DRing::PresenceSignal::NewBuddyNotification>(),
        exported_callback<DRing::PresenceSignal::SubscriptionStateChanged>(),

Adrien Béraud's avatar
Adrien Béraud committed
85
86
87
        /* Audio */
        exported_callback<DRing::AudioSignal::DeviceEvent>(),

Guillaume Roguez's avatar
Guillaume Roguez committed
88
#ifdef RING_VIDEO
89
90
91
92
        /* Video */
        exported_callback<DRing::VideoSignal::DeviceEvent>(),
        exported_callback<DRing::VideoSignal::DecodingStarted>(),
        exported_callback<DRing::VideoSignal::DecodingStopped>(),
93
#ifdef __ANDROID__
94
95
96
97
        exported_callback<DRing::VideoSignal::GetCameraInfo>(),
        exported_callback<DRing::VideoSignal::SetParameters>(),
        exported_callback<DRing::VideoSignal::StartCapture>(),
        exported_callback<DRing::VideoSignal::StopCapture>(),
98
#endif
Guillaume Roguez's avatar
Guillaume Roguez committed
99
#endif
100
101
102
103
104
105
    };

    return handlers;
}

}; // namespace ring