Back to index

enigmail  1.4.3
Defines | Functions | Variables
mimedummy.cpp File Reference
#include "mimedummy.h"
#include "nsEnigMimeService.h"

Go to the source code of this file.

Defines

#define MOZILLA_INTERNAL_API

Functions

 MimeDefClass (MimeDummy, MimeDummyClass, mimeDummyClass, NULL)
static int MimeDummy_initialize (MimeObject *)
static void MimeDummy_finalize (MimeObject *)
static int MimeDummy_parse_begin (MimeObject *)
static int MimeDummy_parse_buffer (const char *, PRInt32, MimeObject *)
static int MimeDummy_parse_line (const char *, PRInt32, MimeObject *)
static int MimeDummy_parse_eof (MimeObject *, EMBool)
static int MimeDummy_parse_end (MimeObject *, EMBool)
static int MimeDummy_add_child (MimeObject *, MimeObject *)
static int MimeDummyClassInitialize (MimeDummyClass *clazz)

Variables

MimeEncryptedClass * mimeEncryptedClassP = NULL

Define Documentation

Definition at line 36 of file mimedummy.cpp.


Function Documentation

static int MimeDummy_add_child ( MimeObject *  parent,
MimeObject *  child 
) [static]

Definition at line 168 of file mimedummy.cpp.

{
  MimeContainer *cont = (MimeContainer *) parent;
  if (!parent || !child) return -1;

  /* Encryption containers can only have one child. */
  if (cont->nchildren != 0) return -1;

  return ((MimeContainerClass*)mimeContainerClassP)->add_child(parent, child);
}

Here is the caller graph for this function:

static void MimeDummy_finalize ( MimeObject *  obj) [static]

Definition at line 163 of file mimedummy.cpp.

{
}

Here is the caller graph for this function:

static int MimeDummy_initialize ( MimeObject *  obj) [static]

Definition at line 77 of file mimedummy.cpp.

{
  MimeObjectClass *clazz = obj->clazz;

  fprintf(stderr, "MimeDummy_initialize: class_name=%s\n", clazz->class_name);

  return 0;
}

Here is the caller graph for this function:

static int MimeDummy_parse_begin ( MimeObject *  obj) [static]

Definition at line 88 of file mimedummy.cpp.

{
  fprintf(stderr, "MimeDummy_parse_begin:\n");

  MimeObject *parent = obj->parent;

  MimeContainer* container = (MimeContainer *) parent;

  if (container) {
    PRInt32 nchildren = container->nchildren;
    fprintf(stderr, "MimeDummy_parse_begin: nchildren=%d\n",nchildren );

    if (nchildren == 2) {
      MimeObject* sibling = *(container->children);
      MimeObjectClass *clazz = sibling->clazz;

      fprintf(stderr, "MimeDummy_parse_begin: sibling class_name=%s\n", clazz->class_name);
      MimeObjectClass *superclazz = clazz->superclass;

      if (superclazz) {
        fprintf(stderr, "MimeDummy_parse_begin: sibling superclass_name=%s\n", superclazz->class_name);

        if (!PL_strcasecmp(superclazz->class_name, "MimeEncrypted")) {
          // mimeEncryptedClass
          fprintf(stderr, "MimeDummy_parse_begin: found MimeEncrypted\n");

          mimeEncryptedClassP = (MimeEncryptedClass *) superclazz;
          MimeObjectClass* objClass = (MimeObjectClass*) &mimeEncryptedEnigClass;
          objClass->superclass = (MimeObjectClass *) superclazz;

          nsresult rv;
          nsCOMPtr<nsIEnigMimeService> enigMimeService = do_GetService(NS_ENIGMIMESERVICE_CONTRACTID, &rv);
          if (NS_SUCCEEDED(rv)) {
            enigMimeService->Init();
          }

        }
      }

    }

  }

  return 0;
}

Here is the caller graph for this function:

static int MimeDummy_parse_buffer ( const char *  buffer,
PRInt32  size,
MimeObject *  obj 
) [static]

Definition at line 136 of file mimedummy.cpp.

{
  return 0;
}

Here is the caller graph for this function:

static int MimeDummy_parse_end ( MimeObject *  obj,
EMBool  abort_p 
) [static]

Definition at line 156 of file mimedummy.cpp.

{
  return 0;
}

Here is the caller graph for this function:

static int MimeDummy_parse_eof ( MimeObject *  obj,
EMBool  abort_p 
) [static]

Definition at line 149 of file mimedummy.cpp.

{
  return 0;
}

Here is the caller graph for this function:

static int MimeDummy_parse_line ( const char *  line,
PRInt32  length,
MimeObject *  obj 
) [static]

Definition at line 143 of file mimedummy.cpp.

{
  return 0;
}

Here is the caller graph for this function:

static int MimeDummyClassInitialize ( MimeDummyClass clazz) [static]

Definition at line 56 of file mimedummy.cpp.

{
  MimeObjectClass    *oclass = (MimeObjectClass *)    clazz;
  MimeContainerClass *cclass = (MimeContainerClass *) clazz;

  PR_ASSERT(!oclass->class_initialized);
  oclass->initialize   = MimeDummy_initialize;
  oclass->finalize     = MimeDummy_finalize;
  oclass->parse_begin  = MimeDummy_parse_begin;
  oclass->parse_buffer = MimeDummy_parse_buffer;
  oclass->parse_line   = MimeDummy_parse_line;
  oclass->parse_eof    = MimeDummy_parse_eof;
  oclass->parse_end    = MimeDummy_parse_end;

  cclass->add_child    = MimeDummy_add_child;

  return 0;
}

Here is the call graph for this function:


Variable Documentation

MimeEncryptedClass* mimeEncryptedClassP = NULL

Definition at line 40 of file mimedummy.cpp.