SGUsedFonts Class Reference

#include <ngitem.h>

Inheritance diagram for SGUsedFonts:

SGNameGroup SGDisplayGroup SGDisplayGroup SGDisplayNode SGDisplayNode CCObject CCObject SimpleCCObject SimpleCCObject List of all members.

Public Member Functions

 SGUsedFonts ()
virtual BOOL IsMember (Node *, const StringBase &) const
virtual BOOL CreateItems (Node *)
 Create 'Used Fonts' set items for the node, as appropriate.

Detailed Description

Definition at line 301 of file ngitem.h.


Constructor & Destructor Documentation

SGUsedFonts::SGUsedFonts  )  [inline]
 

Definition at line 304 of file ngitem.h.

00305       : SGNameGroup(_R(IDS_NAMEGAL_TYPEFACES_TYPE), _R(IDS_NAMEGAL_TYPEFACES_TITLE))
00306             { /* empty */ }


Member Function Documentation

BOOL SGUsedFonts::CreateItems Node pNode  )  [virtual]
 

Create 'Used Fonts' set items for the node, as appropriate.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Parameters:
pNode --- the node to test/register for membership [INPUTS]
Returns:
FALSE for an error, eg. out of memory.
See also:
SGNameGroup::RegisterMember; SGUsedFonts::IsMember; CreateDisplayScan::CreateItems::Do

Implements SGNameGroup.

Definition at line 1318 of file ngitem.cpp.

01319 {
01320     // Only consider genuine text objects.
01321     if (!pNode->IsATextChar()) return TRUE;
01322 //  if (!pNode->IsABaseTextClass()) return TRUE;
01323 
01324     // Does a typeface attribute apply?
01325     AttrTxtFontTypeface* pAttr =
01326                 (AttrTxtFontTypeface*) pNode->FindFirstAttr( &Node::IsATypeface );
01327     if (pAttr == 0) return TRUE;
01328 
01329     // Yes, make an item for it.
01330     String_64 strFont;
01331     FONTMANAGER->GetFontName(pAttr->Value.HTypeface, strFont);
01332     return RegisterMember(pNode, strFont) != 0;
01333 }

BOOL SGUsedFonts::IsMember Node pNode,
const StringBase strName
const [virtual]
 

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/6/99
Parameters:
pNode --- the node to test for membership [INPUTS] strName --- the set value (name) to test for equality
Returns:
TRUE if the given node is a member of the given set within this group.
See also:
SGNameGroup::RegisterMember; SGNameItem::IsMember; CreateDisplayScan::CreateItems::Do

Implements SGNameGroup.

Definition at line 1287 of file ngitem.cpp.

01288 {
01289     // Only consider genuine text objects.
01290     if (!pNode->IsATextChar()) return FALSE;
01291 //  if (!pNode->IsABaseTextClass()) return FALSE;
01292 
01293     // Does a typeface attribute apply?
01294     AttrTxtFontTypeface* pAttr =
01295                 (AttrTxtFontTypeface*) pNode->FindFirstAttr( &Node::IsATypeface );
01296     if (pAttr == 0) return FALSE;
01297 
01298     // The same value?
01299     String_64 strFont;
01300     FONTMANAGER->GetFontName(pAttr->Value.HTypeface, strFont);
01301     return strFont == strName;
01302 }


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