AttrTxtFontTypeface Class Reference

AttrTxtFontTypeface specifies a font typeface. More...

#include <txtattr.h>

Inheritance diagram for AttrTxtFontTypeface:

AttrTxtBase NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrTxtFontTypeface ()
 Default constructor for AttrTxtFontTypeface class.
 AttrTxtFontTypeface (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates a AttrTxtFontTypeface Attribute.
void Render (RenderRegion *pRender)
 'Renders' a Line Width attribute.
NodeSimpleCopy ()
 This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.
virtual INT32 operator== (const NodeAttribute &NodeAttrib)
 A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
virtual UINT32 GetAttrNameID (void)
 Returns back a string resource ID describing the attribute.
virtual AttrIndex GetAttributeIndex ()
void GetDebugDetails (StringBase *Str)
 Used for debugging purposes during developement. Override in your own class and output suitable debugging details.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual AttributeValueGetAttributeValue ()
void SetBold (BOOL State)
void SetItalic (BOOL State)
BOOL IsBold ()
BOOL IsItalic ()
BOOL IsATypeface () const
void UpdateCachedData ()
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Saves the text font typeface attribute to the new file format filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)

Public Attributes

TxtFontTypefaceAttribute Value

Private Member Functions

void CopyNodeContents (AttrTxtFontTypeface *NodeCopy)
 This method copies the node's contents to the node pointed to by NodeCopy.

Detailed Description

AttrTxtFontTypeface specifies a font typeface.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/03/95

Definition at line 833 of file txtattr.h.


Constructor & Destructor Documentation

AttrTxtFontTypeface::AttrTxtFontTypeface  ) 
 

Default constructor for AttrTxtFontTypeface class.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 3836 of file txtattr.cpp.

03837 {
03838 }

AttrTxtFontTypeface::AttrTxtFontTypeface Node ContextNode,
AttachNodeDirection  Direction,
BOOL  Locked = FALSE,
BOOL  Mangled = FALSE,
BOOL  Marked = FALSE,
BOOL  Selected = FALSE
 

Creates a AttrTxtFontTypeface Attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 3811 of file txtattr.cpp.

03817              : AttrTxtBase(ContextNode, Direction, Locked, Mangled, Marked, Selected)  
03818 {                         
03819 } 


Member Function Documentation

void AttrTxtFontTypeface::CopyNodeContents AttrTxtFontTypeface NodeCopy  )  [private]
 

This method copies the node's contents to the node pointed to by NodeCopy.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/93
Parameters:
[INPUTS] 
A copy of this node [OUTPUTS]
Returns:
-

Errors: An assertion failure will occur if NodeCopy is NULL

Scope: protected

Definition at line 3960 of file txtattr.cpp.

03961 {
03962     // Let the base class do its bit
03963     AttrTxtBase::CopyNodeContents( NodeCopy );
03964     
03965     //Copy contents specific to derived class here
03966     NodeCopy->Value.HTypeface = Value.HTypeface;
03967     NodeCopy->Value.IsBold = Value.IsBold;
03968     NodeCopy->Value.IsItalic = Value.IsItalic;
03969 } 

virtual AttrIndex AttrTxtFontTypeface::GetAttributeIndex  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 855 of file txtattr.h.

00855 { return ATTR_TXTFONTTYPEFACE; }

virtual AttributeValue* AttrTxtFontTypeface::GetAttributeValue  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 863 of file txtattr.h.

00863 { return &Value; }

UINT32 AttrTxtFontTypeface::GetAttrNameID void   )  [virtual]
 

Returns back a string resource ID describing the attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/2/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Attribute description ID

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 3936 of file txtattr.cpp.

03937 {
03938     return (_R(IDS_FONTTYPEFACE)); 
03939 }  

void AttrTxtFontTypeface::GetDebugDetails StringBase Str  )  [virtual]
 

Used for debugging purposes during developement. Override in your own class and output suitable debugging details.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/04/94
Parameters:
- [INPUTS]

Reimplemented from NodeRenderable.

Definition at line 4028 of file txtattr.cpp.

04029 {
04030     NodeAttribute::GetDebugDetails( Str );
04031     String_64 FontName;
04032     if (FONTMANAGER->GetFontName(Value.HTypeface, FontName))
04033     {
04034         FontClass Class = FONTMANAGER->GetFontClass(Value.HTypeface);
04035 
04036         TCHAR           buf[255];
04037         
04038         camSnprintf( buf, 255, _T("\r\nFontName = %s\r\n"), (TCHAR*)(FontName) );
04039         (*Str) += buf;
04040 
04041         camSnprintf( buf, 256, _T("\r\nFont Handle = %ld\r\n"), Value.HTypeface );
04042         (*Str) += buf;
04043         
04044         switch (Class)
04045         {
04046         case FC_ATM:
04047             camSnprintf( buf, 255, _T("Type = ATM Type1\r\n") ); 
04048             break;
04049         case FC_TRUETYPE: 
04050             camSnprintf( buf, 255, _T("Type = TrueType\r\n") );
04051             break;
04052         default:
04053             camSnprintf( buf, 255, _T("Type = Unknown\r\n") ); 
04054             break;
04055         }
04056         
04057         (*Str) += buf;
04058         camSnprintf( buf, 255, _T("Bold = %s\r\n"), Value.IsBold ? _T("TRUE"):_T("FALSE"));
04059         (*Str) += buf;
04060         camSnprintf( buf, 255, _T("Italic = %s\r\n"), Value.IsItalic ? _T("TRUE"):_T("FALSE"));
04061         (*Str) += buf;  
04062         camSnprintf( buf, 255, _T("Replaced = %s\r\n"), FONTMANAGER->IsFontReplaced(&FontName, Class) ? _T("TRUE"):_T("FALSE"));
04063         (*Str) += buf;  
04064     }
04065 }

