Initialize the gmime for upstream
[platform/upstream/gmime.git] / gmime / gmime-message-partial.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*  GMime
3  *  Copyright (C) 2000-2012 Jeffrey Stedfast
4  *
5  *  This library is free software; you can redistribute it and/or
6  *  modify it under the terms of the GNU Lesser General Public License
7  *  as published by the Free Software Foundation; either version 2.1
8  *  of the License, or (at your option) any later version.
9  *
10  *  This library is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  *  Lesser General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Lesser General Public
16  *  License along with this library; if not, write to the Free
17  *  Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
18  *  02110-1301, USA.
19  */
20
21
22 #ifndef __GMIME_MESSAGE_PARTIAL_H__
23 #define __GMIME_MESSAGE_PARTIAL_H__
24
25 #include <glib.h>
26
27 #include <gmime/gmime-part.h>
28 #include <gmime/gmime-message.h>
29
30 G_BEGIN_DECLS
31
32 #define GMIME_TYPE_MESSAGE_PARTIAL            (g_mime_message_partial_get_type ())
33 #define GMIME_MESSAGE_PARTIAL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMIME_TYPE_MESSAGE_PARTIAL, GMimeMessagePartial))
34 #define GMIME_MESSAGE_PARTIAL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMIME_TYPE_MESSAGE_PARTIAL, GMimeMessagePartialClass))
35 #define GMIME_IS_MESSAGE_PARTIAL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMIME_TYPE_MESSAGE_PARTIAL))
36 #define GMIME_IS_MESSAGE_PARTIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GMIME_TYPE_MESSAGE_PARTIAL))
37 #define GMIME_MESSAGE_PARTIAL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GMIME_TYPE_MESSAGE_PARTIAL, GMimeMessagePartialClass))
38
39 typedef struct _GMimeMessagePartial GMimeMessagePartial;
40 typedef struct _GMimeMessagePartialClass GMimeMessagePartialClass;
41
42 /**
43  * GMimeMessagePartial:
44  * @parent_object: parent #GMimePart object
45  * @number: the part number
46  * @total: the total number of message/partials that make up the whole message/rfc822
47  * @id: message/partial id
48  *
49  * A message/partial MIME part.
50  **/
51 struct _GMimeMessagePartial {
52         GMimePart parent_object;
53         
54         int number;
55         int total;
56         char *id;
57 };
58
59 struct _GMimeMessagePartialClass {
60         GMimePartClass parent_class;
61         
62 };
63
64
65 GType g_mime_message_partial_get_type (void);
66
67 GMimeMessagePartial *g_mime_message_partial_new (const char *id, int number, int total);
68
69 const char *g_mime_message_partial_get_id (GMimeMessagePartial *partial);
70
71 int g_mime_message_partial_get_number (GMimeMessagePartial *partial);
72
73 int g_mime_message_partial_get_total (GMimeMessagePartial *partial);
74
75 GMimeMessage *g_mime_message_partial_reconstruct_message (GMimeMessagePartial **partials, size_t num);
76
77 GMimeMessage **g_mime_message_partial_split_message (GMimeMessage *message, size_t max_size, size_t *nparts);
78
79 G_END_DECLS
80
81 #endif /* __GMIME_MESSAGE_PARTIAL_H__ */