1 /* This file is part of the KDE project
2    Copyright (C) 2008 Thorsten Zachmann <zachmann@kde.org>
3 
4    This library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Library General Public
6    License as published by the Free Software Foundation; either
7    version 2 of the License, or (at your option) any later version.
8 
9    This library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Library General Public License for more details.
13 
14    You should have received a copy of the GNU Library General Public License
15    along with this library; see the file COPYING.LIB.  If not, write to
16    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef KOEVENTACTIONFACTORY_H
21 #define KOEVENTACTIONFACTORY_H
22 
23 #include <QString>
24 
25 #include "flake_export.h"
26 
27 class KoEventAction;
28 class QWidget;
29 
30 /**
31  * Factory for creating KoEventActions
32  *
33  * This is the base class for event action plugins. Each plugin that ships a KoEventAction should
34  * also ship a factory.
35  */
36 class FLAKE_EXPORT KoEventActionFactoryBase
37 {
38 public:
39     /**
40      * Factory to create events
41      *
42      * @param id The id of the event action
43      * @param action Only presentation event actions need to set the action. It is not used
44      *               for script event actions.
45      */
46     explicit KoEventActionFactoryBase(const QString &id, const QString & action = QString());
47     virtual ~KoEventActionFactoryBase();
48 
49     /**
50      * Create the event action.
51      */
52     virtual KoEventAction *createEventAction() = 0;
53 
54     /**
55      * Create the widget to configure the action
56      */
57     virtual QWidget *createOptionWidget() = 0;
58 
59     /**
60      * The action is used to differentiate presentation effects.
61      */
62     QString action() const;
63 
64     /**
65      * return the id for the variable this factory creates.
66      * @return the id for the variable this factory creates.
67      */
68     QString id() const;
69 
70 private:
71     class Private;
72     Private * const d;
73 };
74 
75 #endif /* KOEVENTACTIONFACTORY_H */
76