~ubuntu-branches/ubuntu/utopic/gossip/utopic

« back to all changes in this revision

Viewing changes to libgossip/gossip-log.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-03-05 08:21:49 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20070305082149-9hnkboi8t8fizggz
Tags: 0.23-0ubuntu1
* New upstream release.
* debian/control.in:
  - changed Maintainer field.
  - bumped dbus requirement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef __GOSSIP_LOG_H__
22
22
#define __GOSSIP_LOG_H__
23
23
 
 
24
#include <glib-object.h>
 
25
 
 
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"
26
31
 
27
32
G_BEGIN_DECLS
28
33
 
29
 
void           gossip_log_init                      (GossipSession        *session);
30
 
void           gossip_log_term                      (void);
31
 
 
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))
 
40
 
 
41
typedef struct _GossipLogManager      GossipLogManager;
 
42
typedef struct _GossipLogManagerClass GossipLogManagerClass;
 
43
typedef struct _GossipLogSearchHit    GossipLogSearchHit;
 
44
 
 
45
struct _GossipLogManager {
 
46
        GObject parent;
 
47
};
 
48
 
 
49
struct _GossipLogManagerClass {
 
50
        GObjectClass parent_class;
 
51
};
 
52
 
33
53
typedef void (* GossipLogMessageFunc)  (GossipContact  *own_contact,
34
54
                                        GossipMessage  *message,
35
55
                                        gpointer        user_data);
36
56
 
37
 
void           gossip_log_handler_add_for_contact   (GossipContact        *contact,
38
 
                                                     GossipLogMessageFunc  func,
39
 
                                                     gpointer              user_data);
40
 
void           gossip_log_handler_add_for_chatroom  (GossipChatroom       *chatroom,
41
 
                                                     GossipLogMessageFunc  func,
42
 
                                                     gpointer              user_data);
43
 
void           gossip_log_handler_remove            (GossipLogMessageFunc  func);
 
57
GType             gossip_log_manager_get_type          (void) G_GNUC_CONST;
 
58
 
 
59
/* Log message handlers */
 
60
void              gossip_log_handler_add_for_contact   (GossipLogManager      *manager,
 
61
                                                        GossipContact         *contact,
 
62
                                                        GossipLogMessageFunc   func,
 
63
                                                        gpointer               user_data);
 
64
void              gossip_log_handler_add_for_chatroom  (GossipLogManager      *manager,
 
65
                                                        GossipChatroom        *chatroom,
 
66
                                                        GossipLogMessageFunc   func,
 
67
                                                        gpointer               user_data);
 
68
void              gossip_log_handler_remove            (GossipLogManager      *manager,
 
69
                                                        GossipLogMessageFunc   func);
 
70
 
44
71
 
45
72
/* Utils */
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);
 
78
 
50
79
 
51
80
/* Contact functions */
52
 
GList *        gossip_log_get_dates_for_contact     (GossipContact        *contact);
53
 
GList *        gossip_log_get_messages_for_contact  (GossipContact        *contact,
54
 
                                                     const gchar          *date);
55
 
void           gossip_log_message_for_contact       (GossipMessage        *message,
56
 
                                                     gboolean              incoming);
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,
 
84
                                                        const gchar           *date);
 
85
void              gossip_log_message_for_contact       (GossipLogManager      *manager,
 
86
                                                        GossipMessage         *message,
 
87
                                                        gboolean               incoming);
 
88
gboolean          gossip_log_exists_for_contact        (GossipContact         *contact);
 
89
GList *           gossip_log_get_last_for_contact      (GossipLogManager      *manager,
 
90
                                                        GossipContact         *contact);
 
91
 
59
92
 
60
93
/* Chatroom functions */
61
 
GList *        gossip_log_get_dates_for_chatroom    (GossipChatroom       *chatroom);
62
 
GList *        gossip_log_get_messages_for_chatroom (GossipChatroom       *chatroom,
63
 
                                                     const gchar          *date);
64
 
void           gossip_log_message_for_chatroom      (GossipChatroom       *chatroom,
65
 
                                                     GossipMessage        *message,
66
 
                                                     gboolean              incoming);
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,
 
97
                                                        const gchar           *date);
 
98
void              gossip_log_message_for_chatroom      (GossipLogManager      *manager,
 
99
                                                        GossipChatroom        *chatroom,
 
100
                                                        GossipMessage         *message,
 
101
                                                        gboolean               incoming);
 
102
gboolean          gossip_log_exists_for_chatroom       (GossipChatroom        *chatroom);
 
103
 
68
104
 
69
105
/* Searching */
70
 
typedef struct _GossipLogSearchHit GossipLogSearchHit;
71
 
 
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);
78
 
 
79
 
 
80
 
#ifdef DEPRECATED
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,
 
107
                                                        const gchar           *text);
 
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);
86
113
 
87
114
G_END_DECLS
88
115