Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

mpcl::text::html::TTag Class Reference

#include <tag.hh>

Inheritance diagram for mpcl::text::html::TTag:

mpcl::text::html::TCheckbox mpcl::text::html::TContainer mpcl::text::html::TFrame mpcl::text::html::THidden mpcl::text::html::THorizRule mpcl::text::html::TImage mpcl::text::html::TInputImage mpcl::text::html::TLineBreak mpcl::text::html::TLink mpcl::text::html::TOption mpcl::text::html::TPassword mpcl::text::html::TRadio mpcl::text::html::TReset mpcl::text::html::TSubmit mpcl::text::html::TText mpcl::text::html::TTextArea mpcl::text::html::TTextEntry mpcl::text::html::TTitle List of all members.

Public Types

typedef std::list< QTTagTTagList
 List type with smart-pointers to tags.

typedef TTagList::const_iterator const_iterator
 Constant iterator for the tag list.

typedef TTagList::iterator iterator
 Iterator for the tag list.

typedef TTagList::size_type size_type
 Size type for the tag list.


Public Methods

 TTag (bool gDYNAMICALLY_CREATED=false)
 TTag (const char *pkcIDENTIFIER, const char *pkcVALUE="")
 TTag (const char *pkcIDENTIFIER, bool gDYNAMICALLY_CREATED)
virtual ~TTag (void)
 Destroys the instance.

virtual void clear (void)
 Clears instance.

virtual void reset (void)
 Clears attribute "value".

virtual void setClass (const TString &rkyCLASS, bool gDELEGATE=false)
virtual void setClass (const char *pkcCLASS, bool gDELEGATE=false)
void setDynamiclyLoadable (bool gDYNAMICLY_LOADABLE)
virtual void setId (const char *pkcID, bool=false)
virtual void setId (const TString &rkyID, bool=false)
virtual void setValue (const TString &rkyVALUE)
virtual void setValue (const char *pkcVALUE)
void setVisibility (bool gIS_VISIBLE)
virtual void update (void)
virtual TStringattribute (const char *pkcNAME)
virtual const TStringattribute (const char *pkcNAME) const
TString getClass (void) const
const TStringgetId (void) const
virtual const TStringgetValue (void) const
 Returns the value of the "value" attribute.

virtual bool hasAttribute (const char *pkcNAME) const
bool hasBeenDynamiclyCreated (void) const
 Tells if this is a dynamically loadable instance.

virtual const TStringidentifier (void) const
 Returns the value of the "identifier" attribute.

virtual bool isAssignable (void) const
 Tells if this is an assignable instance.

bool isDynamiclyLoadable (void) const
 Tells if this is a dynamically loadable instance.

bool isQualified (void) const
 Tells if this is an assignable instance.

virtual bool isVisible (void) const
virtual QTTag tag (const TString &rkyIDENTIFIER) const
virtual TStringoperator() (const char *pkcNAME)
virtual const TStringoperator() (const char *pkcNAME) const
virtual const TTag & operator[] (const char *pkcIDENTIFIER) const
virtual const TTag & operator[] (const TString &rkyIDENTIFIER) const
 Synonym of the previous member function.

virtual TTag & operator[] (const char *pkcIDENTIFIER)
virtual TTag & operator[] (const TString &rkyIDENTIFIER)
 Synonym of the previous member function.

virtual const TStringqualifiedIdentifier (void) const
 Returns the value of the "qualified-identifier" attribute.

virtual size_type size (void) const
virtual void writeUsing (std::basic_ostream< char > &rtTARGET_OSTREAM, const TString &rkyQUALIFIED_IDENTIFIER) const

Static Public Methods

void _setCodeGenerator (const TPatternBasedCodeGenerator &rktCG)
 Sets code generator for all instances.


Protected Attributes

bool gForwardIdentifier
 True if identifier isn't forwarded to inner tags.

bool gHasBeenDynamiclyCreated
 True if tag has been dynamically created.

bool gIsDynamiclyLoadable
 True if tag can be dynamicly loaded.

bool gIsQualified
bool gIsRootNode
bool gIsVisible
 Boolean with truth value iif tag is visible (must be written).

