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 #include "empathy-log-store.h"
26 empathy_log_store_get_type (void)
28 static GType type = 0;
30 static const GTypeInfo info = {
31 sizeof (EmpathyLogStoreInterface),
33 NULL, /* base_finalize */
34 NULL, /* class_init */
35 NULL, /* class_finalize */
36 NULL, /* class_data */
39 NULL /* instance_init */
41 type = g_type_register_static (G_TYPE_INTERFACE, "EmpathyLogStore",
48 empathy_log_store_get_name (EmpathyLogStore *self)
50 if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_name)
53 return EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_name (self);
57 empathy_log_store_exists (EmpathyLogStore *self,
62 if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->exists)
65 return EMPATHY_LOG_STORE_GET_INTERFACE (self)->exists (
66 self, account, chat_id, chatroom);
72 empathy_log_store_add_message (EmpathyLogStore *self,
75 EmpathyMessage *message,
78 if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->add_message)
81 return EMPATHY_LOG_STORE_GET_INTERFACE (self)->add_message (
82 self, chat_id, chatroom, message, error);
86 empathy_log_store_get_dates (EmpathyLogStore *self,
91 if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_dates)
94 return EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_dates (
95 self, account, chat_id, chatroom);
99 empathy_log_store_get_messages_for_date (EmpathyLogStore *self,
101 const gchar *chat_id,
105 if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_messages_for_date)
108 return EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_messages_for_date (
109 self, account, chat_id, chatroom, date);
113 empathy_log_store_get_last_messages (EmpathyLogStore *self,
115 const gchar *chat_id,
118 if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_last_messages)
121 return EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_last_messages (
122 self, account, chat_id, chatroom);
126 empathy_log_store_get_chats (EmpathyLogStore *self,
129 if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_chats)
132 return EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_chats (self, account);
136 empathy_log_store_search_new (EmpathyLogStore *self,
139 if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->search_new)
142 return EMPATHY_LOG_STORE_GET_INTERFACE (self)->search_new (self, text);
146 empathy_log_store_ack_message (EmpathyLogStore *self,
147 const gchar *chat_id,
149 EmpathyMessage *message)
151 if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->ack_message)
154 EMPATHY_LOG_STORE_GET_INTERFACE (self)->ack_message (
155 self, chat_id, chatroom, message);
159 empathy_log_store_get_filtered_messages (EmpathyLogStore *self,
161 const gchar *chat_id,
164 EmpathyLogMessageFilter filter,
168 if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_filtered_messages)
171 return EMPATHY_LOG_STORE_GET_INTERFACE (self)->get_filtered_messages (
172 self, account, chat_id, chatroom, num_messages, filter, user_data);