TxtBoldAttribute Class Reference

This text attribute specifies the BOLD state (on/off). More...

#include <txtattr.h>

Inheritance diagram for TxtBoldAttribute:

TxtBaseClassAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 TxtBoldAttribute ()
 Default Constuctor for TxtBoldAttribute The Bold state is set to FALSE.
 TxtBoldAttribute (BOOL boldOn)
 TxtBoldAttribute constructor.
virtual void Restore (RenderRegion *, BOOL)
 Restores the TxtBoldAttribute attribute for the given render region.
virtual void Render (RenderRegion *pRegion, BOOL Temp=FALSE)
 Sets the TxtBoldAttribute attribute for the given render region.
virtual void SimpleCopy (AttributeValue *)
 See AttributeValue::SimpleCopy.
virtual NodeAttributeMakeNode ()
 Make a AttrTextFontTypeface node, see base class.
BOOL IsDifferent (AttributeValue *pAttr)
 See base class version.
virtual TxtBoldAttributeoperator= (TxtBoldAttribute &Attrib)
 Make the Attribute the same as the other.
INT32 operator== (const TxtBoldAttribute &Attrib)
 Comparison operator. See NodeAttribute::operator== for a description of why it's required.

Static Public Member Functions

static BOOL Init ()
 Registers default attribute.

Public Attributes

BOOL BoldOn

Detailed Description

This text attribute specifies the BOLD state (on/off).

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/3/95
See also:
-

Definition at line 258 of file txtattr.h.


Constructor & Destructor Documentation

TxtBoldAttribute::TxtBoldAttribute  ) 
 

Default Constuctor for TxtBoldAttribute The Bold state is set to FALSE.

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

Definition at line 667 of file txtattr.cpp.

00668 {
00669     BoldOn = FALSE;
00670 } 

TxtBoldAttribute::TxtBoldAttribute BOOL  boldOn  ) 
 

TxtBoldAttribute constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/3/95
Parameters:
boldOn,: BOOL value indicating the initial bold state [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 688 of file txtattr.cpp.

00689 { 
00690     BoldOn = boldOn; 
00691 }


Member Function Documentation

BOOL TxtBoldAttribute::Init void   )  [static]
 

Registers default attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Returns:
TRUE - initialised ok; FALSE if not.

Errors: Out of memory.

See also:
AttributeManager

Reimplemented from SimpleCCObject.

Definition at line 824 of file txtattr.cpp.

00825 {
00826     TxtBoldAttribute *pAttr = new TxtBoldAttribute;
00827     if (pAttr==NULL)
00828         // error message has already been set by new
00829         return FALSE;
00830 
00831     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(BaseTextClass), 
00832                                                          pAttr);
00833 
00834     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising TxtBoldAttribute");
00835 
00836     return TRUE;
00837 }

BOOL TxtBoldAttribute::IsDifferent AttributeValue pAttr  )  [virtual]
 

See base class version.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Returns:
Errors: The two attributes are not of the same type.
See also:
AttributeValue::IsDifferent

Reimplemented from AttributeValue.

Definition at line 801 of file txtattr.cpp.

00802 {
00803     // This must be at least a FillGeometryAttribute...
00804     ERROR3IF(!pAttr->IsKindOf(CC_RUNTIME_CLASS(TxtBoldAttribute)), 
00805                 "Different attribute types in TxtBoldAttribute::IsDifferent()");
00806 
00807     // Check they are NOT the same.
00808     return ( !(*((TxtBoldAttribute *)pAttr) == *this) ); 
00809 }

NodeAttribute * TxtBoldAttribute::MakeNode  )  [virtual]
 

Make a AttrTextFontTypeface node, see base class.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Returns:
Pointer to the new node, or NULL if out of memory.

Errors: Out of memory

See also:
AttributeValue::MakeNode

Reimplemented from AttributeValue.

Definition at line 852 of file txtattr.cpp.

00853 {
00854     // Create new attribute node
00855     AttrTxtBold*  pAttr = new AttrTxtBold();
00856     if (pAttr==NULL)      
00857         // error message has already been set by new
00858         return NULL;
00859 
00860     // Copy attribute value into the new node.
00861     pAttr->Value.SimpleCopy(this);
00862 
00863     // Return the new node
00864     return pAttr;
00865 }

TxtBoldAttribute & TxtBoldAttribute::operator= TxtBoldAttribute Attrib  )  [virtual]
 

Make the Attribute the same as the other.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
Attrib - the attribute to copy [INPUTS]
Returns:
Usual semantics for equality.

Definition at line 744 of file txtattr.cpp.

00745 {    
00746     BoldOn = Attrib.BoldOn;
00747     return *this;
00748 }

INT32 TxtBoldAttribute::operator== const TxtBoldAttribute Attrib  ) 
 

Comparison operator. See NodeAttribute::operator== for a description of why it's required.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
Attrib - the attribute to compare this attribute with [INPUTS]
Returns:
Usual semantics for equality.
See also:
NodeAttribute::operator==

Definition at line 764 of file txtattr.cpp.

00765 {
00766     return (Attrib.BoldOn == BoldOn); 
00767 }

void TxtBoldAttribute::Render RenderRegion pRegion,
BOOL  Temp = FALSE
[virtual]
 

Sets the TxtBoldAttribute attribute for the given render region.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pRegion - the render region to render this attribute into. [INPUTS]
See also:
-

Implements AttributeValue.

Definition at line 707 of file txtattr.cpp.

00708 {
00709     pRegion->SetTxtBold(this, Temp);
00710 }

void TxtBoldAttribute::Restore RenderRegion pRegion,
BOOL  Temp
[virtual]
 

Restores the TxtBoldAttribute attribute for the given render region.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pRegion - the render region to restore the attribute into. [INPUTS] Temp - TRUE if this is a temporary attribute, FALSE if it is permanent (e.g. it's in a document tree).
See also:
-

Implements TxtBaseClassAttribute.

Definition at line 726 of file txtattr.cpp.

00727 {
00728     pRegion->RestoreTxtBold(this, Temp);
00729 }

void TxtBoldAttribute::SimpleCopy AttributeValue pValue  )  [virtual]
 

See AttributeValue::SimpleCopy.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - pointer to the AttributeValue to copy. [INPUTS]

Implements AttributeValue.

Definition at line 780 of file txtattr.cpp.

00781 {
00782     ERROR3IF(!IS_A(pValue, TxtBoldAttribute), 
00783         "Invalid Attribute value passed to TxtBoldAttribute::SimpleCopy");
00784     // We may as well just use our assignment operator.
00785     *this = *((TxtBoldAttribute*)pValue);
00786 }


Member Data Documentation

BOOL TxtBoldAttribute::BoldOn
 

Definition at line 278 of file txtattr.h.


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