KDEUI
kxmlguiclient.cpp
Go to the documentation of this file.
100 kWarning(240) << this << "deleted without having been removed from the factory first. This will leak standalone popupmenus and could lead to crashes.";
167 if (d->m_xmlFile.isEmpty()) // setXMLFile not called at all, can't save. Use case: ToolBarHandler
170 return KStandardDirs::locateLocal( "data", componentData().componentName() + '/' + d->m_xmlFile );
176 // TODO: this method can't be used for the KXmlGuiWindow, since it doesn't merge in ui_standards.rc!
196 kWarning() << "ui/ui_standards.rc not found in" << componentData().dirs()->resourceDirs("config");
224 kWarning() << "cannot find .rc file" << _file << "for component" << componentData().componentName();
229 const bool exists = QDir::isRelativePath(d->m_localXMLFile) || QFile::exists(d->m_localXMLFile);
247void KXMLGUIClient::replaceXMLFile( const QString& xmlfile, const QString& localxmlfile, bool merge )
264 bool result = document.isEmpty() || doc.setContent(document, &errorMsg, &errorLine, &errorColumn);
269 kError(240) << "Error parsing XML document:" << errorMsg << "at line" << errorLine << "column" << errorColumn;
270 setDOMDocument(QDomDocument(), merge); // otherwise empty menus from ui_standards.rc stay around
272 kFatal() << "Error parsing XML document:" << errorMsg << "at line" << errorLine << "column" << errorColumn;
311bool KXMLGUIClientPrivate::mergeXML( QDomElement &base, QDomElement &additive, KActionCollection *actionCollection )
496bool KXMLGUIClientPrivate::isEmptyContainer(const QDomElement& base, KActionCollection *actionCollection) const
555QDomElement KXMLGUIClientPrivate::findMatchingElement( const QDomElement &base, const QDomElement &additive )
565 n = n.nextSibling(); // Advance now so that we can safely delete e -- TODO we don't, so simplify this
705void KXMLGUIClient::stateChanged(const QString &newstate, KXMLGUIClient::ReverseStateChange reverse)
void addAssociatedWidget(QWidget *widget)
Associate all actions in this collection to the given widget, including any actions added after this ...
Definition: kactioncollection.cpp:708
void setComponentData(const KComponentData &componentData)
Set the componentData associated with this action collection.
Definition: kactioncollection.cpp:157
void removeAssociatedWidget(QWidget *widget)
Remove an association between all actions in this collection and the given widget,...
Definition: kactioncollection.cpp:718
QAction * action(int index) const
Return the QAction* at position "index" in the action collection.
Definition: kactioncollection.cpp:141
QString componentName() const
KStandardDirs * dirs() const
QStringList findAllResources(const char *type, const QString &filter, SearchOptions options, QStringList &relPaths) const
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
static QString locateLocal(const char *type, const QString &filename, bool createDir, const KComponentData &cData=KGlobal::mainComponent())
QStringList resourceDirs(const char *type) const
Implements the creation of the GUI (menubar, menus and toolbars) as requested by the GUI factory.
Definition: kxmlguibuilder.h:42
void setBuilderComponentData(const KComponentData &componentData)
Definition: kxmlguibuilder.cpp:397
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
Definition: kxmlguiclient.h:47
KXMLGUIClient * parentClient() const
KXMLGUIClients can form a simple child/parent object tree.
Definition: kxmlguiclient.cpp:607
virtual QString xmlFile() const
This will return the name of the XML file as set by setXMLFile().
Definition: kxmlguiclient.cpp:154
virtual void setDOMDocument(const QDomDocument &document, bool merge=false)
Sets the Document for the part, describing the layout of the GUI.
Definition: kxmlguiclient.cpp:277
QAction * action(const char *name) const
Retrieves an action of the client by name.
Definition: kxmlguiclient.cpp:115
void replaceXMLFile(const QString &xmlfile, const QString &localxmlfile, bool merge=false)
Sets a new xmlFile() and localXMLFile().
Definition: kxmlguiclient.cpp:247
KXMLGUIClient()
Constructs a KXMLGUIClient which can be used with a KXMLGUIFactory to create a GUI from actions and a...
Definition: kxmlguiclient.cpp:82
static QString findMostRecentXMLFile(const QStringList &files, QString &doc)
Definition: kxmlguiclient.cpp:668
void removeChildClient(KXMLGUIClient *child)
Removes the given child from the client's children list.
Definition: kxmlguiclient.cpp:620
void reloadXML()
Forces this client to re-read its XML resource file.
Definition: kxmlguiclient.cpp:174
void addStateActionDisabled(const QString &state, const QString &action)
Definition: kxmlguiclient.cpp:687
virtual void stateChanged(const QString &newstate, ReverseStateChange reverse=StateNoReverse)
Actions can collectively be assigned a "State".
Definition: kxmlguiclient.cpp:705
virtual KActionCollection * actionCollection() const
Retrieves the entire action collection for the GUI client.
Definition: kxmlguiclient.cpp:128
void unplugActionList(const QString &name)
Unplugs the action list name from the XMLGUI.
Definition: kxmlguiclient.cpp:660
void plugActionList(const QString &name, const QList< QAction * > &actionList)
ActionLists are a way for XMLGUI to support dynamic lists of actions.
Definition: kxmlguiclient.cpp:652
virtual void setXMLFile(const QString &file, bool merge=false, bool setXMLDoc=true)
Sets the name of the rc file containing the XML for the part.
Definition: kxmlguiclient.cpp:203
virtual KComponentData componentData() const
Definition: kxmlguiclient.cpp:144
StateChange getActionsToChangeForState(const QString &state)
Definition: kxmlguiclient.cpp:699
QList< KXMLGUIClient * > childClients()
Retrieves a list of all child clients.
Definition: kxmlguiclient.cpp:635
KXMLGUIFactory * factory() const
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return 0 if the client...
Definition: kxmlguiclient.cpp:602
void setXMLGUIBuildDocument(const QDomDocument &doc)
Definition: kxmlguiclient.cpp:587
void setClientBuilder(KXMLGUIBuilder *builder)
A client can have an own KXMLGUIBuilder.
Definition: kxmlguiclient.cpp:640
virtual void setLocalXMLFile(const QString &file)
Set the full path to the "local" xml file, the one used for saving toolbar and shortcut changes.
Definition: kxmlguiclient.cpp:242
void setFactory(KXMLGUIFactory *factory)
This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GU...
Definition: kxmlguiclient.cpp:597
virtual void setXML(const QString &document, bool merge=false)
Sets the XML for the part.
Definition: kxmlguiclient.cpp:257
KXMLGUIBuilder * clientBuilder() const
Retrieves the client's GUI builder or 0 if no client specific builder has been assigned via setClient...
Definition: kxmlguiclient.cpp:647
virtual void setComponentData(const KComponentData &componentData)
Returns true if client was added to super client list.
Definition: kxmlguiclient.cpp:184
void addStateActionEnabled(const QString &state, const QString &action)
Definition: kxmlguiclient.cpp:675
void insertChildClient(KXMLGUIClient *child)
Use this method to make a client a child client of another client.
Definition: kxmlguiclient.cpp:612
QDomDocument xmlguiBuildDocument() const
Definition: kxmlguiclient.cpp:592
virtual void virtual_hook(int id, void *data)
Definition: kxmlguiclient.cpp:750
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
Definition: kxmlguifactory.h:66
static QString readConfigFile(const QString &filename, const KComponentData &componentData=KComponentData())
Definition: kxmlguifactory.cpp:117
#define kWarning
bool authorizeKAction(const QString &action)
const QString & staticQString(const char *str)
const KComponentData & mainComponent()
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
Definition: kxmlguiclient.h:264
QStringList actionsToEnable
Definition: kxmlguiclient.h:265
QStringList actionsToDisable
Definition: kxmlguiclient.h:266
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.