Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / libedataserverui / e-name-selector-entry.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
3 /* e-name-selector-entry.c - Single-line text entry widget for EDestinations.
4  *
5  * Copyright (C) 2004 Novell, Inc.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of version 2 of the GNU Lesser General Public
9  * License as published by the Free Software Foundation.
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 Lesser General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * Authors: Hans Petter Jansson <hpj@novell.com>
22  */
23
24 #ifndef E_NAME_SELECTOR_ENTRY_H
25 #define E_NAME_SELECTOR_ENTRY_H
26
27 #include <gtk/gtkentry.h>
28 #include <libebook/e-contact.h>
29 #include <libedataserverui/e-contact-store.h>
30 #include <libedataserverui/e-destination-store.h>
31 #include <libedataserverui/e-tree-model-generator.h>
32
33 G_BEGIN_DECLS
34
35 #define E_TYPE_NAME_SELECTOR_ENTRY            (e_name_selector_entry_get_type ())
36 #define E_NAME_SELECTOR_ENTRY(obj)            (GTK_CHECK_CAST ((obj), e_name_selector_entry_get_type (), ENameSelectorEntry))
37 #define E_NAME_SELECTOR_ENTRY_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), e_name_selector_entry_get_type (), ENameSelectorEntryClass))
38 #define E_IS_NAME_SELECTOR_ENTRY(obj)         (GTK_CHECK_TYPE (obj, e_name_selector_entry_get_type ()))
39 #define E_IS_NAME_SELECTOR_ENTRY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), e_name_selector_entry_get_type ()))
40 #define E_NAME_SELECTOR_ENTRY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), E_NAME_SELECTOR_ENTRY_TYPE, ENameSelectorEntryClass))
41
42 #define MINIMUM_QUERY_LENGTH "/apps/evolution/addressbook/completion/minimum_query_length"
43
44 typedef struct _ENameSelectorEntry      ENameSelectorEntry;
45 typedef struct _ENameSelectorEntryClass ENameSelectorEntryClass;
46
47 struct _ENameSelectorEntryClass {
48         GtkEntryClass parent_class;
49         void (*updated) (ENameSelectorEntry *entry, char *email);
50         void *reserved1;
51         void *reserved2;
52 };
53
54 struct _ENameSelectorEntry {
55         GtkEntry             parent;
56
57         /* Private */
58
59         PangoAttrList       *attr_list;
60         ESourceList         *source_list;
61         EContactStore       *contact_store;
62         ETreeModelGenerator *email_generator;
63         EDestinationStore   *destination_store;
64         GtkEntryCompletion  *entry_completion;
65
66         guint                type_ahead_complete_cb_id;
67         guint                update_completions_cb_id;
68
69         EDestination        *popup_destination;
70
71         /* TEMPORARY */
72         gpointer             (*contact_editor_func) (EBook *, EContact *, gboolean, gboolean);
73         gpointer             (*contact_list_editor_func) (EBook *, EContact *, gboolean, gboolean);
74 };
75
76 GType               e_name_selector_entry_get_type               (void);
77 ENameSelectorEntry *e_name_selector_entry_new                    (void);
78
79 EContactStore      *e_name_selector_entry_peek_contact_store     (ENameSelectorEntry *name_selector_entry);
80 void                e_name_selector_entry_set_contact_store      (ENameSelectorEntry *name_selector_entry,
81                                                                   EContactStore *contact_store);
82
83 EDestinationStore  *e_name_selector_entry_peek_destination_store (ENameSelectorEntry *name_selector_entry);
84 void                e_name_selector_entry_set_destination_store  (ENameSelectorEntry *name_selector_entry,
85                                                                   EDestinationStore *destination_store);
86
87 /* TEMPORARY API - DO NOT USE */
88 void                e_name_selector_entry_set_contact_editor_func      (ENameSelectorEntry *name_selector_entry,
89                                                                         gpointer func);
90 void                e_name_selector_entry_set_contact_list_editor_func (ENameSelectorEntry *name_selector_entry,
91                                                                         gpointer func);
92
93 G_END_DECLS
94
95 #endif /* E_NAME_SELECTOR_ENTRY_H */