HTMLExportFilter Class Reference

The HTML export filter base class. More...

#include <htmlexp.h>

Inheritance diagram for HTMLExportFilter:

Filter ListItem CCObject SimpleCCObject ImagemapFilter List of all members.

Public Member Functions

 HTMLExportFilter ()
 Default constructor.
INT32 Write (UINT32 uiResource, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes the specified uiResource to the file, or the text buffer, or both, or neither.
INT32 Write (TCHAR *pcToWrite, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes the specified string to the file, or the text buffer, or both, or neither.
INT32 Write (DocCoord dcToWrite, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes the coordinate to the file, separated by a comma:.
INT32 WriteNumber (INT32 lToWrite, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes the number to the file.
INT32 WriteTag (UINT32 uiResource, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out the specified UI resource enclosed by < and >.
INT32 WriteCloseTag (UINT32 uiResource, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out the specified UI resource enclosed by </ and >.
INT32 WriteStartOfTag (CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out a <.
INT32 WriteStartOfTag (UINT32 uiResource, CCLexFile *pfileToWrite, TCHAR *pcBuffer)
 Writes out a < followed by a resource (e.g. "<IMG").
INT32 WriteStartOfTag (TCHAR *pcTag, CCLexFile *pfileToWrite, TCHAR *pcBuffer)
 Writes out a < followed by a resource (e.g. "<IMG").
INT32 WriteStartOfCloseTag (CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out a <\.
INT32 WriteEndOfTag (CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out a >.
INT32 WriteParameter (UINT32 uiParameter, UINT32 uiValue, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out a parameter, e.g. SHAPE=RECTANGLE.
INT32 WriteParameter (UINT32 uiParameter, TCHAR *pcValue, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out a parameter, e.g. SHAPE=RECTANGLE.
INT32 WriteParameter (TCHAR *pcParameter, TCHAR *pcValue, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out a parameter, e.g. SHAPE=RECTANGLE.
INT32 WriteParameterInQuotes (UINT32 uiParameter, UINT32 uiValue, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out a parameter, putting the value in quotes, e.g. COORDS="146, 145, 234, 132, 12, 456".
INT32 WriteParameterInQuotes (UINT32 uiParameter, TCHAR *pcValue, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out a parameter with the value in quotes, e.g. HREF="http://www.xara.com".
INT32 WriteParameterInQuotes (TCHAR *pcParameter, TCHAR *pcValue, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out a parameter with the value in quotes, e.g. HREF="http://www.xara.com".
INT32 WriteCoords (DocRect rectToWrite, TCHAR *pcValue, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out the coordinates of a rectangular area, e.g. COORDS="0,0,100,100".
INT32 WriteCoords (Path *ppthToWrite, TCHAR *pcValue, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out the coordinates of a polygon e.g. COORDS="0,0,0,100,100,100,100,0".
INT32 WriteCircleCoords (DocCoord dcCentre, INT32 lRadius, TCHAR *pcValue, CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out the coordinates of a circle e.g. COORDS="200,200,100".
INT32 WriteEOL (CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out an end of line character.
INT32 WriteTab (CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out a tab character.
INT32 WriteIndent (CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes a number of tab characters equal to the current indent level.
INT32 GetIndent ()
void SetIndent (INT32 lIndent)
void Indent (INT32 lIndentInc=1)
void Unindent (INT32 lIndentDec=1)
void CancelIndent ()
void EnableWordWrap (BOOL fShouldWordWrap=TRUE)
INT32 GetWordWrap ()
void SetWordWrap (INT32 lWordWrap)
String_256 GetTagString (UINT32 uiResource)
 Gets the specified UI resource enclosed by < and >.
String_256 GetCloseTagString (UINT32 uiResource)
 Gets the specified UI resource enclosed by < and >.

Public Attributes

INT32 m_lCharsOnThisLine
BOOL m_fShouldWordWrap
INT32 m_lWordWrap
INT32 m_lIndent

Private Member Functions

 CC_DECLARE_DYNCREATE (HTMLExportFilter)

Detailed Description

The HTML export filter base class.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/4/97
This filter itself will not be added into the filter system - derived classes of this will be added. At the moment, the only derived class is ImagemapFilter.

This class contains the functionality for writing out HTML tags.

Definition at line 127 of file htmlexp.h.


Constructor & Destructor Documentation

HTMLExportFilter::HTMLExportFilter  ) 
 

Default constructor.

> INT32 HTMLExportFilter::HTMLExportFilter()

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/4/97

Definition at line 130 of file htmlexp.cpp.

00131 {
00132     //Set all member variables to defaults
00133     m_lCharsOnThisLine=0;
00134     m_lWordWrap=HTMLEXPORT_DEFAULTWORDWRAP;
00135     m_lIndent=0;
00136     m_fShouldWordWrap=TRUE;
00137 }


Member Function Documentation

void HTMLExportFilter::CancelIndent  )  [inline]
 

Definition at line 197 of file htmlexp.h.

00198     {
00199         m_lIndent=0;
00200     }

HTMLExportFilter::CC_DECLARE_DYNCREATE HTMLExportFilter   )  [private]
 

void HTMLExportFilter::EnableWordWrap BOOL  fShouldWordWrap = TRUE  )  [inline]
 

Definition at line 205 of file htmlexp.h.

00206     {
00207         m_fShouldWordWrap=fShouldWordWrap;
00208     }

String_256 HTMLExportFilter::GetCloseTagString UINT32  uiResource  ) 
 

Gets the specified UI resource enclosed by < and >.

> String_256 HTMLExportFilter::GetCloseTagString(UINT32 uiResource)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/4/97
Parameters:
uiResource The resource to convert to a tag [INPUTS]
Returns:
The resource string enclosed in < and >.

Definition at line 988 of file htmlexp.cpp.

00989 {
00990     String_256 strStart(_R(IDS_HTMLEXPORT_CLOSETAGSTART));
00991     strStart+=String_256(uiResource);
00992     strStart+=String_256(_R(IDS_HTMLEXPORT_TAGEND));
00993 
00994     return strStart;
00995 }

INT32 HTMLExportFilter::GetIndent  )  [inline]
 

Definition at line 177 of file htmlexp.h.

00178     {
00179         return m_lIndent;
00180     }

String_256 HTMLExportFilter::GetTagString UINT32  uiResource  ) 
 

Gets the specified UI resource enclosed by < and >.

> String_256 HTMLExportFilter::GetTagString(UINT32 uiResource)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/4/97
Parameters:
uiResource The resource to convert to a tag [INPUTS]
Returns:
The resource string enclosed in < and >.

Definition at line 967 of file htmlexp.cpp.

00968 {
00969     String_256 strStart(_R(IDS_HTMLEXPORT_TAGSTART));
00970     strStart+=String_256(uiResource);
00971     strStart+=String_256(_R(IDS_HTMLEXPORT_TAGEND));
00972 
00973     return strStart;
00974 }

INT32 HTMLExportFilter::GetWordWrap  )  [inline]
 

Definition at line 210 of file htmlexp.h.

00211     {
00212         return m_lWordWrap;
00213     }

void HTMLExportFilter::Indent INT32  lIndentInc = 1  )  [inline]
 

Definition at line 187 of file htmlexp.h.

00188     {
00189         m_lIndent+=lIndentInc;
00190     }

void HTMLExportFilter::SetIndent INT32  lIndent  )  [inline]
 

Definition at line 182 of file htmlexp.h.

00183     {
00184         m_lIndent=lIndent;
00185     }

void HTMLExportFilter::SetWordWrap INT32  lWordWrap  )  [inline]
 

Definition at line 215 of file htmlexp.h.

00216     {
00217         m_lWordWrap=lWordWrap;
00218     }

void HTMLExportFilter::Unindent INT32  lIndentDec = 1  )  [inline]
 

Definition at line 192 of file htmlexp.h.

00193     {
00194         m_lIndent-=lIndentDec;
00195     }

INT32 HTMLExportFilter::Write DocCoord  dcToWrite,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes the coordinate to the file, separated by a comma:.

> INT32 HTMLExportFilter::Write(DocCoord dcToWrite, CCLexFile* pfileToWrite, TCHAR* pcBuffer)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/4/97
Parameters:
pcToWrite The coordinate to write [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written
200,100

Definition at line 308 of file htmlexp.cpp.

00309 {
00310     //Format our coords
00311     String_256 strFormat;
00312 
00313     strFormat.MakeMsg(_R(IDS_HTMLEXPORT_COORDFORMAT), dcToWrite.x, dcToWrite.y);
00314 
00315     //And write it out
00316     return Write(strFormat, pfileToWrite, pcBuffer);
00317 }

INT32 HTMLExportFilter::Write TCHAR pcToWrite,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes the specified string to the file, or the text buffer, or both, or neither.

> INT32 HTMLExportFilter::Write(TCHAR* pcToWrite, CCLexFile* pfileToWrite, TCHAR* pcBuffer)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/4/97
Parameters:
pcToWrite The string to write [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written
This function returns the number of TCHARS written. So you can call this function first with all parameters NULL to find out the length of the text buffer you need, then set up that text buffer, then call this function again to write to that text buffer.

Note that this should be the *only* function that actually writes to the file. All other write functions must call this one. That's because this function handles the word wrapping.

Notes: This is how the word wrapping works:

First this function writes out the string passed to it (e.g. "<HTML>"). It does not put any EOLs in the middle of this string.

Then it checks to see if word wrapping is turned on (from our member flag m_fShouldWordWrap).

If so, it checks to see if the number of characters written on the line so far is greater than the word wrap limit.

If so, this function puts an EOL line after the string that has been written.

Note that, if you write an end of line string ("\r\n") directly to the write function without calling WriteEOL, the word wrapping will not work properly.

Definition at line 222 of file htmlexp.cpp.

00223 {
00224     //If we've been passed a NULL pointer, then simply write nothing
00225     if (pcToWrite==NULL)
00226         return 0;
00227 
00228     //If we have a file, then write to it
00229     if (pfileToWrite)
00230         pfileToWrite->write(pcToWrite, camStrlen(pcToWrite));
00231 
00232     //If we have a text buffer, then write to it
00233     if (pcBuffer)
00234     {
00235         //We want to start writing at the NULL character where the text
00236         //buffer ends at the moment.
00237         
00238         //So find the length of the buffer
00239         INT32 lBufLen=camStrlen(pcBuffer);
00240 
00241         //And start writing at the NULL character
00242         camStrcpy(pcBuffer+lBufLen*sizeof(TCHAR), pcToWrite);
00243     }
00244 
00245     //So, the number of characters written is equal to the length of the string
00246     INT32 lCharsWritten= camStrlen(pcToWrite);
00247 
00248     //Now, if we should be doing word wrapping
00249     if (m_fShouldWordWrap)
00250     {
00251         //Then update the number of characters on this line
00252         m_lCharsOnThisLine+=lCharsWritten;
00253 
00254         //And if we have now exceeded the maximum number of characters
00255         //that should be written on this line
00256         if (m_lCharsOnThisLine > m_lWordWrap)
00257         {
00258             //Then write out an end of line
00259             //This will also reset m_lCharsOnThisLine to zero
00260             lCharsWritten+=WriteEOL(pfileToWrite, pcBuffer);
00261         }
00262     }
00263 
00264     //And return the number of characters written
00265     return lCharsWritten;
00266 }

INT32 HTMLExportFilter::Write UINT32  uiResource,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes the specified uiResource to the file, or the text buffer, or both, or neither.

> INT32 HTMLExportFilter::Write(UINT32 uiResource, CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/4/97
Parameters:
uiResource The resource to write [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer Pointer to the text buffer to write to (may be NULL) fWrap Whether to do word wrapping or not Set to FALSE if you want to write something (e.g. a tag) without this function putting word wrapping end of lines in.
Returns:
The number of TCHARs written
This function returns the number of TCHARS written. So you can call this function first with all parameters NULL to find out the length of the text buffer you need, then set up that text buffer, then call this function again to write to that text buffer.

Definition at line 170 of file htmlexp.cpp.

00171 {
00172     //Construct our string
00173     String_256 strToWrite(uiResource);
00174 
00175     //Then call our sister function to write out the string
00176     return Write(strToWrite, pfileToWrite, pcBuffer);
00177 }

INT32 HTMLExportFilter::WriteCircleCoords DocCoord  dcCentre,
INT32  lRadius,
TCHAR pcValue,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out the coordinates of a circle e.g. COORDS="200,200,100".

INT32 HTMLExportFilter::WriteCircleCoords(DocCoord dcCentre, INT32 lRadius, TCHAR* pcValue, CCLexFile* pfileToWrite, TCHAR* pcBuffer)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
dcCentre Centre of the circle to write [INPUTS] lRadius Radius of the circle to write pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 830 of file htmlexp.cpp.

00831 {
00832     //This is the value we will return
00833     INT32 lCharsWritten=0;
00834 
00835     //First write out a space
00836     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_SPACE), pfileToWrite, pcBuffer);
00837 
00838     //Now write out COORDS
00839     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_COORDS), pfileToWrite, pcBuffer);
00840                    
00841     //And an equals sign
00842     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_EQUALS), pfileToWrite, pcBuffer);
00843 
00844     //And an opening quote
00845     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_QUOTES), pfileToWrite, pcBuffer);
00846 
00847     //The centre
00848     lCharsWritten+=Write(dcCentre, pfileToWrite, pcBuffer);
00849 
00850     //A comma
00851     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_COMMA), pfileToWrite, pcBuffer);
00852 
00853     //The radius
00854     lCharsWritten+=WriteNumber(lRadius, pfileToWrite, pcBuffer);
00855 
00856     //Write a closing quote
00857     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_QUOTES), pfileToWrite, pcBuffer);
00858 
00859     //And return the number of characters written
00860     return lCharsWritten;
00861 }

INT32 HTMLExportFilter::WriteCloseTag UINT32  uiResource,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out the specified UI resource enclosed by </ and >.

> INT32 HTMLExportFilter::WriteCloseTag(UINT32 uiResource, CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
uiResource The resource to write [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 355 of file htmlexp.cpp.

00356 {
00357     //Get our close tag string
00358     String_256 strToWrite=GetCloseTagString(uiResource);
00359 
00360     //Then call our sister function to write out the string
00361     return Write(strToWrite, pfileToWrite, pcBuffer);
00362 }

INT32 HTMLExportFilter::WriteCoords Path ppthToWrite,
TCHAR pcValue,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out the coordinates of a polygon e.g. COORDS="0,0,0,100,100,100,100,0".

INT32 HTMLExportFilter::WriteCoords(Path* ppthToWrite, TCHAR* pcValue, CCLexFile* pfileToWrite, TCHAR* pcBuffer)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
ppthToWrite Pointer to the path to write [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 752 of file htmlexp.cpp.

00753 {
00754     //This is the value we will return
00755     INT32 lCharsWritten=0;
00756 
00757     //First write out a space
00758     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_SPACE), pfileToWrite, pcBuffer);
00759 
00760     //Now write out COORDS
00761     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_COORDS), pfileToWrite, pcBuffer);
00762                    
00763     //And an equals sign
00764     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_EQUALS), pfileToWrite, pcBuffer);
00765 
00766     //And an opening quote
00767     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_QUOTES), pfileToWrite, pcBuffer);
00768 
00769     //Now we must write out the path's coordinates. So find out how
00770     //INT32 the path is
00771     INT32 lNumCoords=ppthToWrite->GetNumCoords();
00772 
00773     //And get its coordinate and verb arrays
00774     DocCoord* pdcCoords=ppthToWrite->GetCoordArray();
00775 //  PathVerb* ppvVerbs=ppthToWrite->GetVerbArray();
00776 
00777     //Keep a copy of the last coordinate written, to make sure
00778     //we don't write out two consecutive identical coordinates
00779     DocCoord dcLastWritten=DocCoord(-1, -1);
00780 
00781     //Now do the following for every coordinate in the path
00782     //EXCEPT the last, which will be the same as the first
00783     INT32 lThisCoord=0;
00784 
00785     do
00786     {
00787         //If this coordinate isn't the same as the last one we wrote
00788         if (pdcCoords[lThisCoord]!=dcLastWritten)
00789         {
00790             //Write out a comma, unless this is the first coord to be written
00791             if (lThisCoord>0)
00792                 lCharsWritten+=Write(_R(IDS_HTMLEXPORT_COMMA), pfileToWrite, pcBuffer);
00793 
00794             //Write it out, followed by a comma
00795             lCharsWritten+=Write(pdcCoords[lThisCoord], pfileToWrite, pcBuffer);
00796         }
00797 
00798         //Keep a copy of this coordinate
00799         dcLastWritten=pdcCoords[lThisCoord];
00800 
00801         //And move on to the next coordinate
00802         ppthToWrite->FindNextEndPoint(&lThisCoord);
00803                 
00804     }
00805     while (lThisCoord<lNumCoords-1);
00806 
00807 
00808     //Write a closing quote
00809     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_QUOTES), pfileToWrite, pcBuffer);
00810 
00811     //And return the number of characters written
00812     return lCharsWritten;
00813 }

