gmime r1337 - trunk/mono



Author: fejj
Date: Thu Jun  5 23:43:53 2008
New Revision: 1337
URL: http://svn.gnome.org/viewvc/gmime?rev=1337&view=rev

Log:
more fixes

Modified:
   trunk/mono/GMime.metadata
   trunk/mono/InternetAddressList.cs
   trunk/mono/Message.custom

Modified: trunk/mono/GMime.metadata
==============================================================================
--- trunk/mono/GMime.metadata	(original)
+++ trunk/mono/GMime.metadata	Thu Jun  5 23:43:53 2008
@@ -117,6 +117,12 @@
   <!-- Header -->
   <attr path="/api/namespace/struct[ cname='GMimeHeaderList']/method[ name='HasRaw']" name="hidden">true</attr>
   <attr path="/api/namespace/struct[ cname='GMimeHeaderList']/method[ name='SetRaw']" name="hidden">true</attr>
+  <attr path="/api/namespace/struct[ cname='GMimeHeaderList']/method[ name='Prepend']" name="name">PrependHeader</attr>
+  <attr path="/api/namespace/struct[ cname='GMimeHeaderList']/method[ name='Append']" name="name">AppendHeader</attr>
+  <attr path="/api/namespace/struct[ cname='GMimeHeaderList']/method[ name='Remove']" name="name">RemoveHeader</attr>
+  <attr path="/api/namespace/struct[ cname='GMimeHeaderList']/method[ name='Set']" name="name">SetHeader</attr>
+  <attr path="/api/namespace/struct[ cname='GMimeHeaderList']/method[ name='Get']" name="name">GetHeader</attr>
+  <attr path="/api/namespace/struct[ cname='GMimeHeaderList']/method[ name='GetIter']/*/parameter[ name='iter']" name="pass_as">out</attr>
   <attr path="/api/namespace/struct[ cname='GMimeHeaderIter']/method[ name='SetValue']/return-type" name="type">void</attr>
   <attr path="/api/namespace/struct[ cname='GMimeHeaderIter']" name="opaque">true</attr>
   <remove-node path="/api/namespace/struct[ cname='GMimeHeaderIter']/field[ cname='hdrlist']"/>

Modified: trunk/mono/InternetAddressList.cs
==============================================================================
--- trunk/mono/InternetAddressList.cs	(original)
+++ trunk/mono/InternetAddressList.cs	Thu Jun  5 23:43:53 2008
@@ -5,7 +5,7 @@
 namespace GMime {
 	public class InternetAddressList : ArrayList, IDisposable {
 		bool needs_destroy;
-		IntPtr raw_list;
+		IntPtr list;
 
 		[DllImport("gmime")]
 		static extern IntPtr internet_address_list_next (IntPtr raw);
@@ -16,34 +16,34 @@
 		[DllImport("gmime")]
 		static extern void internet_address_list_destroy (IntPtr raw);
 
-		public InternetAddressList (IntPtr raw_list, bool needs_destroy)
+		public InternetAddressList (IntPtr list, bool needs_destroy)
 		{
 			this.needs_destroy = needs_destroy;
-			this.raw_list = raw_list;
+			this.list = list;
 			
-			while (raw_list != IntPtr.Zero) {
-				IntPtr raw_ia = internet_address_list_get_address (raw_list);
+			while (list != IntPtr.Zero) {
+				IntPtr ia = internet_address_list_get_address (list);
 				
-				InternetAddress addr = new InternetAddress (raw_ia);
-				this.Add (addr);
+				InternetAddress addr = new InternetAddress (ia);
+				Add (addr);
 				
-				raw_list = internet_address_list_next (raw_list);
+				list = internet_address_list_next (list);
 			}
 		}
 
-		public InternetAddressList (IntPtr raw_list) : this (raw_list, false) { }
+		public InternetAddressList (IntPtr list) : this (list, false) { }
 
 		~InternetAddressList ()
 		{
-			this.Dispose ();
+			Dispose ();
 		}
 
 		public void Dispose ()
 		{
-			if (this.needs_destroy) {
-				internet_address_list_destroy (this.raw_list);
-				this.raw_list = IntPtr.Zero;
-				this.needs_destroy = false;
+			if (needs_destroy) {
+				internet_address_list_destroy (list);
+				needs_destroy = false;
+				list = IntPtr.Zero;
 			}
 			GC.SuppressFinalize (this);
 		}
@@ -53,9 +53,24 @@
 
 		public static InternetAddressList ParseString (string list)
 		{
-			IntPtr raw_ret = internet_address_parse_string (list);
+			IntPtr ret = internet_address_parse_string (list);
 			
-			return new InternetAddressList (raw_ret, true);
+			return new InternetAddressList (ret, true);
+		}
+
+		[DllImport("gmime")]
+		static extern IntPtr internet_address_list_to_string (IntPtr list, bool encode);
+
+		public string ToString (bool encode)
+		{
+			IntPtr str = internet_address_list_to_string (list, encode);
+			
+			return GLib.Marshaller.PtrToStringGFree (str);
+		}
+
+		public override string ToString ()
+		{
+			return ToString (false);
 		}
 	}
 }

Modified: trunk/mono/Message.custom
==============================================================================
--- trunk/mono/Message.custom	(original)
+++ trunk/mono/Message.custom	Thu Jun  5 23:43:53 2008
@@ -5,13 +5,13 @@
 };
 
 [DllImport ("gmime")]
-static extern IntPtr g_mime_message_get_recipients (IntPtr raw, string type);
+static extern IntPtr g_mime_message_get_recipients (IntPtr message, string type);
 
 public InternetAddressList GetRecipients (RecipientType type)
 {
-	IntPtr raw_ret = g_mime_message_get_recipients (Handle, type.ToString ());
+	IntPtr list = g_mime_message_get_recipients (Handle, type.ToString ());
 
-	return new InternetAddressList (raw_ret);
+	return new InternetAddressList (list);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]