TStringToStringMap tAttributeMap
 Map with attribute name to value correspondences.


Static Protected Attributes

TPatternBasedCodeGenerator * _ptCodeGenerator = NULL
 Static pointer to a code-generator.


Detailed Description

Base class for HTML tags.

This class doesn't represent exactly the HTML tags elements, rather than this, they represent somehow, a meta-tag that can represent a set of HTML tags (though this set cardinal can be one). There are two classes for store-able tags. The first class is for normal tags, and the second class is for special purpose tags.

Attributes (accessed through member method attribute()):

"class-identifier" ::= Class identifier (used as canonical name in _ptCodeGenerator). "qualified-identifier" ::= Tag identifier (used as a way of identifying the tag through the containers tree). "identifier" ::= *.NAME. "value" ::= *.VALUE.

Warning:
Only tags initialized with identifiers, will be assignable.

Definition at line 89 of file tag.hh.


Constructor & Destructor Documentation

mpcl::text::html::TTag::TTag bool    gDYNAMICALLY_CREATED = false
 

Builds a new instance.

Parameters:
gDYNAMICALLY_CREATED  True if it's dynamically created.

Definition at line 53 of file tag.cc.

References tAttributeMap.

Referenced by mpcl::text::html::TLayoutTable::findOrInsertTag(), and mpcl::text::html::TContainer::findOrInsertTag().

mpcl::text::html::TTag::TTag const char *    pkcIDENTIFIER,
const char *    pkcVALUE = ""
 

Builds a new assignable instance.

Parameters:
pkcIDENTIFIER  Identifier.
pkcVALUE  Value.

Definition at line 75 of file tag.cc.

References tAttributeMap.

mpcl::text::html::TTag::TTag const char *    pkcIDENTIFIER,
bool    gDYNAMICALLY_CREATED
 

Builds a new assignable instance.

Parameters:
pkcIDENTIFIER  Identifier.
gDYNAMICALLY_CREATED  True if it's dynamically created.

Definition at line 97 of file tag.cc.

References tAttributeMap.


Member Function Documentation

virtual const TString& mpcl::text::html::TTag::attribute const char *    pkcNAME const [inline, virtual]
 

Gets attribute named pkcNAME.

Parameters:
pkcNAME  Source attribute name.

Definition at line 305 of file tag.hh.

References tAttributeMap, and mpcl::text::TString.

virtual TString& mpcl::text::html::TTag::attribute const char *    pkcNAME [inline, virtual]
 

Gets attribute named pkcNAME.

Parameters:
pkcNAME  Source attribute name.

Definition at line 296 of file tag.hh.

References tAttributeMap, and mpcl::text::TString.

Referenced by operator()(), setId(), and mpcl::text::html::TText::writeUsing().

TString mpcl::text::html::TTag::getClass void    const [inline]
 

Gets CSS class.

Returns:
CSS class name.

Definition at line 322 of file tag.hh.

References tAttributeMap, and mpcl::text::TString.

const TString& mpcl::text::html::TTag::getId void    const [inline]
 

Gets attribute ID.

Returns:
Attribute ID.

Definition at line 331 of file tag.hh.

References tAttributeMap, and mpcl::text::TString.

virtual bool mpcl::text::html::TTag::hasAttribute const char *    pkcNAME const [inline, virtual]
 

Returns true if there is an attribute named pkcNAME between the tags stored (if any) in this instance, within first class.

Parameters:
pkcNAME  Source attribute name.

Definition at line 347 of file tag.hh.

References tAttributeMap.

virtual bool mpcl::text::html::TTag::isVisible void    const [inline, virtual]
 

Gets visibility of the tag.

Returns:
True if the tag is visible.

Definition at line 386 of file tag.hh.

References gIsVisible.

Referenced by mpcl::text::html::TText::writeUsing(), writeUsing(), mpcl::text::html::TPatternPage::writeUsing(), and mpcl::text::html::TContainer::writeUsing().

virtual const TString& mpcl::text::html::TTag::operator() const char *    pkcNAME const [inline, virtual]
 

Gets attribute named pkcNAME. It is a synonym of attribute().

Parameters:
pkcNAME  Source attribute name.