INT32 HTMLExportFilter::WriteCoords DocRect  rectToWrite,
TCHAR pcValue,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out the coordinates of a rectangular area, e.g. COORDS="0,0,100,100".

INT32 HTMLExportFilter::WriteCoords(DocRect rectToWrite, TCHAR* pcValue, CCLexFile* pfileToWrite, TCHAR* pcBuffer)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
rectToWrite The rectangle to write [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 709 of file htmlexp.cpp.

00710 {
00711     //This is the value we will return
00712     INT32 lCharsWritten=0;
00713 
00714     //First write out a space
00715     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_SPACE), pfileToWrite, pcBuffer);
00716 
00717     //Now write out COORDS
00718     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_COORDS), pfileToWrite, pcBuffer);
00719                    
00720     //And an equals sign
00721     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_EQUALS), pfileToWrite, pcBuffer);
00722 
00723     //And an opening quote
00724     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_QUOTES), pfileToWrite, pcBuffer);
00725 
00726     //And the coords
00727     lCharsWritten+=Write(rectToWrite.lo, pfileToWrite, pcBuffer);
00728     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_COMMA), pfileToWrite, pcBuffer);
00729     lCharsWritten+=Write(rectToWrite.hi, pfileToWrite, pcBuffer);
00730     
00731     //And a closing quote
00732     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_QUOTES), pfileToWrite, pcBuffer);
00733 
00734     //And return the number of characters written
00735     return lCharsWritten;
00736 }