UINT32 AttrTxtFontTypeface::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The size of the node in bytes
See also:
Node::GetSubtreeSize

Reimplemented from Node.

Definition at line 4010 of file txtattr.cpp.

04011 {     
04012     return (sizeof(AttrTxtFontTypeface)); 
04013 }

BOOL AttrTxtFontTypeface::IsATypeface  )  const [inline, virtual]
 

Reimplemented from Node.

Definition at line 869 of file txtattr.h.

00869 { return TRUE; }

BOOL AttrTxtFontTypeface::IsBold  )  [inline]
 

Definition at line 867 of file txtattr.h.

00867 { return Value.IsBold; }

BOOL AttrTxtFontTypeface::IsItalic  )  [inline]
 

Definition at line 868 of file txtattr.h.

00868 { return Value.IsItalic; }

INT32 AttrTxtFontTypeface::operator== const NodeAttribute Attrib  )  [virtual]
 

A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
Atrib,: The attribute to compare, which must be an AttrTxtFontTypeface [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: An ENSURE failure will occur if Attrib does not have a AttrTxtFontTypeface runtime class.

See also:
NodeAttribute::operator==

Reimplemented from NodeAttribute.

Definition at line 3909 of file txtattr.cpp.

03910 {
03911     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrTxtFontTypeface)), 
03912         "Trying to compare two objects with different types"); 
03913     AttrTxtFontTypeface* Attr = (AttrTxtFontTypeface*) &Attrib;
03914     return (Attr->Value.HTypeface == Value.HTypeface &&
03915             Attr->Value.IsBold == Value.IsBold &&
03916             Attr->Value.IsItalic == Value.IsItalic  ); 
03917 } 

void AttrTxtFontTypeface::PolyCopyNodeContents NodeRenderable pNodeCopy  )  [virtual]
 

Polymorphically copies the contents of this node to another.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/12/2003
Parameters:
- [OUTPUTS]
Returns:
Errors: An assertion failure will occur if NodeCopy is NULL Scope: protected

Reimplemented from NodeRenderable.

Definition at line 3984 of file txtattr.cpp.

03985 {
03986     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
03987     ENSURE(IS_A(pNodeCopy, AttrTxtFontTypeface), "PolyCopyNodeContents given wrong dest node type");
03988 
03989     if (IS_A(pNodeCopy, AttrTxtFontTypeface))
03990         CopyNodeContents((AttrTxtFontTypeface*)pNodeCopy);
03991 }

void AttrTxtFontTypeface::Render RenderRegion pRegion  )  [virtual]
 

'Renders' a Line Width attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 3856 of file txtattr.cpp.

03857 {
03858     pRegion->SetTxtFontTypeface(&Value, FALSE);
03859 }

void AttrTxtFontTypeface::SetBold BOOL  State  )  [inline]
 

Definition at line 865 of file txtattr.h.

00865 { Value.IsBold = State; }

void AttrTxtFontTypeface::SetItalic BOOL  State  )  [inline]
 

Definition at line 866 of file txtattr.h.

00866 { Value.IsItalic = State; }

Node * AttrTxtFontTypeface::SimpleCopy void   )  [virtual]
 

This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
A copy of the node, or NULL if memory runs out

Errors: If memory runs out when trying to copy, then ERROR is called with an out of memory error and the function returns NULL.

Scope: protected

Reimplemented from NodeAttribute.

Definition at line 3882 of file txtattr.cpp.

03883 {
03884     AttrTxtFontTypeface* NodeCopy = new AttrTxtFontTypeface();
03885     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
03886     CopyNodeContents(NodeCopy);
03887     return NodeCopy;
03888 }

void AttrTxtFontTypeface::UpdateCachedData  ) 
 

BOOL AttrTxtFontTypeface::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 4091 of file txtattr.cpp.

04092 {
04093 #ifdef DO_EXPORT
04094     ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
04095 
04096     return CXaraFileTxtFontTypeface::WritePreChildrenNative(pFilter, this);
04097 #else
04098     return FALSE;
04099 #endif
04100 }

BOOL AttrTxtFontTypeface::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Saves the text font typeface attribute to the new file format filter.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/07/96
Parameters:
pFilter - new camelot filter to save to [INPUTS]
Returns:
TRUE if successful, FALSE otherwise

Reimplemented from Node.

Definition at line 4080 of file txtattr.cpp.

04081 {
04082 #ifdef DO_EXPORT
04083     ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
04084 
04085     return CXaraFileTxtFontTypeface::WritePreChildrenWeb(pFilter, this);
04086 #else
04087     return FALSE;
04088 #endif
04089 }


Member Data Documentation

TxtFontTypefaceAttribute AttrTxtFontTypeface::Value
 

Definition at line 885 of file txtattr.h.


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