Bug 617446 - libmime: mimeEncryptedClass (and also some other classes) are not exposed via XPCOM; r=bienvenu sr=Standard8
authorStanislas Marquis <stnsls@gmail.com>
Fri, 17 Dec 2010 10:26:04 +0000
changeset 6854 05b2436293603a177c0e761bea9cfdba2df23d86
parent 6853 929bd9af213ef02fdbc38323147c0e49083aaac8
child 6855 c6c5290dc2ae37ab11652e1360665151c906dc04
push idunknown
push userunknown
push dateunknown
reviewersbienvenu, Standard8
bugs617446
Bug 617446 - libmime: mimeEncryptedClass (and also some other classes) are not exposed via XPCOM; r=bienvenu sr=Standard8
mailnews/mime/public/nsIMimeObjectClassAccess.h
mailnews/mime/src/mimecom.cpp
mailnews/mime/src/mimecom.h
mailnews/mime/src/mimecth.cpp
mailnews/mime/src/mimecth.h
mailnews/mime/src/nsMimeObjectClassAccess.cpp
mailnews/mime/src/nsMimeObjectClassAccess.h
--- a/mailnews/mime/public/nsIMimeObjectClassAccess.h
+++ b/mailnews/mime/public/nsIMimeObjectClassAccess.h
@@ -67,16 +67,17 @@ public:
   // The following group of calls expose the pointers for the object
   // system within libmime.
   NS_IMETHOD    GetmimeInlineTextClass(void **ptr) = 0;
   NS_IMETHOD    GetmimeLeafClass(void **ptr) = 0;
   NS_IMETHOD    GetmimeObjectClass(void **ptr) = 0;
   NS_IMETHOD    GetmimeContainerClass(void **ptr) = 0;
   NS_IMETHOD    GetmimeMultipartClass(void **ptr) = 0;
   NS_IMETHOD    GetmimeMultipartSignedClass(void **ptr) = 0;
+  NS_IMETHOD    GetmimeEncryptedClass(void **ptr) = 0;
 
   NS_IMETHOD    MimeCreate(char* content_type, void * hdrs, void * opts, void **ptr) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIMimeObjectClassAccess,
                               NS_IMIME_OBJECT_CLASS_ACCESS_IID)
 
 #endif /* nsIMimeObjectClassAccess_h_ */
--- a/mailnews/mime/src/mimecom.cpp
+++ b/mailnews/mime/src/mimecom.cpp
@@ -35,16 +35,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 #include "mimei.h"
 #include "mimeobj.h"  /*  MimeObject (abstract)              */
 #include "mimecont.h"  /*   |--- MimeContainer (abstract)          */
 #include "mimemult.h"  /*   |     |--- MimeMultipart (abstract)      */
 #include "mimemsig.h"  /*   |     |     |--- MimeMultipartSigned (abstract)*/
 #include "mimetext.h"  /*   |     |--- MimeInlineText (abstract)      */
+#include "mimecryp.h"
 #include "mimecth.h"
 
 /*
  * These calls are necessary to expose the object class hierarchy
  * to externally developed content type handlers.
  */
 extern "C" void *
 XPCOM_GetmimeInlineTextClass(void)
@@ -77,16 +78,22 @@ XPCOM_GetmimeMultipartClass(void)
 }
 
 extern "C" void *
 XPCOM_GetmimeMultipartSignedClass(void)
 {
   return (void *) &mimeMultipartSignedClass;
 }
 