INT32 HTMLExportFilter::WriteEndOfTag CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out a >.

> INT32 HTMLExportFilter::WriteEndOfTag(CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
pfileToWrite The file to write to (may be NULL) [INPUTS] pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 481 of file htmlexp.cpp.

00482 {
00483     //Get our close tag string
00484     String_256 strToWrite(_R(IDS_HTMLEXPORT_TAGEND));
00485 
00486     //Then call our sister function to write out the string
00487     return Write(strToWrite, pfileToWrite, pcBuffer);
00488 }

INT32 HTMLExportFilter::WriteEOL CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out an end of line character.

> INT32 HTMLExportFilter::WriteEOL(CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
pfileToWrite The file to write to (may be NULL) [INPUTS] pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written
Also writes out the appropriate number of tabs, according to how much the current text is indented.

Definition at line 881 of file htmlexp.cpp.

00882 {
00883     //Keep a count of the number of characters we write
00884     INT32 lCharsWritten=0;
00885 
00886     //Now, while we write out the following characters, we must turn
00887     //off word wrapping, so we don't write out an end of line and then
00888     //do word wrapping (for instance)
00889     EnableWordWrap(FALSE);
00890 
00891     //Write an end of line
00892     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_EOL), pfileToWrite, pcBuffer);
00893 
00894     //Now write out the indent
00895     lCharsWritten+=WriteIndent(pfileToWrite, pcBuffer);
00896 
00897     //Set the number of characters written on this line to zero
00898     m_lCharsOnThisLine=0;
00899 
00900     //Turn word wrapping back on
00901     EnableWordWrap(TRUE);
00902 
00903     //And return the number of characters written
00904     return lCharsWritten;
00905 }

INT32 HTMLExportFilter::WriteIndent CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes a number of tab characters equal to the current indent level.

> INT32 HTMLExportFilter::WriteIndent(CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
pfileToWrite The file to write to (may be NULL) [INPUTS] pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 937 of file htmlexp.cpp.

00938 {
00939     //Keep a count of the number of characters written
00940     INT32 lCharsWritten=0;
00941 
00942     //And write out one tab for every indent level
00943     for (INT32 i=0; i<m_lIndent; i++)
00944     {
00945         lCharsWritten+=Write(_R(IDS_HTMLEXPORT_TAB), pfileToWrite, pcBuffer);
00946     }
00947 
00948     //And return the number of characters written
00949     return lCharsWritten;
00950 }

INT32 HTMLExportFilter::WriteNumber INT32  lToWrite,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes the number to the file.

> INT32 HTMLExportFilter::Write(INT32 lToWrite, CCLexFile* pfileToWrite, TCHAR* pcBuffer)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/4/97
Parameters:
lToWrite The number to write [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 281 of file htmlexp.cpp.

00282 {
00283     //Format our number
00284     String_256 strFormat;
00285 
00286     strFormat.MakeMsg(_R(IDS_HTMLEXPORT_NUMBERFORMAT), lToWrite);
00287 
00288     //And write it out
00289     return Write(strFormat, pfileToWrite, pcBuffer);
00290 }

INT32 HTMLExportFilter::WriteParameter TCHAR pcParameter,
TCHAR pcValue,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out a parameter, e.g. SHAPE=RECTANGLE.

> INT32 HTMLExportFilter::WriteParameter(TCHAR* pcParameter, TCHAR* pcValue, CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
pcParameter The parameter to write (e.g. SHAPE) [INPUTS] pcValue The value of the parameter (e.g. RECTANGLE) pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 564 of file htmlexp.cpp.

00565 {
00566     //This is the value we will return
00567     INT32 lCharsWritten=0;
00568 
00569     //First write out a space, to separate this parameter from the one before
00570     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_SPACE), pfileToWrite, pcBuffer);
00571 
00572     //Now write out the parameter
00573     lCharsWritten+=Write(pcParameter, pfileToWrite, pcBuffer);
00574                    
00575     //And an equals sign
00576     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_EQUALS), pfileToWrite, pcBuffer);
00577 
00578     //And the value
00579     lCharsWritten+=Write(pcValue, pfileToWrite, pcBuffer);
00580 
00581     //And return the number of characters written
00582     return lCharsWritten;
00583 }

