webkitchatcontainer.h 3.7 KB
Newer Older
aviau's avatar
aviau committed
1
/*
2
 *  Copyright (C) 2016-2019 Savoir-faire Linux Inc.
aviau's avatar
aviau committed
3
 *  Author: Alexandre Viau <alexandre.viau@savoirfairelinux.com>
4
 *  Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
aviau's avatar
aviau committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 *  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.
 */

#pragma once

23
// Gtk
aviau's avatar
aviau committed
24
#include <gtk/gtk.h>
25
#include <map>
aviau's avatar
aviau committed
26

27 28
// LRC
#include <api/interaction.h>
aviau's avatar
aviau committed
29

30 31 32 33
namespace lrc { namespace api {
class ConversationModel;
}};

aviau's avatar
aviau committed
34 35 36 37 38 39 40 41 42 43 44
G_BEGIN_DECLS

#define WEBKIT_CHAT_CONTAINER_TYPE            (webkit_chat_container_get_type ())
#define WEBKIT_CHAT_CONTAINER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), WEBKIT_CHAT_CONTAINER_TYPE, WebKitChatContainer))
#define WEBKIT_CHAT_CONTAINER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_CHAT_CONTAINER_TYPE, WebKitChatContainerClass))
#define IS_WEBKIT_CHAT_CONTAINER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_CHAT_CONTAINER_TYPE))
#define IS_WEBKIT_CHAT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_CHAT_CONTAINER_TYPE))

typedef struct _WebKitChatContainer      WebKitChatContainer;
typedef struct _WebKitChatContainerClass WebKitChatContainerClass;

45 46 47 48
GType      webkit_chat_container_get_type             (void) G_GNUC_CONST;
GtkWidget* webkit_chat_container_new                  (void);
void       webkit_chat_container_clear                (WebKitChatContainer *view);
void       webkit_chat_container_clear_sender_images  (WebKitChatContainer *view);
49 50
void       webkit_chat_container_print_new_interaction(WebKitChatContainer *view, lrc::api::ConversationModel& conversation_model, uint64_t msgId, const lrc::api::interaction::Info& interaction);
void       webkit_chat_container_update_interaction   (WebKitChatContainer *view, lrc::api::ConversationModel& conversation_model, uint64_t msgId, const lrc::api::interaction::Info& interaction);
51
void       webkit_chat_container_remove_interaction   (WebKitChatContainer *view, uint64_t interactionId);
52
void       webkit_chat_container_print_history        (WebKitChatContainer *view, lrc::api::ConversationModel& conversation_model, const std::map<uint64_t, lrc::api::interaction::Info> interactions);
53 54 55
void       webkit_chat_container_set_sender_image     (WebKitChatContainer *view, const std::string& sender, const std::string& senderImage);
gboolean   webkit_chat_container_is_ready             (WebKitChatContainer *view);
void       webkit_chat_container_set_display_links    (WebKitChatContainer *view, bool display);
56
void       webkit_chat_container_set_invitation       (WebKitChatContainer *view, bool show, const std::string& contactUri, const std::string& contactId);
57
void       webkit_chat_set_header_visible             (WebKitChatContainer *view, bool isVisible);
58
void       webkit_chat_set_record_visible             (WebKitChatContainer *view, bool isVisible);
59
void       webkit_chat_set_dark_mode                  (WebKitChatContainer *view, bool darkMode, const std::string& background);
60
void       webkit_chat_update_chatview_frame          (WebKitChatContainer *view, bool accountEnabled, bool isBanned, bool isInvited, const gchar* alias, const gchar* bestId);
aviau's avatar
aviau committed
61 62

G_END_DECLS