Defines | Typedefs | Enumerations | Functions | Variables

ie_imp_XHTML.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "ut_locale.h"
#include "ut_assert.h"
#include "ut_debugmsg.h"
#include "ut_types.h"
#include "ut_base64.h"
#include "ut_bytebuf.h"
#include "ut_path.h"
#include "ut_misc.h"
#include "ut_string.h"
#include "ut_std_string.h"
#include "fg_GraphicRaster.h"
#include "ie_imp_PasteListener.h"
#include "pd_Document.h"
#include "ie_types.h"
#include "ie_impGraphic.h"
#include "ie_Table.h"
#include "ie_impexp_HTML.h"
#include "ie_imp_XHTML.h"
#include "ut_html.h"

Defines

#define CSS_MASK_INLINE   (1<<0)
#define CSS_MASK_BLOCK   (1<<1)
#define CSS_MASK_IMAGE   (1<<2)
#define CSS_MASK_BODY   (1<<3)
#define TokenTableSize   ((sizeof(s_Tokens)/sizeof(s_Tokens[0])))
#define X_TestParseState(ps)   ((m_parseState==(ps)))
#define X_VerifyParseState(ps)
#define X_CheckDocument(b)
#define X_CheckError(v)
#define X_EatIfAlreadyError()   do { if (m_error) { failLine = __LINE__; goto X_Fail; } } while (0)

Typedefs

typedef enum section_class SectionClass

Enumerations

enum  section_class { sc_section = 0, sc_other }

Functions

static UT_UTF8String s_parseCSStyle (const UT_UTF8String &style, UT_uint32 css_mask)
static SectionClass s_class_query (const char *class_value)
static void s_append_font_family (UT_UTF8String &style, const char *face)
static void s_append_font_size (UT_UTF8String &style, const char *size)
static void s_append_color (UT_UTF8String &style, const char *color, const char *property)
static bool recognizeXHTML (const char *szBuf, UT_uint32 iNumbytes)
static void s_pass_whitespace (const char *&csstr)
static const char * s_pass_name (const char *&csstr)
static const char * s_pass_value (const char *&csstr)
static bool s_pass_number (char *&ptr, bool &bIsPercent)
static unsigned char s_rgb_number (float f, bool bIsPercent)
static void s_props_append (UT_UTF8String &props, UT_uint32 css_mask, const char *name, char *value)

Variables

static const char * s_section_classes [sc_other]
static IE_SuffixConfidence IE_Imp_XHTML_Sniffer__SuffixConfidence []
static IE_MimeConfidence IE_Imp_XHTML_Sniffer__MimeConfidence []
static const gchar * ol_atts []
static const gchar * ol_p_atts []
static const gchar * ul_atts []
static const gchar * ul_p_atts []
static struct xmlToIdMapping s_Tokens []
static const char * s_font_size [7]

Define Documentation

#define CSS_MASK_BLOCK   (1<<1)
#define CSS_MASK_BODY   (1<<3)

Referenced by s_props_append().

#define CSS_MASK_IMAGE   (1<<2)
#define CSS_MASK_INLINE   (1<<0)
#define TokenTableSize   ((sizeof(s_Tokens)/sizeof(s_Tokens[0])))
#define X_CheckDocument (   b  ) 
Value:
do {  if (!(b)) \
                    {  m_error = UT_IE_BOGUSDOCUMENT;   \
                    failLine = __LINE__; goto X_Fail; } } while (0)

Referenced by IE_Imp_XHTML::endElement().

#define X_CheckError (   v  ) 
Value:
do {  if (!(v)) \
                      {  m_error = UT_ERROR; \
                         UT_DEBUGMSG(("JOHN: X_CheckError\n")); \
                    failLine = __LINE__; goto X_Fail; } } while (0)

Referenced by IE_Imp_XHTML::charData(), IE_Imp_XHTML::endElement(), and IE_Imp_XHTML::startElement().