INT32 HTMLExportFilter::WriteParameter UINT32  uiParameter,
TCHAR pcValue,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out a parameter, e.g. SHAPE=RECTANGLE.

> INT32 HTMLExportFilter::WriteParameter(UINT32 uiParameter, TCHAR* pcValue, CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
uiParameter The parameter to write (e.g. SHAPE) [INPUTS] pcValue The value of the parameter (e.g. RECTANGLE) pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 529 of file htmlexp.cpp.

00530 {
00531     //This is the value we will return
00532     INT32 lCharsWritten=0;
00533 
00534     //First write out a space, to separate this parameter from the one before
00535     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_SPACE), pfileToWrite, pcBuffer);
00536 
00537     //Now write out the parameter
00538     lCharsWritten+=Write(uiParameter, pfileToWrite, pcBuffer);
00539                    
00540     //And an equals sign
00541     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_EQUALS), pfileToWrite, pcBuffer);
00542 
00543     //And the value
00544     lCharsWritten+=Write(pcValue, pfileToWrite, pcBuffer);
00545 
00546     //And return the number of characters written
00547     return lCharsWritten;
00548 }

INT32 HTMLExportFilter::WriteParameter UINT32  uiParameter,
UINT32  uiValue,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out a parameter, e.g. SHAPE=RECTANGLE.

