kdeui Library API Documentation

kxmlguifactory.h

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., 59 Temple Place - Suite 330, 00017 Boston, MA 02111-1307, USA. 00018 */ 00019 00020 #ifndef __kxmlguifactory_h__ 00021 #define __kxmlguifactory_h__ 00022 00023 #include <qobject.h> 00024 #include <qptrlist.h> 00025 #include <qdom.h> 00026 #include <qvaluelist.h> 00027 00028 class KAction; 00029 class KXMLGUIFactoryPrivate; 00030 class KXMLGUIClient; 00031 class KXMLGUIBuilder; 00032 class KInstance; 00033 00034 namespace KXMLGUI 00035 { 00036 struct MergingIndex; 00037 class ContainerNode; 00038 class ContainerClient; 00039 class BuildHelper; 00040 } 00041 00059 class KXMLGUIFactory : public QObject 00060 { 00061 friend class KXMLGUI::BuildHelper; 00062 Q_OBJECT 00063 public: 00071 KXMLGUIFactory( KXMLGUIBuilder *builder, QObject *parent = 0, const char *name = 0 ); 00072 00076 ~KXMLGUIFactory(); 00077 00078 // XXX move to somewhere else? (Simon) 00079 static QString readConfigFile( const QString &filename, bool never_null, const KInstance *instance = 0 ); 00080 static QString readConfigFile( const QString &filename, const KInstance *instance = 0 ); 00081 static bool saveConfigFile( const QDomDocument& doc, const QString& filename, 00082 const KInstance *instance = 0 ); 00083 00084 static QString documentToXML( const QDomDocument& doc ); 00085 static QString elementToXML( const QDomElement& elem ); 00086 00090 static void removeDOMComments( QDomNode &node ); 00091 00102 void addClient( KXMLGUIClient *client ); 00103 00109 void removeClient( KXMLGUIClient *client ); 00110 00111 void plugActionList( KXMLGUIClient *client, const QString &name, const QPtrList<KAction> &actionList ); 00112 void unplugActionList( KXMLGUIClient *client, const QString &name ); 00113 00117 QPtrList<KXMLGUIClient> clients() const; 00118 00139 QWidget *container( const QString &containerName, KXMLGUIClient *client, bool useTagName = false ); 00140 00141 QPtrList<QWidget> containers( const QString &tagName ); 00142 00151 void reset(); 00152 00162 void resetContainer( const QString &containerName, bool useTagName = false ); 00163 00164 signals: 00165 void clientAdded( KXMLGUIClient *client ); 00166 void clientRemoved( KXMLGUIClient *client ); 00167 00168 private: 00169 00170 QWidget *findRecursive( KXMLGUI::ContainerNode *node, bool tag ); 00171 00172 QPtrList<QWidget> findRecursive( KXMLGUI::ContainerNode *node, const QString &tagName ); 00173 00174 void applyActionProperties( const QDomElement &element ); 00175 void configureAction( KAction *action, const QDomNamedNodeMap &attributes ); 00176 void configureAction( KAction *action, const QDomAttr &attribute ); 00177 00178 protected: 00179 virtual void virtual_hook( int id, void* data ); 00180 private: 00181 KXMLGUIFactoryPrivate *d; 00182 }; 00183 00184 #endif 00185 /* vim: et sw=4 00186 */
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 8 11:14:29 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003