Definition at line 419 of file tag.hh.

References attribute(), and mpcl::text::TString.

virtual TString& mpcl::text::html::TTag::operator() const char *    pkcNAME [inline, virtual]
 

Gets attribute named pkcNAME. It is a synonym of attribute().

Parameters:
pkcNAME  Source attribute name.

Definition at line 409 of file tag.hh.

References attribute(), and mpcl::text::TString.

mpcl::text::html::TTag & mpcl::text::html::TTag::operator[] const char *    pkcIDENTIFIER [virtual]
 

Gets the tag named pkcIDENTIFIER from the tags stored (if any) in this instance, within first class. It is a synonym of tag().

Parameters:
pkcIDENTIFIER  Source tag identifier.
Returns:
Returns that tag.
Exceptions:
TConstraintException  Always, because this class is not a container.
Warning:
This operator is implemented here to ease the access to the container instances (tHtmlPage ["mytable"]["myform"]["myinput"]).

Reimplemented in mpcl::text::html::TContainer.

Definition at line 443 of file tag.cc.

References mpcl::text::Format(), identifier(), and mpcl::text::TString.

const mpcl::text::html::TTag & mpcl::text::html::TTag::operator[] const char *    pkcIDENTIFIER const [virtual]
 

Gets the tag named pkcIDENTIFIER from the tags stored (if any) in this instance, within first class. It is a synonym of tag().

Parameters:
pkcIDENTIFIER  Source tag identifier.
Returns:
Returns that tag.
Exceptions:
TConstraintException  Always, because this class is not a container.
Warning:
This operator is implemented here to ease the access to the container instances (tHtmlPage ["mytable"]["myform"]["myinput"]).

Reimplemented in mpcl::text::html::TContainer.

Definition at line 430 of file tag.cc.

References mpcl::text::Format(), identifier(), and mpcl::text::TString.

Referenced by operator[]().

void mpcl::text::html::TTag::setClass const char *    pkcCLASS,
bool    gDELEGATE = false
[virtual]
 

Sets CSS class.

Parameters:
pkcCLASS  CSS class name.
gDELEGATE  Make objects contained to belong to the same class.

Reimplemented in mpcl::text::html::TContainer.

Definition at line 137 of file tag.cc.

References tAttributeMap.

void mpcl::text::html::TTag::setClass const TString   rkyCLASS,
bool    gDELEGATE = false
[virtual]
 

Sets CSS class.

Parameters:
rkyCLASS  CSS class name.
gDELEGATE  Make objects contained to belong to the same class.

Reimplemented in mpcl::text::html::TContainer.

Definition at line 128 of file tag.cc.

References tAttributeMap, and mpcl::text::TString.

void mpcl::text::html::TTag::setDynamiclyLoadable bool    gDYNAMICLY_LOADABLE [inline]
 

Sets dynamic load ability.

Parameters:
gDYNAMICLY_LOADABLE  True if the tag is dynamicly loadable.

Definition at line 222 of file tag.hh.

References gIsDynamiclyLoadable.

virtual void mpcl::text::html::TTag::setId const TString   rkyID,
bool    = false
[inline, virtual]
 

Assigns a value to the attribute "id" in the attribute map.

Parameters:
rkyID  New value of the attribute "id".
gDELEGATE  Make objects contained to have the same id.

Reimplemented in mpcl::text::html::TContainer.

Definition at line 242 of file tag.hh.

References attribute(), and mpcl::text::TString.

virtual void mpcl::text::html::TTag::setId const char *    pkcID,
bool    = false
[inline, virtual]
 

Assigns a value to the attribute "id" in the attribute map.

Parameters:
pkcID  New value of the attribute "id".
gDELEGATE  Make objects contained to have the same id.

Reimplemented in mpcl::text::html::TContainer.

Definition at line 232 of file tag.hh.

References attribute().

virtual void mpcl::text::html::TTag::setValue const char *    pkcVALUE [inline, virtual]
 

Assings a value to the attribute "value" in the attribute map.

Parameters:
pkcVALUE  Value to assign.

Reimplemented in mpcl::text::html::TCheckbox, mpcl::text::html::TCheckboxGroup, mpcl::text::html::TOption, mpcl::text::html::TRadio, mpcl::text::html::TRadioGroup, and mpcl::text::html::TSelect.

Definition at line 260 of file tag.hh.

References isAssignable(), and tAttributeMap.

virtual void mpcl::text::html::TTag::setValue const TString   rkyVALUE [inline, virtual]
 

Assings a value to the attribute "value" in the attribute map.

Parameters:
rkyVALUE  Value to assign.

Reimplemented in mpcl::text::html::TCheckbox, and mpcl::text::html::TCheckboxGroup.

Definition at line 251 of file tag.hh.

References mpcl::text::TString.

void mpcl::text::html::TTag::setVisibility bool    gIS_VISIBLE [inline]
 

Sets visibility of the tag.

Parameters:
gIS_VISIBLE  True if the tag must be written.

Definition at line 273 of file tag.hh.

References gIsVisible.

mpcl::text::html::TTag::size_type mpcl::text::html::TTag::size void    const [virtual]
 

Gets the number of tags stored in this instance.

Returns:
Tags cardinal.
Exceptions:
TConstraintException  Always, because this class is not a container.
Warning:
This member function is implemented here to ease the access to the container instances (tHtmlPage ["mytable"].size()).

Reimplemented in mpcl::text::html::TContainer.

Definition at line 456 of file tag.cc.

References mpcl::text::Format(), identifier(), and mpcl::text::TString.

mpcl::text::html::QTTag mpcl::text::html::TTag::tag const TString   rkyIDENTIFIER const [virtual]
 

Gets the tag named rkyIDENTIFIER from the tags stored (if any) in this instance, within first class.

Parameters:
rkyIDENTIFIER  Source tag identifier.
Returns:
Returns that tag.

Reimplemented in mpcl::text::html::TContainer.

Definition at line 469 of file tag.cc.

References mpcl::text::Format(), identifier(), mpcl::text::html::QTTag, and mpcl::text::TString.

virtual void mpcl::text::html::TTag::update void    [inline, virtual]
 

Updates the object. This member function is used by HTML containers to update the value of the object, before writing the object onto a stream.

Reimplemented in mpcl::text::html::TContainer.

Definition at line 283 of file tag.hh.

void mpcl::text::html::TTag::writeUsing std::basic_ostream< char > &    rtTARGET_OSTREAM,
const TString   rkyQUALIFIED_IDENTIFIER
const [virtual]
 

Writes on rtTARGET_OSTREAM this i nstance, using the identifier rkyQUALIFIED_IDENTIFIER plus qualified identifier.

Parameters:
rtTARGET_OSTREAM  Target stream.
rkyQUALIFIED_IDENTIFIER  Source qualified identifier.
See also:
qualifiedIdentifier().

Reimplemented in mpcl::text::html::TContainer, mpcl::text::html::TPatternPage, and mpcl::text::html::TText.

Definition at line 482 of file tag.cc.

References gIsQualified, isVisible(), mpcl::text::html::kcIdentifierSeparator, qualifiedIdentifier(), mpcl::text::TString, and mpcl::util::collection::TStringToStringMap.


Member Data Documentation

bool mpcl::text::html::TTag::gIsQualified [protected]
 

Boolean with truth value iif identifier has to be included in inner tags ("qualified-identifier").

Definition at line 133 of file tag.hh.

Referenced by isQualified(), mpcl::text::html::TAnchor::TAnchor(), mpcl::text::html::TBody::TBody(), mpcl::text::html::TDivision::TDivision(), mpcl::text::html::TForm::TForm(), mpcl::text::html::TInputImage::TInputImage(), mpcl::text::html::TText::writeUsing(), writeUsing(), mpcl::text::html::TPatternPage::writeUsing(), and mpcl::text::html::TContainer::writeUsing().

bool mpcl::text::html::TTag::gIsRootNode [protected]
 

Boolean with truth value iif identifier does not transmit the attribute "qualified-identifier" to inner tags.

Definition at line 139 of file tag.hh.

Referenced by mpcl::text::html::TForm::TForm().


The documentation for this class was generated from the following files:
Generated on Mon Oct 13 02:35:26 2003 for MPCL by doxygen1.2.18