The Gnome Chemistry Utils  0.14.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
gccv::TextTag Class Reference

class for text attributes More...

#include <text-tag.h>

Inheritance diagram for gccv::TextTag:
gccv::BackgroundTextTag gccv::FamilyTextTag gccv::ForegroundTextTag gccv::NewLineTextTag gccv::OverlineTextTag gccv::PositionTextTag gccv::RiseTextTag gccv::SizeTextTag gccv::StretchTextTag gccv::StrikethroughTextTag gccv::StyleTextTag gccv::UnderlineTextTag gccv::VariantTextTag gccv::WeightTextTag

Public Member Functions

 TextTag (Tag tag, TagPriority priority=TagPriorityFirst)
virtual ~TextTag ()
virtual void Filter (PangoAttrList *l, unsigned start, unsigned end)=0
virtual bool operator== (TextTag const &tag) const =0
virtual TextTagDuplicate () const =0
virtual bool NeedsNewRun ()
virtual TextTagRestrict (TextTag *tag)
Tag GetTag (void) const
TagPriority GetPriority (void) const
void SetStartIndex (unsigned val)
unsigned GetStartIndex (void) const
unsigned & GetRefStartIndex (void)
void SetEndIndex (unsigned val)
unsigned GetEndIndex (void) const
unsigned & GetRefEndIndex (void)
bool GetStacked (void)
bool GetNewLine (void)

Static Public Member Functions

static Tag RegisterTagType ()
static bool Order (TextTag *first, TextTag *last)

Static Public Attributes

static Tag MaxTag

Protected Attributes

bool m_Stacked
bool m_NewLine

Detailed Description

class for text attributes

Used to set various attributes to a Text item. This class is virtual.

Definition at line 128 of file text-tag.h.

Constructor & Destructor Documentation

gccv::TextTag::TextTag ( Tag  tag,
TagPriority  priority = TagPriorityFirst 
)
Parameters
tagthe tag type.
prioritythe tag priority.

Creates a new tag.

virtual gccv::TextTag::~TextTag ( )
virtual

The destructor.

Member Function Documentation

virtual TextTag* gccv::TextTag::Duplicate ( ) const
pure virtual
virtual void gccv::TextTag::Filter ( PangoAttrList *  l,
unsigned  start,
unsigned  end 
)
pure virtual
Parameters
la PangoAttrList.
startthe start index of the relevant text.
endthe end index of the relevant text.

Derived classes must implement this pure virtual method. Used to add appropriate PangoAttribute corresponding to the TextTag in the given bounds. In some cases already existing attributes might have to be restricted in scope.

Implemented in gccv::NewLineTextTag, gccv::PositionTextTag, gccv::RiseTextTag, gccv::BackgroundTextTag, gccv::ForegroundTextTag, gccv::StrikethroughTextTag, gccv::OverlineTextTag, gccv::UnderlineTextTag, gccv::StretchTextTag, gccv::VariantTextTag, gccv::WeightTextTag, gccv::StyleTextTag, gccv::SizeTextTag, and gccv::FamilyTextTag.

gccv::TextTag::GetEndIndex ( void  ) const
inline
Returns
the end index in bytes for the TexTag.

Definition at line 230 of file text-tag.h.

gccv::TextTag::GetNewLine ( void  )
inline
Returns
true if the TextTag begins a new text line.

Definition at line 245 of file text-tag.h.

gccv::TextTag::GetPriority ( void  ) const
inline
Returns
the TextPriority for the TextTag.

Definition at line 206 of file text-tag.h.

gccv::TextTag::GetRefEndIndex ( void  )
inline
Returns
the end index in bytes for the TexTag as a reference.

Definition at line 230 of file text-tag.h.

gccv::TextTag::GetRefStartIndex ( void  )
inline
Returns
the start index in bytes for the TexTag as a reference.

Definition at line 218 of file text-tag.h.

gccv::TextTag::GetStacked ( void  )
inline

true if the TextTag begins a stacked text run.

Definition at line 238 of file text-tag.h.

gccv::TextTag::GetStartIndex ( void  ) const
inline
Returns
the start index in bytes for the TexTag.

Definition at line 218 of file text-tag.h.

gccv::TextTag::GetTag ( void  ) const
inline
Returns
the Tag for the TextTag.

Definition at line 202 of file text-tag.h.

virtual bool gccv::TextTag::NeedsNewRun ( )
inlinevirtual
Returns
true if the TextTag needs to create a new PangoLayout.

Reimplemented in gccv::PositionTextTag.

Definition at line 170 of file text-tag.h.

virtual bool gccv::TextTag::operator== ( TextTag const &  tag) const
pure virtual
Parameters
taga TextTag.

Equality operator. Derived classes must implement this pure virtual method.

Returns
true if the two tags have the same type and same attributes, e.g., two color attributes are identical if they have the same color.

Implemented in gccv::NewLineTextTag, gccv::PositionTextTag, gccv::RiseTextTag, gccv::BackgroundTextTag, gccv::ForegroundTextTag, gccv::StrikethroughTextTag, gccv::OverlineTextTag, gccv::UnderlineTextTag, gccv::StretchTextTag, gccv::VariantTextTag, gccv::WeightTextTag, gccv::StyleTextTag, gccv::SizeTextTag, and gccv::FamilyTextTag.

static bool gccv::TextTag::Order ( TextTag first,
TextTag last 
)
static
Parameters
firsta TextTag.
lasta TextTag.

Used to sort TextTag instances according to their start and end indices.

Returns
true if first should come before last.
static Tag gccv::TextTag::RegisterTagType ( )
static

Creates a new registered Tag value equal to current MaxTag value and increments MaxTag.

Returns
the new Tag value.
virtual TextTag* gccv::TextTag::Restrict ( TextTag tag)
virtual
Parameters
taga TextTag.

Used to avoid overlapping of TextTag instances of the same Tag type. this will have its bounds updated accordingly and might be split.

Returns
the new TextTag if this split or NULL.
gccv::TextTag::SetEndIndex ( unsigned  index)
inline
Parameters
indexthe end index

Sets the end index in bytes for the TexTag.

Definition at line 230 of file text-tag.h.

gccv::TextTag::SetStartIndex ( unsigned  index)
inline
Parameters
indexthe start index

Sets the start index in bytes for the TexTag.

Definition at line 218 of file text-tag.h.

Member Data Documentation

gccv::TextTag::m_NewLine
protected

true if the TextTag begins a new text line.

Definition at line 245 of file text-tag.h.

gccv::TextTag::m_Stacked
protected

true if the TextTag begins a stacked text run. This is used to have two text runs start at the same horizontal position.

Definition at line 238 of file text-tag.h.

Referenced by gccv::PositionTextTag::GetPosition().

Tag gccv::TextTag::MaxTag
static

The current first available Tag value for new TextTag types.

Definition at line 189 of file text-tag.h.


The documentation for this class was generated from the following file: