]> git.0d.be Git - empathy.git/blob - libempathy-gtk/empathy-individual-widget.h
UOA: Do not segfault when "Done" or "Cancel" button clicked but widget is not ready yet
[empathy.git] / libempathy-gtk / empathy-individual-widget.h
1 /*
2  * Copyright (C) 2010 Collabora Ltd.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  *
18  * Authors: Philip Withnall <philip.withnall@collabora.co.uk>
19  */
20
21 #ifndef __EMPATHY_INDIVIDUAL_WIDGET_H__
22 #define __EMPATHY_INDIVIDUAL_WIDGET_H__
23
24 #include <gtk/gtk.h>
25
26 #include <folks/folks.h>
27
28 G_BEGIN_DECLS
29
30 /**
31  * EmpathyIndividualWidgetFlags:
32  * @EMPATHY_INDIVIDUAL_WIDGET_NONE: Don't show any widgets to edit any
33  * details of the individual, or to display any extended details of the
34  * individual. This should be the option for widgets that merely display basic
35  * information about an individual.
36  * @EMPATHY_INDIVIDUAL_WIDGET_EDIT_ALIAS: Show a #GtkEntry allowing changes to
37  * the individual's alias.
38  * @EMPATHY_INDIVIDUAL_WIDGET_EDIT_FAVOURITE: Show a checkbutton
39  * allowing changes to the individual's favourite status.
40  * @EMPATHY_INDIVIDUAL_WIDGET_EDIT_GROUPS: Show a widget to change the groups
41  * the individual is in.
42  * @EMPATHY_INDIVIDUAL_WIDGET_FOR_TOOLTIP: Make widgets more designed for a
43  * tooltip. For example, make labels not selectable.
44  * @EMPATHY_INDIVIDUAL_WIDGET_SHOW_LOCATION: Display the individual's current
45  * location textually or using a map (if compiled with libchamplain support).
46  * @EMPATHY_INDIVIDUAL_WIDGET_SHOW_DETAILS: Fetch and display extended vCard
47  * details of the individual, if the individual has them.
48  * @EMPATHY_INDIVIDUAL_WIDGET_SHOW_PERSONAS: List the #FolksPersona<!-- -->s
49  * contained in the individual.
50  *
51  * Flags used when creating an #EmpathyIndividualWidget to specify which
52  * features should be available.
53  */
54 typedef enum
55 {
56   EMPATHY_INDIVIDUAL_WIDGET_NONE = 0,
57   EMPATHY_INDIVIDUAL_WIDGET_EDIT_ALIAS   = 1 << 0,
58   EMPATHY_INDIVIDUAL_WIDGET_EDIT_FAVOURITE = 1 << 1,
59   EMPATHY_INDIVIDUAL_WIDGET_EDIT_GROUPS  = 1 << 2,
60   EMPATHY_INDIVIDUAL_WIDGET_FOR_TOOLTIP  = 1 << 3,
61   EMPATHY_INDIVIDUAL_WIDGET_SHOW_LOCATION  = 1 << 4,
62   EMPATHY_INDIVIDUAL_WIDGET_SHOW_DETAILS = 1 << 5,
63   EMPATHY_INDIVIDUAL_WIDGET_SHOW_PERSONAS = 1 << 6,
64   EMPATHY_INDIVIDUAL_WIDGET_SHOW_CLIENT_TYPES = 1 << 7,
65 } EmpathyIndividualWidgetFlags;
66
67 #define EMPATHY_TYPE_INDIVIDUAL_WIDGET (empathy_individual_widget_get_type ())
68 #define EMPATHY_INDIVIDUAL_WIDGET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
69     EMPATHY_TYPE_INDIVIDUAL_WIDGET, EmpathyIndividualWidget))
70 #define EMPATHY_INDIVIDUAL_WIDGET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), \
71     EMPATHY_TYPE_INDIVIDUAL_WIDGET, EmpathyIndividualWidgetClass))
72 #define EMPATHY_IS_INDIVIDUAL_WIDGET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
73     EMPATHY_TYPE_INDIVIDUAL_WIDGET))
74 #define EMPATHY_IS_INDIVIDUAL_WIDGET_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), \
75     EMPATHY_TYPE_INDIVIDUAL_WIDGET))
76 #define EMPATHY_INDIVIDUAL_WIDGET_GET_CLASS(o) ( \
77     G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_INDIVIDUAL_WIDGET, \
78         EmpathyIndividualWidgetClass))
79
80 typedef struct {
81         GtkBox parent;
82
83         /*<private>*/
84         gpointer priv;
85 } EmpathyIndividualWidget;
86
87 typedef struct {
88         GtkBoxClass parent_class;
89 } EmpathyIndividualWidgetClass;
90
91 GType empathy_individual_widget_get_type (void) G_GNUC_CONST;
92
93 GtkWidget * empathy_individual_widget_new (FolksIndividual *individual,
94     EmpathyIndividualWidgetFlags flags);
95
96 FolksIndividual * empathy_individual_widget_get_individual (
97     EmpathyIndividualWidget *self);
98 void empathy_individual_widget_set_individual (EmpathyIndividualWidget *self,
99     FolksIndividual *individual);
100
101 G_END_DECLS
102
103 #endif /*  __EMPATHY_INDIVIDUAL_WIDGET_H__ */