Imagemap Class Reference

This is a list of clickable areas. More...

#include <imagemap.h>

Inheritance diagram for Imagemap:

OverrideList List CCObject SimpleCCObject List of all members.

Public Member Functions

 Imagemap ()
 Default constructor.
 ~Imagemap ()
 Destructor.
void AddRectangle (DocRect rectToAdd, TCHAR *pcURL=NULL, TCHAR *pcFrame=NULL)
 Adds a rectangular clickable region to the imagemap.
void AddCircle (Path *pthToAdd, TCHAR *pcURL=NULL, TCHAR *pcFrame=NULL)
 Adds a circular clickable region to the imagemap.
void AddPolygon (Path *pthToAdd, TCHAR *pcURL=NULL, TCHAR *pcFrame=NULL)
 Adds a straight-sided polygon to the imagemap.
INT32 Write (CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL)
 Writes out the imagemap.

Detailed Description

This is a list of clickable areas.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97
The clickable areas can be any of the following objects:

ImagemapClickableCircle ImagemapClickableRectangle ImagemapClickablePolygon

All these classes are derived from the ImagemapClickableArea class, which is in turn derived from ListItem.

This imagemap class also has the ability to write itself out to a file, via the Write function.

Definition at line 133 of file imagemap.h.


Constructor & Destructor Documentation

Imagemap::Imagemap  ) 
 

Default constructor.

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

Definition at line 126 of file imagemap.cpp.

00126                    : OverrideList()
00127 {
00128     //Does nothing
00129 }

Imagemap::~Imagemap  ) 
 

Destructor.

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

Definition at line 147 of file imagemap.cpp.

00148 {
00149     //Delete all our list items
00150     DeleteAll();
00151 }


Member Function Documentation

void Imagemap::AddCircle Path pthToAdd,
TCHAR pcURL = NULL,
TCHAR pcFrame = NULL
 

Adds a circular clickable region to the imagemap.

> Imagemap::AddCircle(Path* pthToAdd, TCHAR* pcURL=NULL, TCHAR* pcFrame=NULL);

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97
Parameters:
pthToAdd The circular path to add to the imagemap [INPUTS]

Definition at line 194 of file imagemap.cpp.

00195 {
00196     //Create a new ImagemapClickableCircle with our scaled path
00197     ImagemapClickableCircle* pCircle=new ImagemapClickableCircle(pthToAdd, pcURL, pcFrame);
00198 
00199     //And add it to the imagemap
00200     //Note that we add it to the head of the list. That's because, in imagemaps,
00201     //the first clickable area found in the file is the one nearest the front.
00202     AddHead(pCircle);
00203 }

void Imagemap::AddPolygon Path pthToAdd,
TCHAR pcURL = NULL,
TCHAR pcFrame = NULL
 

Adds a straight-sided polygon to the imagemap.

> Imagemap::AddPolygon(Path* pthToAdd, TCHAR* pcURL=NULL, TCHAR* pcFrame=NULL);

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97
Parameters:
pthToAdd The path to add to the imagemap [INPUTS]

Definition at line 218 of file imagemap.cpp.

00219 {
00220     //Create a new ImagemapClickableCircle with the path we've been given
00221     ImagemapClickablePolygon* pPolygon=new ImagemapClickablePolygon(pthToAdd, pcURL, pcFrame);
00222         
00223     //And add it to the imagemap
00224     //Note that we add it to the head of the list. That's because, in imagemaps,
00225     //the first clickable area found in the file is the one nearest the front.
00226     AddHead(pPolygon);
00227 }

void Imagemap::AddRectangle DocRect  rectToAdd,
TCHAR pcURL = NULL,
TCHAR pcFrame = NULL
 

Adds a rectangular clickable region to the imagemap.

> Imagemap::AddRectangle(DocRect rectToAdd, TCHAR* pcURL=NULL, TCHAR* pcFrame=NULL);

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/97
Parameters:
rectToAdd The rectangle to add to the imagemap [INPUTS]

Definition at line 171 of file imagemap.cpp.

00172 {
00173     //Create a new ImagemapClickableRectangle with the rectangle we've been given
00174     ImagemapClickableRectangle* pRectangle=new ImagemapClickableRectangle(rectToAdd, pcURL, pcFrame);
00175 
00176     //And add it to the imagemap
00177     //Note that we add it to the head of the list. That's because, in imagemaps,
00178     //the first clickable area found in the file is the one nearest the front.
00179     AddHead(pRectangle);
00180 }

INT32 Imagemap::Write CCLexFile pfileToWrite = NULL,
TCHAR pcBuffer = NULL
 

Writes out the imagemap.

> INT32 Imagemap::WriteHelper(CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)

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

Returns:
The number of TCHARs written.
This function simply iterates through the list and calls on the members to write themselves out.

SeeAlso: ImagemapRenderRegion::Write()

Definition at line 258 of file imagemap.cpp.

00259 {
00260     //Set up a variable to remember how many bytes we have written
00261     INT32 lBytesWritten=0;
00262     
00263     //Now, get the first clickable area in the imagemap
00264     ImagemapClickableArea* pAreaToWrite=(ImagemapClickableArea*) GetHead();
00265 
00266     //And while we're still looking at a valid clickable area
00267     while (pAreaToWrite!=NULL)
00268     {
00269         //Tell that area to write itself out to the imagemap.
00270         //This function will return the number of TCHARs it writes
00271         lBytesWritten+=pAreaToWrite->Write(pfileToWrite, pcBuffer);
00272 
00273         //And move on to the next clickable area
00274         pAreaToWrite=(ImagemapClickableArea*) GetNext(pAreaToWrite);
00275     }
00276 
00277     //And return the number of TCHARs we have written
00278     return lBytesWritten;
00279     
00280 }


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