aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-name-selector-entry.h
blob: 6aa0943e56023d11a33f1bfab4d3029f46299f7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

/* e-name-selector-entry.c - Single-line text entry widget for EDestinations.
 *
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 * Authors: Hans Petter Jansson <hpj@novell.com>
 */

#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
#error "Only <e-util/e-util.h> should be included directly."
#endif

#ifndef E_NAME_SELECTOR_ENTRY_H
#define E_NAME_SELECTOR_ENTRY_H

#include <gtk/gtk.h>
#include <libebook/libebook.h>

#include <e-util/e-contact-store.h>
#include <e-util/e-destination-store.h>
#include <e-util/e-tree-model-generator.h>

/* Standard GObject macros */
#define E_TYPE_NAME_SELECTOR_ENTRY \
    (e_name_selector_entry_get_type ())
#define E_NAME_SELECTOR_ENTRY(obj) \
    (G_TYPE_CHECK_INSTANCE_CAST \
    ((obj), E_TYPE_NAME_SELECTOR_ENTRY, ENameSelectorEntry))
#define E_NAME_SELECTOR_ENTRY_CLASS(cls) \
    (G_TYPE_CHECK_CLASS_CAST \
    ((cls), E_TYPE_NAME_SELECTOR_ENTRY, ENameSelectorEntryClass))
#define E_IS_NAME_SELECTOR_ENTRY(obj) \
    (G_TYPE_CHECK_INSTANCE_TYPE \
    ((obj), E_TYPE_NAME_SELECTOR_ENTRY))
#define E_IS_NAME_SELECTOR_ENTRY_CLASS(cls) \
    (G_TYPE_CHECK_CLASS_TYPE \
    ((cls), E_TYPE_NAME_SELECTOR_ENTRY))
#define E_NAME_SELECTOR_ENTRY_GET_CLASS(obj) \
    (G_TYPE_INSTANCE_GET_CLASS \
    ((obj), E_TYPE_NAME_SELECTOR_ENTRY, ENameSelectorEntryClass))

G_BEGIN_DECLS

typedef struct _ENameSelectorEntry ENameSelectorEntry;
typedef struct _ENameSelectorEntryClass ENameSelectorEntryClass;
typedef struct _ENameSelectorEntryPrivate ENameSelectorEntryPrivate;

struct _ENameSelectorEntry {
    GtkEntry parent;
    ENameSelectorEntryPrivate *priv;
};

struct _ENameSelectorEntryClass {
    GtkEntryClass parent_class;

    void (*updated) (ENameSelectorEntry *entry, gchar *email);

    gpointer reserved1;
    gpointer reserved2;
};

GType       e_name_selector_entry_get_type  (void) G_GNUC_CONST;
ENameSelectorEntry *
        e_name_selector_entry_new   (ESourceRegistry *registry);
ESourceRegistry *
        e_name_selector_entry_get_registry
                        (ENameSelectorEntry *name_selector_entry);
void        e_name_selector_entry_set_registry
                        (ENameSelectorEntry *name_selector_entry,
                         ESourceRegistry *registry);
gint        e_name_selector_entry_get_minimum_query_length
                        (ENameSelectorEntry *name_selector_entry);
void        e_name_selector_entry_set_minimum_query_length
                        (ENameSelectorEntry *name_selector_entry,
                         gint length);
gboolean    e_name_selector_entry_get_show_address
                        (ENameSelectorEntry *name_selector_entry);
void        e_name_selector_entry_set_show_address
                        (ENameSelectorEntry *name_selector_entry,
                         gboolean show);
EContactStore * e_name_selector_entry_peek_contact_store
                        (ENameSelectorEntry *name_selector_entry);
void        e_name_selector_entry_set_contact_store
                        (ENameSelectorEntry *name_selector_entry,
                         EContactStore *contact_store);
EDestinationStore *
        e_name_selector_entry_peek_destination_store
                        (ENameSelectorEntry *name_selector_entry);
void        e_name_selector_entry_set_destination_store
                        (ENameSelectorEntry *name_selector_entry,
                         EDestinationStore *destination_store);
EDestination *  e_name_selector_entry_get_popup_destination
                        (ENameSelectorEntry *name_selector_entry);

/* TEMPORARY API - DO NOT USE */
void        e_name_selector_entry_set_contact_editor_func
                        (ENameSelectorEntry *name_selector_entry,
                         gpointer func);
void        e_name_selector_entry_set_contact_list_editor_func
                        (ENameSelectorEntry *name_selector_entry,
                         gpointer func);
gchar *     ens_util_populate_user_query_fields
                        (GSList *user_query_fields,
                         const gchar *cue_str,
                         const gchar *encoded_cue_str);

G_END_DECLS

#endif /* E_NAME_SELECTOR_ENTRY_H */