21
21
#ifndef __GOSSIP_LOG_H__
22
22
#define __GOSSIP_LOG_H__
24
#include <glib-object.h>
26
#include "gossip-account.h"
27
#include "gossip-chatroom.h"
28
#include "gossip-contact.h"
29
#include "gossip-log.h"
24
30
#include "gossip-message.h"
25
#include "gossip-session.h"
29
void gossip_log_init (GossipSession *session);
30
void gossip_log_term (void);
32
/* Log message handlers */
34
#define GOSSIP_TYPE_LOG_MANAGER (gossip_log_manager_get_type ())
35
#define GOSSIP_LOG_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GOSSIP_TYPE_LOG_MANAGER, GossipLogManager))
36
#define GOSSIP_LOG_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GOSSIP_TYPE_LOG_MANAGER, GossipLogManagerClass))
37
#define GOSSIP_IS_LOG_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GOSSIP_TYPE_LOG_MANAGER))
38
#define GOSSIP_IS_LOG_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GOSSIP_TYPE_LOG_MANAGER))
39
#define GOSSIP_LOG_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GOSSIP_TYPE_LOG_MANAGER, GossipLogManagerClass))
41
typedef struct _GossipLogManager GossipLogManager;
42
typedef struct _GossipLogManagerClass GossipLogManagerClass;
43
typedef struct _GossipLogSearchHit GossipLogSearchHit;
45
struct _GossipLogManager {
49
struct _GossipLogManagerClass {
50
GObjectClass parent_class;
33
53
typedef void (* GossipLogMessageFunc) (GossipContact *own_contact,
34
54
GossipMessage *message,
35
55
gpointer user_data);
37
void gossip_log_handler_add_for_contact (GossipContact *contact,
38
GossipLogMessageFunc func,
40
void gossip_log_handler_add_for_chatroom (GossipChatroom *chatroom,
41
GossipLogMessageFunc func,
43
void gossip_log_handler_remove (GossipLogMessageFunc func);
57
GType gossip_log_manager_get_type (void) G_GNUC_CONST;
59
/* Log message handlers */
60
void gossip_log_handler_add_for_contact (GossipLogManager *manager,
61
GossipContact *contact,
62
GossipLogMessageFunc func,
64
void gossip_log_handler_add_for_chatroom (GossipLogManager *manager,
65
GossipChatroom *chatroom,
66
GossipLogMessageFunc func,
68
void gossip_log_handler_remove (GossipLogManager *manager,
69
GossipLogMessageFunc func);
46
GossipContact *gossip_log_get_own_contact (GossipAccount *account);
47
GList * gossip_log_get_contacts (GossipAccount *account);
48
GList * gossip_log_get_chatrooms (GossipAccount *account);
49
gchar * gossip_log_get_date_readable (const gchar *date);
73
GList * gossip_log_get_contacts (GossipLogManager *manager,
74
GossipAccount *account);
75
GList * gossip_log_get_chatrooms (GossipLogManager *manager,
76
GossipAccount *account);
77
gchar * gossip_log_get_date_readable (const gchar *date);
51
80
/* Contact functions */
52
GList * gossip_log_get_dates_for_contact (GossipContact *contact);
53
GList * gossip_log_get_messages_for_contact (GossipContact *contact,
55
void gossip_log_message_for_contact (GossipMessage *message,
57
gboolean gossip_log_exists_for_contact (GossipContact *contact);
58
GList * gossip_log_get_last_for_contact (GossipContact *contact);
81
GList * gossip_log_get_dates_for_contact (GossipContact *contact);
82
GList * gossip_log_get_messages_for_contact (GossipLogManager *manager,
83
GossipContact *contact,
85
void gossip_log_message_for_contact (GossipLogManager *manager,
86
GossipMessage *message,
88
gboolean gossip_log_exists_for_contact (GossipContact *contact);
89
GList * gossip_log_get_last_for_contact (GossipLogManager *manager,
90
GossipContact *contact);
60
93
/* Chatroom functions */
61
GList * gossip_log_get_dates_for_chatroom (GossipChatroom *chatroom);
62
GList * gossip_log_get_messages_for_chatroom (GossipChatroom *chatroom,
64
void gossip_log_message_for_chatroom (GossipChatroom *chatroom,
65
GossipMessage *message,
67
gboolean gossip_log_exists_for_chatroom (GossipChatroom *chatroom);
94
GList * gossip_log_get_dates_for_chatroom (GossipChatroom *chatroom);
95
GList * gossip_log_get_messages_for_chatroom (GossipLogManager *manager,
96
GossipChatroom *chatroom,
98
void gossip_log_message_for_chatroom (GossipLogManager *manager,
99
GossipChatroom *chatroom,
100
GossipMessage *message,
102
gboolean gossip_log_exists_for_chatroom (GossipChatroom *chatroom);
70
typedef struct _GossipLogSearchHit GossipLogSearchHit;
72
GList * gossip_log_search_new (const gchar *text);
73
void gossip_log_search_free (GList *hits);
74
GossipAccount *gossip_log_search_hit_get_account (GossipLogSearchHit *hit);
75
GossipContact *gossip_log_search_hit_get_contact (GossipLogSearchHit *hit);
76
const gchar * gossip_log_search_hit_get_date (GossipLogSearchHit *hit);
77
const gchar * gossip_log_search_hit_get_filename (GossipLogSearchHit *hit);
81
void gossip_log_show_for_contact (GtkWidget *window,
82
GossipContact *contact);
83
void gossip_log_show_for_chatroom (GtkWidget *window,
84
GossipChatroom *chatroom);
85
#endif /* DEPRECATED */
106
GList * gossip_log_search_new (GossipLogManager *manager,
108
void gossip_log_search_free (GList *hits);
109
GossipAccount * gossip_log_search_hit_get_account (GossipLogSearchHit *hit);
110
GossipContact * gossip_log_search_hit_get_contact (GossipLogSearchHit *hit);
111
const gchar * gossip_log_search_hit_get_date (GossipLogSearchHit *hit);
112
const gchar * gossip_log_search_hit_get_filename (GossipLogSearchHit *hit);