InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
XDocBkCALSContentHandler Class Reference
Inheritance diagram for XDocBkCALSContentHandler:
CSAXDOMSerializerHandlerCPMUnknown< ISAXDOMSerializerHandler >ISAXDOMSerializerHandlerIPMUnknown

Public Member Functions

 XDocBkCALSContentHandler (IPMUnknown *boss)
 
virtual void Register (ISAXDOMSerializerServices *saxServices, IPMUnknown *importer)
 
virtual bool16 HandlesSubElements () const
 
virtual void Characters (const WideString &chars, IIDXMLDOMNode *currentNode)
 
virtual void StartElement (const WideString &uri, const WideString &localname, const WideString &qname, ISAXAttributeList *attrs, IIDXMLDOMNode *currentNode)
 
virtual void EndElement (const WideString &uri, const WideString &localname, const WideString &qname, IIDXMLDOMNode *currentNode)
 
- Public Member Functions inherited from CSAXDOMSerializerHandler
 CSAXDOMSerializerHandler (IPMUnknown *boss)
 
virtual void StartDocument (ISAXDOMSerializerServices *saxServices)
 
virtual void EndDocument ()
 
virtual void StartPrefixMapping (const WideString &prefix, const WideString &uri)
 
virtual void EndPrefixMapping (const WideString &prefix)
 
virtual void ProcessingInstruction (const WideString &target, const WideString &data, IIDXMLDOMNode *currentNode)
 
virtual void ExtComment (const WideString &comment, IIDXMLDOMNode *currentNode)
 
- Public Member Functions inherited from CPMUnknown< ISAXDOMSerializerHandler >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Protected Member Functions

void BeginTable (IXMLParsingContext *ctx, IXMLTableParsingContext *tableCtx)
 
void EndTable (IXMLParsingContext *ctx, IXMLTableParsingContext *tableCtx)
 
void BeginHeader (IXMLParsingContext *ctx, IXMLTableParsingContext *tableCtx)
 
void BeginBody (IXMLParsingContext *ctx, IXMLTableParsingContext *tableCtx)
 
void AddRowToTable (IXMLParsingContext *ctx, IXMLTableParsingContext *tableCtx)
 
void AddColumnToTable (IXMLParsingContext *ctx, IXMLTableParsingContext *tableCtx)
 
void TrimTableToFitIncoming (ITableModel *tableModel)
 
bool16 IsIgnorableWhiteSpace (const WideString &chars) const
 
void ImportCellText (const WideString &chars)
 
void UpdateCurrentInsertionPosition (const UIDRef &storyUIDRef, IIDXMLElement *element)
 
ErrorCode VerifyElementHasAssocTextModel (IIDXMLElement *element)
 
ErrorCode WrapTable (const UIDRef &textModelUIDRef, const TextIndex &firstTableFrameTextIndex, const WideString &tagName, bool16 addAttribute, const WideString &attrName, const WideString &attrValue)
 
ErrorCode InsertChar (const UIDRef &textModelUIDRef, const TextIndex &where, const textchar &whatChar)
 
- Protected Member Functions inherited from CSAXDOMSerializerHandler
bool16 HasAttribute (ISAXAttributeList *attrs, const WideString &key)
 
WideString GetAttributeString (ISAXAttributeList *attrs, const WideString &key, const WideString &defaultValue=WideString())
 
bool16 GetAttributeBool (ISAXAttributeList *attrs, const WideString &key, bool16 defaultValue=kFalse)
 
int32 GetAttributeInt (ISAXAttributeList *attrs, const WideString &key, int32 defaultValue=0)
 
- Protected Member Functions inherited from CPMUnknown< ISAXDOMSerializerHandler >
 CPMUnknown (IPMUnknown *boss)
 

Additional Inherited Members

- Public Types inherited from ISAXDOMSerializerHandler
enum  { kDefaultIID = IID_ISAXDOMSERIALIZERHANDLER }
 
- Protected Attributes inherited from CPMUnknown< ISAXDOMSerializerHandler >
HelperInterface fHelperInterface
 

Detailed Description

Implementation of ISAXDOMSerializerHandler that creates tables based on DocBook tables. Also uses our error-string service to deliver user-friendly errors when problems are encountered in parsing the XML data.

Uses exceptions to generate clean way to abort parsing and make sure that error is transmitted to topmost level methods in this plug-in.

