Initialize the gmime for upstream
[platform/upstream/gmime.git] / docs / reference / html / gmime-changes-2-0.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Changes from 1.0 to 2.0</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GMime 2.6 Reference Manual">
8 <link rel="up" href="gmime.html" title="Part I. GMime Overview">
9 <link rel="prev" href="gmime-compiling.html" title="Compiling GMime Applications">
10 <link rel="next" href="gmime-changes-2-2.html" title="Changes from 2.0 to 2.2">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
16 <td><a accesskey="p" href="gmime-compiling.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
17 <td><a accesskey="u" href="gmime.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
18 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
19 <th width="100%" align="center">GMime 2.6 Reference Manual</th>
20 <td><a accesskey="n" href="gmime-changes-2-2.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
21 </tr></table>
22 <div class="refentry">
23 <a name="gmime-changes-2-0"></a><div class="titlepage"></div>
24 <div class="refnamediv"><table width="100%"><tr>
25 <td valign="top">
26 <h2><span class="refentrytitle">Changes from 1.0 to 2.0</span></h2>
27 <p>Changes from 1.0 to 2.0 — 
28 Incompatible changes made between version 1.0 and version 2.0
29 </p>
30 </td>
31 <td valign="top" align="right"></td>
32 </tr></table></div>
33 <div class="refsect1">
34 <a name="idp4962656"></a><h2>Incompatible changes from 1.0 to 2.0</h2>
35 <p>
36 See also the PORTING document in the toplevel GMime source directory.
37 </p>
38 <p>
39 The major change here is that I've dropped my own base object class
40 and have replaced it with GObject from glib-2.0. This should be a
41 pleasant change since you (the developer) will now be able to do many
42 more things such as setting arbitrary data on all GMime objects. For
43 additional information about GObject, please see the GObject Reference
44 Manual at http://developer.gnome.org/doc/API/2.0/gobject/
45 </p>
46 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
47 <li class="listitem"><p>
48 The first thing you need to know is that any function returning a
49 non-const pointer to any object /must/ be unref'd when you are done
50 with it. Since all objects in GMime now subclass GObject, you may
51 safely use <code class="function">g_object_unref()</code>
52 (<span class="structname">GMimeStream</span>'s may also be unref'd using
53 <code class="function">g_mime_stream_unref()</code>, but either way is fine).
54
55 Don't forget that
56 <code class="function">g_mime_part_get_content_object()</code> returns a
57 ref-counted <span class="structname">GMimeDataWrapper</span> object now, and
58 so you /must/ unref it when you have finished using it. You must also
59 remember to unref any GMimeDataWrapper object that you /set/ on a
60 GMimePart using <code class="function">g_mime_part_set_content_object()</code>
61 as the GMimePart will now ref the content object that you set on it.
62 </p></li>
63 <li class="listitem"><p><span class="structname">GMimeMultipart</span> is a new class which is to be
64 used for all multipart MIME parts rather than GMimePart (as in
65 1.0). There are also some subclasses of GMimeMultipart for other
66 things.
67 </p></li>
68 <li class="listitem"><p><code class="function">g_mime_part_[g,s]et_boundary()</code> have been removed
69 (see above). You must now create a GMimeMultipart object and use
70 <code class="function">g_mime_multipart_[g,s]et_boundary()</code>.
71 </p></li>
72 <li class="listitem"><p><code class="function">g_mime_part_add_subpart()</code> has been replaced with
73 <code class="function">g_mime_multipart_add_part()</code>.
74 </p></li>
75 <li class="listitem"><p><code class="function">g_mime_part_foreach()</code> has been replaced with
76 <code class="function">g_mime_multipart_foreach()</code> and/or
77 <code class="function">g_mime_message_foreach_part()</code>.
78 </p></li>
79 <li class="listitem"><p><code class="function">g_mime_part_get_subpart_from_content_id()</code> has
80 been replaced with
81 <code class="function">g_mime_multipart_get_subpart_from_content_id()</code>.
82 </p></li>
83 <li class="listitem"><p>
84 Another new class is <span class="structname">GMimeMessagePart</span> which
85 is to be used for all MIME parts containing an rfc822 message. All 1.0
86 GMimePart's representing message/rfc822 parts (as well as message/news
87 parts?)  need to be migrated over to be GMimeMessagePart objects.
88 </p></li>
89 <li class="listitem"><p><span class="structname">GMimeMessagePartial</span> is another class meant
90 for handling the message/partial MIME type. All 1.0 GMimePart's
91 holding data of this type should be replaced with GMimeMessagePartial
92 objects.
93 </p></li>
94 <li class="listitem"><p><code class="function">g_mime_message_write_to_stream()</code> and
95 <code class="function">g_mime_part_write_to_stream()</code> functions have been
96 consolidated into a virtual method. Replace calls to these functions
97 with <code class="function">g_mime_object_write_to_stream()</code>. Note: while
98 <code class="function">g_mime_part_write_to_stream()</code> and
99 <code class="function">g_mime_message_write_to_stream()</code> still exist, it
100 is suggested you migrate to
101 <code class="function">g_mime_object_write_to_stream()</code>. Same goes for
102 <code class="function">g_mime_part_to_string()</code> and
103 <code class="function">g_mime_message_to_string()</code>.
104 </p></li>
105 <li class="listitem"><p><span class="structname">GMimeMessage</span>'s structure has changed a
106 bit. You will not be able to do <code class="literal">message-&gt;header</code>,
107 instead you want to do <code class="literal">((GMimeObject *)
108 message)-&gt;header</code>.
109 </p></li>
110 <li class="listitem"><p><code class="function">g_mime_message_set_message_id()</code> now takes a
111 message_id argument without the encapsulating &lt; and &gt;'s (it now
112 just takes the addr-spec portion of the msg-id).
113 </p></li>
114 <li class="listitem"><p><span class="structname">GMimeFilterFrom</span> has changed slightly, you
115 will want to replace all calls to
116 <code class="function">g_mime_filter_from_new()</code> with
117 <code class="function">g_mime_filter_from_new
118 (GMIME_FILTER_FROM_MODE_DEFAULT)</code>
119 (<code class="literal">GMIME_FILTER_FROM_MODE_DEFAULT</code> is equivalent to (<span class="type">int</span>) 0).
120 </p></li>
121 <li class="listitem"><p><span class="structname">GMimeParser</span> is a brand new class and
122 <code class="filename">gmime-parser.h</code> has had a number of API additions.
123 <code class="function">g_mime_parser_construct_part()</code> and
124 <code class="function">g_mime_parser_construct_message()</code> still exist,
125 however they no longer take a GMimeStream argument. Instead, they take
126 a GMimeParser object.
127 </p></li>
128 </ul></div>
129 </div>
130 </div>
131 <div class="footer">
132 <hr>
133           Generated by GTK-Doc V1.18</div>
134 </body>
135 </html>