#include <fontcomp.h>
Inheritance diagram for FontComponentList:
Public Member Functions | |
FontComponentList () | |
Constructor See Also: class FontComponent. | |
~FontComponentList () | |
Destructor See Also: class FontComponent. | |
BOOL | ExportStart () |
Gives objects of this type a chance to prepare for an export operation. See Also: class FontComponent. | |
BOOL | ExportEnd (BOOL Success) |
Gives objects if this class a chance to recover from an export operation, tidying up if neccessary. See Also: class FontComponent. | |
FontComponentListItem * | ExportFind (WORD FontHandle, BOOL IsBold, BOOL IsItalic) |
Searches the list of FontComponentListItem's for a match See Also: class FontComponentListItem. | |
BOOL | ImportStart () |
Allows objects of this class a chance to initialise before an import operation See Also: class FontComponent. | |
BOOL | ImportEnd (BOOL Success) |
Allows objects of this class a chance to recover from an import operation See Also: class FontComponent. | |
FontComponentListItem * | ImportFind (INT32 RecordNumber) |
Searches the list for a matching FontComponentListItem. See Also: class FontComponentListItem, class FontComponent. | |
Private Member Functions | |
CC_DECLARE_DYNAMIC (FontComponentList) | |
FontComponentListItem * | ExportFindAux (FontComponentListItem *pItem, WORD FontHandle, BOOL IsBold, BOOL IsItalic) |
Searches the list of FontComponentListItems for match See Also: class FontComponentListItem, class FontComponent. | |
FontComponentListItem * | ImportFindAux (FontComponentListItem *pItem, INT32 RecordNumber) |
Searches the list for a matching FontComponentListItem See Also: class FontComponentListItem, class FontComponent. | |
Private Attributes | |
BOOL | ExportInitialised |
BOOL | ImportInitialised |
Definition at line 191 of file fontcomp.h.
|
Constructor See Also: class FontComponent.
Definition at line 370 of file fontcomp.cpp. 00371 { 00372 ExportInitialised=FALSE; 00373 ImportInitialised=FALSE; 00374 }
|
|
Destructor See Also: class FontComponent.
Definition at line 389 of file fontcomp.cpp. 00390 { 00391 ERROR3IF(ExportInitialised==TRUE, "Deconstructor called when ExportInitialised==TRUE"); 00392 ERROR3IF(ImportInitialised==TRUE, "Deconstructor called when ImportInitialised==TRUE"); 00393 00394 DeleteAll(); 00395 }
|
|
|
|
Gives objects if this class a chance to recover from an export operation, tidying up if neccessary. See Also: class FontComponent.
Definition at line 443 of file fontcomp.cpp. 00444 { 00445 //ERROR2IF(ExportInitialised==FALSE, FALSE, "ExportEnd called when ExportInitialised==FALSE."); 00446 // If we error about the ExportInitialised then we assume that the StartExport has been called. 00447 // This may not be the case if we are in clean up mode. So just handle it! 00448 00449 if (Success==FALSE && ExportInitialised) 00450 { 00451 // export operation was unsuccessful, so need to delete all the entries in the list 00452 // made during the export. this is easy; since the mRecentlyCreated member of all the 00453 // elements in the list was set to FALSE before the export any element with an non-FALSE 00454 // mRecentlyCreated member. 00455 00456 FontComponentListItem *pItem = (FontComponentListItem *) GetHead(); 00457 FontComponentListItem *qItem; 00458 00459 while (pItem!=NULL) 00460 { 00461 qItem = pItem; 00462 pItem = (FontComponentListItem *) GetNext(qItem); 00463 00464 if (qItem->mRecentlyCreated==TRUE) 00465 { 00466 RemoveItem(qItem); 00467 delete qItem; 00468 } 00469 } 00470 } 00471 //else // Removed due to the change to the if statement above 00472 //{ 00473 // // oh well, the export operation was successful, so do nothing 00474 //} 00475 00476 ExportInitialised=FALSE; 00477 return TRUE; 00478 }
|
|
Searches the list of FontComponentListItem's for a match See Also: class FontComponentListItem.
Definition at line 495 of file fontcomp.cpp. 00496 { 00497 ERROR2IF(ExportInitialised==FALSE, FALSE, "ExportFind called when ExportInitialised==FALSE."); 00498 00499 // auxillary functions, searches using tail recursion. the msvc compiler should 00500 // optimise this quite well - at least, it should 00501 return ExportFindAux((FontComponentListItem *) GetHead(), FontHandle, IsBold, IsItalic); 00502 }
|
|
Searches the list of FontComponentListItems for match See Also: class FontComponentListItem, class FontComponent.
Definition at line 520 of file fontcomp.cpp. 00521 { 00522 ERROR2IF(ExportInitialised==FALSE, FALSE, "ExportFindAux called when ExportInitialised==FALSE."); 00523 ERROR2IF(FontHandle==ILLEGALFHANDLE, FALSE, "ExportFindAux called with an illegal font handle."); 00524 00525 if (pItem==NULL) 00526 { 00527 return NULL; 00528 } 00529 else if (pItem->mFontHandle==FontHandle && pItem->mIsBold==IsBold && pItem->mIsItalic==IsItalic) 00530 { 00531 return pItem; 00532 } 00533 else 00534 { 00535 // tail recursion ;) 00536 return ExportFindAux((FontComponentListItem *) GetNext(pItem), FontHandle, IsBold, IsItalic); 00537 } 00538 }
|
|
Gives objects of this type a chance to prepare for an export operation. See Also: class FontComponent.
Definition at line 410 of file fontcomp.cpp. 00411 { 00412 ERROR2IF(ExportInitialised!=FALSE, FALSE, "ExportStart called when ExportInitialised!=FALSE."); 00413 00414 FontComponentListItem *pItem = (FontComponentListItem *) GetHead(); 00415 00416 // need to set the mRecentlyCreated and mRecordNumber member of all the elements in the list to NULL 00417 while (pItem!=NULL) 00418 { 00419 pItem->mRecentlyCreated = FALSE; 00420 pItem->mRecordNumber = 0; 00421 pItem = (FontComponentListItem *) GetNext(pItem); 00422 } 00423 00424 ExportInitialised = TRUE; 00425 00426 return TRUE; 00427 }
|
|
Allows objects of this class a chance to recover from an import operation See Also: class FontComponent.
Definition at line 586 of file fontcomp.cpp. 00587 { 00588 //ERROR2IF(ImportInitialised==FALSE, FALSE, "ImportEnd called when ImportInitialised==FALSE."); 00589 // If we error about the ImportInitialised then we assume that the StartExport has been called. 00590 // This may not be the case if we are in clean up mode. So just handle it! 00591 00592 if (Success==FALSE && ImportInitialised) 00593 { 00594 // import operation was not successful, so we need to delete any elements in the list 00595 // created during the import. this is easy since all the elements in the list had 00596 // their mRecentlyCreated member set to FALSE before the import - any new elements will 00597 // have mRecentlyCreated==TRUE (thanks to the FontComponentListItem constructor). 00598 00599 FontComponentListItem *pItem = (FontComponentListItem *) GetHead(); 00600 FontComponentListItem *qItem = NULL; 00601 00602 while (pItem!=NULL) 00603 { 00604 qItem = pItem; 00605 pItem = (FontComponentListItem *) GetNext(qItem); 00606 00607 if (qItem->mRecentlyCreated==TRUE) 00608 { 00609 RemoveItem(qItem); 00610 delete qItem; 00611 } 00612 } 00613 } 00614 //else // Removed due to the change to the if statement above 00615 //{ 00616 // // import operation was successful, so just return. 00617 //} 00618 00619 ImportInitialised=FALSE; 00620 return TRUE; 00621 }
|
|
Searches the list for a matching FontComponentListItem. See Also: class FontComponentListItem, class FontComponent.
Definition at line 636 of file fontcomp.cpp. 00637 { 00638 ERROR2IF(ImportInitialised==FALSE, FALSE, "ImportFind callled when ImportInitialied==FALSE."); 00639 00640 return ImportFindAux((FontComponentListItem *) GetHead(), RecordNumber); 00641 }
|
|
Searches the list for a matching FontComponentListItem See Also: class FontComponentListItem, class FontComponent.
Definition at line 657 of file fontcomp.cpp. 00658 { 00659 ERROR2IF(ImportInitialised==FALSE, FALSE, "ImportFindAux called when ImportInitialised==FALSE."); 00660 00661 if (pItem==NULL) 00662 { 00663 return NULL; 00664 } 00665 else if (pItem->mRecordNumber==RecordNumber) 00666 { 00667 return pItem; 00668 } 00669 else 00670 { 00671 // tail recursion ;) 00672 return ImportFindAux((FontComponentListItem *) GetNext(pItem), RecordNumber); 00673 } 00674 }
|
|
Allows objects of this class a chance to initialise before an import operation See Also: class FontComponent.
Definition at line 553 of file fontcomp.cpp. 00554 { 00555 ERROR2IF(ImportInitialised!=FALSE, FALSE, "ImportStart called when ImportInitialised!=FALSE"); 00556 00557 FontComponentListItem *pItem = (FontComponentListItem *) GetHead(); 00558 00559 // need to set the mRecentlyCreated and mRecordNumber members of all the elements in the list 00560 // to FALSE and NULL respectively. 00561 while (pItem!=NULL) 00562 { 00563 pItem->mRecentlyCreated=FALSE; 00564 pItem->mRecordNumber = 0; 00565 pItem = (FontComponentListItem *) GetNext(pItem); 00566 } 00567 00568 ImportInitialised=TRUE; 00569 00570 return TRUE; 00571 }
|
|
Definition at line 207 of file fontcomp.h. |
|
Definition at line 216 of file fontcomp.h. |