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__
29 #include <glib-object.h>
31 #include <telepathy-glib/account.h>
33 #include "empathy-message.h"
34 #include "empathy-log-manager.h"
38 #define EMPATHY_TYPE_LOG_STORE (empathy_log_store_get_type ())
39 #define EMPATHY_LOG_STORE(obj) \
40 (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMPATHY_TYPE_LOG_STORE, \
42 #define EMPATHY_IS_LOG_STORE(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMPATHY_TYPE_LOG_STORE))
44 #define EMPATHY_LOG_STORE_GET_INTERFACE(inst) \
45 (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EMPATHY_TYPE_LOG_STORE, \
46 EmpathyLogStoreInterface))
48 typedef struct _EmpathyLogStore EmpathyLogStore; /* dummy object */
49 typedef struct _EmpathyLogStoreInterface EmpathyLogStoreInterface;
51 struct _EmpathyLogStoreInterface
53 GTypeInterface parent;
55 const gchar * (*get_name) (EmpathyLogStore *self);
56 gboolean (*exists) (EmpathyLogStore *self, TpAccount *account,
57 const gchar *chat_id, gboolean chatroom);
58 gboolean (*add_message) (EmpathyLogStore *self, const gchar *chat_id,
59 gboolean chatroom, EmpathyMessage *message, GError **error);
60 GList * (*get_dates) (EmpathyLogStore *self, TpAccount *account,
61 const gchar *chat_id, gboolean chatroom);
62 GList * (*get_messages_for_date) (EmpathyLogStore *self,
63 TpAccount *account, const gchar *chat_id, gboolean chatroom,
65 GList * (*get_last_messages) (EmpathyLogStore *self, TpAccount *account,
66 const gchar *chat_id, gboolean chatroom);
67 GList * (*get_chats) (EmpathyLogStore *self,
69 GList * (*search_new) (EmpathyLogStore *self, const gchar *text);
70 void (*ack_message) (EmpathyLogStore *self, const gchar *chat_id,
71 gboolean chatroom, EmpathyMessage *message);
72 GList * (*get_filtered_messages) (EmpathyLogStore *self, TpAccount *account,
73 const gchar *chat_id, gboolean chatroom, guint num_messages,
74 EmpathyLogMessageFilter filter, gpointer user_data);
77 GType empathy_log_store_get_type (void) G_GNUC_CONST;
79 const gchar *empathy_log_store_get_name (EmpathyLogStore *self);
80 gboolean empathy_log_store_exists (EmpathyLogStore *self,
81 TpAccount *account, const gchar *chat_id, gboolean chatroom);
82 gboolean empathy_log_store_add_message (EmpathyLogStore *self,
83 const gchar *chat_id, gboolean chatroom, EmpathyMessage *message,
85 GList *empathy_log_store_get_dates (EmpathyLogStore *self,
86 TpAccount *account, const gchar *chat_id, gboolean chatroom);
87 GList *empathy_log_store_get_messages_for_date (EmpathyLogStore *self,
88 TpAccount *account, const gchar *chat_id, gboolean chatroom,
90 GList *empathy_log_store_get_last_messages (EmpathyLogStore *self,
91 TpAccount *account, const gchar *chat_id, gboolean chatroom);
92 GList *empathy_log_store_get_chats (EmpathyLogStore *self,
94 GList *empathy_log_store_search_new (EmpathyLogStore *self,
96 void empathy_log_store_ack_message (EmpathyLogStore *self,
97 const gchar *chat_id, gboolean chatroom, EmpathyMessage *message);
98 GList *empathy_log_store_get_filtered_messages (EmpathyLogStore *self,
99 TpAccount *account, const gchar *chat_id, gboolean chatroom,
100 guint num_messages, EmpathyLogMessageFilter filter, gpointer user_data);
104 #endif /* ENABLE_TPL */
105 #endif /* __EMPATHY_LOG_STORE_H__ */