> INT32 HTMLExportFilter::WriteParameter(UINT32 uiParameter, UINT32 uiValue, CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
uiParameter The resource of the parameter to write (e.g. SHAPE) [INPUTS] uiValue The resource of the value of the parameter (e.g. RECTANGLE) pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 505 of file htmlexp.cpp.

00506 {
00507     //Get our two strings
00508     String_256 strParameterToWrite(uiParameter);
00509     String_256 strValueToWrite(uiValue);
00510     
00511     //Then call our sister function to write out the string
00512     return WriteParameter((TCHAR*) strParameterToWrite, (TCHAR*) strValueToWrite, pfileToWrite, pcBuffer);
00513 }

INT32 HTMLExportFilter::WriteParameterInQuotes TCHAR pcParameter,
TCHAR pcValue,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out a parameter with the value in quotes, e.g. HREF="http://www.xara.com".

> INT32 HTMLExportFilter::WriteParameterInQuotes(TCHAR* pcParameter, TCHAR* pcValue, CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
pcParameter The parameter to write (e.g. SHAPE) [INPUTS] pcValue The value of the parameter (e.g. RECTANGLE) pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 668 of file htmlexp.cpp.

00669 {
00670     //This is the value we will return
00671     INT32 lCharsWritten=0;
00672 
00673     //First write out a space, to separate this parameter from the one before
00674     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_SPACE), pfileToWrite, pcBuffer);
00675 
00676     //Now write out the parameter
00677     lCharsWritten+=Write(pcParameter, pfileToWrite, pcBuffer);
00678                    
00679     //And an equals sign
00680     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_EQUALS), pfileToWrite, pcBuffer);
00681 
00682     //And an opening quote
00683     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_QUOTES), pfileToWrite, pcBuffer);
00684 
00685     //And the value
00686     lCharsWritten+=Write(pcValue, pfileToWrite, pcBuffer);
00687 
00688     //And a closing quote
00689     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_QUOTES), pfileToWrite, pcBuffer);
00690 
00691     //And return the number of characters written
00692     return lCharsWritten;
00693 }

