]> git.0d.be Git - empathy.git/blob - libempathy/empathy-log-store.h
Added checks to the arguments of empathy_message_equal.
[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
32 G_BEGIN_DECLS
33
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, \
37                                EmpathyLogStore))
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))
43
44 typedef struct _EmpathyLogStore EmpathyLogStore; /* dummy object */
45 typedef struct _EmpathyLogStoreInterface EmpathyLogStoreInterface;
46
47 struct _EmpathyLogStoreInterface
48 {
49   GTypeInterface parent;
50
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,
60       const gchar *date);
61   GList * (*get_last_messages) (EmpathyLogStore *self, McAccount *account,
62       const gchar *chat_id, gboolean chatroom);
63   GList * (*get_chats) (EmpathyLogStore *self,
64             McAccount         *account);
65   GList * (*search_new) (EmpathyLogStore *self, const gchar *text);
66   void (*ack_message) (EmpathyLogStore *self, const gchar *chat_id,
67       gboolean chatroom, EmpathyMessage *message);
68 };
69
70 GType empathy_log_store_get_type (void) G_GNUC_CONST;
71
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,
77     GError **error);
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,
82     const gchar *date);
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,
86     McAccount *account);
87 GList *empathy_log_store_search_new (EmpathyLogStore *self,
88     const gchar *text);
89 void empathy_log_store_ack_message (EmpathyLogStore *self,
90     const gchar *chat_id, gboolean chatroom, EmpathyMessage *message);
91
92 G_END_DECLS
93
94 #endif /* __EMPATHY_LOG_STORE_H__ */