aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/select-names/e-select-names-model.h
blob: 9f89e91093cec074f956c6b08e7298911fa83ebc (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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

/*
 * Authors:
 *   Chris Lahey <clahey@ximian.com>
 *   Jon Trowbridge <trow@ximian.com>
 *
 * Copyright (C) 2000, 2001 Ximian, Inc.
 */

#ifndef __E_SELECT_NAMES_MODEL_H__
#define __E_SELECT_NAMES_MODEL_H__

#include <time.h>
#include <gtk/gtkobject.h>
#include <stdio.h>
#include <e-util/e-list.h>
#include <addressbook/backend/ebook/e-card.h>
#include <addressbook/backend/ebook/e-destination.h>

#define E_TYPE_SELECT_NAMES_MODEL            (e_select_names_model_get_type ())
#define E_SELECT_NAMES_MODEL(obj)            (GTK_CHECK_CAST ((obj), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModel))
#define E_SELECT_NAMES_MODEL_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModelClass))
#define E_IS_SELECT_NAMES_MODEL(obj)         (GTK_CHECK_TYPE ((obj), E_TYPE_SELECT_NAMES_MODEL))
#define E_IS_SELECT_NAMES_MODEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MODEL))

typedef struct _ESelectNamesModel ESelectNamesModel;
typedef struct _ESelectNamesModelClass ESelectNamesModelClass;
struct _ESelectNamesModelPrivate;

struct _ESelectNamesModel {
    GtkObject object;
    
    struct _ESelectNamesModelPrivate *priv;
};

struct _ESelectNamesModelClass {
    GtkObjectClass parent_class;

    void (*changed) (ESelectNamesModel *model);
    void (*resized) (ESelectNamesModel *model, gint index, gint old_len, gint new_len);
};

GtkType e_select_names_model_get_type  (void);

ESelectNamesModel *e_select_names_model_new       (void);
ESelectNamesModel *e_select_names_model_duplicate (ESelectNamesModel *old);

const gchar  *e_select_names_model_get_textification (ESelectNamesModel *model);
const gchar  *e_select_names_model_get_address_text  (ESelectNamesModel *model);

gint                e_select_names_model_count               (ESelectNamesModel *model);
gint                e_select_names_model_get_limit           (ESelectNamesModel *model);
void                e_select_names_model_set_limit           (ESelectNamesModel *model, gint limit);
gboolean            e_select_names_model_at_limit            (ESelectNamesModel *model);

const EDestination *e_select_names_model_get_destination     (ESelectNamesModel *model, gint index);
gchar              *e_select_names_model_export_destinationv (ESelectNamesModel *model);
void                e_select_names_model_import_destinationv (ESelectNamesModel *model,
                                  gchar *destinationv);
ECard              *e_select_names_model_get_card            (ESelectNamesModel *model, gint index);
const gchar        *e_select_names_model_get_string          (ESelectNamesModel *model, gint index);

void          e_select_names_model_insert         (ESelectNamesModel *model, gint index, EDestination *dest);
void          e_select_names_model_append         (ESelectNamesModel *model, EDestination *dest);
void          e_select_names_model_replace        (ESelectNamesModel *model, gint index, EDestination *dest);
void          e_select_names_model_delete         (ESelectNamesModel *model, gint index);
void          e_select_names_model_delete_all     (ESelectNamesModel *model);
void          e_select_names_model_overwrite_copy (ESelectNamesModel *dest, ESelectNamesModel *src);

void          e_select_names_model_clean      (ESelectNamesModel *model);

void          e_select_names_model_name_pos (ESelectNamesModel *model, gint index, gint *pos, gint *length);
void          e_select_names_model_text_pos (ESelectNamesModel *model, gint pos, gint *index, gint *start_pos, gint *length);

void          e_select_names_model_cardify            (ESelectNamesModel *model, EBook *book, gint index, gint delay);
void          e_select_names_model_cancel_cardify     (ESelectNamesModel *model, gint index);
void          e_select_names_model_cardify_all        (ESelectNamesModel *model, EBook *book, gint delay);
void          e_select_names_model_cancel_cardify_all (ESelectNamesModel *model);


#endif /* ! __E_SELECT_NAMES_MODEL_H__ */