Back to index

enigmail  1.4.3
Public Member Functions | Static Public Member Functions | Protected Attributes
nsEnigContentHandler Class Reference

#include <nsEnigContentHandler.h>

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS NS_IMETHOD GetContentType (char **contentType)
NS_IMETHOD CreateContentTypeHandlerClass (const char *content_type, contentTypeHandlerInitStruct *initStruct, MimeObjectClass **objClass)
 nsEnigContentHandler ()
virtual ~nsEnigContentHandler ()

Static Public Member Functions

static NS_METHOD Create (nsISupports *aOuter, REFNSIID aIID, void **aResult)

Protected Attributes

nsCString mContentType

Detailed Description

Definition at line 45 of file nsEnigContentHandler.h.


Constructor & Destructor Documentation

Definition at line 99 of file nsEnigContentHandler.cpp.

{
  nsresult rv;
#ifdef FORCE_PR_LOG
  nsCOMPtr<nsIThread> myThread;
  rv = ENIG_GET_THREAD(myThread);
  DEBUG_LOG(("nsEnigContentHandler:: >>>>>>>>> DTOR(%p): myThread=%p\n",
         this, myThread.get()));
#endif

}

Member Function Documentation

static NS_METHOD nsEnigContentHandler::Create ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
) [static]
NS_IMETHODIMP nsEnigContentHandler::CreateContentTypeHandlerClass ( const char *  content_type,
contentTypeHandlerInitStruct *  initStruct,
MimeObjectClass **  objClass 
)

Definition at line 124 of file nsEnigContentHandler.cpp.

{
  DEBUG_LOG(("nsEnigContenthandler::CreateContentTypeHandlerClass: %s\n", content_type));

#ifdef EM_OLD_MIME
  mContentType = content_type;

  *objClass = NULL;

  if (!PL_strcasecmp(content_type, APPLICATION_XENIGMAIL_DUMMY)) {
    // application/x-enigmail-dummy

    if (!mimeContainerClassP) {
      nsresult rv;

      nsCOMPtr<nsIMimeObjectClassAccess> mimeObjectClassAccess(do_CreateInstance(kMimeObjectClassAccessCID, &rv));
      if (NS_FAILED(rv))
        return rv;

      rv = mimeObjectClassAccess->GetmimeContainerClass((void **) &mimeContainerClassP);
      if (NS_FAILED(rv))
        return rv;

      // Set superclass by hand
      MimeObjectClass *clazz = (MimeObjectClass *) &mimeDummyClass;
      clazz->superclass = (MimeObjectClass *) mimeContainerClassP;
    }

    *objClass = (MimeObjectClass *) &mimeDummyClass;

    initStruct->force_inline_display = PR_FALSE;

    return NS_OK;
  }

  if (!PL_strcasecmp(content_type, MULTIPART_ENCRYPTED)) {
    // multipart/encrypted

    if (!mimeContainerClassP || !mimeEncryptedClassP)
      return NS_ERROR_FAILURE;

    *objClass = (MimeObjectClass *) &mimeEncryptedEnigClass;

    initStruct->force_inline_display = PR_FALSE;

    return NS_OK;
  }

  if (!PL_strcasecmp(content_type, APPLICATION_PGP)) {
    // application/pgp

    if (!mimeContainerClassP || !mimeEncryptedClassP)
      return NS_ERROR_FAILURE;

    *objClass = (MimeObjectClass *) &mimeEncryptedEnigClass;

    initStruct->force_inline_display = PR_FALSE;

    return NS_OK;
  }

  return NS_ERROR_FAILURE;
#else
  DEBUG_LOG(("nsEnigContenthandler::CreateContentTypeHandlerClass: with nsIPgpMime\n"));

  return NS_OK;
#endif
}
NS_IMETHODIMP nsEnigContentHandler::GetContentType ( char **  contentType)

Definition at line 117 of file nsEnigContentHandler.cpp.

{
  DEBUG_LOG(("nsEnigContenthandler::GetContentType: \n"));
  return NS_ERROR_NOT_IMPLEMENTED;
}

Member Data Documentation

nsCString nsEnigContentHandler::mContentType [protected]

Definition at line 63 of file nsEnigContentHandler.h.


The documentation for this class was generated from the following files: