ImagemapClickableRectangle Class Reference

This class represents a clickable rectangle. More...

#include <clicarea.h>

Inheritance diagram for ImagemapClickableRectangle:

ImagemapClickableArea OverrideListItem ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ImagemapClickableRectangle ()
 Default constructor.
 ImagemapClickableRectangle (DocRect rectToStore, TCHAR *pcURL=NULL, TCHAR *pcFrame=NULL)
 Specific constructor.
INT32 Write (CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes this clickable area, in client-side imagemap form, into the buffer or the file or both.
BOOL OverrideFromBelow (OverrideListItem *picaOther)
 If this ImagemapClickableRectangle encloses (or is equal to) the bounding box of the other ImagemapClickableArea, and both have the same URL and frame information, then we override the other.
BOOL OverrideFromAbove (OverrideListItem *picaOther)
DocRect GetBoundingRect ()

Public Attributes

DocRect m_rect

Detailed Description

This class represents a clickable rectangle.

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

Definition at line 171 of file clicarea.h.


Constructor & Destructor Documentation

ImagemapClickableRectangle::ImagemapClickableRectangle  ) 
 

Default constructor.

ImagemapClickableRectangle::ImagemapClickableRectangle() : ImagemapClickableArea()

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]

Definition at line 324 of file clicarea.cpp.

00324                                                        : ImagemapClickableArea()
00325 {
00326     m_rect=DocRect(0,0,0,0);
00327 }

ImagemapClickableRectangle::ImagemapClickableRectangle DocRect  rectNew,
TCHAR pcURL = NULL,
TCHAR pcFrame = NULL
 

Specific constructor.

ImagemapClickableRectangle::ImagemapClickableRectangle(DocRect rectNew, TCHAR* pcURL, TCHAR* pcFrame) : ImagemapClickableArea(pcURL, pcFrame)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97
Parameters:
rectNew The new rectangle to use [INPUTS]
- [OUTPUTS]

Definition at line 342 of file clicarea.cpp.

00343 : ImagemapClickableArea(pcURL, pcFrame)
00344 {
00345     m_rect=rectNew;
00346 }


Member Function Documentation

DocRect ImagemapClickableRectangle::GetBoundingRect  )  [inline, virtual]
 

Implements ImagemapClickableArea.

Definition at line 196 of file clicarea.h.

00197     {
00198         return m_rect;
00199     }

BOOL ImagemapClickableRectangle::OverrideFromAbove OverrideListItem picaOther  )  [inline, virtual]
 

Reimplemented from OverrideListItem.

Definition at line 189 of file clicarea.h.

00190     {
00191         return OverrideFromBelow(picaOther);
00192     }

BOOL ImagemapClickableRectangle::OverrideFromBelow OverrideListItem poliOther  )  [virtual]
 

If this ImagemapClickableRectangle encloses (or is equal to) the bounding box of the other ImagemapClickableArea, and both have the same URL and frame information, then we override the other.

BOOL ImagemapClickableRectangle::OverrideFromBelow(OverrideListItem* picaOther)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97
Parameters:
picaOther The imagemap clickable area which we want to know [INPUTS] if it's overridden or not
Returns:
TRUE if this ImagemapClickableRectangle overrides picaOther FALSE otherwise

Reimplemented from OverrideListItem.

Definition at line 431 of file clicarea.cpp.

00432 {
00433     ERROR2IF(poliOther==NULL, FALSE, "ImagemapClickableRectangle::OverrideFromAbove passed NULL parameter");
00434 
00435     if (!poliOther->IsAClickableArea())
00436         return FALSE;
00437 
00438     ImagemapClickableArea* picaOther=(ImagemapClickableArea*) poliOther;
00439 
00440     //Get the bounding box of the other ImagemapClickableArea
00441     DocRect rectOther=picaOther->GetBoundingRect();
00442 
00443     //We override the other ImagemapClickableArea if we contain
00444     //its bounding box and if URL and frame strings are equal
00445     return (m_rect.ContainsRect(rectOther)
00446         && WebAddressAttribute::AreStringsEqual(m_pcURL, picaOther->m_pcURL)
00447         && WebAddressAttribute::AreStringsEqual(m_pcFrame, picaOther->m_pcFrame));
00448 
00449 }

INT32 ImagemapClickableRectangle::Write CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
[virtual]
 

Writes this clickable area, in client-side imagemap form, into the buffer or the file or both.

INT32 Write(CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97
Parameters:
pfileToWrite The file to write to [INPUTS] pcBuffer The text buffer to write to
Either of the above may be NULL.

Returns:
The number of TCHARs written.
This function may be called with all parameters NULL, to find out how many TCHARs will be written into the imagemap, and hence to find out how long the text buffer must be

Implements ImagemapClickableArea.

Definition at line 370 of file clicarea.cpp.

00371 {
00372     PORTNOTETRACE("other","ImagemapClickableArea::Write - do nothing");
00373 #ifndef EXCLUDE_FROM_XARALX
00374     //Keep a count of the characters we write out
00375     INT32 lCharsWritten = 0;
00376 
00377     ImagemapFilter * pFilter = GetImagemapFilter();
00378     ERROR2IF(pFilter == NULL,lCharsWritten,"ImagemapClickableRectangle::Write no imagemap filter");
00379 
00380     //First indent the text
00381     pFilter->Indent();
00382     lCharsWritten += pFilter->WriteIndent(pfileToWrite, pcBuffer);
00383 
00384     //And write out <AREA
00385     lCharsWritten += pFilter->WriteStartOfTag(_R(IDS_HTMLEXPORT_AREA), pfileToWrite, pcBuffer);
00386 
00387     //Now write out SHAPE=RECTANGLE
00388     lCharsWritten += pFilter->WriteParameter(_R(IDS_HTMLEXPORT_SHAPE), _R(IDS_HTMLEXPORT_RECTANGLE), pfileToWrite, pcBuffer);
00389 
00390     //Write out the URL and the FRAME
00391     lCharsWritten += WriteURLAndFrame(pfileToWrite, pcBuffer);
00392         
00393     //And write out our coords
00394     lCharsWritten += pFilter->WriteCoords(m_rect, m_pcFrame, pfileToWrite, pcBuffer);
00395 
00396     //And the end of the tag
00397     lCharsWritten += pFilter->WriteEndOfTag(pfileToWrite, pcBuffer);
00398 
00399     //Then reset the indent
00400     pFilter->Unindent();
00401 
00402     //And write out a new line
00403     lCharsWritten += pFilter->WriteEOL(pfileToWrite, pcBuffer);
00404 
00405     //And return the number of characters we've written
00406     return lCharsWritten;
00407 #else
00408     return 0;
00409 #endif
00410 }


Member Data Documentation

DocRect ImagemapClickableRectangle::m_rect
 

Definition at line 203 of file clicarea.h.


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