]> git.0d.be Git - empathy.git/blob - libempathy/empathy-individual-manager.h
Add confirmation dialog to Remove
[empathy.git] / libempathy / empathy-individual-manager.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2007-2010 Collabora Ltd.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library 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  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  *
19  * Authors: Xavier Claessens <xclaesse@gmail.com>
20  *          Travis Reitter <travis.reitter@collabora.co.uk>
21  */
22
23 #ifndef __EMPATHY_INDIVIDUAL_MANAGER_H__
24 #define __EMPATHY_INDIVIDUAL_MANAGER_H__
25
26 #include <glib.h>
27 #include <folks/folks.h>
28
29 #include "empathy-contact.h"
30
31 G_BEGIN_DECLS
32 #define EMPATHY_TYPE_INDIVIDUAL_MANAGER         (empathy_individual_manager_get_type ())
33 #define EMPATHY_INDIVIDUAL_MANAGER(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_INDIVIDUAL_MANAGER, EmpathyIndividualManager))
34 #define EMPATHY_INDIVIDUAL_MANAGER_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), EMPATHY_TYPE_INDIVIDUAL_MANAGER, EmpathyIndividualManagerClass))
35 #define EMPATHY_IS_INDIVIDUAL_MANAGER(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_INDIVIDUAL_MANAGER))
36 #define EMPATHY_IS_INDIVIDUAL_MANAGER_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_INDIVIDUAL_MANAGER))
37 #define EMPATHY_INDIVIDUAL_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_INDIVIDUAL_MANAGER, EmpathyIndividualManagerClass))
38
39 typedef enum
40 {
41   EMPATHY_INDIVIDUAL_MANAGER_NO_FLAGS = 0,
42   EMPATHY_INDIVIDUAL_MANAGER_CAN_ADD = 1 << 0,
43   EMPATHY_INDIVIDUAL_MANAGER_CAN_REMOVE = 1 << 1,
44   EMPATHY_INDIVIDUAL_MANAGER_CAN_ALIAS = 1 << 2,
45   EMPATHY_INDIVIDUAL_MANAGER_CAN_GROUP = 1 << 3,
46   EMPATHY_INDIVIDUAL_MANAGER_CAN_BLOCK = 1 << 4,
47   EMPATHY_INDIVIDUAL_MANAGER_CAN_REPORT_ABUSIVE = 1 << 5,
48 } EmpathyIndividualManagerFlags;
49
50 typedef struct _EmpathyIndividualManager EmpathyIndividualManager;
51 typedef struct _EmpathyIndividualManagerClass EmpathyIndividualManagerClass;
52
53 struct _EmpathyIndividualManager
54 {
55   GObject parent;
56   gpointer priv;
57 };
58
59 struct _EmpathyIndividualManagerClass
60 {
61   GObjectClass parent_class;
62 };
63
64 GType empathy_individual_manager_get_type (void) G_GNUC_CONST;
65
66 gboolean empathy_individual_manager_initialized (void);
67
68 EmpathyIndividualManager *empathy_individual_manager_dup_singleton (void);
69
70 GList *empathy_individual_manager_get_members (
71     EmpathyIndividualManager *manager);
72
73 FolksIndividual *empathy_individual_manager_lookup_member (
74     EmpathyIndividualManager *manager,
75     const gchar *id);
76
77 void empathy_individual_manager_add_from_contact (
78     EmpathyIndividualManager *manager,
79     EmpathyContact *contact);
80
81 void empathy_individual_manager_remove (EmpathyIndividualManager *manager,
82     FolksIndividual *individual,
83     const gchar *message);
84
85 void empathy_individual_manager_remove_group (EmpathyIndividualManager *manager,
86     const gchar *group);
87
88 void empathy_individual_manager_link_personas (EmpathyIndividualManager *self,
89     GList *personas);
90
91 void empathy_individual_manager_unlink_individual (
92     EmpathyIndividualManager *self,
93     FolksIndividual *individual);
94
95 gboolean empathy_individual_manager_supports_blocking (
96     EmpathyIndividualManager *self,
97     FolksIndividual *individual);
98
99 void empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
100     FolksIndividual *individual,
101     gboolean blocked);
102
103 G_END_DECLS
104 #endif /* __EMPATHY_INDIVIDUAL_MANAGER_H__ */