The parsing-related methods of ISAXDOMSerializerHandler that we override (Characters, StartElement, EndElement) all have try-catch blocks, and exceptions are only thrown within the scope of these methods.

This means that we don't propagate exceptions outside of our plug-in.

See Also
ISAXDOMSerializerHandler
XML Fundamentals documentation
XDocBkErrorStringService, IErrorStringService

Member Function Documentation

void XDocBkCALSContentHandler::AddColumnToTable (IXMLParsingContextctx,
IXMLTableParsingContexttableCtx 
)
protected

Add column to existing table

Parameters
ctxIN
tableCtxIN
void XDocBkCALSContentHandler::AddRowToTable (IXMLParsingContextctx,
IXMLTableParsingContexttableCtx 
)
protected

Add row to existing table

Parameters
ctxIN
tableCtxIN
void XDocBkCALSContentHandler::BeginBody (IXMLParsingContextctx,
IXMLTableParsingContexttableCtx 
)
protected

Start parsing body rows of table

Parameters
ctxIN
tableCtxIN
void XDocBkCALSContentHandler::BeginHeader (IXMLParsingContextctx,
IXMLTableParsingContexttableCtx 
)
protected

Start parsing header rows of table

Parameters
ctxIN
tableCtxIN
void XDocBkCALSContentHandler::BeginTable (IXMLParsingContextctx,
IXMLTableParsingContexttableCtx 
)
protected

Start parsing table

Parameters
ctxIN
tableCtxIN
void XDocBkCALSContentHandler::Characters (const WideStringchars,
IIDXMLDOMNodecurrentNode 
)
virtual
void XDocBkCALSContentHandler::EndElement (const WideStringuri,
const WideStringlocalname,
const WideStringqname,
IIDXMLDOMNodecurrentNode 
)
virtual
void XDocBkCALSContentHandler::EndTable (IXMLParsingContextctx,
IXMLTableParsingContexttableCtx 
)
protected

Finish parsing table

Parameters
ctxIN
tableCtxIN
bool16 XDocBkCALSContentHandler::HandlesSubElements () const
virtual
void XDocBkCALSContentHandler::ImportCellText (const WideStringchars)
protected

Put some text into the current cell

Parameters
charsIN
ErrorCode XDocBkCALSContentHandler::InsertChar (const UIDReftextModelUIDRef,
const TextIndex & where,
const textchar & whatChar 
)
protected

Insert single character into story

Parameters
textModelUIDRefIN
whereIN
whatCharIN
Returns
ErrorCode
bool16 XDocBkCALSContentHandler::IsIgnorableWhiteSpace (const WideStringchars) const
protected

Determine if string is whitespace only

Parameters
charsIN
Returns
bool16 kTrue if whitespace only, kFalse otherwise
void XDocBkCALSContentHandler::Register (ISAXDOMSerializerServicessaxServices,
IPMUnknownimporter 
)
virtual
void XDocBkCALSContentHandler::StartElement (const WideStringuri,
const WideStringlocalname,
const WideStringqname,
ISAXAttributeListattrs,
IIDXMLDOMNodecurrentNode 
)
virtual
void XDocBkCALSContentHandler::TrimTableToFitIncoming (ITableModeltableModel)
protected

Trim the existing table to fit the incoming XML data

Parameters
tableModelIN
void XDocBkCALSContentHandler::UpdateCurrentInsertionPosition (const UIDRefstoryUIDRef,
IIDXMLElementelement 
)
protected

Set the insertion position in the parsing context

Parameters
storyUIDRef
elementIN
ErrorCode XDocBkCALSContentHandler::VerifyElementHasAssocTextModel (IIDXMLElementelement)
protected

Determine if element has associated story

Parameters
elementIN
Returns
ErrorCode kSuccess if we have associated text model, other ErrorCode otherwise
ErrorCode XDocBkCALSContentHandler::WrapTable (const UIDReftextModelUIDRef,
const TextIndex & firstTableFrameTextIndex,
const WideStringtagName,
bool16 addAttribute,
const WideStringattrName,
const WideStringattrValue 
)
protected

Wrap a table in an element. This is partly a workaround because at time of writing (build 209, CS2), attempting to tag table created in this parsing context doesn't work correctly.

Parameters
textModelUIDRefIN
firstTableFrameTextIndexIN
tagNameIN
addAttributeIN
attrNameIN
attrValueIN
Returns
ErrorCode IN