]> git.0d.be Git - empathy.git/blob - libempathy/empathy-log-manager.h
New window for viewing logs.
[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) 2007 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: Xavier Claessens <xclaesse@gmail.com>
21  */
22
23 #ifndef __EMPATHY_LOG_MANAGER_H__
24 #define __EMPATHY_LOG_MANAGER_H__
25
26 #include <glib-object.h>
27
28 #include <libmissioncontrol/mc-account.h>
29
30 #include "gossip-message.h"
31
32 G_BEGIN_DECLS
33
34 #define EMPATHY_TYPE_LOG_MANAGER         (empathy_log_manager_get_type ())
35 #define EMPATHY_LOG_MANAGER(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_LOG_MANAGER, EmpathyLogManager))
36 #define EMPATHY_LOG_MANAGER_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_LOG_MANAGER, EmpathyLogManagerClass))
37 #define EMPATHY_IS_LOG_MANAGER(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_LOG_MANAGER))
38 #define EMPATHY_IS_LOG_MANAGER_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_LOG_MANAGER))
39 #define EMPATHY_LOG_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_LOG_MANAGER, EmpathyLogManagerClass))
40
41 typedef struct _EmpathyLogManager      EmpathyLogManager;
42 typedef struct _EmpathyLogManagerClass EmpathyLogManagerClass;
43 typedef struct _EmpathyLogManagerPriv  EmpathyLogManagerPriv;
44 typedef struct _EmpathyLogSearchHit    EmpathyLogSearchHit;
45
46 struct _EmpathyLogManager {
47         GObject parent;
48 };
49
50 struct _EmpathyLogManagerClass {
51         GObjectClass parent_class;
52 };
53
54 struct _EmpathyLogSearchHit {
55         McAccount *account;
56         gchar     *chat_id;
57         gboolean   is_chatroom;
58         gchar     *filename;
59         gchar     *date;
60 };
61
62 GType              empathy_log_manager_get_type              (void) G_GNUC_CONST;
63 EmpathyLogManager *empathy_log_manager_new                   (void);
64 void               empathy_log_manager_add_message           (EmpathyLogManager *manager,
65                                                               const gchar       *chat_id,
66                                                               gboolean           chatroom,
67                                                               GossipMessage     *message);
68 GList *            empathy_log_manager_get_dates             (EmpathyLogManager *manager,
69                                                               McAccount         *account,
70                                                               const gchar       *chat_id,
71                                                               gboolean           chatroom);
72 GList *            empathy_log_manager_get_messages_for_date (EmpathyLogManager *manager,
73                                                               McAccount         *account,
74                                                               const gchar       *chat_id,
75                                                               gboolean           chatroom,
76                                                               const gchar       *date);
77 GList *            empathy_log_manager_get_last_messages     (EmpathyLogManager *manager,
78                                                               McAccount         *account,
79                                                               const gchar       *chat_id,
80                                                               gboolean           chatroom);
81 GList *            empathy_log_manager_get_chats             (EmpathyLogManager *manager,
82                                                               McAccount         *account);
83 GList *            empathy_log_manager_search_new            (EmpathyLogManager *manager,
84                                                               const gchar       *text);
85 void               empathy_log_manager_search_free           (GList             *hits);
86 gchar *            empathy_log_manager_get_date_readable     (const gchar       *date);
87
88 G_END_DECLS
89
90 #endif /* __EMPATHY_LOG_MANAGER_H__ */