• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Kross

Kross::ActionCollection

Kross::ActionCollection Class Reference

#include <actioncollection.h>

Inheritance diagram for Kross::ActionCollection:

Inheritance graph
[legend]

List of all members.


Detailed Description

The ActionCollection class manages collections of Action instances.

Definition at line 39 of file 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)

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 57 of file actioncollection.cpp.

ActionCollection::~ActionCollection (  )  [virtual]

Destructor.

Definition at line 68 of file actioncollection.cpp.


Member Function Documentation

QString ActionCollection::name (  )  const

Returns:
the objectName for this ActionCollection.

Definition at line 75 of file actioncollection.cpp.

QString ActionCollection::text (  )  const

Returns:
the display text

Definition at line 77 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::description (  )  const

Returns:
the optional description for this ActionCollection.

Definition at line 80 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.

QString ActionCollection::iconName (  )  const

Returns:
the name of the icon.

Definition at line 83 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.

QIcon ActionCollection::icon (  )  const

Returns:
the icon defined with setIconName() .

Definition at line 85 of file actioncollection.cpp.

bool ActionCollection::isEnabled (  )  const

Return the enable this ActionCollection has.

Definition at line 87 of file actioncollection.cpp.

void ActionCollection::setEnabled ( bool  enabled  ) 

Enable or disable this ActionCollection.

Definition at line 88 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::hasCollection ( const QString &  name  )  const

Returns:
true if this collection has a child ActionCollection instance which objectName is name .

Definition at line 95 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 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.

QList< Action * > ActionCollection::actions (  )  const

Definition at line 132 of file actioncollection.cpp.

Action * ActionCollection::action ( const QString &  name  )  const

Returns:
action with given name or 0 if it wasn't found

Definition at line 137 of file actioncollection.cpp.

void ActionCollection::addAction ( Action *  action  ) 

Definition at line 142 of file actioncollection.cpp.

void ActionCollection::addAction ( const QString &  name,
Action *  action 
)

Definition at line 148 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.

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.

bool ActionCollection::readXml ( QIODevice *  device,
const QDir &  directory = QDir() 
)

Read XML from the QIODevice device .

Definition at line 251 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 266 of file actioncollection.cpp.

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.

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 334 of file actioncollection.cpp.

void Kross::ActionCollection::updated (  )  [signal]

This signal is emitted if the content of the ActionCollection was changed.

void ActionCollection::registerCollection ( ActionCollection *  collection  )  [protected]

Definition at line 110 of file actioncollection.cpp.

void ActionCollection::unregisterCollection ( const QString &  name  )  [protected]

Definition at line 121 of file actioncollection.cpp.


The documentation for this class was generated from the following files:
  • actioncollection.h
  • actioncollection.cpp

Kross

Skip menu "Kross"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   WTF
  • KJSEmbed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal