]> git.0d.be Git - empathy.git/blob - libempathy/empathy-log-manager.h
Remove useless mission-control includes
[empathy.git] / libempathy / empathy-log-manager.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2003-2007 Imendio AB
4  * Copyright (C) 2007-2008 Collabora Ltd.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public
17  * License along with this program; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19  * Boston, MA  02110-1301  USA
20  *
21  * Authors: Xavier Claessens <xclaesse@gmail.com>
22  */
23
24 #ifndef __EMPATHY_LOG_MANAGER_H__
25 #define __EMPATHY_LOG_MANAGER_H__
26
27 #include <glib-object.h>
28
29 #include "empathy-message.h"
30 #include "empathy-dispatcher.h"
31
32 G_BEGIN_DECLS
33
34 #define EMPATHY_TYPE_LOG_MANAGER (empathy_log_manager_get_type ())
35 #define EMPATHY_LOG_MANAGER(o) \
36   (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_LOG_MANAGER, \
37                                EmpathyLogManager))
38 #define EMPATHY_LOG_MANAGER_CLASS(k) \
39   (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_LOG_MANAGER, \
40                             EmpathyLogManagerClass))
41 #define EMPATHY_IS_LOG_MANAGER(o) \
42   (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_LOG_MANAGER))
43 #define EMPATHY_IS_LOG_MANAGER_CLASS(k) \
44   (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_LOG_MANAGER))
45 #define EMPATHY_LOG_MANAGER_GET_CLASS(o) \
46   (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_LOG_MANAGER, \
47                               EmpathyLogManagerClass))
48
49 typedef struct _EmpathyLogManager EmpathyLogManager;
50 typedef struct _EmpathyLogManagerClass EmpathyLogManagerClass;
51 typedef struct _EmpathyLogSearchHit EmpathyLogSearchHit;
52
53 struct _EmpathyLogManager
54 {
55   GObject parent;
56   gpointer priv;
57 };
58
59 struct _EmpathyLogManagerClass
60 {
61   GObjectClass parent_class;
62 };
63
64 struct _EmpathyLogSearchHit
65 {
66   EmpathyAccount *account;
67   gchar     *chat_id;
68   gboolean   is_chatroom;
69   gchar     *filename;
70   gchar     *date;
71 };
72
73 typedef gboolean (*EmpathyLogMessageFilter) (EmpathyMessage *message,
74     gpointer user_data);
75
76 GType empathy_log_manager_get_type (void) G_GNUC_CONST;
77 EmpathyLogManager *empathy_log_manager_dup_singleton (void);
78 gboolean empathy_log_manager_add_message (EmpathyLogManager *manager,
79     const gchar *chat_id, gboolean chatroom, EmpathyMessage *message,
80     GError **error);
81 gboolean empathy_log_manager_exists (EmpathyLogManager *manager,
82     EmpathyAccount *account, const gchar *chat_id, gboolean chatroom);
83 GList *empathy_log_manager_get_dates (EmpathyLogManager *manager,
84     EmpathyAccount *account, const gchar *chat_id, gboolean chatroom);
85 GList *empathy_log_manager_get_messages_for_date (EmpathyLogManager *manager,
86     EmpathyAccount *account, const gchar *chat_id, gboolean chatroom,
87     const gchar *date);
88 GList *empathy_log_manager_get_filtered_messages (EmpathyLogManager *manager,
89     EmpathyAccount *account, const gchar *chat_id, gboolean chatroom,
90     guint num_messages, EmpathyLogMessageFilter filter, gpointer user_data);
91 GList *empathy_log_manager_get_chats (EmpathyLogManager *manager,
92     EmpathyAccount *account);
93 GList *empathy_log_manager_search_new (EmpathyLogManager *manager,
94     const gchar *text);
95 void empathy_log_manager_search_free (GList *hits);
96 gchar *empathy_log_manager_get_date_readable (const gchar *date);
97 void empathy_log_manager_search_hit_free (EmpathyLogSearchHit *hit);
98 void empathy_log_manager_observe (EmpathyLogManager *log_manager,
99     EmpathyDispatcher *dispatcher);
100
101 G_END_DECLS
102
103 #endif /* __EMPATHY_LOG_MANAGER_H__ */