INT32 HTMLExportFilter::WriteParameterInQuotes UINT32  uiParameter,
TCHAR pcValue,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out a parameter with the value in quotes, e.g. HREF="http://www.xara.com".

> INT32 HTMLExportFilter::WriteParameterInQuotes(UINT32 uiParameter, TCHAR* pcValue, CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
uiParameter The parameter to write (e.g. SHAPE) [INPUTS] pcValue The value of the parameter (e.g. RECTANGLE) pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 625 of file htmlexp.cpp.

00626 {
00627     //This is the value we will return
00628     INT32 lCharsWritten=0;
00629 
00630     //First write out a space, to separate this parameter from the one before
00631     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_SPACE), pfileToWrite, pcBuffer);
00632 
00633     //Now write out the parameter
00634     lCharsWritten+=Write(uiParameter, pfileToWrite, pcBuffer);
00635                    
00636     //And an equals sign
00637     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_EQUALS), pfileToWrite, pcBuffer);
00638 
00639     //And an opening quote
00640     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_QUOTES), pfileToWrite, pcBuffer);
00641 
00642     //And the value
00643     lCharsWritten+=Write(pcValue, pfileToWrite, pcBuffer);
00644 
00645     //And a closing quote
00646     lCharsWritten+=Write(_R(IDS_HTMLEXPORT_QUOTES), pfileToWrite, pcBuffer);
00647 
00648     //And return the number of characters written
00649     return lCharsWritten;
00650 }

INT32 HTMLExportFilter::WriteParameterInQuotes UINT32  uiParameter,
UINT32  uiValue,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out a parameter, putting the value in quotes, e.g. COORDS="146, 145, 234, 132, 12, 456".

