File borogove.h

File List > cpp > borogove.h

Go to the documentation of this file


#ifndef __BOROGOVE_H
#define __BOROGOVE_H

#ifndef MKDOCS
#include <stdbool.h>
#include <stddef.h>

#ifndef API_PREFIX
    #ifdef _WIN32
        #define API_PREFIX __declspec(dllimport)
    #else
        #define API_PREFIX
    #endif
#endif

#endif

typedef void (*borogove_panic_callback) (const char *info);

enum
#ifdef __clang__
__attribute__((enum_extensibility(closed)))
#endif
borogove_message_type {
    MessageChat = 0,
    MessageCall = 1,
    MessageChannel = 2,
    MessageChannelPrivate = 3
};

enum
#ifdef __clang__
__attribute__((enum_extensibility(closed)))
#endif
borogove_message_direction {
    MessageReceived = 0,
    MessageSent = 1
};

enum
#ifdef __clang__
__attribute__((enum_extensibility(closed)))
#endif
borogove_message_status {
    MessagePending = 0,
    MessageDeliveredToServer = 1,
    MessageDeliveredToDevice = 2,
    MessageFailedToSend = 3
};

typedef int borogove_event_handler_token;

enum
#ifdef __clang__
__attribute__((enum_extensibility(closed)))
#endif
borogove_ui_state {
    Pinned = 0,
    Open = 1,
    Closed = 2
};

enum
#ifdef __clang__
__attribute__((enum_extensibility(closed)))
#endif
borogove_calls_call_status {
    NoCall = 0,
    Incoming = 1,
    Outgoing = 2,
    Connecting = 3,
    Ongoing = 4,
    Failed = 5
};

