kxmlguifactory.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
class KAction;
00030
class KXMLGUIFactoryPrivate;
00031
class KXMLGUIClient;
00032
class KXMLGUIBuilder;
00033
class KInstance;
00034
00035
namespace KXMLGUI
00036 {
00037
struct MergingIndex;
00038
class ContainerNode;
00039
class ContainerClient;
00040
class BuildHelper;
00041 }
00042
00060 class KXMLGUIFactory :
public QObject
00061 {
00062
friend class KXMLGUI::BuildHelper;
00063 Q_OBJECT
00064
public:
00072
KXMLGUIFactory(
KXMLGUIBuilder *builder,
QObject *parent = 0,
const char *name = 0 );
00073
00077
~KXMLGUIFactory();
00078
00079
00080
static QString readConfigFile(
const QString &filename,
bool never_null,
const KInstance *instance = 0 );
00081
static QString readConfigFile(
const QString &filename,
const KInstance *instance = 0 );
00082
static bool saveConfigFile(
const QDomDocument& doc,
const QString& filename,
00083
const KInstance *instance = 0 );
00084
00085
static QString documentToXML(
const QDomDocument& doc );
00086
static QString elementToXML(
const QDomElement& elem );
00087
00091
static void removeDOMComments(
QDomNode &node );
00092
00097
static QDomElement actionPropertiesElement(
QDomDocument& doc );
00098
00104
static QDomElement findActionByName(
QDomElement& elem,
const QString& sName,
bool create );
00105
00116
void addClient(
KXMLGUIClient *client );
00117
00123
void removeClient(
KXMLGUIClient *client );
00124
00125
void plugActionList(
KXMLGUIClient *client,
const QString &name,
const QPtrList<KAction> &actionList );
00126
void unplugActionList(
KXMLGUIClient *client,
const QString &name );
00127
00131
QPtrList<KXMLGUIClient> clients()
const;
00132
00153
QWidget *
container(
const QString &containerName,
KXMLGUIClient *client,
bool useTagName =
false );
00154
00155
QPtrList<QWidget> containers(
const QString &tagName );
00156
00165
void reset();
00166
00176
void resetContainer(
const QString &containerName,
bool useTagName =
false );
00177
00178
public slots:
00194
int configureShortcuts(
bool bAllowLetterShortcuts =
true,
bool bSaveSettings =
true);
00195
00196 signals:
00197
void clientAdded(
KXMLGUIClient *client );
00198
void clientRemoved(
KXMLGUIClient *client );
00199
00200
private:
00201
00202
QWidget *findRecursive( KXMLGUI::ContainerNode *node,
bool tag );
00203
00204
QPtrList<QWidget> findRecursive( KXMLGUI::ContainerNode *node,
const QString &tagName );
00205
00206
void applyActionProperties(
const QDomElement &element );
00207
void configureAction(
KAction *action,
const QDomNamedNodeMap &attributes );
00208
void configureAction(
KAction *action,
const QDomAttr &attribute );
00209
00210
protected:
00211
virtual void virtual_hook(
int id,
void* data );
00212
private:
00213 KXMLGUIFactoryPrivate *d;
00214 };
00215
00216
#endif
00217
00218
This file is part of the documentation for kdeui Library Version 3.3.1.