Kross
Kross::ActionCollection Class Reference
The ActionCollection class manages collections of Action instances. More...
#include <actioncollection.h>

Detailed Description
The ActionCollection class manages collections of Action instances.An ActionCollection can have both actions and other collections as children. Child actions can be accessed using actions() which returns a list of Action pointers. Child collections can be accessed using collections() which returns a list of collection names. The collection can then be accessed with collection(name). To add a child action, call addAction(), and to remove an action: removeAction(). To add a child collection, call setParentCollection(parent) in the collection you want to add to parent. To remove a collection call setParentCollection(0). NOTE: Do not use setParent().
Definition at line 46 of file actioncollection.h.
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 setParentCollection method.
Definition at line 61 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 165 of file actioncollection.cpp.
void Kross::ActionCollection::actionInserted | ( | Action * | child, | |
ActionCollection * | parent | |||
) | [signal] |
This signal is emitted after child
has been added to parent
.
void Kross::ActionCollection::actionRemoved | ( | Action * | child, | |
ActionCollection * | parent | |||
) | [signal] |
This signal is emitted after child
has been removed from parent
.
Definition at line 160 of file actioncollection.cpp.
void Kross::ActionCollection::actionToBeInserted | ( | Action * | child, | |
ActionCollection * | parent | |||
) | [signal] |
This signal is emitted just before child
is added to parent
.
void Kross::ActionCollection::actionToBeRemoved | ( | Action * | child, | |
ActionCollection * | parent | |||
) | [signal] |
This signal is emitted before child
is removed from parent
.
Definition at line 176 of file actioncollection.cpp.
void ActionCollection::addAction | ( | Action * | action | ) |
Definition at line 170 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 128 of file actioncollection.cpp.
void Kross::ActionCollection::collectionInserted | ( | ActionCollection * | child, | |
ActionCollection * | parent | |||
) | [signal] |
This signal is emitted after child
has been added to parent
.
void Kross::ActionCollection::collectionRemoved | ( | ActionCollection * | child, | |
ActionCollection * | parent | |||
) | [signal] |
This signal is emitted after child
has been removed from parent
.
QStringList ActionCollection::collections | ( | ) | const |
- Returns:
- a list of names of child ActionCollection instances this collection has
Definition at line 133 of file actioncollection.cpp.
void Kross::ActionCollection::collectionToBeInserted | ( | ActionCollection * | child, | |
ActionCollection * | parent | |||
) | [signal] |
This signal is emitted just before child
is added to parent
.
void Kross::ActionCollection::collectionToBeRemoved | ( | ActionCollection * | child, | |
ActionCollection * | parent | |||
) | [signal] |
This signal is emitted before child
is removed from parent
.
void ActionCollection::connectSignals | ( | Action * | collection, | |
bool | conn | |||
) | [protected] |
Definition at line 215 of file actioncollection.cpp.
void ActionCollection::connectSignals | ( | ActionCollection * | collection, | |
bool | conn | |||
) | [protected] |
Definition at line 226 of file actioncollection.cpp.
void Kross::ActionCollection::dataChanged | ( | ActionCollection * | ) | [signal] |
This signal is emitted when the data of the ActionCollection is changed.
void Kross::ActionCollection::dataChanged | ( | Action * | ) | [signal] |
This signal is emitted when the data of a child action is changed.
QString ActionCollection::description | ( | ) | const |
- Returns:
- the optional description for this ActionCollection.
Definition at line 88 of file actioncollection.cpp.
bool ActionCollection::hasCollection | ( | const QString & | name | ) | const |
- Returns:
- true if this collection has a child ActionCollection instance which objectName is
name
.
Definition at line 123 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 83 of file actioncollection.cpp.
ActionCollection * ActionCollection::parentCollection | ( | ) | const |
- Returns:
- the parent ActionCollection instance this is child of or NULL if this collection does not have a parent.
Definition at line 98 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 268 of file actioncollection.cpp.
bool ActionCollection::readXmlFile | ( | const QString & | file | ) |
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 348 of file actioncollection.cpp.
void ActionCollection::registerCollection | ( | ActionCollection * | collection | ) | [protected] |
Definition at line 138 of file actioncollection.cpp.
void ActionCollection::removeAction | ( | Action * | action | ) |
Definition at line 205 of file actioncollection.cpp.
void ActionCollection::removeAction | ( | const QString & | name | ) |
Definition at line 190 of file actioncollection.cpp.
void ActionCollection::setDescription | ( | const QString & | description | ) |
Set the optional description for this ActionCollection.
Definition at line 89 of file actioncollection.cpp.
void ActionCollection::setEnabled | ( | bool | enabled | ) |
void ActionCollection::setIconName | ( | const QString & | iconname | ) |
void ActionCollection::setParentCollection | ( | ActionCollection * | parent | ) |
Set the parent to parent
. NOTE: Do not use setParent().
Definition at line 103 of file actioncollection.cpp.
void ActionCollection::setText | ( | const QString & | text | ) |
QString ActionCollection::text | ( | ) | const |
void ActionCollection::unregisterCollection | ( | const QString & | name | ) | [protected] |
Definition at line 149 of file actioncollection.cpp.
void Kross::ActionCollection::updated | ( | ) | [signal] |
This signal is emitted if the content of the ActionCollection was changed.
bool ActionCollection::writeXml | ( | QIODevice * | device, | |
int | indent = 2 | |||
) |
Write XML to the QIODevice device
and use a space-idention of indent
for the XML.
Definition at line 416 of file actioncollection.cpp.
QDomElement ActionCollection::writeXml | ( | ) |
- Returns:
- a QDomElement that represents the child Action and ActionCollection instances this collection has.
Definition at line 376 of file actioncollection.cpp.
The documentation for this class was generated from the following files: