1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2007-2008 Collabora Ltd.
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.
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.
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
19 * Authors: Xavier Claessens <xclaesse@gmail.com>
22 #ifndef __EMPATHY_CONTACT_WIDGET_H__
23 #define __EMPATHY_CONTACT_WIDGET_H__
27 #include <libempathy/empathy-contact.h>
28 #include "empathy-account-chooser.h"
32 typedef struct _EmpathyContactWidget EmpathyContactWidget;
33 typedef struct _EmpathyContactWidgetClass EmpathyContactWidgetClass;
34 typedef struct _EmpathyContactWidgetPriv EmpathyContactWidgetPriv;
36 struct _EmpathyContactWidgetClass
39 GtkBoxClass parent_class;
42 struct _EmpathyContactWidget
46 EmpathyContactWidgetPriv *priv;
49 GType empathy_contact_widget_get_type (void);
52 #define EMPATHY_TYPE_CONTACT_WIDGET \
53 (empathy_contact_widget_get_type ())
54 #define EMPATHY_CONTACT_WIDGET(obj) \
55 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
56 EMPATHY_TYPE_CONTACT_WIDGET, \
57 EmpathyContactWidget))
58 #define EMPATHY_CONTACT_WIDGET_CLASS(klass) \
59 (G_TYPE_CHECK_CLASS_CAST((klass), \
60 EMPATHY_TYPE_CONTACT_WIDGET, \
61 EmpathyContactWidgetClass))
62 #define EMPATHY_IS_CONTACT_WIDGET(obj) \
63 (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
64 EMPATHY_TYPE_CONTACT_WIDGET))
65 #define EMPATHY_IS_CONTACT_WIDGET_CLASS(klass) \
66 (G_TYPE_CHECK_CLASS_TYPE((klass), \
67 EMPATHY_TYPE_CONTACT_WIDGET))
68 #define EMPATHY_CONTACT_WIDGET_GET_CLASS(obj) \
69 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
70 EMPATHY_TYPE_CONTACT_WIDGET, \
71 EmpathyContactWidgetClass))
74 * EmpathyContactWidgetFlags:
75 * @EMPATHY_CONTACT_WIDGET_EDIT_NONE: Don't show any widgets to edit any details
76 * of the contact. This should be the option for widgets that merely display
77 * information about a contact.
78 * @EMPATHY_CONTACT_WIDGET_EDIT_ALIAS: Show a #GtkEntry allowing changes to the
80 * @EMPATHY_CONTACT_WIDGET_EDIT_AVATAR: Show an #EmpathyAvatarChooser allowing
81 * changes to the contact's avatar.
82 * @EMPATHY_CONTACT_WIDGET_EDIT_ACCOUNT: Show an #EmpathyAccountChooser allowing
83 * changes to the contact's account.
84 * @EMPATHY_CONTACT_WIDGET_EDIT_ID: Show a #GtkEntry allowing changes to the
85 * contact's identifier.
86 * @EMPATHY_CONTACT_WIDGET_EDIT_GROUPS: Show a widget to change the groups the
88 * @EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP: Make widgets more designed for a tooltip.
89 * For example, make widgets not selectable.
91 * Flags used when creating an #EmpathyContactWidget to specify which features
92 * should be available.
96 EMPATHY_CONTACT_WIDGET_EDIT_NONE = 0,
97 EMPATHY_CONTACT_WIDGET_EDIT_ALIAS = 1 << 0,
98 EMPATHY_CONTACT_WIDGET_EDIT_AVATAR = 1 << 1,
99 EMPATHY_CONTACT_WIDGET_EDIT_ACCOUNT = 1 << 2,
100 EMPATHY_CONTACT_WIDGET_EDIT_ID = 1 << 3,
101 EMPATHY_CONTACT_WIDGET_EDIT_GROUPS = 1 << 4,
102 EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP = 1 << 5,
103 EMPATHY_CONTACT_WIDGET_SHOW_LOCATION = 1 << 6,
104 EMPATHY_CONTACT_WIDGET_NO_SET_ALIAS = 1 << 7,
105 EMPATHY_CONTACT_WIDGET_SHOW_DETAILS = 1 << 8,
106 EMPATHY_CONTACT_WIDGET_EDIT_DETAILS = 1 << 9,
107 EMPATHY_CONTACT_WIDGET_NO_STATUS = 1 << 10,
108 EMPATHY_CONTACT_WIDGET_NO_ACCOUNT = 1 << 11,
109 } EmpathyContactWidgetFlags;
111 GtkWidget * empathy_contact_widget_new (EmpathyContact *contact,
112 EmpathyContactWidgetFlags flags);
113 EmpathyContact *empathy_contact_widget_get_contact (GtkWidget *widget);
114 void empathy_contact_widget_set_contact (GtkWidget *widget,
115 EmpathyContact *contact);
116 void empathy_contact_widget_set_account_filter (GtkWidget *widget,
117 EmpathyAccountChooserFilterFunc filter, gpointer user_data);
118 const gchar *empathy_contact_widget_get_alias (GtkWidget *widget);
122 #endif /* __EMPATHY_CONTACT_WIDGET_H__ */