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., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, 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"
34 #define EMPATHY_TYPE_LOG_STORE (empathy_log_store_get_type ())
35 #define EMPATHY_LOG_STORE(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMPATHY_TYPE_LOG_STORE, \
38 #define EMPATHY_IS_LOG_STORE(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMPATHY_TYPE_LOG_STORE))
40 #define EMPATHY_LOG_STORE_GET_INTERFACE(inst) \
41 (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EMPATHY_TYPE_LOG_STORE, \
42 EmpathyLogStoreInterface))
44 typedef struct _EmpathyLogStore EmpathyLogStore; /* dummy object */
45 typedef struct _EmpathyLogStoreInterface EmpathyLogStoreInterface;
47 struct _EmpathyLogStoreInterface
49 GTypeInterface parent;
51 const gchar * (*get_name) (EmpathyLogStore *self);
52 gboolean (*exists) (EmpathyLogStore *self, McAccount *account,
53 const gchar *chat_id, gboolean chatroom);
54 gboolean (*add_message) (EmpathyLogStore *self, const gchar *chat_id,
55 gboolean chatroom, EmpathyMessage *message, GError **error);
56 GList * (*get_dates) (EmpathyLogStore *self, McAccount *account,
57 const gchar *chat_id, gboolean chatroom);
58 GList * (*get_messages_for_date) (EmpathyLogStore *self,
59 McAccount *account, const gchar *chat_id, gboolean chatroom,
61 GList * (*get_last_messages) (EmpathyLogStore *self, McAccount *account,
62 const gchar *chat_id, gboolean chatroom);
63 GList * (*get_chats) (EmpathyLogStore *self,
65 GList * (*search_new) (EmpathyLogStore *self, const gchar *text);
66 void (*ack_message) (EmpathyLogStore *self, const gchar *chat_id,
67 gboolean chatroom, EmpathyMessage *message);
70 GType empathy_log_store_get_type (void) G_GNUC_CONST;
72 const gchar *empathy_log_store_get_name (EmpathyLogStore *self);
73 gboolean empathy_log_store_exists (EmpathyLogStore *self,
74 McAccount *account, const gchar *chat_id, gboolean chatroom);
75 gboolean empathy_log_store_add_message (EmpathyLogStore *self,
76 const gchar *chat_id, gboolean chatroom, EmpathyMessage *message,
78 GList *empathy_log_store_get_dates (EmpathyLogStore *self,
79 McAccount *account, const gchar *chat_id, gboolean chatroom);
80 GList *empathy_log_store_get_messages_for_date (EmpathyLogStore *self,
81 McAccount *account, const gchar *chat_id, gboolean chatroom,
83 GList *empathy_log_store_get_last_messages (EmpathyLogStore *self,
84 McAccount *account, const gchar *chat_id, gboolean chatroom);
85 GList *empathy_log_store_get_chats (EmpathyLogStore *self,
87 GList *empathy_log_store_search_new (EmpathyLogStore *self,
89 void empathy_log_store_ack_message (EmpathyLogStore *self,
90 const gchar *chat_id, gboolean chatroom, EmpathyMessage *message);
94 #endif /* __EMPATHY_LOG_STORE_H__ */