Kross
ui/plugin.cpp
Go to the documentation of this file.
74 ScriptingPlugin::ScriptingPlugin(const QString& collectionName, const QString& userActionsFile, const QString& referenceActionsDir, QObject* parent)
88 Kross::ActionCollection* collection=Kross::Manager::self().actionCollection()->collection(d->collectionName);
109 void ScriptingPlugin::addObject(QObject* object, const QString& name, ChildrenInterface::Options options)
117 Kross::ActionCollection* collection=Kross::Manager::self().actionCollection()->collection(d->collectionName);
119 collection=new Kross::ActionCollection(d->collectionName, Kross::Manager::self().actionCollection());
122 QStringList allActionFiles = KGlobal::dirs()->findAllResources("appdata", "scripts/"+d->referenceActionsDir+"/*.rc");
127 else if (QFile::exists(d->userActionsFile)) //in case d->userActionsFile isn't in the standard local dir
209 Kross::ActionCollection* collection=Kross::Manager::self().actionCollection()->collection(d->collectionName);
210 bool collectionEmpty = !collection||(collection->actions().empty()&&collection->collections().empty());
224 "Collection name attribute represents the name of the menu, e.g., to use menu \"File\" use \"file\" or \"Help\" use \"help\". You can add new menus."
226 "If you type a relative script file beware the this script is located in $KDEHOME/share/apps/applicationname/"
text
virtual void setDOMDocument(const QDomDocument &document, bool merge=false)
Re-implement in order to load additional kross scripting rc files.
Definition: ui/plugin.cpp:97
ActionCollection * parentCollection() const
Definition: actioncollection.cpp:98
QString directory(const DirectoryOptions &options=IgnoreTrailingSlash) const
void addObject(QObject *object, const QString &name=QString(), Options options=NoOption)
Add a QObject to the list of children.
Definition: childreninterface.h:80
QDomNode appendChild(const QDomNode &newChild)
QString attribute(const QString &name, const QString &defValue) const
QList< Action * > actions() const
Definition: actioncollection.cpp:163
QStringList findDirs(const char *type, const QString &reldir) const
void setIcon(const QIcon &icon)
bool isEnabled() const
Return the enable this ActionCollection has.
Definition: actioncollection.cpp:95
KStandardDirs * dirs()
QDomElement nextSiblingElement(const QString &tagName) const
T takeAt(int i)
virtual void slotResetScriptActions()
Deletes the user rc file, which has the effect of falling back to the default script actions (if any)...
Definition: ui/plugin.cpp:261
QDomElement documentElement() const
bool exists() const
virtual void setDOMDocument(const QDomDocument &document, bool merge=false)
void addObject(QObject *object, const QString &name, ChildrenInterface::Options options)
Add a QObject to the list of children.
Definition: ui/plugin.cpp:109
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
bool isNull() const
void append(const T &value)
bool empty() const
void setParentCollection(ActionCollection *parent)
Set the parent to parent. NOTE: Do not use setParent().
Definition: actioncollection.cpp:103
void setAttribute(const QString &name, const QString &value)
ActionCollection * collection(const QString &name) const
Definition: actioncollection.cpp:128
Options
Additional options that could be defined for a QObject instance.
Definition: childreninterface.h:45
void deleteLater()
ActionCollection * actionCollection() const
Definition: manager.cpp:285
QStringList collections() const
Definition: actioncollection.cpp:133
QDomText createTextNode(const QString &value)
bool readXml(const QDomElement &element, const QDir &directory=QDir())
Load child Action and ActionCollection instances this collection has from the element ...
Definition: actioncollection.cpp:271
bool isNull() const
No additional options. This is the default.
Definition: childreninterface.h:46
static QString locateLocal(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
bool isEnabled() const
Return true if this Action is enabled else false is returned.
Definition: action.cpp:306
QDomElement firstChildElement(const QString &tagName) const
The class Object does provide us scripting objects like class instances to the C++ world...
Definition: object.h:69
int indexOf(const QRegExp &rx, int from) const
The Action class is an abstract container to deal with scripts like a single standalone script file...
Definition: action.h:94
virtual void slotEditScriptActions()
This slot will open/create a scriptactions.rc file at $KDEHOME/share/apps/application/scripts/ which ...
Definition: ui/plugin.cpp:248
QStringList findAllResources(const char *type, const QString &filter=QString(), SearchOptions options=NoSearchOptions) const
QDomElement createElement(const QString &tagName)
The ActionCollection class manages collections of Action instances.
Definition: actioncollection.h:45
QString absolutePath() const
void setEnabled(bool)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.