#define X_EatIfAlreadyError (  )     do { if (m_error) { failLine = __LINE__; goto X_Fail; } } while (0)
#define X_TestParseState (   ps  )     ((m_parseState==(ps)))
#define X_VerifyParseState (   ps  ) 
Value:
do {  if (!(X_TestParseState(ps)))      \
                {  m_error = UT_IE_BOGUSDOCUMENT;   \
                                   UT_DEBUGMSG(("DOM: unhandled tag: %d (ps: %d)\n", tokenIndex, ps)); \
                   failLine = __LINE__; goto X_Fail; } } while (0)

Referenced by IE_Imp_XHTML::endElement(), and IE_Imp_XHTML::startElement().


Typedef Documentation


Enumeration Type Documentation

Enumerator:
sc_section 
sc_other 

Function Documentation

static bool recognizeXHTML ( const char *  szBuf,
UT_uint32  iNumbytes 
) [static]
static void s_append_color ( UT_UTF8String style,
const char *  color,
const char *  property 
) [static]
static void s_append_font_family ( UT_UTF8String style,
const char *  face 
) [static]
static void s_append_font_size ( UT_UTF8String style,
const char *  size 
) [static]
static SectionClass s_class_query ( const char *  class_value  )  [static]

References s_section_classes.

Referenced by IE_Imp_XHTML::startElement().

static UT_UTF8String s_parseCSStyle ( const UT_UTF8String style,
UT_uint32  css_mask 
) [static]
static const char* s_pass_name ( const char *&  csstr  )  [static]
static bool s_pass_number ( char *&  ptr,
bool &  bIsPercent 
) [static]

Referenced by s_props_append().

static const char* s_pass_value ( const char *&  csstr  )  [static]
static void s_pass_whitespace ( const char *&  csstr  )  [static]
static void s_props_append ( UT_UTF8String props,
UT_uint32  css_mask,
const char *  name,
char *  value 
) [static]
static unsigned char s_rgb_number ( float  f,
bool  bIsPercent 
) [static]

Referenced by s_props_append().


Variable Documentation

Initial value:
 {
    { IE_MIME_MATCH_FULL,   IE_MIMETYPE_XHTML,      UT_CONFIDENCE_PERFECT   }, 
    { IE_MIME_MATCH_FULL,   "application/xhtml",    UT_CONFIDENCE_PERFECT   }, 
    { IE_MIME_MATCH_FULL,   "text/html",            UT_CONFIDENCE_PERFECT   },
    { IE_MIME_MATCH_BOGUS,  "",                     UT_CONFIDENCE_ZILCH }
}
Initial value:
 {
    { "xhtml",  UT_CONFIDENCE_PERFECT   },
    { "html",   UT_CONFIDENCE_PERFECT   },
    { "htm",    UT_CONFIDENCE_PERFECT   },
    { "",   UT_CONFIDENCE_ZILCH     }
}
const gchar* ol_atts[] [static]
Initial value:
  {
    "id", "1",
    "parentid", "0",
    "type", "0",
    "start-value", "1",
    "list-delim", "%L.",
    "list-decimal", ".",
    NULL, NULL
  }
const gchar* ol_p_atts[] [static]
Initial value:
 
  {
    "level", "1",
    "listid", "1",
    "parentid", "0",
    "props", "list-style:Numbered List; start-value:1; text-indent:-0.3in; field-font: NULL;",
    
    "style", "Normal",
    NULL, NULL
  }
const char* s_font_size[7] [static]
Initial value:
 {
    "8pt",
    "10pt",
    "11pt",
    "12pt",
    "16pt",
    "24pt",
    "32pt"
}
const char* s_section_classes[sc_other] [static]
Initial value:
 {
    "Section"
}

Referenced by s_class_query(), and IE_Imp_XHTML::startElement().

struct xmlToIdMapping s_Tokens[] [static]
const gchar* ul_atts[] [static]
Initial value:
  {
    "id", "2",
    "parentid", "0",
    "type", "5",
    "start-value", "0",
    "list-delim", "%L",
    "list-decimal", "NULL",
    NULL, NULL
  }
const gchar* ul_p_atts[] [static]
Initial value:
  {
    "level", "1",
    "listid", "2",
    "parentid", "0",
    "props", "list-style:Bullet List; start-value:0; text-indent:-0.3in; field-font: NULL;",
    
    "style", "Normal",
    NULL, NULL
  }