1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 /* e-name-selector-entry.c - Single-line text entry widget for EDestinations.
5 * Copyright (C) 2004 Novell, Inc.
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.
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.
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.
21 * Authors: Hans Petter Jansson <hpj@novell.com>
24 #ifndef E_NAME_SELECTOR_ENTRY_H
25 #define E_NAME_SELECTOR_ENTRY_H
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>
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))
42 #define MINIMUM_QUERY_LENGTH "/apps/evolution/addressbook/completion/minimum_query_length"
44 typedef struct _ENameSelectorEntry ENameSelectorEntry;
45 typedef struct _ENameSelectorEntryClass ENameSelectorEntryClass;
47 struct _ENameSelectorEntryClass {
48 GtkEntryClass parent_class;
49 void (*updated) (ENameSelectorEntry *entry, char *email);
54 struct _ENameSelectorEntry {
59 PangoAttrList *attr_list;
60 ESourceList *source_list;
61 EContactStore *contact_store;
62 ETreeModelGenerator *email_generator;
63 EDestinationStore *destination_store;
64 GtkEntryCompletion *entry_completion;
66 guint type_ahead_complete_cb_id;
67 guint update_completions_cb_id;
69 EDestination *popup_destination;
72 gpointer (*contact_editor_func) (EBook *, EContact *, gboolean, gboolean);
73 gpointer (*contact_list_editor_func) (EBook *, EContact *, gboolean, gboolean);
76 GType e_name_selector_entry_get_type (void);
77 ENameSelectorEntry *e_name_selector_entry_new (void);
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);
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);
87 /* TEMPORARY API - DO NOT USE */
88 void e_name_selector_entry_set_contact_editor_func (ENameSelectorEntry *name_selector_entry,
90 void e_name_selector_entry_set_contact_list_editor_func (ENameSelectorEntry *name_selector_entry,
95 #endif /* E_NAME_SELECTOR_ENTRY_H */