ImportedBitmaps Class Reference

Encapsulate the process of maintaining an list of Bitmaps already exported from the current document out to file. More...

#include <impbmp.h>

Inheritance diagram for ImportedBitmaps:

CCObject SimpleCCObject BitmapSequence List of all members.

Public Member Functions

 ImportedBitmaps ()
 Construct the class which encapsulates a list of exported Bitmaps.
 ~ImportedBitmaps ()
 Destroy the class which encapsulates a list of exported Bitmaps.
BOOL AddBitmap (KernelBitmap *pNewBmp, INT32 RecordNumber)
 Add the specified Bitmap to the list of already exported Bitmaps.
KernelBitmapGetBitmap (INT32 ReqRecordNumber)
 Searches for a previously imported bitmap definition. Used by the native/web filter to convert a bitmap reference in a record to an KernelBitmap. This must have already been imported in the file as the rule is that reference to bitmaps can only be made if the bitmap definition has already been output.

Protected Attributes

ImportBitmapList Bitmaps

Detailed Description

Encapsulate the process of maintaining an list of Bitmaps already exported from the current document out to file.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/6/96
See also:
NewImportBitmap; ImportBitmapList

Definition at line 175 of file impbmp.h.


Constructor & Destructor Documentation

ImportedBitmaps::ImportedBitmaps  ) 
 

Construct the class which encapsulates a list of exported Bitmaps.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/5/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
ImportedBitmaps

Definition at line 212 of file impbmp.cpp.

00213 {
00214 }

ImportedBitmaps::~ImportedBitmaps  ) 
 

Destroy the class which encapsulates a list of exported Bitmaps.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/6/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
ImportedBitmaps

Definition at line 230 of file impbmp.cpp.

00231 {
00232     // Delete all the bitmaps in the list, as copies will have been made to
00233     // put in the tree
00234 
00235     ImportBitmap* pBitmap = (ImportBitmap *)Bitmaps.GetHead();
00236     while (pBitmap != NULL)
00237     {
00238         if (pBitmap->pBmp &&
00239             pBitmap->pBmp->GetParentBitmapList() == NULL)
00240         {
00241             // Only delete the bitmap if it has a NULL parent bitmap list,
00242             // because otherwise it means they are being used
00243             delete pBitmap->pBmp;
00244         }
00245 
00246         // Try the next Bitmap in the list
00247         pBitmap = (ImportBitmap *)Bitmaps.GetNext(pBitmap);
00248     }
00249 
00250 }


Member Function Documentation

BOOL ImportedBitmaps::AddBitmap KernelBitmap pBmp,
INT32  RecordNumber
 

Add the specified Bitmap to the list of already exported Bitmaps.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/6/96
Parameters:
pNewBmp - the Bitmap to put in the list. [INPUTS] RecordNumber - the number of the record that this Bitmap definition has been saved in.
Returns:
TRUE if the Bitmap could be added; FALSE if not

Errors: -

See also:
ImportBitmapList;

Definition at line 269 of file impbmp.cpp.

00270 {
00271     // Add the Bitmap onto our list
00272     ImportBitmap * pNewBmp = Bitmaps.AddBitmap(pBmp, RecordNumber);
00273     if (pNewBmp)
00274         return TRUE;
00275     
00276     return FALSE;
00277 }

KernelBitmap * ImportedBitmaps::GetBitmap INT32  ReqRecordNumber  ) 
 

Searches for a previously imported bitmap definition. Used by the native/web filter to convert a bitmap reference in a record to an KernelBitmap. This must have already been imported in the file as the rule is that reference to bitmaps can only be made if the bitmap definition has already been output.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/6/96
Parameters:
ReqRecordNumber - the record number to search the list for [INPUTS]
Returns:
Pointer to the KernelBitmap if successful; NULL if not found.

Errors: -

See also:
ImportedBitmaps; BitmapListComponent;

Definition at line 297 of file impbmp.cpp.

00298 {
00299     // Work our way through the list of imported bitmaps until we find the required record number
00300     ImportBitmap* pBitmap = (ImportBitmap *)Bitmaps.GetHead();
00301     while (pBitmap != NULL)
00302     {
00303         if (pBitmap->RecordNumber == ReqRecordNumber)
00304             return pBitmap->pBmp;
00305 
00306         // Try the next Bitmap in the list
00307         pBitmap = (ImportBitmap *)Bitmaps.GetNext(pBitmap);
00308     }
00309 
00310     // Something went a bit wrong and we didn't find the requested record number
00311     // return NULL to the caller 
00312     return NULL;
00313 }


Member Data Documentation

ImportBitmapList ImportedBitmaps::Bitmaps [protected]
 

Definition at line 192 of file impbmp.h.


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