[gmime] Improved C# GMimeObject binding



commit e0698f3392ee9a46df402f9b4df8c3463fc30d9e
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Sun Aug 14 10:59:14 2011 -0400

    Improved C# GMimeObject binding
    
    2011-08-14  Jeffrey Stedfast  <fejj gnome org>
    
    	* mono/GMime.metadata (PartBase): Rename to Entity to be more
    	consistent with MIME terminology and removed more convenience
    	methods that really only make sense in the C API.
    	(g_mime_object_new_type): Removed, there's no easy way to map
    	this to managed.
    	(g_mime_object_new): Removed, there's no easy way to map this
    	to managed.

 ChangeLog             |   10 ++++++++++
 mono/GMime.metadata   |   11 ++++++++++-
 mono/Message.custom   |    7 ++++++-
 mono/Multipart.custom |   26 +++++++++++++-------------
 4 files changed, 39 insertions(+), 15 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3e45fd8..2a8044e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-08-14  Jeffrey Stedfast  <fejj gnome org>
 
+	* mono/GMime.metadata (PartBase): Rename to Entity to be more
+	consistent with MIME terminology and removed more convenience
+	methods that really only make sense in the C API.
+	(g_mime_object_new_type): Removed, there's no easy way to map this
+	to managed.
+	(g_mime_object_new): Removed, there's no easy way to map this
+	to managed.
+
+2011-08-14  Jeffrey Stedfast  <fejj gnome org>
+
 	* gmime/gmime-part-iter.c: Updated to be more consistent with IMAP
 	part specifiers.
 
diff --git a/mono/GMime.metadata b/mono/GMime.metadata
index 8d355cf..1b66c14 100644
--- a/mono/GMime.metadata
+++ b/mono/GMime.metadata
@@ -280,12 +280,21 @@
   <!-- MultipartSigned -->
   
   <!-- Object -->
-  <attr path="/api/namespace/object[ cname='GMimeObject']" name="name">PartBase</attr>
+  <attr path="/api/namespace/object[ cname='GMimeObject']" name="name">Entity</attr>
+  <remove-node path="/api/namespace/object[ cname='GMimeObject']/constructor[ cname='g_mime_object_new']"/>
+  <remove-node path="/api/namespace/object[ cname='GMimeObject']/constructor[ cname='g_mime_object_new_type']"/>
   <!-- Clean up some unnecessary helper methods from GMimeObject -->
+  <remove-node path="/api/namespace/object[ cname='GMimeObject']/method[ cname='g_mime_object_get_disposition']"/>
+  <remove-node path="/api/namespace/object[ cname='GMimeObject']/method[ cname='g_mime_object_set_disposition']"/>
   <remove-node path="/api/namespace/object[ cname='GMimeObject']/method[ cname='g_mime_object_get_content_type_parameter']"/>
   <remove-node path="/api/namespace/object[ cname='GMimeObject']/method[ cname='g_mime_object_set_content_type_parameter']"/>
   <remove-node path="/api/namespace/object[ cname='GMimeObject']/method[ cname='g_mime_object_get_content_disposition_parameter']"/>
   <remove-node path="/api/namespace/object[ cname='GMimeObject']/method[ cname='g_mime_object_set_content_disposition_parameter']"/>
+  <remove-node path="/api/namespace/object[ cname='GMimeObject']/method[ cname='g_mime_object_prepend_header']"/>
+  <remove-node path="/api/namespace/object[ cname='GMimeObject']/method[ cname='g_mime_object_append_header']"/>
+  <remove-node path="/api/namespace/object[ cname='GMimeObject']/method[ cname='g_mime_object_remove_header']"/>
+  <remove-node path="/api/namespace/object[ cname='GMimeObject']/method[ cname='g_mime_object_get_header']"/>
+  <remove-node path="/api/namespace/object[ cname='GMimeObject']/method[ cname='g_mime_object_set_header']"/>
 
   <!-- Param -->
   <remove-node path="/api/namespace/struct[ cname='GMimeParam']/field[ cname='value']"/>
