~ubuntu-branches/ubuntu/gutsy/kde4libs/gutsy

« back to all changes in this revision

Viewing changes to kdeui/kxmlguibuilder.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-02-21 11:00:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070221110012-6kw8khr9knv6lmg1
Tags: 3.80.3-0ubuntu1
New upstream unstable release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* This file is part of the KDE project
2
 
   Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
3
 
                      David Faure <faure@kde.org>
4
 
 
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.
9
 
 
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.
14
 
 
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.
19
 
*/
20
 
#ifndef kxmlguibuilder_h
21
 
#define kxmlguibuilder_h
22
 
 
23
 
#include <kdelibs_export.h>
24
 
 
25
 
class KInstance;
26
 
class KXMLGUIBuilderPrivate;
27
 
class KXMLGUIClient;
28
 
 
29
 
class QAction;
30
 
class QDomElement;
31
 
class QStringList;
32
 
class QWidget;
33
 
 
34
 
/**
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)
39
 
 */
40
 
class KDEUI_EXPORT KXMLGUIBuilder
41
 
{
42
 
 public:
43
 
 
44
 
  explicit KXMLGUIBuilder( QWidget *widget );
45
 
  virtual ~KXMLGUIBuilder();
46
 
 
47
 
  /* @internal */
48
 
  KXMLGUIClient *builderClient() const;
49
 
  /* @internal */
50
 
  void setBuilderClient( KXMLGUIClient *client );
51
 
  /* @internal */
52
 
  KInstance *builderInstance() const;
53
 
  /* @internal */
54
 
  void setBuilderInstance( KInstance *instance );
55
 
  /* @internal */
56
 
  QWidget *widget();
57
 
 
58
 
  virtual QStringList containerTags() const;
59
 
 
60
 
  /**
61
 
   * Creates a container (menubar/menu/toolbar/statusbar/separator/...)
62
 
   * from an element in the XML file
63
 
   *
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
71
 
   */
72
 
  virtual QWidget *createContainer( QWidget *parent, int index,
73
 
          const QDomElement &element, int &id );
74
 
 
75
 
  /**
76
 
   * Removes the given (and previously via createContainer )
77
 
   * created container.
78
 
   *
79
 
   */
80
 
  virtual void removeContainer( QWidget *container, QWidget *parent,
81
 
                                QDomElement &element, int id );
82
 
 
83
 
  virtual QStringList customTags() const;
84
 
 
85
 
  virtual QAction* createCustomElement( QWidget *parent, int index, const QDomElement &element );
86
 
 
87
 
  virtual void removeCustomElement( QWidget *parent, QAction* action );
88
 
 
89
 
  virtual void finalizeGUI( KXMLGUIClient *client );
90
 
 
91
 
protected:
92
 
  virtual void virtual_hook( int id, void* data );
93
 
private:
94
 
  KXMLGUIBuilderPrivate *d;
95
 
};
96
 
 
97
 
#endif
98