aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas/pas-book.h
blob: 2cb84569c2968ea86c28af391db1e1e42b0862b7 (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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * A wrapper object which exports the GNOME_Evolution_Addressbook_Book CORBA interface
 * and which maintains a request queue.
 *
 * Author:
 *   Nat Friedman (nat@ximian.com)
 *
 * Copyright 2000, Ximian, Inc.
 */

#ifndef __PAS_BOOK_H__
#define __PAS_BOOK_H__

#include <pas/addressbook.h>
#include <bonobo/bonobo-object.h>
#include "e-util/e-list.h"

#include <pas/pas-types.h>

#define PAS_TYPE_BOOK        (pas_book_get_type ())
#define PAS_BOOK(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), PAS_TYPE_BOOK, PASBook))
#define PAS_BOOK_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), PAS_BOOK_FACTORY_TYPE, PASBookClass))
#define PAS_IS_BOOK(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAS_TYPE_BOOK))
#define PAS_IS_BOOK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PAS_TYPE_BOOK))
#define PAS_BOOK_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAS_TYPE_BOOK, PASBookClass))

typedef struct _PASBookPrivate PASBookPrivate;

struct _PASBook {
    BonoboObject       parent_object;
    PASBookPrivate    *priv;
};

struct _PASBookClass {
    BonoboObjectClass parent_class;

    POA_GNOME_Evolution_Addressbook_Book__epv epv;

    /* Padding for future expansion */
    void (*_pas_reserved0) (void);
    void (*_pas_reserved1) (void);
    void (*_pas_reserved2) (void);
    void (*_pas_reserved3) (void);
    void (*_pas_reserved4) (void);
};


PASBook                *pas_book_new                    (PASBackend                               *backend,
                             const char                               *uri,
                             GNOME_Evolution_Addressbook_BookListener  listener);
GNOME_Evolution_Addressbook_BookListener pas_book_get_listener (PASBook                         *book);
PASBackend             *pas_book_get_backend            (PASBook                                *book);
const char             *pas_book_get_uri                (PASBook                                *book);

void                    pas_book_respond_open           (PASBook                                *book,
                             GNOME_Evolution_Addressbook_CallStatus  status);
void                    pas_book_respond_remove         (PASBook                                *book,
                             GNOME_Evolution_Addressbook_CallStatus  status);
void                    pas_book_respond_create         (PASBook                                *book,
                             GNOME_Evolution_Addressbook_CallStatus  status,
                             EContact                               *contact);
void                    pas_book_respond_remove_contacts (PASBook                                *book,
                              GNOME_Evolution_Addressbook_CallStatus  status,
                              GList                                  *ids);
void                    pas_book_respond_modify         (PASBook                                *book,
                             GNOME_Evolution_Addressbook_CallStatus  status,
                             EContact                               *contact);
void                    pas_book_respond_authenticate_user (PASBook                                *book,
                                GNOME_Evolution_Addressbook_CallStatus  status);
void                    pas_book_respond_get_supported_fields (PASBook                                *book,
                                   GNOME_Evolution_Addressbook_CallStatus  status,
                                   GList                                  *fields);
void                    pas_book_respond_get_supported_auth_methods (PASBook                                *book,
                                     GNOME_Evolution_Addressbook_CallStatus  status,
                                     GList                                  *fields);

void                    pas_book_respond_get_book_view  (PASBook                           *book,
                             GNOME_Evolution_Addressbook_CallStatus  status,
                             PASBookView                       *book_view);
void                    pas_book_respond_get_contact    (PASBook                           *book,
                             GNOME_Evolution_Addressbook_CallStatus  status,
                             char                              *vcard);
void                    pas_book_respond_get_contact_list (PASBook                           *book,
                               GNOME_Evolution_Addressbook_CallStatus  status,
                               GList *cards);
void                    pas_book_respond_get_changes    (PASBook                                *book,
                             GNOME_Evolution_Addressbook_CallStatus  status,
                             GList                                  *changes);

void                    pas_book_report_writable        (PASBook                           *book,
                             gboolean                           writable);

GType                   pas_book_get_type               (void);

#endif /* ! __PAS_BOOK_H__ */