F:/KPlato/koffice/libs/kofficecore/threadAction/KoAction.h

Aller à la documentation de ce fichier.
00001 /*
00002  * Copyright (C) 2006 Thomas Zander <zander@kde.org>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this library; see the file COPYING.LIB.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  */
00019 #ifndef TW_ACTION_H
00020 #define TW_ACTION_H
00021 
00022 #include <ThreadWeaver.h>
00023 
00024 #include <koffice_export.h>
00025 
00026 class KoExecutePolicy;
00027 class DirectPolicy;
00028 class KoJobsListPolicy;
00029 
00055 class KOFFICECORE_EXPORT KoAction : public QObject {
00056     Q_OBJECT
00057 public:
00063     KoAction(QObject *parent = 0);
00064     virtual ~KoAction();
00065 
00071     void setWeaver(ThreadWeaver::WeaverInterface *weaver) { m_weaver = weaver; }
00072 
00076     ThreadWeaver::WeaverInterface *weaver() const { return m_weaver; }
00077 
00081     void setExecutePolicy(KoExecutePolicy *policy) { m_policy = policy; }
00082 
00088     void setEnabled(bool enabled) { m_enabled = enabled; }
00089 
00093     bool isEnabled() const { return m_enabled; }
00094 
00098     int jobCount();
00099 
00100 signals:
00107     void triggered(const QVariant &params);
00108 
00115     void updateUi(const QVariant &params);
00116 
00117 public slots:
00122     void execute();
00123 
00130     void execute(QVariant *params);
00131 
00132 private:
00133     friend class ActionJob;
00134     void doAction(QVariant *params); // called from ActionJob
00135     void doActionUi(QVariant *params); // called from ActionJob
00136 
00137     KoExecutePolicy *m_policy;
00138     ThreadWeaver::WeaverInterface *m_weaver;
00139     bool m_enabled;
00140     KoJobsListPolicy *m_jobsQueue;
00141 };
00142 
00143 #endif

Généré le Wed Nov 22 23:41:04 2006 pour KPlato par  doxygen 1.5.1-p1