> INT32 HTMLExportFilter::WriteParameterWithQuotes(UINT32 uiParameter, UINT32 uiValue, CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
uiParameter The resource of the parameter to write (e.g. SHAPE) [INPUTS] uiValue The resource of the value of the parameter (e.g. RECTANGLE) pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 600 of file htmlexp.cpp.

00601 {
00602     //Get our two strings
00603     String_256 strParameterToWrite(uiParameter);
00604     String_256 strValueToWrite(uiValue);
00605     
00606     //Then call our sister function to write out the string
00607     return WriteParameterInQuotes(strParameterToWrite, strValueToWrite, pfileToWrite, pcBuffer);
00608 }

INT32 HTMLExportFilter::WriteStartOfCloseTag CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out a <\.

> INT32 HTMLExportFilter::WriteStartOfCloseTag(CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
uiResource The resource to write [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 458 of file htmlexp.cpp.

00459 {
00460     //Get our close tag string
00461     String_256 strToWrite(_R(IDS_HTMLEXPORT_CLOSETAGSTART));
00462 
00463     //Then call our sister function to write out the string
00464     //making sure the write function doesn't put an EOL
00465     //after it
00466     return Write(strToWrite, pfileToWrite, pcBuffer);
00467 }

INT32 HTMLExportFilter::WriteStartOfTag TCHAR pcTag,
CCLexFile pfileToWrite,
TCHAR pcBuffer
 

Writes out a < followed by a resource (e.g. "<IMG").

> INT32 HTMLExportFilter::WriteStartOfTag(TCHAR* pcTag, CCLexFile* pfileToWrite, TCHAR* pcBuffer)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
pcTag The string to write after the start of the tag [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 404 of file htmlexp.cpp.

00405 {
00406     //Get our start tag string
00407     String_256 strToWrite(_R(IDS_HTMLEXPORT_TAGSTART));
00408 
00409     //Add the resource string to the end of it
00410     strToWrite+=pcTag;
00411 
00412     //Then call our sister function to write out the string
00413     //making sure the write function doesn't put an EOL
00414     //after it
00415     return Write(strToWrite, pfileToWrite, pcBuffer);
00416 }

INT32 HTMLExportFilter::WriteStartOfTag UINT32  uiResource,
CCLexFile pfileToWrite,
TCHAR pcBuffer
 

Writes out a < followed by a resource (e.g. "<IMG").

> INT32 HTMLExportFilter::WriteStartOfTag(UINT32 uiResource, CCLexFile* pfileToWrite, TCHAR* pcBuffer)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
uiResource The resource to write after the start of the tag [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 377 of file htmlexp.cpp.

00378 {
00379     //Get our start tag string
00380     String_256 strToWrite(_R(IDS_HTMLEXPORT_TAGSTART));
00381 
00382     //Add the resource string to the end of it
00383     strToWrite+=String_256(uiResource);
00384 
00385     //Then call our sister function to write out the string
00386     //making sure the write function doesn't put an EOL
00387     //after it
00388     return Write(strToWrite, pfileToWrite, pcBuffer);
00389 }

INT32 HTMLExportFilter::WriteStartOfTag CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out a <.

> INT32 HTMLExportFilter::WriteStartOfTag(CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
uiResource The resource to write [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 434 of file htmlexp.cpp.

00435 {
00436     //Get our close tag string
00437     String_256 strToWrite(_R(IDS_HTMLEXPORT_TAGSTART));
00438 
00439     //Then call our sister function to write out the string
00440     //making sure the write function doesn't put an EOL
00441     //after it
00442     return Write(strToWrite, pfileToWrite, pcBuffer);
00443 }

INT32 HTMLExportFilter::WriteTab CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out a tab character.

> INT32 HTMLExportFilter::WriteTab(CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/97
Parameters:
pfileToWrite The file to write to (may be NULL) [INPUTS] pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 919 of file htmlexp.cpp.

00920 {
00921     return Write(_R(IDS_HTMLEXPORT_TAB), pfileToWrite, pcBuffer);
00922 }

INT32 HTMLExportFilter::WriteTag UINT32  uiResource,
CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out the specified UI resource enclosed by < and >.

> INT32 HTMLExportFilter::WriteTag(UINT32 uiResource, CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/4/97
Parameters:
uiResource The resource to write [INPUTS] pfileToWrite The file to write to (may be NULL) pcBuffer The text buffer to write to (may be NULL)
Returns:
The number of TCHARs written

Definition at line 333 of file htmlexp.cpp.

00334 {
00335     //Get our tag string
00336     String_256 strToWrite=GetTagString(uiResource);
00337 
00338     //Then call our sister function to write out the string
00339     return Write(strToWrite, pfileToWrite, pcBuffer);
00340 }


Member Data Documentation

BOOL HTMLExportFilter::m_fShouldWordWrap
 

Definition at line 232 of file htmlexp.h.

INT32 HTMLExportFilter::m_lCharsOnThisLine
 

Definition at line 229 of file htmlexp.h.

INT32 HTMLExportFilter::m_lIndent
 

Definition at line 239 of file htmlexp.h.

INT32 HTMLExportFilter::m_lWordWrap
 

Definition at line 236 of file htmlexp.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:55:10 2007 for Camelot by  doxygen 1.4.4