kdeui Library API Documentation

kxmlguifactory.h

00001 // -*- mode: c++; c-basic-offset: 2 -*- 00002 /* This file is part of the KDE libraries 00003 Copyright (C) 1999 Simon Hausmann <hausmann@kde.org> 00004 Copyright (C) 2000 Kurt Granroth <granroth@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License version 2 as published by the Free Software Foundation. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 00019 */ 00020 00021 #ifndef __kxmlguifactory_h__ 00022 #define __kxmlguifactory_h__ 00023 00024 #include <qobject.h> 00025 #include <qptrlist.h> 00026 #include <qdom.h> 00027 #include <qvaluelist.h> 00028 00029 #include <kdelibs_export.h> 00030 00031 class KAction; 00032 class KXMLGUIFactoryPrivate; 00033 class KXMLGUIClient; 00034 class KXMLGUIBuilder; 00035 class KInstance; 00036 00037 namespace KXMLGUI 00038 { 00039 struct MergingIndex; 00040 struct ContainerNode; 00041 struct ContainerClient; 00042 class BuildHelper; 00043 } 00044 00062 class KDEUI_EXPORT KXMLGUIFactory : public QObject 00063 { 00064 friend class KXMLGUI::BuildHelper; 00065 Q_OBJECT 00066 public: 00074 KXMLGUIFactory( KXMLGUIBuilder *builder, QObject *parent = 0, const char *name = 0 ); 00075 00079 ~KXMLGUIFactory(); 00080 00081 // XXX move to somewhere else? (Simon) 00082 static QString readConfigFile( const QString &filename, bool never_null, const KInstance *instance = 0 ); 00083 static QString readConfigFile( const QString &filename, const KInstance *instance = 0 ); 00084 static bool saveConfigFile( const QDomDocument& doc, const QString& filename, 00085 const KInstance *instance = 0 ); 00086 00087 static QString documentToXML( const QDomDocument& doc ); 00088 static QString elementToXML( const QDomElement& elem ); 00089 00093 static void removeDOMComments( QDomNode &node ); 00094 00099 static QDomElement actionPropertiesElement( QDomDocument& doc ); 00100 00106 static QDomElement findActionByName( QDomElement& elem, const QString& sName, bool create ); 00107 00118 void addClient( KXMLGUIClient *client ); 00119 00125 void removeClient( KXMLGUIClient *client ); 00126 00127 void plugActionList( KXMLGUIClient *client, const QString &name, const QPtrList<KAction> &actionList ); 00128 void unplugActionList( KXMLGUIClient *client, const QString &name ); 00129 00133 QPtrList<KXMLGUIClient> clients() const; 00134 00155 QWidget *container( const QString &containerName, KXMLGUIClient *client, bool useTagName = false ); 00156 00157 QPtrList<QWidget> containers( const QString &tagName ); 00158 00167 void reset(); 00168 00178 void resetContainer( const QString &containerName, bool useTagName = false ); 00179 00180 public slots: 00196 int configureShortcuts(bool bAllowLetterShortcuts = true, bool bSaveSettings = true); 00197 00198 signals: 00199 void clientAdded( KXMLGUIClient *client ); 00200 void clientRemoved( KXMLGUIClient *client ); 00201 00202 private: 00203 00204 QWidget *findRecursive( KXMLGUI::ContainerNode *node, bool tag ); 00205 00206 QPtrList<QWidget> findRecursive( KXMLGUI::ContainerNode *node, const QString &tagName ); 00207 00208 void applyActionProperties( const QDomElement &element ); 00209 void configureAction( KAction *action, const QDomNamedNodeMap &attributes ); 00210 void configureAction( KAction *action, const QDomAttr &attribute ); 00211 00212 protected: 00213 virtual void virtual_hook( int id, void* data ); 00214 private: 00215 KXMLGUIFactoryPrivate *d; 00216 }; 00217 00218 #endif 00219 /* vim: et sw=4 00220 */
KDE Logo
This file is part of the documentation for kdeui Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Apr 14 00:10:18 2005 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003