Kross

scriptingplugin.h
1 /* This file is part of the KDE project
2  Copyright (C) 2008 Paulo Moura Guedes <[email protected]>
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 KROSS_PLUGIN_H
21 #define KROSS_PLUGIN_H
22 
23 #include <kparts/plugin.h>
24 
25 #include <kross/ui/krossui_export.h>
26 #include <kross/core/childreninterface.h>
27 
28 namespace Kross
29 {
30 class ActionCollection;
31 }
32 
33 class QWidget;
34 
35 namespace Kross
36 {
37 
61 class KROSSUI_EXPORT ScriptingPlugin : public KParts::Plugin
62 {
63  Q_OBJECT
64 public:
65 
71  explicit ScriptingPlugin(QObject *parent = nullptr);
72 
79  ScriptingPlugin(const QString &collectionName, const QString &userActionsFile, const QString &referenceActionsDir = QString(), QObject *parent = nullptr);
80 
84  virtual ~ScriptingPlugin();
85 
89  void setDOMDocument(const QDomDocument &document, bool merge = false) override;
90 
97  void addObject(QObject *object, const QString &name/* = QString()*/, ChildrenInterface::Options options/* = ChildrenInterface::NoOption*/);
98 
100  void addObject(QObject *object, const QString &name = QString()); //BIC
101 
102 protected Q_SLOTS:
103 
108  virtual void slotEditScriptActions();
109 
113  virtual void slotResetScriptActions();
114 
115 private:
116  QDomDocument buildDomDocument(const QDomDocument &document);
117  void buildDomDocument(QDomDocument &document, Kross::ActionCollection *collection);
118  void save();
119 
120 private:
121  class ScriptingPluginPrivate;
122  ScriptingPluginPrivate *const d;
123 };
124 
125 }
126 
127 #endif
Definition: action.cpp:36
Options
Additional options that could be defined for a QObject instance.
The ScriptingPlugin class loads additional actions stored in rc files with the KrossScripting format:...
The ActionCollection class manages collections of Action instances.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Sep 20 2020 22:58:38 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.