1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2008 Collabora Ltd.
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.
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.
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., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301 USA
20 * Authors: Jonny Lamb <jonny.lamb@collabora.co.uk>
23 #ifndef __EMPATHY_LOG_STORE_H__
24 #define __EMPATHY_LOG_STORE_H__
26 #include <glib-object.h>
28 #include <libmissioncontrol/mc-account.h>
30 #include "empathy-message.h"
31 #include "empathy-log-manager.h"
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, \
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))
45 typedef struct _EmpathyLogStore EmpathyLogStore; /* dummy object */
46 typedef struct _EmpathyLogStoreInterface EmpathyLogStoreInterface;
48 struct _EmpathyLogStoreInterface
50 GTypeInterface parent;
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,
62 GList * (*get_last_messages) (EmpathyLogStore *self, McAccount *account,
63 const gchar *chat_id, gboolean chatroom);
64 GList * (*get_chats) (EmpathyLogStore *self,
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);
74 GType empathy_log_store_get_type (void) G_GNUC_CONST;
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,
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,
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,
91 GList *empathy_log_store_search_new (EmpathyLogStore *self,
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);
101 #endif /* __EMPATHY_LOG_STORE_H__ */