+extern "C" void *
+XPCOM_GetmimeEncryptedClass(void)
+{
+  return (void *) &mimeEncryptedClass;
+}
+
 extern "C" int
 XPCOM_MimeObject_write(void *mimeObject,
                        char *data,
                        PRInt32 length,
                        PRBool user_visible_p)
 {
   return MIME_MimeObject_write((MimeObject *)mimeObject, data,
                                 length, user_visible_p);
--- a/mailnews/mime/src/mimecom.h
+++ b/mailnews/mime/src/mimecom.h
@@ -58,12 +58,13 @@ extern "C" int  XPCOM_MimeObject_write(v
  * system within libmime. 
  */                                                        
 extern "C" void *XPCOM_GetmimeInlineTextClass(void);
 extern "C" void *XPCOM_GetmimeLeafClass(void);
 extern "C" void *XPCOM_GetmimeObjectClass(void);
 extern "C" void *XPCOM_GetmimeContainerClass(void);
 extern "C" void *XPCOM_GetmimeMultipartClass(void);
 extern "C" void *XPCOM_GetmimeMultipartSignedClass(void);
+extern "C" void *XPCOM_GetmimeEncryptedClass(void);
 
 extern "C" void *XPCOM_Mime_create(char *content_type, void* hdrs, void* opts);
 
 #endif /* _MIMECOM_H_ */
--- a/mailnews/mime/src/mimecth.cpp
+++ b/mailnews/mime/src/mimecth.cpp
@@ -70,8 +70,14 @@ MIME_GetmimeMultipartClass(void)
   return &mimeMultipartClass;
 }
 
 MimeMultipartSignedClass *
 MIME_GetmimeMultipartSignedClass(void)
 {
   return &mimeMultipartSignedClass;
 }
+
+MimeEncryptedClass *
+MIME_GetmimeEncryptedClass(void)
+{
+  return &mimeEncryptedClass;
+}
--- a/mailnews/mime/src/mimecth.h
+++ b/mailnews/mime/src/mimecth.h
@@ -46,16 +46,17 @@
 #define _MIMECTH_H_
 
 #include "mimei.h"
 #include "mimeobj.h"  /*  MimeObject (abstract)              */
 #include "mimecont.h"  /*   |--- MimeContainer (abstract)          */
 #include "mimemult.h"  /*   |     |--- MimeMultipart (abstract)      */
 #include "mimemsig.h"  /*   |     |     |--- MimeMultipartSigned (abstract)*/
 #include "mimetext.h"  /*   |     |--- MimeInlineText (abstract)      */
+#include "mimecryp.h"
 
 /*
   This header exposes functions that are necessary to access the
   object hierarchy for the mime chart. The class hierarchy is:
 
      MimeObject (abstract)
       |
       |--- MimeContainer (abstract)
@@ -127,16 +128,17 @@ extern int                        MIME_M
  * system within libmime.
  */
 extern MimeInlineTextClass       *MIME_GetmimeInlineTextClass(void);
 extern MimeLeafClass             *MIME_GetmimeLeafClass(void);
 extern MimeObjectClass           *MIME_GetmimeObjectClass(void);
 extern MimeContainerClass        *MIME_GetmimeContainerClass(void);
 extern MimeMultipartClass        *MIME_GetmimeMultipartClass(void);
 extern MimeMultipartSignedClass  *MIME_GetmimeMultipartSignedClass(void);
+extern MimeEncryptedClass        *MIME_GetmimeEncryptedClass(void);
 
 /*
  * These are the functions that need to be implemented by the
  * content type handler plugin. They will be called by by libmime
  * when the module is loaded at runtime.
  */
 
 /*
--- a/mailnews/mime/src/nsMimeObjectClassAccess.cpp
+++ b/mailnews/mime/src/nsMimeObjectClassAccess.cpp
@@ -111,13 +111,20 @@ nsMimeObjectClassAccess::GetmimeMultipar
 nsresult 
 nsMimeObjectClassAccess::GetmimeMultipartSignedClass(void **ptr)
 {
   *ptr = XPCOM_GetmimeMultipartSignedClass();
   return NS_OK;
 }
 
 nsresult 
+nsMimeObjectClassAccess::GetmimeEncryptedClass(void **ptr)
+{
+  *ptr = XPCOM_GetmimeEncryptedClass();
+  return NS_OK;
+}
+
+nsresult
 nsMimeObjectClassAccess::MimeCreate(char * content_type, void * hdrs, void * opts, void **ptr)
 {
   *ptr = XPCOM_Mime_create(content_type, hdrs, opts);
   return NS_OK;
 }
--- a/mailnews/mime/src/nsMimeObjectClassAccess.h
+++ b/mailnews/mime/src/nsMimeObjectClassAccess.h
@@ -68,13 +68,14 @@ public:
   // The following group of calls expose the pointers for the object
   // system within libmime.
   NS_IMETHOD    GetmimeInlineTextClass(void **ptr);
   NS_IMETHOD    GetmimeLeafClass(void **ptr);
   NS_IMETHOD    GetmimeObjectClass(void **ptr);
   NS_IMETHOD    GetmimeContainerClass(void **ptr);
   NS_IMETHOD    GetmimeMultipartClass(void **ptr);
   NS_IMETHOD    GetmimeMultipartSignedClass(void **ptr);
+  NS_IMETHOD    GetmimeEncryptedClass(void **ptr);
 
   NS_IMETHOD    MimeCreate(char *content_type, void * hdrs, void * opts, void**ptr);
 }; 
 
 #endif /* nsMimeObjectClassAccess_h_ */