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

Signals | |
| void | updated () |
Public Member Functions | |
| ActionCollection (const QString &name, ActionCollection *parent=0) | |
| virtual | ~ActionCollection () |
| QString | name () const |
| QString | text () const |
| void | setText (const QString &text) |
| QString | description () const |
| void | setDescription (const QString &description) |
| QString | iconName () const |
| void | setIconName (const QString &iconname) |
| QIcon | icon () const |
| bool | isEnabled () const |
| void | setEnabled (bool enabled) |
| ActionCollection * | parentCollection () const |
| bool | hasCollection (const QString &name) const |
| ActionCollection * | collection (const QString &name) const |
| QStringList | collections () const |
| QList< Action * > | actions () const |
| Action * | action (const QString &name) const |
| void | addAction (Action *action) |
| void | addAction (const QString &name, Action *action) |
| void | removeAction (const QString &name) |
| void | removeAction (Action *action) |
| bool | readXml (const QDomElement &element, const QDir &directory=QDir()) |
| bool | readXml (QIODevice *device, const QDir &directory=QDir()) |
| bool | readXmlFile (const QString &file) |
| QDomElement | writeXml () |
| bool | writeXml (QIODevice *device, int indent=2) |
Protected Member Functions | |
| void | registerCollection (ActionCollection *collection) |
| void | unregisterCollection (const QString &name) |
Detailed Description
The ActionCollection class manages collections of Action instances.
Definition at line 39 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 parentby using the registerCollection method.
Definition at line 57 of file actioncollection.cpp.
| ActionCollection::~ActionCollection | ( | ) | [virtual] |
Destructor.
Definition at line 68 of file actioncollection.cpp.
Member Function Documentation
- Returns:
- action with given name or 0 if it wasn't found
Definition at line 137 of file actioncollection.cpp.
Definition at line 132 of file actioncollection.cpp.
| void ActionCollection::addAction | ( | Action * | action | ) |
Definition at line 142 of file actioncollection.cpp.
Definition at line 148 of file actioncollection.cpp.
| ActionCollection * ActionCollection::collection | ( | const QString & | name | ) | const |
- Returns:
- the ActionCollection instance which objectName is
nameor NULL if there exists no such ActionCollection .
Definition at line 100 of file actioncollection.cpp.
| QStringList ActionCollection::collections | ( | ) | const |
- Returns:
- a list of names of child ActionCollection instances this collection has
Definition at line 105 of file actioncollection.cpp.
| QString ActionCollection::description | ( | ) | const |
- Returns:
- the optional description for this ActionCollection.
Definition at line 80 of file actioncollection.cpp.
- Returns:
- true if this collection has a child ActionCollection instance which objectName is
name.
Definition at line 95 of file actioncollection.cpp.
| QIcon ActionCollection::icon | ( | ) | const |
- Returns:
- the icon defined with
setIconName().
Definition at line 85 of file actioncollection.cpp.
| QString ActionCollection::iconName | ( | ) | const |
- Returns:
- the name of the icon.
Definition at line 83 of file actioncollection.cpp.
| bool ActionCollection::isEnabled | ( | ) | const |
Return the enable this ActionCollection has.
Definition at line 87 of file actioncollection.cpp.
| QString ActionCollection::name | ( | ) | const |
- Returns:
- the objectName for this ActionCollection.
Definition at line 75 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 90 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 187 of file actioncollection.cpp.
Read XML from the QIODevice device .
Definition at line 251 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 266 of file actioncollection.cpp.
| void ActionCollection::registerCollection | ( | ActionCollection * | collection | ) | [protected] |
Definition at line 110 of file actioncollection.cpp.
| void ActionCollection::removeAction | ( | const QString & | name | ) |
Definition at line 159 of file actioncollection.cpp.
| void ActionCollection::removeAction | ( | Action * | action | ) |
Definition at line 170 of file actioncollection.cpp.
| void ActionCollection::setDescription | ( | const QString & | description | ) |
Set the optional description for this ActionCollection.
Definition at line 81 of file actioncollection.cpp.
| void ActionCollection::setEnabled | ( | bool | enabled | ) |
Enable or disable this ActionCollection.
Definition at line 88 of file actioncollection.cpp.
| void ActionCollection::setIconName | ( | const QString & | iconname | ) |
Set the name of the icon to iconname .
Definition at line 84 of file actioncollection.cpp.
| void ActionCollection::setText | ( | const QString & | text | ) |
Set the display text to text .
Definition at line 78 of file actioncollection.cpp.
| QString ActionCollection::text | ( | ) | const |
- Returns:
- the display text
Definition at line 77 of file actioncollection.cpp.
| void ActionCollection::unregisterCollection | ( | const QString & | name | ) | [protected] |
Definition at line 121 of file actioncollection.cpp.
| void Kross::ActionCollection::updated | ( | ) | [signal] |
This signal is emitted if the content of the ActionCollection was changed.
| QDomElement ActionCollection::writeXml | ( | ) |
- Returns:
- a QDomElement that represents the child Action and ActionCollection instances this collection has.
Definition at line 294 of file actioncollection.cpp.
Write XML to the QIODevice device and use a space-idention of indent for the XML.
Definition at line 334 of file actioncollection.cpp.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference