1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 * camel-signed--multipart.h : class for a signed-multipart
4 * Authors: Michael Zucchi <notzed@ximian.com>
6 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
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.
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.
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
23 /* Should this be a subclass of multipart?
24 * No, because we dont have different parts?
25 * I'm not really sure yet ... ? */
27 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
28 #error "Only <camel/camel.h> can be included directly."
31 #ifndef CAMEL_MULTIPART_SIGNED_H
32 #define CAMEL_MULTIPART_SIGNED_H
34 #include <camel/camel-multipart.h>
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))
57 /* 'handy' enums for getting the internal parts of the multipart */
59 CAMEL_MULTIPART_SIGNED_CONTENT,
60 CAMEL_MULTIPART_SIGNED_SIGNATURE
63 typedef struct _CamelMultipartSigned CamelMultipartSigned;
65 struct _CamelMultipartSigned
67 CamelMultipart parent;
69 /* these are the client visible parts, decoded forms of our data wrapper content */
70 CamelMimePart *content;
71 CamelMimePart *signature;
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;
80 /* just cache some info we use */
84 /* offset pointers of start of boundary in content object */
90 CamelMultipartClass parent_class;
91 } CamelMultipartSignedClass;
93 GType camel_multipart_signed_get_type (void);
96 CamelMultipartSigned *camel_multipart_signed_new (void);
98 CamelStream *camel_multipart_signed_get_content_stream (CamelMultipartSigned *mps, GError **error);
102 #endif /* CAMEL_MULTIPART_SIGNED_H */