1 /* This file is part of the KDE project
2    Copyright (C) 2003 Lucijan Busch <lucijan@gmx.at>
3    Copyright (C) 2004-2009 Jarosław Staniek <staniek@kde.org>
4 
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Library General Public
7    License as published by the Free Software Foundation; either
8    version 2 of the License, or (at your option) any later version.
9 
10    This library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Library General Public License for more details.
14 
15    You should have received a copy of the GNU Library General Public License
16    along with this library; see the file COPYING.LIB.  If not, write to
17    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef LIBACTIONWIDGET_H
22 #define LIBACTIONWIDGET_H
23 
24 #include "kformdesigner_export.h"
25 #include "utils.h"
26 
27 #include <KToggleAction>
28 
29 namespace KFormDesigner
30 {
31 
32 class WidgetInfo;
33 
34 /**
35  * KToggleAction subclass which remembers the matching class name.
isTrue(KPluginMetaData * metaData,const char * fieldName,bool defaultValue=false)36  */
37 class KFORMDESIGNER_EXPORT LibActionWidget : public KToggleAction
38 {
39     Q_OBJECT
40 public:
41     /** LibActionWidget object is initialized to be mutually
42       exclusive with all other LibActionWidget objects for group @a group. */
43     LibActionWidget(ActionGroup *group, WidgetInfo *w);
44 
45     virtual ~LibActionWidget();
46 
47 Q_SIGNALS:
48     /**
49      * emits a signal containing the class name
50      */
51     void toggled(const QByteArray &className);
52 
53 protected Q_SLOTS:
54     /** reimplemented from KToggleAction */
55     virtual void slotToggled(bool checked);
56 
57 private:
58     class Private;
59 
60     Private* const d;
61 };
62 
63 }
64 
65 #endif
66