|
ubit
|
Ubit class. More...
#include <uclass.hpp>
Public Types | |
| enum | ParseModes { EMPTY_ELEMENT = 1<<0, DONT_PARSE_CONTENT = 1<<1, PRESERVE_SPACES = 1<<2 } |
| Parse Modes returned by UClass::getParseModes(): More... | |
Public Member Functions | |
| UClass (const char *name) | |
| UClass (const UStr &name) | |
| const UStr & | getName () const |
| returns the class name. | |
| unsigned int | getNo () const |
| returns the class #. More... | |
| virtual int | getParseModes () const |
| returns an ORed combination of the parse modes (0 if none). | |
| virtual bool | isInstance (UObject &object) const |
| returns true if this 'object' derives from this class. | |
| virtual UObject * | newInstance () const |
| creates a new instance of the corresponding class (if applicable). More... | |
| virtual UStyle * | newStyle () const |
| creates a new instance of the style of this class (if applicable). More... | |
| UStyle * | obtainStyle () const |
| returns the style prototype that is associated to this class. More... | |
| UAttrList * | getAttributes () const |
| returns current class properties. More... | |
| void | setAttributes (UAttrList *alist) const |
| changes the class properties. More... | |
Ubit class.
All classes that derives from UObject can have an associated UClass. UClass is a metaclass that defines some useful data for the corresponding Ubit class, such as the class name, a unique ID, a static constructor, a style def, etc.
UObject (and UNode) subclasses MUST invoke the UCLASS macro in the public section of their declaration as follows:
class UColor: public UAttr { public: UCLASS("ucolor", UColor, new UColor) ..... };
The arguments of the UCLASS macro are:
The UCLASS macro redefines the getClass() and Class() methods which are, respectively, an instance ad a class method. Both methods return a metaclass that describes the C++ class.
Parse Modes returned by UClass::getParseModes():
element)
|
inline |
returns current class properties.
WARNING: the returned properties must NOT be deleted.
|
inline |
returns the class #.
the class No depends in which order classes are created (the first created class has No 1 and so on)
|
inlinevirtual |
creates a new instance of the corresponding class (if applicable).
Ubit classes that derive from UObject should have an associated UClass that redefines this method.
Reimplemented in ubit::UObject::MetaClass, ubit::UDefaultBlockElement::MetaClass, ubit::UDefaultInlineElement::MetaClass, and ubit::UDefaultAttribute::MetaClass.
|
inlinevirtual |
creates a new instance of the style of this class (if applicable).
Ubit classes that derive from UElem should have an associated UClass that redefines this method.
Reimplemented in ubit::UObject::MetaClass, ubit::UDefaultBlockElement::MetaClass, and ubit::UDefaultInlineElement::MetaClass.
|
inline |
returns the style prototype that is associated to this class.
Ubit classes that derive from UElem can have a style prototype. This function calls newStyle() the 1st type it is called to create the style prototype WARNING: the returned style must NOT be deleted.
|
inline |
changes the class properties.
WARNING: the properties given as argument are not copied and will be destroyed by the Class destr. They must NOT be deleted by another function
1.8.12