Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[platform/upstream/evolution-data-server.git] / camel / camel-multipart-signed.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2  * camel-signed--multipart.h : class for a signed-multipart
3  *
4  * Authors: Michael Zucchi <notzed@ximian.com>
5  *
6  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of version 2 of the GNU Lesser General Public
10  * License as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22
23 /* Should this be a subclass of multipart?
24  * No, because we dont have different parts?
25  * I'm not really sure yet ... ? */
26
27 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
28 #error "Only <camel/camel.h> can be included directly."
29 #endif
30
31 #ifndef CAMEL_MULTIPART_SIGNED_H
32 #define CAMEL_MULTIPART_SIGNED_H
33
34 #include <camel/camel-multipart.h>
35
36 /* Standard GObject macros */
37 #define CAMEL_TYPE_MULTIPART_SIGNED \
38         (camel_multipart_signed_get_type ())
39 #define CAMEL_MULTIPART_SIGNED(obj) \
40         (G_TYPE_CHECK_INSTANCE_CAST \
41         ((obj), CAMEL_TYPE_MULTIPART_SIGNED, CamelMultipartSigned))
42 #define CAMEL_MULTIPART_SIGNED_CLASS(cls) \
43         (G_TYPE_CHECK_CLASS_CAST \
44         ((cls), CAMEL_TYPE_MULTIPART_SIGNED, CamelMultipartSignedClass))
45 #define CAMEL_IS_MULTIPART_SIGNED(obj) \
46         (G_TYPE_CHECK_INSTANCE_TYPE \
47         ((obj), CAMEL_TYPE_MULTIPART_SIGNED))
48 #define CAMEL_IS_MULTIPART_SIGNED_CLASS(cls) \
49         (G_TYPE_CHECK_CLASS_TYPE \
50         ((cls), CAMEL_TYPE_MULTIPART_SIGNED))
51 #define CAMEL_MULTIPART_SIGNED_GET_CLASS(obj) \
52         (G_TYPE_INSTANCE_GET_CLASS \
53         ((obj), CAMEL_TYPE_MULTIPART_SIGNED, CamelMultipartSignedClass))
54
55 G_BEGIN_DECLS
56
57 /* 'handy' enums for getting the internal parts of the multipart */
58 enum {
59         CAMEL_MULTIPART_SIGNED_CONTENT,
60         CAMEL_MULTIPART_SIGNED_SIGNATURE
61 };
62
63 typedef struct _CamelMultipartSigned CamelMultipartSigned;
64
65 struct _CamelMultipartSigned
66 {
67         CamelMultipart parent;
68
69         /* these are the client visible parts, decoded forms of our data wrapper content */
70         CamelMimePart *content;
71         CamelMimePart *signature;
72
73         /* the raw content which must go over the wire, if we have generated it */
74         /* perhaps this should jsut set data_wrapper->stream and update start1/end1 accordingly, as it is done
75          * for other parts, or visa versa? */
76         CamelStream *contentraw;
77
78         /*int state;*/
79
80         /* just cache some info we use */
81         gchar *protocol;
82         gchar *micalg;
83
84         /* offset pointers of start of boundary in content object */
85         goffset start1, end1;
86         goffset start2, end2;
87 };
88
89 typedef struct {
90         CamelMultipartClass parent_class;
91 } CamelMultipartSignedClass;
92
93 GType camel_multipart_signed_get_type (void);
94
95 /* public methods */
96 CamelMultipartSigned *camel_multipart_signed_new           (void);
97
98 CamelStream *camel_multipart_signed_get_content_stream (CamelMultipartSigned *mps, GError **error);
99
100 G_END_DECLS
101
102 #endif /* CAMEL_MULTIPART_SIGNED_H */