aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook/e-book-view-listener.h
blob: 3ca502dbfc9629911b2d26b145a44fb8985212e2 (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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * A client-side GObject which exposes the
 * Evolution:BookViewListener interface.
 *
 * Author:
 *   Nat Friedman (nat@ximian.com)
 *
 * Copyright 2000, Ximian, Inc.
 */

#ifndef __E_BOOK_VIEW_LISTENER_H__
#define __E_BOOK_VIEW_LISTENER_H__

#include <bonobo/bonobo-object.h>
#include <ebook/e-book-types.h>
#include <ebook/addressbook.h>

#define E_TYPE_BOOK_VIEW_LISTENER           (e_book_view_listener_get_type ())
#define E_BOOK_VIEW_LISTENER(o)             (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_VIEW_LISTENER, EBookViewListener))
#define E_BOOK_VIEW_LISTENER_CLASS(k)       (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_VIEW_LISTENER, EBookViewListenerClass))
#define E_IS_BOOK_VIEW_LISTENER(o)          (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_VIEW_LISTENER))
#define E_IS_BOOK_VIEW_LISTENER_CLASS(k)    (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_VIEW_LISTENER))
#define E_BOOK_VIEW_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_VIEW_LISTENER, EBookViewListenerClass))

G_BEGIN_DECLS

typedef struct _EBookViewListener EBookViewListener;
typedef struct _EBookViewListenerClass EBookViewListenerClass;
typedef struct _EBookViewListenerPrivate EBookViewListenerPrivate;

struct _EBookViewListener {
    BonoboObject           parent;
    EBookViewListenerPrivate *priv;
};

struct _EBookViewListenerClass {
    BonoboObjectClass parent;

    /*
     * Signals
     */
    void (*responses_queued) (void);
};

typedef enum {
    /* Async events */
    CardAddedEvent,
    CardRemovedEvent,
    CardModifiedEvent,
    SequenceCompleteEvent,
    StatusMessageEvent,
} EBookViewListenerOperation;

typedef struct {
    EBookViewListenerOperation  op;

    /* For SequenceComplete */
    EBookViewStatus             status;

    /* For CardRemovedEvent */
    char                   *id;

    /* For Card[Added|Modified]Event */
    GList                  *cards; /* Of type ECard. */

    /* For StatusMessageEvent */
    char                   *message;
    
} EBookViewListenerResponse;


struct _EBookViewListenerServant {
    POA_GNOME_Evolution_Addressbook_BookViewListener servant_placeholder;
    EBookViewListener *object;
};
typedef struct _EBookViewListenerServant EBookViewListenerServant;



EBookViewListener         *e_book_view_listener_new            (void);
void                       e_book_view_listener_construct      (EBookViewListener *listener,
                                GNOME_Evolution_Addressbook_BookViewListener corba_objref);
int                        e_book_view_listener_check_pending  (EBookViewListener *listener);
EBookViewListenerResponse *e_book_view_listener_pop_response   (EBookViewListener *listener);
GType                      e_book_view_listener_get_type       (void);
void                       e_book_view_listener_stop           (EBookViewListener *listener);

G_END_DECLS

#endif /* ! __E_BOOK_VIEW_LISTENER_H__ */