1
/* This file is part of the KDE project
2
Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
3
David Faure <faure@kde.org>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
Boston, MA 02110-1301, USA.
20
#ifndef kxmlguibuilder_h
21
#define kxmlguibuilder_h
23
#include <kdelibs_export.h>
26
class KXMLGUIBuilderPrivate;
35
* Abstract interface for a "GUI builder", used by the GUIFactory
36
* This interface is implemented by KMainWindow for the case where
37
* the toplevel widget is a KMainWindow. Other implementations may appear
38
* in the future (dialogs for instance)
40
class KDEUI_EXPORT KXMLGUIBuilder
44
explicit KXMLGUIBuilder( QWidget *widget );
45
virtual ~KXMLGUIBuilder();
48
KXMLGUIClient *builderClient() const;
50
void setBuilderClient( KXMLGUIClient *client );
52
KInstance *builderInstance() const;
54
void setBuilderInstance( KInstance *instance );
58
virtual QStringList containerTags() const;
61
* Creates a container (menubar/menu/toolbar/statusbar/separator/...)
62
* from an element in the XML file
64
* @param parent The parent for the container
65
* @param index The index where the container should be inserted
66
* into the parent container/widget
67
* @param element The element from the DOM tree describing the
68
* container (use it to access container specified
69
* attributes or child elements)
70
* @param id The id to be used for this container
72
virtual QWidget *createContainer( QWidget *parent, int index,
73
const QDomElement &element, int &id );
76
* Removes the given (and previously via createContainer )
80
virtual void removeContainer( QWidget *container, QWidget *parent,
81
QDomElement &element, int id );
83
virtual QStringList customTags() const;
85
virtual QAction* createCustomElement( QWidget *parent, int index, const QDomElement &element );
87
virtual void removeCustomElement( QWidget *parent, QAction* action );
89
virtual void finalizeGUI( KXMLGUIClient *client );
92
virtual void virtual_hook( int id, void* data );
94
KXMLGUIBuilderPrivate *d;