]> git.0d.be Git - empathy.git/blob - libempathy/empathy-log-store.h
Add empathy_tp_chat_get_connection() to direct access the channel's connection.
[empathy.git] / libempathy / empathy-log-store.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2008 Collabora Ltd.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Authors: Jonny Lamb <jonny.lamb@collabora.co.uk>
21  */
22
23 #ifndef __EMPATHY_LOG_STORE_H__
24 #define __EMPATHY_LOG_STORE_H__
25
26 #include <glib-object.h>
27
28 #include <libmissioncontrol/mc-account.h>
29
30 #include "empathy-message.h"
31 #include "empathy-log-manager.h"
32
33 G_BEGIN_DECLS
34
35 #define EMPATHY_TYPE_LOG_STORE (empathy_log_store_get_type ())
36 #define EMPATHY_LOG_STORE(obj) \
37   (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMPATHY_TYPE_LOG_STORE, \
38                                EmpathyLogStore))
39 #define EMPATHY_IS_LOG_STORE(obj) \
40   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMPATHY_TYPE_LOG_STORE))
41 #define EMPATHY_LOG_STORE_GET_INTERFACE(inst) \
42   (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EMPATHY_TYPE_LOG_STORE, \
43                                   EmpathyLogStoreInterface))
44
45 typedef struct _EmpathyLogStore EmpathyLogStore; /* dummy object */
46 typedef struct _EmpathyLogStoreInterface EmpathyLogStoreInterface;
47
48 struct _EmpathyLogStoreInterface
49 {
50   GTypeInterface parent;
51
52   const gchar * (*get_name) (EmpathyLogStore *self);
53   gboolean (*exists) (EmpathyLogStore *self, McAccount *account,
54       const gchar *chat_id, gboolean chatroom);
55   gboolean (*add_message) (EmpathyLogStore *self, const gchar *chat_id,
56       gboolean chatroom, EmpathyMessage *message, GError **error);
57   GList * (*get_dates) (EmpathyLogStore *self, McAccount *account,
58       const gchar *chat_id, gboolean chatroom);
59   GList * (*get_messages_for_date) (EmpathyLogStore *self,
60       McAccount *account, const gchar *chat_id, gboolean chatroom,
61       const gchar *date);
62   GList * (*get_last_messages) (EmpathyLogStore *self, McAccount *account,
63       const gchar *chat_id, gboolean chatroom);
64   GList * (*get_chats) (EmpathyLogStore *self,
65             McAccount         *account);
66   GList * (*search_new) (EmpathyLogStore *self, const gchar *text);
67   void (*ack_message) (EmpathyLogStore *self, const gchar *chat_id,
68       gboolean chatroom, EmpathyMessage *message);
69   GList * (*get_filtered_messages) (EmpathyLogStore *self, McAccount *account,
70       const gchar *chat_id, gboolean chatroom, guint num_messages,
71       EmpathyLogMessageFilter filter, gpointer user_data);
72 };
73
74 GType empathy_log_store_get_type (void) G_GNUC_CONST;
75
76 const gchar *empathy_log_store_get_name (EmpathyLogStore *self);
77 gboolean empathy_log_store_exists (EmpathyLogStore *self,
78     McAccount *account, const gchar *chat_id, gboolean chatroom);
79 gboolean empathy_log_store_add_message (EmpathyLogStore *self,
80     const gchar *chat_id, gboolean chatroom, EmpathyMessage *message,
81     GError **error);
82 GList *empathy_log_store_get_dates (EmpathyLogStore *self,
83     McAccount *account, const gchar *chat_id, gboolean chatroom);
84 GList *empathy_log_store_get_messages_for_date (EmpathyLogStore *self,
85     McAccount *account, const gchar *chat_id, gboolean chatroom,
86     const gchar *date);
87 GList *empathy_log_store_get_last_messages (EmpathyLogStore *self,
88     McAccount *account, const gchar *chat_id, gboolean chatroom);
89 GList *empathy_log_store_get_chats (EmpathyLogStore *self,
90     McAccount *account);
91 GList *empathy_log_store_search_new (EmpathyLogStore *self,
92     const gchar *text);
93 void empathy_log_store_ack_message (EmpathyLogStore *self,
94     const gchar *chat_id, gboolean chatroom, EmpathyMessage *message);
95 GList *empathy_log_store_get_filtered_messages (EmpathyLogStore *self,
96     McAccount *account, const gchar *chat_id, gboolean chatroom,
97     guint num_messages, EmpathyLogMessageFilter filter, gpointer user_data);
98
99 G_END_DECLS
100
101 #endif /* __EMPATHY_LOG_STORE_H__ */