diff --git a/mono/Message.custom b/mono/Message.custom
index 57dde6c..9a76338 100644
--- a/mono/Message.custom
+++ b/mono/Message.custom
@@ -22,7 +22,12 @@
 		
 		public System.Collections.IEnumerable References {
 			get {
-				string references = GetHeader ("References");
+				GMime.HeaderList headers = HeaderList;
+				
+				if (headers == null)
+					yield break;
+				
+				string references = headers.GetHeader ("References");
 				
 				if (references == null)
 					yield break;
diff --git a/mono/Multipart.custom b/mono/Multipart.custom
index 7ef6f44..bf22d08 100644
--- a/mono/Multipart.custom
+++ b/mono/Multipart.custom
@@ -91,7 +91,7 @@
 			get { return this; }
 		}
 		
-		public int Add (GMime.PartBase part)
+		public int Add (GMime.Entity part)
 		{
 			if (part == null)
 				throw CannotAdd (part);
@@ -101,7 +101,7 @@
 		
 		int IList.Add (object value)
 		{
-			GMime.PartBase part = value as GMime.PartBase;
+			GMime.Entity part = value as GMime.Entity;
 			
 			if (part == null)
 				throw CannotAdd (value);
@@ -114,7 +114,7 @@
 			g_mime_multipart_clear (Handle);
 		}
 		
-		public bool Contains (GMime.PartBase part)
+		public bool Contains (GMime.Entity part)
 		{
 			if (part == null)
 				return false;
@@ -124,7 +124,7 @@
 		
 		bool IList.Contains (object value)
 		{
-			return Contains (value as GMime.PartBase);
+			return Contains (value as GMime.Entity);
 		}
 		
 		public void CopyTo (Array array, int index)
@@ -146,7 +146,7 @@
 			return new GMimeMultipartIterator (this);
 		}
 		
-		public int IndexOf (GMime.PartBase part)
+		public int IndexOf (GMime.Entity part)
 		{
 			if (part == null)
 				return -1;
@@ -156,10 +156,10 @@
 		
 		int IList.IndexOf (object value)
 		{
-			return IndexOf (value as GMime.PartBase);
+			return IndexOf (value as GMime.Entity);
 		}
 		
-		public void Insert (int index, GMime.PartBase part)
+		public void Insert (int index, GMime.Entity part)
 		{
 			if (part == null)
 				throw CannotInsert (part);
@@ -172,7 +172,7 @@
 		
 		void IList.Insert (int index, object value)
 		{
-			GMime.PartBase part = value as GMime.PartBase;
+			GMime.Entity part = value as GMime.Entity;
 			
 			if (part == null)
 				throw CannotInsert (value);
@@ -180,7 +180,7 @@
 			Insert (index, part);
 		}
 		
-		public void Remove (GMime.PartBase part)
+		public void Remove (GMime.Entity part)
 		{
 			if (part == null)
 				throw CannotRemove (part);
@@ -190,7 +190,7 @@
 		
 		void IList.Remove (object value)
 		{
-			GMime.PartBase part = value as GMime.PartBase;
+			GMime.Entity part = value as GMime.Entity;
 			
 			if (part == null)
 				throw CannotRemove (value);
@@ -206,14 +206,14 @@
 			g_mime_multipart_remove_at (Handle, index);
 		}
 		
-		public GMime.PartBase this[int index] {
+		public GMime.Entity this[int index] {
 			get {
 				IntPtr raw = g_mime_multipart_get_part (Handle, index);
 				
 				if (raw == IntPtr.Zero)
 					return null;
 				
-				return GLib.Object.GetObject (raw) as GMime.PartBase;
+				return GLib.Object.GetObject (raw) as GMime.Entity;
 			}
 			
 			set {
@@ -238,7 +238,7 @@
 			}
 			
 			set {
-				this[index] = value as GMime.PartBase;
+				this[index] = value as GMime.Entity;
 			}
 		}
 		



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