Référence de la classe KoAction

#include <KoAction.h>

Graphe de collaboration de KoAction:

[légende]
Liste de tous les membres

Connecteurs publics

void execute ()
void execute (QVariant *params)

Signaux

void triggered (const QVariant &params)
void updateUi (const QVariant &params)

Fonctions membres publiques

 KoAction (QObject *parent=0)
virtual ~KoAction ()
void setWeaver (ThreadWeaver::WeaverInterface *weaver)
ThreadWeaver::WeaverInterface * weaver () const
void setExecutePolicy (KoExecutePolicy *policy)
void setEnabled (bool enabled)
bool isEnabled () const
int jobCount ()

Fonctions membres privées

void doAction (QVariant *params)
void doActionUi (QVariant *params)

Attributs privés

KoExecutePolicym_policy
ThreadWeaver::WeaverInterface * m_weaver
bool m_enabled
KoJobsListPolicym_jobsQueue

Amis

class ActionJob

Description détaillée

This class represent the glue between a user event and a piece of controlling logic. Events based programming creates the need to execute certain pieces of logic based on the incoming event, conveniently grouped per action. An action can be something like 'print'. This action uses a ThreadWeaver object to handle the actions and therefor this action is implicitly multithreading. Example usage:
    Action *myAction = new Action();
    myAction->setWeaver(m_weaver);
    myAction->connect(myAction, SIGNAL(triggered(const QVariant&)),
        target, SLOT(slot()), Qt::DirectConnection);

    myAction.execute();
In this example the method 'slot' will be called each time the 'execute()' method is called on the action. It will be called in a differen thread from the main thread and you get the guarentee that it will never be called before a previous call has ended. The execute() method can be called from any thread to simply move control to an anonymous thread.

Notice that the default version uses the SimpleQueuedPolicy.

Définition à la ligne 55 du fichier KoAction.h.


Documentation des contructeurs et destructeur

KoAction::KoAction ( QObject *  parent = 0  ) 

Create a new Action object. The action will start with a SimpleQueuedPolicy.

Paramètres:
parent the parent QObject, for memory mangement purposes.

Définition à la ligne 28 du fichier KoAction.cpp.

Références m_jobsQueue.

KoAction::~KoAction (  )  [virtual]

Définition à la ligne 36 du fichier KoAction.cpp.

Références m_jobsQueue.


Documentation des fonctions membres

void KoAction::setWeaver ( ThreadWeaver::WeaverInterface *  weaver  )  [inline]

Set a ThreadWeaver on this action which is used to execute the action in a different thread when it is activated;

Paramètres:
weaver the weaver to be used

Définition à la ligne 71 du fichier KoAction.h.

ThreadWeaver::WeaverInterface* KoAction::weaver (  )  const [inline]

Return the currently set threadWeaver

Définition à la ligne 76 du fichier KoAction.h.

Référencé par KoSimpleQueuedPolicy::schedule(), KoQueuedPolicy::schedule(), et KoOnlyLastPolicy::schedule().

Voici le graphe d'appel pour cette fonction :

void KoAction::setExecutePolicy ( KoExecutePolicy policy  )  [inline]

Set a new policy for this action.

Définition à la ligne 81 du fichier KoAction.h.

void KoAction::setEnabled ( bool  enabled  )  [inline]

Enable disable this action and all its registered components. Incoming events will not cause the action to be committed when the action is disabled.

Paramètres:
enabled the new state of the action.

Définition à la ligne 88 du fichier KoAction.h.

Référencé par ActionJob::run(), et KoQueuedPolicy::schedule().

Voici le graphe d'appel pour cette fonction :

bool KoAction::isEnabled (  )  const [inline]

return if the action is enabled.

Définition à la ligne 93 du fichier KoAction.h.

Référencé par KoQueuedPolicy::schedule(), et KoOnlyLastPolicy::schedule().

Voici le graphe d'appel pour cette fonction :

int KoAction::jobCount (  ) 

Return te amount of executes there are still to finish.

Définition à la ligne 70 du fichier KoAction.cpp.

Références KoJobsListPolicy::count(), et m_jobsQueue.

Voici le graphe d'appel pour cette fonction :

void KoAction::triggered ( const QVariant &  params  )  [signal]

The signal emitted when the action is triggered. Note that this signal is queued and can very well be in a different thread based on the current executePolicy.

Paramètres:
params a variant that equals the variant given in the execute() signal

Référencé par doAction().

void KoAction::updateUi ( const QVariant &  params  )  [signal]

The signal emitted directly after the triggered() signal, but this signal is guaranteed to be in the Gui thread and can be used to update the user interface after an action has been completed.

Paramètres:
params a variant that equals the variant given in the execute() signal

Référencé par doActionUi().

void KoAction::execute (  )  [slot]

Call this to request the action to be executed. The request will be handled according to the current ExecutePolicy

Définition à la ligne 41 du fichier KoAction.cpp.

void KoAction::execute ( QVariant *  params  )  [slot]

Call this to request the action to be executed. The request will be handled according to the current ExecutePolicy

Paramètres:
params a variant with a parameter that will be emitted in the triggered() and updateUi() signals.

Définition à la ligne 45 du fichier KoAction.cpp.

Références m_enabled, m_jobsQueue, m_policy, m_weaver, et KoExecutePolicy::schedule().

void KoAction::doAction ( QVariant *  params  )  [private]

Définition à la ligne 52 du fichier KoAction.cpp.

Références triggered().

Référencé par ActionJob::run().

Voici le graphe d'appel pour cette fonction :

void KoAction::doActionUi ( QVariant *  params  )  [private]

Définition à la ligne 61 du fichier KoAction.cpp.

Références updateUi().

Référencé par ActionJob::event(), et ActionJob::run().

Voici le graphe d'appel pour cette fonction :


Documentation des fonctions amies et associées

friend class ActionJob [friend]

Définition à la ligne 133 du fichier KoAction.h.


Documentation des données membres

KoExecutePolicy* KoAction::m_policy [private]

Définition à la ligne 137 du fichier KoAction.h.

Référencé par execute().

ThreadWeaver::WeaverInterface* KoAction::m_weaver [private]

Définition à la ligne 138 du fichier KoAction.h.

Référencé par execute().

bool KoAction::m_enabled [private]

Définition à la ligne 139 du fichier KoAction.h.

Référencé par execute().

KoJobsListPolicy* KoAction::m_jobsQueue [private]

Définition à la ligne 140 du fichier KoAction.h.

Référencé par execute(), jobCount(), KoAction(), et ~KoAction().


La documentation de cette classe a été générée à partir des fichiers suivants :
Généré le Wed Nov 22 23:43:39 2006 pour KPlato par  doxygen 1.5.1-p1