#include <variable.h>
Public Types | |
| typedef TQValueList< TDESharedPtr< Variable > > | List |
| typedef TQMap< TQString, TDESharedPtr< Variable > > | Map |
Public Types inherited from KoMacro::MetaParameter | |
| enum | Type { TypeNone = 0 , TypeVariant , TypeObject } |
| typedef TQValueList< TDESharedPtr< MetaParameter > > | List |
Public Member Functions | |
| Variable () | |
| Variable (const TQVariant &variant, const TQString &name=TQString(), const TQString &text=TQString()) | |
| Variable (const TQObject *object) | |
| Variable (const TQDomElement &element) | |
| virtual | ~Variable () |
| TQString | name () const |
| void | setName (const TQString &name) |
| TQString | text () const |
| void | setText (const TQString &text) |
| void | setObject (const TQObject *object) |
| const TQVariant | variant () const |
| void | setVariant (const TQVariant &variant, bool detecttype=true) |
| const TQObject * | object () const |
| operator TQVariant () const | |
| operator const TQObject * () const | |
| const TQString | toString () const |
| int | toInt () const |
| List | children () const |
| void | appendChild (TDESharedPtr< Variable > variable) |
| void | clearChildren () |
| void | setChildren (const List &children) |
Public Member Functions inherited from KoMacro::MetaParameter | |
| MetaParameter (const TQString &signatureargument=TQString()) | |
| ~MetaParameter () | |
| Type | type () const |
| const TQString | typeName () const |
| void | setType (Type type) |
| TQVariant::Type | variantType () const |
| void | setVariantType (TQVariant::Type varianttype) |
| bool | validVariable (TDESharedPtr< Variable > variable) const |
Additional Inherited Members | |
Protected Member Functions inherited from KoMacro::MetaParameter | |
| void | setSignatureArgument (const TQString &signatureargument) |
Detailed Description
A variable value used to provide abstract access to variables.
The class handles TQVariant and TQObject and provides access to them. Variable inherits TDEShared and implements reference couting. So, it's not needed to take care of memory-managment.
Definition at line 38 of file variable.h.
Member Typedef Documentation
◆ List
| typedef TQValueList<TDESharedPtr<Variable > > KoMacro::Variable::List |
Property to get and set a TQVariant as variable.
Property to get and set a TQObject as variable. Property to get a string-representation of the variable. A list of variables.
Definition at line 61 of file variable.h.
◆ Map
| typedef TQMap<TQString, TDESharedPtr<Variable > > KoMacro::Variable::Map |
A map of variables.
Definition at line 66 of file variable.h.
Constructor & Destructor Documentation
◆ Variable() [1/4]
|
explicit |
Default constructor.
Definition at line 79 of file variable.cpp.
◆ Variable() [2/4]
| Variable::Variable | ( | const TQVariant & | variant, |
| const TQString & | name = TQString(), |
||
| const TQString & | text = TQString() |
||
| ) |
Constructor from the TQVariant variant .
- Parameters
-
variant The value this variable has. name The unique name() this variable has. text The describing text() this variable has.
Definition at line 87 of file variable.cpp.
◆ Variable() [3/4]
| Variable::Variable | ( | const TQObject * | object | ) |
Constructor from the TQObject object .
- Parameters
-
object The value this variable has.
Definition at line 98 of file variable.cpp.
◆ Variable() [4/4]
| Variable::Variable | ( | const TQDomElement & | element | ) |
Constructor from the TQDomElement element .
- Deprecated:
- replaced with methods of XMLHandler.
- Parameters
-
element The TQDomElement that may optional contains the variable content or other additional informations.
Definition at line 106 of file variable.cpp.
◆ ~Variable()
|
virtual |
Destructor.
Definition at line 132 of file variable.cpp.
Member Function Documentation
◆ appendChild()
| void Variable::appendChild | ( | TDESharedPtr< Variable > | variable | ) |
Append a Variable to the list of children this Variable has.
Definition at line 221 of file variable.cpp.
◆ children()
| Variable::List Variable::children | ( | ) | const |
- Note
- that the list is returned call-by-reference. The list is accessed as getter/setter (read/write). So, don't set this method to const!
Definition at line 216 of file variable.cpp.
◆ clearChildren()
| void Variable::clearChildren | ( | ) |
Clear the list of children this Variable has.
Definition at line 226 of file variable.cpp.
◆ name()
| TQString Variable::name | ( | ) | const |
- Returns
- the name this Variable has.
Definition at line 137 of file variable.cpp.
◆ object()
| const TQObject * Variable::object | ( | ) | const |
- Returns
- the TQObject this variable has. If this variable isn't a TypeObject NULL got returned.
Definition at line 173 of file variable.cpp.
◆ operator const TQObject *()
| Variable::operator const TQObject * | ( | ) | const |
Implicit conversion to TQObject operator.
This method calls object() internaly.
Definition at line 190 of file variable.cpp.
◆ operator TQVariant()
| Variable::operator TQVariant | ( | ) | const |
Implicit conversion to TQVariant operator.
This method calls variant() internaly.
Definition at line 185 of file variable.cpp.
◆ setChildren()
| void Variable::setChildren | ( | const List & | children | ) |
Set the children this Variable has.
Definition at line 231 of file variable.cpp.
◆ setName()
| void Variable::setName | ( | const TQString & | name | ) |
◆ setObject()
| void Variable::setObject | ( | const TQObject * | object | ) |
Set the TQObject.
- Parameters
-
object this variable has. A previously remembered value will be overwritten and the new type is a TypeObject .
Definition at line 179 of file variable.cpp.
◆ setText()
| void Variable::setText | ( | const TQString & | text | ) |
◆ setVariant()
| void Variable::setVariant | ( | const TQVariant & | variant, |
| bool | detecttype = true |
||
| ) |
Set the TQVariant.
- Parameters
-
variant this variable has. A previously remembered value will be overwritten and the new type is a TypeVariant . If detecttype is true the method tries to set the variantType according to the passed TQVariant. If false the variantType won't be changed.
Definition at line 165 of file variable.cpp.
◆ text()
| TQString Variable::text | ( | ) | const |
- Returns
- the caption this Variable has.
Definition at line 147 of file variable.cpp.
◆ toInt()
| int Variable::toInt | ( | ) | const |
- Returns
- a integer-represenation of the variable.
Definition at line 211 of file variable.cpp.
◆ toString()
| const TQString Variable::toString | ( | ) | const |
- Returns
- a string-represenation of the variable.
Definition at line 195 of file variable.cpp.
◆ variant()
| const TQVariant Variable::variant | ( | ) | const |
- Returns
- the TQVariant this variable has. If this variable isn't a TypeVariant an invalid TQVariant got returned.
Definition at line 157 of file variable.cpp.
The documentation for this class was generated from the following files:

Public Types inherited from