home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kxmlguibuilder.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  3.0 KB  |  97 lines

  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 <qdom.h>
  24. #include <qstringlist.h>
  25.  
  26. #include <kdelibs_export.h>
  27.  
  28. class KXMLGUIBuilderPrivate;
  29. class QWidget;
  30. class KInstance;
  31. class KXMLGUIClient;
  32.  
  33. /**
  34.  * Abstract interface for a "GUI builder", used by the GUIFactory
  35.  * This interface is implemented by KMainWindow for the case where
  36.  * the toplevel widget is a KMainWindow. Other implementations may appear
  37.  * in the future (dialogs for instance)
  38.  */
  39. class KDEUI_EXPORT KXMLGUIBuilder
  40. {
  41.  public:
  42.  
  43.   KXMLGUIBuilder( QWidget *widget );
  44.   virtual ~KXMLGUIBuilder();
  45.  
  46.   /* @internal */
  47.   KXMLGUIClient *builderClient() const;
  48.   /* @internal */
  49.   void setBuilderClient( KXMLGUIClient *client );
  50.   /* @internal */
  51.   KInstance *builderInstance() const;
  52.   /* @internal */
  53.   void setBuilderInstance( KInstance *instance );
  54.   /* @internal */
  55.   QWidget *widget();
  56.  
  57.   virtual QStringList containerTags() const;
  58.  
  59.   /**
  60.    * Creates a container (menubar/menu/toolbar/statusbar/separator/...)
  61.    * from an element in the XML file
  62.    *
  63.    * @param parent The parent for the container
  64.    * @param index The index where the container should be inserted
  65.    *              into the parent container/widget
  66.    * @param element The element from the DOM tree describing the
  67.    *                container (use it to access container specified
  68.    *                attributes or child elements)
  69.    * @param id The id to be used for this container
  70.    */
  71.   virtual QWidget *createContainer( QWidget *parent, int index,
  72.           const QDomElement &element, int &id );
  73.  
  74.   /**
  75.    * Removes the given (and previously via createContainer )
  76.    * created container.
  77.    *
  78.    */
  79.   virtual void removeContainer( QWidget *container, QWidget *parent,
  80.                 QDomElement &element, int id );
  81.  
  82.   virtual QStringList customTags() const;
  83.  
  84.   virtual int createCustomElement( QWidget *parent, int index, const QDomElement &element );
  85.  
  86.   virtual void removeCustomElement( QWidget *parent, int id );
  87.  
  88.   virtual void finalizeGUI( KXMLGUIClient *client );
  89.  
  90. protected:
  91.   virtual void virtual_hook( int id, void* data );
  92. private:
  93.   KXMLGUIBuilderPrivate *d;
  94. };
  95.  
  96. #endif
  97.