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);
247 void 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;
311 bool KXMLGUIClientPrivate::mergeXML( QDomElement &base, QDomElement &additive, KActionCollection *actionCollection )
496 bool KXMLGUIClientPrivate::isEmptyContainer(const QDomElement& base, KActionCollection *actionCollection) const
555 QDomElement 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
705 void KXMLGUIClient::stateChanged(const QString &newstate, KXMLGUIClient::ReverseStateChange reverse)
void removeAssociatedWidget(QWidget *widget)
Remove an association between all actions in this collection and the given widget, i.e.
Definition: kactioncollection.cpp:718
virtual KActionCollection * actionCollection() const
Retrieves the entire action collection for the GUI client.
Definition: kxmlguiclient.cpp:128
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...
Definition: kxmlguiclient.h:46
void replaceXMLFile(const QString &xmlfile, const QString &localxmlfile, bool merge=false)
Sets a new xmlFile() and localXMLFile().
Definition: kxmlguiclient.cpp:247
void removeChildClient(KXMLGUIClient *child)
Removes the given child from the client's children list.
Definition: kxmlguiclient.cpp:620
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
QStringList actionsToEnable
Definition: kxmlguiclient.h:265
void setClientBuilder(KXMLGUIBuilder *builder)
A client can have an own KXMLGUIBuilder.
Definition: kxmlguiclient.cpp:640
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
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
KXMLGUIFactory * factory() const
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return 0 if the client...
Definition: kxmlguiclient.cpp:602
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
void reloadXML()
Forces this client to re-read its XML resource file.
Definition: kxmlguiclient.cpp:174
StateChange getActionsToChangeForState(const QString &state)
Definition: kxmlguiclient.cpp:699
Definition: kxmlguiclient.h:262
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
QStringList actionsToDisable
Definition: kxmlguiclient.h:266
QList< KXMLGUIClient * > childClients()
Retrieves a list of all child clients.
Definition: kxmlguiclient.cpp:635
virtual void stateChanged(const QString &newstate, ReverseStateChange reverse=StateNoReverse)
Actions can collectively be assigned a "State".
Definition: kxmlguiclient.cpp:705
QDomDocument xmlguiBuildDocument() const
Definition: kxmlguiclient.cpp:592
Implements the creation of the GUI (menubar, menus and toolbars) as requested by the GUI factory...
Definition: kxmlguibuilder.h:41
virtual KComponentData componentData() const
Definition: kxmlguiclient.cpp:144
static QString readConfigFile(const QString &filename, const KComponentData &componentData=KComponentData())
Definition: kxmlguifactory.cpp:117
virtual void setXML(const QString &document, bool merge=false)
Sets the XML for the part.
Definition: kxmlguiclient.cpp:257
QString componentName() const
virtual void setComponentData(const KComponentData &componentData)
Returns true if client was added to super client list.
Definition: kxmlguiclient.cpp:184
Definition: kxmlguiclient.h:263
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
Definition: kxmlguifactory.h:65
QStringList resourceDirs(const char *type) const
void setComponentData(const KComponentData &componentData)
Set the componentData associated with this action collection.
Definition: kactioncollection.cpp:157
void setBuilderComponentData(const KComponentData &componentData)
Definition: kxmlguibuilder.cpp:397
QAction * action(const char *name) const
Retrieves an action of the client by name.
Definition: kxmlguiclient.cpp:115
KXMLGUIClient * parentClient() const
KXMLGUIClients can form a simple child/parent object tree.
Definition: kxmlguiclient.cpp:607
void addStateActionDisabled(const QString &state, const QString &action)
Definition: kxmlguiclient.cpp:687
static QString locateLocal(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
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
void addAssociatedWidget(QWidget *widget)
Associate all actions in this collection to the given widget, including any actions added after this ...
Definition: kactioncollection.cpp:708
const KComponentData & mainComponent()
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
virtual QDomDocument domDocument() const
Definition: kxmlguiclient.cpp:149
QAction * action(int index) const
Return the QAction* at position "index" in the action collection.
Definition: kactioncollection.cpp:141
void addStateActionEnabled(const QString &state, const QString &action)
Definition: kxmlguiclient.cpp:675
virtual void virtual_hook(int id, void *data)
Definition: kxmlguiclient.cpp:750
const QString & staticQString(const char *str)
QStringList findAllResources(const char *type, const QString &filter=QString(), SearchOptions options=NoSearchOptions) const
void insertChildClient(KXMLGUIClient *child)
Use this method to make a client a child client of another client.
Definition: kxmlguiclient.cpp:612
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
static QString findMostRecentXMLFile(const QStringList &files, QString &doc)
Definition: kxmlguiclient.cpp:668
static QDebug kFatal(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void unplugActionList(const QString &name)
Unplugs the action list name from the XMLGUI.
Definition: kxmlguiclient.cpp:660
bool authorizeKAction(const QString &action)
void setXMLGUIBuildDocument(const QDomDocument &doc)
Definition: kxmlguiclient.cpp:587
KStandardDirs * dirs() const
KXMLGUIClient()
Constructs a KXMLGUIClient which can be used with a KXMLGUIFactory to create a GUI from actions and a...
Definition: kxmlguiclient.cpp:82
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:16 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:16 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.