Kross
Kross::ActionCollection Class Reference
#include <actioncollection.h>

Detailed Description
The ActionCollection class manages collections of Action instances.Definition at line 39 of file actioncollection.h.
Signals | |
void | updated () |
Public Member Functions | |
Action * | action (const QString &name) const |
ActionCollection (const QString &name, ActionCollection *parent=0) | |
QList< Action * > | actions () const |
void | addAction (const QString &name, Action *action) |
void | addAction (Action *action) |
ActionCollection * | collection (const QString &name) const |
QStringList | collections () const |
QString | description () const |
bool | hasCollection (const QString &name) const |
QIcon | icon () const |
QString | iconName () const |
bool | isEnabled () const |
QString | name () const |
ActionCollection * | parentCollection () const |
bool | readXml (QIODevice *device, const QDir &directory=QDir()) |
bool | readXml (const QDomElement &element, const QDir &directory=QDir()) |
bool | readXmlFile (const QString &file) |
void | removeAction (Action *action) |
void | removeAction (const QString &name) |
void | setDescription (const QString &description) |
void | setEnabled (bool enabled) |
void | setIconName (const QString &iconname) |
void | setText (const QString &text) |
QString | text () const |
bool | writeXml (QIODevice *device, int indent=2) |
QDomElement | writeXml () |
virtual | ~ActionCollection () |
Protected Member Functions | |
void | registerCollection (ActionCollection *collection) |
void | unregisterCollection (const QString &name) |
Constructor & Destructor Documentation
ActionCollection::ActionCollection | ( | const QString & | name, | |
ActionCollection * | parent = 0 | |||
) | [explicit] |
Constructor.
- Parameters:
-
name The objectName the ActionCollection has. parent The parent ActionCollection this ActionCollection will be child of. If parent is not NULL, this ActionCollection instance will register itself as child of the parent parent
by using the registerCollection method.
Definition at line 59 of file actioncollection.cpp.
ActionCollection::~ActionCollection | ( | ) | [virtual] |
Member Function Documentation
- Returns:
- action with given name or 0 if it wasn't found
Definition at line 139 of file actioncollection.cpp.
Definition at line 134 of file actioncollection.cpp.
Definition at line 150 of file actioncollection.cpp.
void ActionCollection::addAction | ( | Action * | action | ) |
Definition at line 144 of file actioncollection.cpp.
ActionCollection * ActionCollection::collection | ( | const QString & | name | ) | const |
- Returns:
- the ActionCollection instance which objectName is
name
or NULL if there exists no such ActionCollection .
Definition at line 102 of file actioncollection.cpp.
QStringList ActionCollection::collections | ( | ) | const |
- Returns:
- a list of names of child ActionCollection instances this collection has
Definition at line 107 of file actioncollection.cpp.
QString ActionCollection::description | ( | ) | const |
- Returns:
- the optional description for this ActionCollection.
Definition at line 82 of file actioncollection.cpp.
- Returns:
- true if this collection has a child ActionCollection instance which objectName is
name
.
Definition at line 97 of file actioncollection.cpp.
QIcon ActionCollection::icon | ( | ) | const |
QString ActionCollection::iconName | ( | ) | const |
bool ActionCollection::isEnabled | ( | ) | const |
QString ActionCollection::name | ( | ) | const |
- Returns:
- the objectName for this ActionCollection.
Definition at line 77 of file actioncollection.cpp.
ActionCollection * ActionCollection::parentCollection | ( | ) | const |
- Returns:
- the parent ActionCollection instance this is child of or NULL oif this collection does not have a parent.
Definition at line 92 of file actioncollection.cpp.
bool ActionCollection::readXml | ( | const QDomElement & | element, | |
const QDir & | directory = QDir() | |||
) |
Load child Action and ActionCollection instances this collection has from the element
.
- Parameters:
-
element The QDomElement that contains the XML. directory The current directory used for relative paths defined within a script-tag for the file-attribute. If the directory is QDir() relative paths are not resolved.
- Returns:
- true on success else false.
Definition at line 189 of file actioncollection.cpp.
Read the XML from the file file
.
- Parameters:
-
file The existing XML file that should be readed.
- Returns:
- true if reading was successful else false.
Definition at line 268 of file actioncollection.cpp.
void ActionCollection::registerCollection | ( | ActionCollection * | collection | ) | [protected] |
Definition at line 112 of file actioncollection.cpp.
void ActionCollection::removeAction | ( | Action * | action | ) |
Definition at line 172 of file actioncollection.cpp.
void ActionCollection::removeAction | ( | const QString & | name | ) |
Definition at line 161 of file actioncollection.cpp.
void ActionCollection::setDescription | ( | const QString & | description | ) |
Set the optional description for this ActionCollection.
Definition at line 83 of file actioncollection.cpp.
void ActionCollection::setEnabled | ( | bool | enabled | ) |
void ActionCollection::setIconName | ( | const QString & | iconname | ) |
void ActionCollection::setText | ( | const QString & | text | ) |
QString ActionCollection::text | ( | ) | const |
void ActionCollection::unregisterCollection | ( | const QString & | name | ) | [protected] |
Definition at line 123 of file actioncollection.cpp.
void Kross::ActionCollection::updated | ( | ) | [signal] |
This signal is emitted if the content of the ActionCollection was changed.
Write XML to the QIODevice device
and use a space-idention of indent
for the XML.
Definition at line 336 of file actioncollection.cpp.
QDomElement ActionCollection::writeXml | ( | ) |
- Returns:
- a QDomElement that represents the child Action and ActionCollection instances this collection has.
Definition at line 296 of file actioncollection.cpp.
The documentation for this class was generated from the following files: