AttrTxtRuler Class Reference

AttrTxtRuler: specifies the ruler. More...

#include <txtattr.h>

Inheritance diagram for AttrTxtRuler:

AttrTxtBase NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrTxtRuler ()
 AttrTxtRuler (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates a AttrTxtRuler Attribute.
void Render (RenderRegion *pRender)
 'Renders' a ruler 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 ()
virtual BOOL IsALineLevelAttrib ()
virtual void BaseLineRelativeTransform (FIXED16 Scale, FIXED16 Aspect)
 Transform the attribute using the baseline relative scale and aspect.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Saves the text baseline attribute to the new file format filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)

Public Attributes

TxtRulerAttribute Value

Private Member Functions

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

Detailed Description

AttrTxtRuler: specifies the ruler.

Author:
Martin Wuerthner <xara@mw-software.com>
Date:
13/06/06

Definition at line 1586 of file txtattr.h.


Constructor & Destructor Documentation

AttrTxtRuler::AttrTxtRuler  )  [inline]
 

Definition at line 1592 of file txtattr.h.

01592 {}

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

Creates a AttrTxtRuler Attribute.

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

Errors: -

See also:
-

Definition at line 7541 of file txtattr.cpp.

07547              : AttrTxtBase(ContextNode, Direction, Locked, Mangled, Marked, Selected)  
07548 {                         
07549 } 


Member Function Documentation

void AttrTxtRuler::BaseLineRelativeTransform FIXED16  Scale,
FIXED16  Aspect
[virtual]
 

Transform the attribute using the baseline relative scale and aspect.

Author:
Martin Wuerthner <xara@mw-software.com>
Date:
04/07/06
Parameters:
Scale - [INPUTS] Aspect -

Reimplemented from AttrTxtBase.

Definition at line 7767 of file txtattr.cpp.

07768 {
07769     TxtRulerAttribute* pRulerAttrVal=(TxtRulerAttribute*)GetAttributeValue();
07770     TxtRuler* pRuler = pRulerAttrVal->Value;
07771     
07772     for (TxtTabStopIterator it = pRuler->begin(); it != pRuler->end(); ++it)
07773     {
07774         MILLIPOINT pos = (*it).GetPosition();
07775         (*it).SetPosition(XLONG(pos) * Scale);
07776     }
07777 }

void AttrTxtRuler::CopyNodeContents AttrTxtRuler 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 7663 of file txtattr.cpp.

07664 {
07665     // Let the base class do its bit
07666     NodeAttribute::CopyNodeContents( NodeCopy );
07667     
07668     //Copy contents specific to derived class here
07669     NodeCopy->Value = Value;
07670 } 

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

Reimplemented from NodeAttribute.

Definition at line 1607 of file txtattr.h.

01607 { return ATTR_TXTRULER; }

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

Reimplemented from NodeAttribute.

Definition at line 1613 of file txtattr.h.

01613 { return &Value; }

UINT32 AttrTxtRuler::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 7639 of file txtattr.cpp.

07640 {
07641     return (_R(IDS_RULER)); 
07642 }  

void AttrTxtRuler::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 7727 of file txtattr.cpp.

07728 {
07729     NodeAttribute::GetDebugDetails( Str );
07730 
07731     String_256 TempStr;
07732     TempStr._MakeMsg( TEXT("\r\nRuler(#1%08x)="), Value.Value);
07733     (*Str) += TempStr;
07734     for (TxtTabStopIterator It = Value.begin(); It != Value.end(); ++It)
07735     {
07736         switch((*It).GetType())
07737         {
07738             case LeftTab:
07739                 TempStr._MakeMsg( TEXT("L(#1%ld)"), (*It).GetPosition());
07740                 break;
07741             case RightTab:
07742                 TempStr._MakeMsg( TEXT("R(#1%ld)"), (*It).GetPosition());
07743                 break;
07744             case CentreTab:
07745                 TempStr._MakeMsg( TEXT("C(#1%ld)"), (*It).GetPosition());
07746                 break;
07747             case DecimalTab:
07748                 TempStr._MakeMsg( TEXT("D(#1%ld)"), (*It).GetPosition());
07749                 break;
07750         }
07751         (*Str) += TempStr;
07752     }
07753     (*Str) += _T("\r\n");
07754 }

UINT32 AttrTxtRuler::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 7709 of file txtattr.cpp.

07710 {     
07711     return (sizeof(AttrTxtRuler)); 
07712 }

virtual BOOL AttrTxtRuler::IsALineLevelAttrib  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 1614 of file txtattr.h.

01614 { return TRUE; }

INT32 AttrTxtRuler::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 AttrTxtRuler [INPUTS]
- [OUTPUTS]
Returns:
-

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

See also:
NodeAttribute::operator==

Reimplemented from NodeAttribute.

Definition at line 7613 of file txtattr.cpp.

07614 {
07615     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrTxtRuler)), 
07616         "Trying to compare two objects with different types"); 
07617     AttrTxtRuler* Attr = (AttrTxtRuler*) &Attrib;
07618     
07619     return (Attr->Value == Value); 
07620 } 

void AttrTxtRuler::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 7685 of file txtattr.cpp.

07686 {
07687     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
07688     ENSURE(IS_A(pNodeCopy, AttrTxtRuler), "PolyCopyNodeContents given wrong dest node type");
07689 
07690     if (IS_A(pNodeCopy, AttrTxtRuler))
07691         CopyNodeContents((AttrTxtRuler*)pNodeCopy);
07692 }

void AttrTxtRuler::Render RenderRegion pRegion  )  [virtual]
 

'Renders' a ruler attribute

Author:
Martin Wuerthner <xara@mw-software.com>
Date:
19/06/06
Parameters:
pRenderRegion = the render region to which the attribute should be rendered [INPUTS]

Reimplemented from NodeAttribute.

Definition at line 7562 of file txtattr.cpp.

07563 {
07564     pRegion->SetTxtRuler(&Value, FALSE);
07565 }

Node * AttrTxtRuler::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 7586 of file txtattr.cpp.

07587 {
07588     AttrTxtRuler* NodeCopy = new AttrTxtRuler();
07589     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
07590     CopyNodeContents(NodeCopy);
07591     return NodeCopy;
07592 } 

BOOL AttrTxtRuler::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 7804 of file txtattr.cpp.

07805 {
07806 #ifdef DO_EXPORT
07807     ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
07808 
07809     return CXaraFileTxtRuler::WritePreChildrenNative(pFilter, this);
07810 #else
07811     return FALSE;
07812 #endif
07813 }

BOOL AttrTxtRuler::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Saves the text baseline 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 7793 of file txtattr.cpp.

07794 {
07795 #ifdef DO_EXPORT
07796     ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
07797 
07798     return CXaraFileTxtRuler::WritePreChildrenWeb(pFilter, this);
07799 #else
07800     return FALSE;
07801 #endif
07802 }


Member Data Documentation

TxtRulerAttribute AttrTxtRuler::Value
 

Definition at line 1629 of file txtattr.h.


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