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

List of all members.

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:
tag the tag type.
priority the 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:
l a PangoAttrList.
start the start index of the relevant text.
end the 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::FamilyTextTag, gccv::SizeTextTag, gccv::StyleTextTag, gccv::WeightTextTag, gccv::VariantTextTag, gccv::StretchTextTag, gccv::UnderlineTextTag, gccv::OverlineTextTag, gccv::StrikethroughTextTag, gccv::ForegroundTextTag, gccv::BackgroundTextTag, gccv::RiseTextTag, gccv::PositionTextTag, and gccv::NewLineTextTag.

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 (  )  [inline, virtual]

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:
tag a 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::FamilyTextTag, gccv::SizeTextTag, gccv::StyleTextTag, gccv::WeightTextTag, gccv::VariantTextTag, gccv::StretchTextTag, gccv::UnderlineTextTag, gccv::OverlineTextTag, gccv::StrikethroughTextTag, gccv::ForegroundTextTag, gccv::BackgroundTextTag, gccv::RiseTextTag, gccv::PositionTextTag, and gccv::NewLineTextTag.

static bool gccv::TextTag::Order ( TextTag first,
TextTag last 
) [static]

Parameters:
first a TextTag.
last a 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:
tag a 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:
index the 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:
index the start index
Sets the start index in bytes for the TexTag.

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


Member Data Documentation

true if the TextTag begins a new text line.

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

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().

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:

Generated on Fri Sep 24 15:58:43 2010 for The Gnome Chemistry Utils by  doxygen 1.5.9