From 8d114ecded84b5946f32bdaeff7572b4b958312c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 30 Aug 2017 09:34:31 +0200 Subject: [PATCH] feat(c-wrapper/api): events interface => OK --- src/c-wrapper/api/c-event-log.cpp | 64 +++++++++++++++++++++++++++++++ src/c-wrapper/api/c-event-log.h | 6 ++- src/c-wrapper/c-tools.h | 2 +- 3 files changed, 69 insertions(+), 3 deletions(-) diff --git a/src/c-wrapper/api/c-event-log.cpp b/src/c-wrapper/api/c-event-log.cpp index c246aef3d..c3ad72f04 100644 --- a/src/c-wrapper/api/c-event-log.cpp +++ b/src/c-wrapper/api/c-event-log.cpp @@ -26,6 +26,10 @@ using namespace std; +extern "C" { +// ----------------------------------------------------------------------------- +// Event log. +// ----------------------------------------------------------------------------- L_DECLARE_C_STRUCT_IMPL(EventLog, event_log); L_DECLARE_C_STRUCT_NEW_DEFAULT(EventLog, event_log); @@ -34,6 +38,10 @@ LinphoneEventLogType linphone_event_log_get_type (const LinphoneEventLog *eventL return static_cast(eventLog->cppPtr->getType()); } +// ----------------------------------------------------------------------------- +// Message event. +// ----------------------------------------------------------------------------- + L_DECLARE_C_STRUCT_IMPL(MessageEvent, message_event); LinphoneMessageEvent *linphone_message_event_new (LinphoneMessage *message) { @@ -47,3 +55,59 @@ LinphoneMessage *linphone_message_event_get_message (const LinphoneMessageEvent // TODO. return nullptr; } + +// ----------------------------------------------------------------------------- +// Call event. +// ----------------------------------------------------------------------------- + +// L_DECLARE_C_STRUCT_IMPL(CallEvent, call_event); + +LinphoneCallEvent *linphone_call_event_new (LinphoneEventLogType type, LinphoneCall *call) { + // TODO. + return nullptr; +} + +LinphoneCall *linphone_call_event_get_call (const LinphoneCallEvent *call_event) { + // TODO. + return nullptr; +} + +// ----------------------------------------------------------------------------- +// Conference event. +// ----------------------------------------------------------------------------- + +// L_DECLARE_C_STRUCT_IMPL(ConferenceEvent, conference_event); + +LinphoneConferenceEvent *linphone_conference_event_new ( + LinphoneEventLogType type, + const LinphoneAddress *address +) { + // TODO. + return nullptr; +} + +const LinphoneAddress *linphone_conference_event_get_address (const LinphoneConferenceEvent *conference_event) { + // TODO. + return nullptr; +} + +// ----------------------------------------------------------------------------- +// Conference participant event. +// ----------------------------------------------------------------------------- + +// L_DECLARE_C_STRUCT_IMPL(ConferenceParticipantEvent, conference_participant_event); + +LinphoneConferenceParticipantEvent *linphone_conference_participant_event_new ( + LinphoneEventLogType type, + const LinphoneAddress *conference_address, + const LinphoneAddress *participant_address +) { + // TODO. + return nullptr; +} + +const LinphoneAddress *linphone_conference_participant_event_get_participant_address (const LinphoneConferenceParticipantEvent *conference_participant_event) { + // TODO. + return nullptr; +} +} diff --git a/src/c-wrapper/api/c-event-log.h b/src/c-wrapper/api/c-event-log.h index 38eea75aa..06cd33e0e 100644 --- a/src/c-wrapper/api/c-event-log.h +++ b/src/c-wrapper/api/c-event-log.h @@ -23,6 +23,7 @@ // ============================================================================= +extern "C" { LINPHONE_PUBLIC LinphoneEventLog *linphone_event_log_new (); LINPHONE_PUBLIC LinphoneEventLogType linphone_event_log_get_type (const LinphoneEventLog *event_log); @@ -34,7 +35,7 @@ LINPHONE_PUBLIC LinphoneConferenceEvent *linphone_conference_event_new ( const LinphoneAddress *address ); -LINPHONE_PUBLIC const LinphoneAddress *linphone_conference_event_get_address (); +LINPHONE_PUBLIC const LinphoneAddress *linphone_conference_event_get_address (const LinphoneConferenceEvent *conference_event); LINPHONE_PUBLIC LinphoneConferenceParticipantEvent *linphone_conference_participant_event_new ( LinphoneEventLogType type, @@ -42,9 +43,10 @@ LINPHONE_PUBLIC LinphoneConferenceParticipantEvent *linphone_conference_particip const LinphoneAddress *participantAddress ); -LINPHONE_PUBLIC const LinphoneAddress *linphone_conference_participant_event_get_participant_address (); +LINPHONE_PUBLIC const LinphoneAddress *linphone_conference_participant_event_get_participant_address (const LinphoneConferenceParticipantEvent *conference_participant_event); LINPHONE_PUBLIC LinphoneMessageEvent *linphone_message_event_new (LinphoneMessage *message); LINPHONE_PUBLIC LinphoneMessage *linphone_message_event_get_message (const LinphoneMessageEvent *message_event); +} #endif // ifndef _C_EVENT_LOG_H_ diff --git a/src/c-wrapper/c-tools.h b/src/c-wrapper/c-tools.h index 1a4c23db3..a63eef594 100644 --- a/src/c-wrapper/c-tools.h +++ b/src/c-wrapper/c-tools.h @@ -52,7 +52,7 @@ ); #define L_DECLARE_C_STRUCT_NEW_DEFAULT(STRUCT, C_NAME) \ - Linphone ## STRUCT * CNAME ## _new() { \ + Linphone ## STRUCT * linphone_ ## C_NAME ## _new() { \ Linphone ## STRUCT * object = _linphone_ ## C_NAME ## _init(); \ object->cppPtr = make_shared(); \ return object; \