#ifdef __cplusplus
extern "C" {
#endif

API_PREFIX const char *borogove_setup(borogove_panic_callback panic_callback);

API_PREFIX void borogove_stop(bool wait);

API_PREFIX void borogove_release(const void *ptr);

API_PREFIX void *borogove_persistence_media_store_fs_new(const char *path);

API_PREFIX void borogove_persistence_media_store_fs_get_media_path(void *media_store_fs, const char *uri, void (*handler) (const char*, void *handler__context), void *handler__context);

API_PREFIX void *borogove_persistence_sqlite_new(const char *dbfile, void *media);

API_PREFIX void borogove_persistence_sqlite_get_message(void *sqlite, const char *accountId, const char *chatId, const char *serverId, const char *localId, void (*handler) (void*, void *handler__context), void *handler__context);

API_PREFIX void borogove_persistence_sqlite_remove_account(void *sqlite, const char *accountId, bool completely);

API_PREFIX void borogove_persistence_sqlite_list_accounts(void *sqlite, void (*handler) (const char**, size_t, void *handler__context), void *handler__context);

API_PREFIX const char *borogove_chat_message_local_id(void *chat_message);

API_PREFIX const char *borogove_chat_message_server_id(void *chat_message);

API_PREFIX const char *borogove_chat_message_server_id_by(void *chat_message);

API_PREFIX enum borogove_message_type borogove_chat_message_type(void *chat_message);

API_PREFIX const char *borogove_chat_message_timestamp(void *chat_message);

API_PREFIX const char *borogove_chat_message_sender_id(void *chat_message);

API_PREFIX void *borogove_chat_message_reply_to_message(void *chat_message);

API_PREFIX const char *borogove_chat_message_thread_id(void *chat_message);

API_PREFIX size_t borogove_chat_message_attachments(void *chat_message, void ***outPtr);

API_PREFIX size_t borogove_chat_message_reaction_keys(void *chat_message, const char ***outPtr);

API_PREFIX size_t borogove_chat_message_reaction_details(void *chat_message, const char *reactionKey, void ***outPtr);

API_PREFIX const char *borogove_chat_message_text(void *chat_message);

API_PREFIX const char *borogove_chat_message_lang(void *chat_message);

API_PREFIX enum borogove_message_direction borogove_chat_message_direction(void *chat_message);

API_PREFIX enum borogove_message_status borogove_chat_message_status(void *chat_message);

API_PREFIX void borogove_chat_message_set_status(void *chat_message, enum borogove_message_status value);

API_PREFIX size_t borogove_chat_message_versions(void *chat_message, void ***outPtr);

API_PREFIX void *borogove_chat_message_encryption(void *chat_message);

API_PREFIX void borogove_chat_message_set_encryption(void *chat_message, void *value);

API_PREFIX void *borogove_chat_message_reply(void *chat_message);

API_PREFIX const char *borogove_chat_message_html(void *chat_message, void *sender);

API_PREFIX const char *borogove_chat_message_chat_id(void *chat_message);

API_PREFIX const char *borogove_chat_message_account(void *chat_message);

API_PREFIX bool borogove_chat_message_is_incoming(void *chat_message);

API_PREFIX const char *borogove_chat_message_thread_icon(void *chat_message);

API_PREFIX const char *borogove_chat_message_call_status(void *chat_message);

API_PREFIX const char *borogove_chat_message_call_sid(void *chat_message);

API_PREFIX const char *borogove_chat_message_call_duration(void *chat_message);

API_PREFIX void *borogove_chat_attachment_create(const char *name, const char *mime, int size, const char *uri);

API_PREFIX const char *borogove_chat_attachment_name(void *chat_attachment);

API_PREFIX const char *borogove_chat_attachment_mime(void *chat_attachment);

API_PREFIX int borogove_chat_attachment_size(void *chat_attachment);

API_PREFIX size_t borogove_chat_attachment_uris(void *chat_attachment, const char ***outPtr);

API_PREFIX size_t borogove_chat_attachment_hashes(void *chat_attachment, void ***outPtr);

API_PREFIX void *borogove_hash_from_hex(const char *algorithm, const char *hash);

API_PREFIX void *borogove_hash_from_uri(const char *uri);

API_PREFIX const char *borogove_hash_algorithm(void *hash);

API_PREFIX const char *borogove_hash_to_uri(void *hash);

API_PREFIX const char *borogove_hash_to_hex(void *hash);

API_PREFIX const char *borogove_hash_to_base_64(void *hash);

API_PREFIX const char *borogove_hash_to_base_64_url(void *hash);

API_PREFIX void *borogove_reaction_unicode(const char *unicode);

API_PREFIX const char *borogove_reaction_sender_id(void *reaction);

API_PREFIX const char *borogove_reaction_timestamp(void *reaction);

API_PREFIX const char *borogove_reaction_key(void *reaction);

API_PREFIX const char *borogove_reaction_render(void *reaction, const char *(*forText) (const char*, void*), void *forText__context, const char *(*forImage) (const char*, const char*, void*), void *forImage__context);

API_PREFIX void *borogove_chat_message_builder_new();

API_PREFIX const char *borogove_chat_message_builder_local_id(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_local_id(void *chat_message_builder, const char *value);

API_PREFIX const char *borogove_chat_message_builder_server_id(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_server_id(void *chat_message_builder, const char *value);

API_PREFIX const char *borogove_chat_message_builder_server_id_by(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_server_id_by(void *chat_message_builder, const char *value);

API_PREFIX enum borogove_message_type borogove_chat_message_builder_type(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_type(void *chat_message_builder, enum borogove_message_type value);

API_PREFIX const char *borogove_chat_message_builder_timestamp(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_timestamp(void *chat_message_builder, const char *value);

API_PREFIX const char *borogove_chat_message_builder_sender_id(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_sender_id(void *chat_message_builder, const char *value);

API_PREFIX void *borogove_chat_message_builder_reply_to_message(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_reply_to_message(void *chat_message_builder, void *value);

API_PREFIX const char *borogove_chat_message_builder_thread_id(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_thread_id(void *chat_message_builder, const char *value);

API_PREFIX size_t borogove_chat_message_builder_attachments(void *chat_message_builder, void ***outPtr);

API_PREFIX const char *borogove_chat_message_builder_text(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_text(void *chat_message_builder, const char *value);

API_PREFIX const char *borogove_chat_message_builder_lang(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_lang(void *chat_message_builder, const char *value);

API_PREFIX enum borogove_message_direction borogove_chat_message_builder_direction(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_direction(void *chat_message_builder, enum borogove_message_direction value);

API_PREFIX enum borogove_message_status borogove_chat_message_builder_status(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_status(void *chat_message_builder, enum borogove_message_status value);

API_PREFIX void borogove_chat_message_builder_set_versions(void *chat_message_builder, void *const *inPtr, size_t count);

API_PREFIX size_t borogove_chat_message_builder_versions(void *chat_message_builder, void ***outPtr);

API_PREFIX void *borogove_chat_message_builder_encryption(void *chat_message_builder);

API_PREFIX void borogove_chat_message_builder_set_encryption(void *chat_message_builder, void *value);

API_PREFIX void borogove_chat_message_builder_add_attachment(void *chat_message_builder, void *attachment);

API_PREFIX void borogove_chat_message_builder_set_html(void *chat_message_builder, const char *html);

API_PREFIX const char *borogove_chat_message_builder_chat_id(void *chat_message_builder);

API_PREFIX const char *borogove_chat_message_builder_get_sender_id(void *chat_message_builder);

API_PREFIX void *borogove_chat_message_builder_build(void *chat_message_builder);

API_PREFIX const char *borogove_participant_display_name(void *participant);

API_PREFIX const char *borogove_participant_photo_uri(void *participant);

API_PREFIX const char *borogove_participant_placeholder_uri(void *participant);

API_PREFIX bool borogove_participant_is_self(void *participant);

API_PREFIX void *borogove_persistence_dummy_new();

API_PREFIX void *borogove_push_receive(const char *data, void *persistence);

API_PREFIX const char *borogove_notification_title(void *notification);

API_PREFIX const char *borogove_notification_body(void *notification);

API_PREFIX const char *borogove_notification_account_id(void *notification);

API_PREFIX const char *borogove_notification_chat_id(void *notification);

API_PREFIX const char *borogove_notification_sender_id(void *notification);

API_PREFIX const char *borogove_notification_message_id(void *notification);

API_PREFIX enum borogove_message_type borogove_notification_type(void *notification);

API_PREFIX const char *borogove_notification_call_status(void *notification);

API_PREFIX const char *borogove_notification_call_sid(void *notification);

API_PREFIX const char *borogove_notification_image_uri(void *notification);

API_PREFIX const char *borogove_notification_lang(void *notification);

API_PREFIX const char *borogove_notification_timestamp(void *notification);

API_PREFIX void borogove_event_emitter_remove_event_listener(void *event_emitter, borogove_event_handler_token token);

API_PREFIX void *borogove_client_new(const char *address, void *persistence);

API_PREFIX void borogove_client_set_send_available(void *client, bool value);

API_PREFIX void borogove_client_start(void *client);

API_PREFIX void borogove_client_start_offline(void *client, void (*handler) (bool, void *handler__context), void *handler__context);

API_PREFIX void borogove_client_logout(void *client, bool completely);

API_PREFIX void borogove_client_use_password(void *client, const char *password);

API_PREFIX const char *borogove_client_account_id(void *client);

API_PREFIX const char *borogove_client_display_name(void *client);

API_PREFIX void borogove_client_set_display_name(void *client, const char *displayName);

API_PREFIX void borogove_client_prepare_attachment(void *client, void *source, void (*handler) (void*, void *handler__context), void *handler__context);

API_PREFIX size_t borogove_client_get_chats(void *client, void ***outPtr);

API_PREFIX void borogove_client_find_available_chats(void *client, const char *q, bool (*callback) (const char*, void**, size_t, void*), void *callback__context);

API_PREFIX void *borogove_client_start_chat(void *client, void *availableChat);

API_PREFIX void *borogove_client_get_chat(void *client, const char *chatId);

API_PREFIX void borogove_client_enable_push(void *client, const char *push_service, const char *endpoint, const unsigned char *p256dh, size_t p256dh__len, const unsigned char *auth, size_t auth__len, int grace, const unsigned char *vapid_private_pkcs8, size_t vapid_private_pkcs8__len, const char *const *claims, size_t claims__len);

API_PREFIX borogove_event_handler_token borogove_client_add_password_needed_listener(void *client, void (*handler) (void*, void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_status_online_listener(void *client, void (*handler) (void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_status_offline_listener(void *client, void (*handler) (void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_connection_failed_listener(void *client, void (*handler) (void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_tls_check_listener(void *client, bool (*handler) (const char*, const char**, size_t, void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_chat_message_listener(void *client, void (*handler) (void*, int, void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_sync_message_listener(void *client, void (*handler) (void*, void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_chats_updated_listener(void *client, void (*handler) (void**, size_t, void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_call_ring_listener(void *client, void (*handler) (void*, void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_call_retract_listener(void *client, void (*handler) (const char*, const char*, void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_call_ringing_listener(void *client, void (*handler) (void*, void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_call_update_status_listener(void *client, void (*handler) (void*, void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_call_media_listener(void *client, void (*handler) (void*, bool, bool, void*), void *handler__context);

API_PREFIX borogove_event_handler_token borogove_client_add_call_track_listener(void *client, void (*handler) (void*, void*, void**, size_t, void*), void *handler__context);

API_PREFIX void borogove_client_set_in_foreground(void *client);

API_PREFIX void borogove_client_set_not_in_foreground(void *client);

API_PREFIX const char *borogove_chat_chat_id(void *chat);

API_PREFIX enum borogove_ui_state borogove_chat_ui_state(void *chat);

API_PREFIX bool borogove_chat_is_blocked(void *chat);

API_PREFIX void *borogove_chat_last_message(void *chat);

API_PREFIX void borogove_chat_get_messages_before(void *chat, const char *beforeId, const char *beforeTime, void (*handler) (void**, size_t, void *handler__context), void *handler__context);

API_PREFIX void borogove_chat_get_messages_after(void *chat, const char *afterId, const char *afterTime, void (*handler) (void**, size_t, void *handler__context), void *handler__context);

API_PREFIX void borogove_chat_get_messages_around(void *chat, const char *aroundId, const char *aroundTime, void (*handler) (void**, size_t, void *handler__context), void *handler__context);

API_PREFIX void borogove_chat_send_message(void *chat, void *message);

API_PREFIX void borogove_chat_mark_read_up_to(void *chat, void *message);

API_PREFIX void borogove_chat_bookmark(void *chat);

API_PREFIX size_t borogove_chat_get_participants(void *chat, const char ***outPtr);

API_PREFIX void *borogove_chat_get_participant_details(void *chat, const char *participantId);

API_PREFIX void borogove_chat_correct_message(void *chat, const char *localId, void *message);

API_PREFIX void borogove_chat_add_reaction(void *chat, void *m, void *reaction);

API_PREFIX void borogove_chat_remove_reaction(void *chat, void *m, void *reaction);

API_PREFIX void borogove_chat_typing(void *chat, const char *threadId, const char *content);

API_PREFIX void borogove_chat_set_active(void *chat, bool active, const char *threadId);

API_PREFIX void borogove_chat_close(void *chat);

API_PREFIX void borogove_chat_toggle_pinned(void *chat);

API_PREFIX void borogove_chat_block(void *chat, void *reportSpam, bool onServer);

API_PREFIX void borogove_chat_unblock(void *chat, bool onServer);

API_PREFIX void borogove_chat_set_notifications(void *chat, bool filtered, bool mention, bool reply);

API_PREFIX bool borogove_chat_notifications_filtered(void *chat);

API_PREFIX bool borogove_chat_notify_mention(void *chat);

API_PREFIX bool borogove_chat_notify_reply(void *chat);

API_PREFIX const char *borogove_chat_last_message_id(void *chat);

API_PREFIX const char *borogove_chat_get_photo(void *chat);

API_PREFIX const char *borogove_chat_get_placeholder(void *chat);

API_PREFIX const char *borogove_chat_read_up_to(void *chat);

API_PREFIX int borogove_chat_unread_count(void *chat);

API_PREFIX const char *borogove_chat_preview(void *chat);

API_PREFIX void borogove_chat_set_display_name(void *chat, const char *displayName);

API_PREFIX const char *borogove_chat_get_display_name(void *chat);

API_PREFIX void borogove_chat_set_trusted(void *chat, bool trusted);

API_PREFIX bool borogove_chat_is_trusted(void *chat);

API_PREFIX bool borogove_chat_syncing(void *chat);

API_PREFIX bool borogove_chat_can_audio_call(void *chat);

API_PREFIX bool borogove_chat_can_video_call(void *chat);

API_PREFIX void *borogove_chat_start_call(void *chat, bool audio, bool video);

API_PREFIX void borogove_chat_accept_call(void *chat);

API_PREFIX void borogove_chat_hangup(void *chat);

API_PREFIX enum borogove_calls_call_status borogove_chat_call_status(void *chat);

API_PREFIX void *borogove_chat_dtmf(void *chat);

API_PREFIX size_t borogove_chat_video_tracks(void *chat, void ***outPtr);

API_PREFIX const char *borogove_chat_encryption_mode(void *chat);

API_PREFIX const char *borogove_calls_media_stream_track_id(void *media_stream_track);

API_PREFIX bool borogove_calls_media_stream_track_muted(void *media_stream_track);

API_PREFIX const char *borogove_calls_media_stream_track_kind(void *media_stream_track);

API_PREFIX size_t borogove_calls_media_stream_track_supported_audio_formats(void *media_stream_track, void ***outPtr);

API_PREFIX void borogove_calls_media_stream_track_add_pcm_listener(void *media_stream_track, void (*callback) (short*, size_t, int, int, void*), void *callback__context);

API_PREFIX void borogove_calls_media_stream_track_add_ready_for_pcm_listener(void *media_stream_track, void (*callback) (void*), void *callback__context);

API_PREFIX void borogove_calls_media_stream_track_write_pcm(void *media_stream_track, const short *pcm, size_t pcm__len, int clockRate, int channels);

API_PREFIX void borogove_calls_media_stream_track_stop(void *media_stream_track);

API_PREFIX void *borogove_calls_audio_format_new(const char *format, unsigned char payloadType, int clockRate, int channels);

API_PREFIX int borogove_calls_audio_format_clock_rate(void *audio_format);

API_PREFIX int borogove_calls_audio_format_channels(void *audio_format);

API_PREFIX const char *borogove_available_chat_chat_id(void *available_chat);

API_PREFIX const char *borogove_available_chat_display_name(void *available_chat);

API_PREFIX const char *borogove_available_chat_note(void *available_chat);

API_PREFIX bool borogove_available_chat_is_channel(void *available_chat);

API_PREFIX const char *borogove_calls_initiated_session_sid(void *initiated_session);

API_PREFIX const char *borogove_calls_initiated_session_chat_id(void *initiated_session);

API_PREFIX void borogove_calls_initiated_session_accept(void *initiated_session);

API_PREFIX void borogove_calls_initiated_session_hangup(void *initiated_session);

API_PREFIX void borogove_calls_initiated_session_add_media(void *initiated_session, void *const *streams, size_t streams__len);

API_PREFIX enum borogove_calls_call_status borogove_calls_initiated_session_call_status(void *initiated_session);

API_PREFIX size_t borogove_calls_initiated_session_audio_tracks(void *initiated_session, void ***outPtr);

API_PREFIX size_t borogove_calls_initiated_session_video_tracks(void *initiated_session, void ***outPtr);

API_PREFIX void *borogove_calls_initiated_session_dtmf(void *initiated_session);

API_PREFIX void borogove_calls_initiated_session_supply_media(void *initiated_session, void *const *streams, size_t streams__len);

API_PREFIX void *borogove_calls_media_stream_new();

API_PREFIX void *borogove_calls_media_stream_make_audio();

API_PREFIX void borogove_calls_media_stream_add_track(void *media_stream, void *track);

API_PREFIX size_t borogove_calls_media_stream_get_tracks(void *media_stream, void ***outPtr);

API_PREFIX void *borogove_attachment_source_new(const char *path, const char *mime);

API_PREFIX const char *borogove_attachment_source_path(void *attachment_source);

API_PREFIX const char *borogove_attachment_source_type(void *attachment_source);

API_PREFIX const char *borogove_attachment_source_name(void *attachment_source);

API_PREFIX int borogove_attachment_source_size(void *attachment_source);

API_PREFIX bool borogove_channel_is_private(void *channel);

API_PREFIX void borogove_calls_dtmf_sender_insert_dtmf(void *dtmf_sender, const char *tones);

API_PREFIX void *borogove_custom_emoji_reaction_custom(const char *text, const char *uri);

API_PREFIX const char *borogove_custom_emoji_reaction_uri(void *custom_emoji_reaction);

API_PREFIX const char *borogove_identicon_svg(const char *source);

API_PREFIX bool borogove_config_relative_hash_uri();

API_PREFIX void borogove_config_set_relative_hash_uri(bool value);

API_PREFIX void borogove_config_enable_constrained_memory_mode();

#ifdef __cplusplus
}
#endif

#undef API_PREFIX

#endif