Oops, this needs to take a userid argument.
[platform/upstream/evolution-data-server.git] / camel / camel-multipart-encrypted.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  *  Authors: Jeffrey Stedfast <fejj@ximian.com>
4  *
5  *  Copyright 2002 Ximian, Inc. (www.ximian.com)
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
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 General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
20  *
21  */
22
23
24 #ifndef __CAMEL_MULTIPART_ENCRYPTED_H__
25 #define __CAMEL_MULTIPART_ENCRYPTED_H__
26
27 #ifdef __cplusplus
28 extern "C" {
29 #pragma }
30 #endif /* __cplusplus */
31
32 #include <camel/camel-multipart.h>
33 #include <camel/camel-cipher-context.h>
34
35 #define CAMEL_MULTIPART_ENCRYPTED_TYPE     (camel_multipart_encrypted_get_type ())
36 #define CAMEL_MULTIPART_ENCRYPTED(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_MULTIPART_ENCRYPTED_TYPE, CamelMultipartEncrypted))
37 #define CAMEL_MULTIPART_ENCRYPTED_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_MULTIPART_ENCRYPTED_TYPE, CamelMultipartEncryptedClass))
38 #define CAMEL_IS_MULTIPART_ENCRYPTED(o)    (CAMEL_CHECK_TYPE((o), CAMEL_MULTIPART_ENCRYPTED_TYPE))
39
40 typedef struct _CamelMultipartEncrypted CamelMultipartEncrypted;
41 typedef struct _CamelMultipartEncryptedClass CamelMultipartEncryptedClass;
42
43 /* 'handy' enums for getting the internal parts of the multipart */
44 enum {
45         CAMEL_MULTIPART_ENCRYPTED_VERSION,
46         CAMEL_MULTIPART_ENCRYPTED_CONTENT,
47 };
48
49 struct _CamelMultipartEncrypted {
50         CamelMultipart parent_object;
51         
52         CamelMimePart *version;
53         CamelMimePart *content;
54         CamelMimePart *decrypted;
55         
56         char *protocol;
57 };
58
59
60 struct _CamelMultipartEncryptedClass {
61         CamelMultipartClass parent_class;
62         
63 };
64
65
66 CamelType camel_multipart_encrypted_get_type (void);
67
68
69 CamelMultipartEncrypted *camel_multipart_encrypted_new (void);
70
71 int camel_multipart_encrypted_encrypt (CamelMultipartEncrypted *mpe, CamelMimePart *content,
72                                        CamelCipherContext *cipher, const char *userid,
73                                        GPtrArray *recipients, CamelException *ex);
74
75 CamelMimePart *camel_multipart_encrypted_decrypt (CamelMultipartEncrypted *mpe,
76                                                   CamelCipherContext *cipher,
77                                                   CamelException *ex);
78
79 #ifdef __cplusplus
80 }
81 #endif /* __cplusplus */
82
83 #endif /* __CAMEL_MULTIPART_ENCRYPTED_H__ */