Fix FSF address (Tobias Mueller, #470445)
[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 2002 Ximian, Inc. (www.ximian.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 #ifndef CAMEL_MULTIPART_SIGNED_H
28 #define CAMEL_MULTIPART_SIGNED_H 1
29
30 #include <camel/camel-multipart.h>
31
32 #define CAMEL_MULTIPART_SIGNED_TYPE     (camel_multipart_signed_get_type ())
33 #define CAMEL_MULTIPART_SIGNED(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_MULTIPART_SIGNED_TYPE, CamelMultipartSigned))
34 #define CAMEL_MULTIPART_SIGNED_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MULTIPART_SIGNED_TYPE, CamelMultipartSignedClass))
35 #define CAMEL_IS_MULTIPART_SIGNED(o)    (CAMEL_CHECK_TYPE((o), CAMEL_MULTIPART_SIGNED_TYPE))
36
37 G_BEGIN_DECLS
38
39 /*
40 enum {
41         CAMEL_MULTIPART_EMPTY,
42         CAMEL_MULTIPART_CONST,
43         CAMEL_MULTIPART_SIGN,
44         CAMEL_MULTIPART_ENCR,
45 };
46 */
47
48 /* 'handy' enums for getting the internal parts of the multipart */
49 enum {
50         CAMEL_MULTIPART_SIGNED_CONTENT,
51         CAMEL_MULTIPART_SIGNED_SIGNATURE,
52 };
53
54 typedef struct _CamelMultipartSigned CamelMultipartSigned;
55
56 struct _CamelMultipartSigned
57 {
58         CamelMultipart parent_object;
59
60         /* these are the client visible parts, decoded forms of our data wrapper content */
61         CamelMimePart *content;
62         CamelMimePart *signature;
63
64         /* the raw content which must go over the wire, if we have generated it */
65         /* perhaps this should jsut set data_wrapper->stream and update start1/end1 accordingly, as it is done
66            for other parts, or visa versa? */
67         CamelStream *contentraw;
68
69         /*int state;*/
70
71         /* just cache some info we use */
72         char *protocol;
73         char *micalg;
74
75         /* offset pointers of start of boundary in content object */
76         off_t start1, end1;
77         off_t start2, end2;
78 };
79
80 typedef struct {
81         CamelMultipartClass parent_class;
82 } CamelMultipartSignedClass;
83
84 /* Standard Camel function */
85 CamelType camel_multipart_signed_get_type (void);
86
87 /* public methods */
88 CamelMultipartSigned *camel_multipart_signed_new           (void);
89
90 CamelStream *camel_multipart_signed_get_content_stream(CamelMultipartSigned *mps, CamelException *ex);
91
92 G_END_DECLS
93
94 #endif /* CAMEL_MULTIPART_SIGNED_H */