KDEUI
kxmlguifactory.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1999 Simon Hausmann <hausmann@kde.org> 00003 Copyright (C) 2000 Kurt Granroth <granroth@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef kxmlguifactory_h 00021 #define kxmlguifactory_h 00022 00023 #include <kdeui_export.h> 00024 #include <kcomponentdata.h> 00025 00026 #include <QtCore/QObject> 00027 00028 class QAction; 00029 class KXMLGUIFactoryPrivate; 00030 class KXMLGUIClient; 00031 class KXMLGUIBuilder; 00032 class KComponentData; 00033 00034 class QDomAttr; 00035 class QDomDocument; 00036 class QDomElement; 00037 class QDomNode; 00038 class QDomNamedNodeMap; 00039 00040 namespace KXMLGUI 00041 { 00042 struct MergingIndex; 00043 struct ContainerNode; 00044 struct ContainerClient; 00045 class BuildHelper; 00046 } 00047 00065 class KDEUI_EXPORT KXMLGUIFactory : public QObject 00066 { 00067 friend class KXMLGUI::BuildHelper; 00068 Q_OBJECT 00069 public: 00077 explicit KXMLGUIFactory( KXMLGUIBuilder *builder, QObject *parent = 0 ); 00078 00082 ~KXMLGUIFactory(); 00083 00084 // XXX move to somewhere else? (Simon) 00086 static QString readConfigFile(const QString &filename, 00087 const KComponentData &componentData = KComponentData()); 00089 static bool saveConfigFile(const QDomDocument& doc, const QString& filename, 00090 const KComponentData &componentData = KComponentData()); 00091 00096 static QDomElement actionPropertiesElement( QDomDocument& doc ); 00097 00103 static QDomElement findActionByName( QDomElement& elem, const QString& sName, bool create ); 00104 00115 void addClient( KXMLGUIClient *client ); 00116 00122 void removeClient( KXMLGUIClient *client ); 00123 00124 void plugActionList( KXMLGUIClient *client, const QString &name, const QList<QAction*> &actionList ); 00125 void unplugActionList( KXMLGUIClient *client, const QString &name ); 00126 00130 QList<KXMLGUIClient*> clients() const; 00131 00152 QWidget *container( const QString &containerName, KXMLGUIClient *client, bool useTagName = false ); 00153 00154 QList<QWidget*> containers( const QString &tagName ); 00155 00164 void reset(); 00165 00175 void resetContainer( const QString &containerName, bool useTagName = false ); 00176 00181 void refreshActionProperties(); 00182 00183 public Q_SLOTS: 00198 int configureShortcuts(bool bAllowLetterShortcuts = true, bool bSaveSettings = true); 00199 00200 void changeShortcutScheme(const QString &scheme); 00201 00202 Q_SIGNALS: 00203 void clientAdded( KXMLGUIClient *client ); 00204 void clientRemoved( KXMLGUIClient *client ); 00205 00216 void makingChanges(bool); 00217 00218 private: 00219 friend class KXMLGUIClient; 00221 void forgetClient(KXMLGUIClient *client); 00222 00223 KXMLGUIFactoryPrivate *const d; 00224 }; 00225 00226 #endif 00227 /* vim: et sw=4 00228 */
KDE 4.6 API Reference