• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

kxmlguiclient.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
00003    Copyright (C) 2000 Kurt Granroth <granroth@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 #ifndef KXMLGUICLIENT_H
00020 #define KXMLGUICLIENT_H
00021 
00022 #include <kdeui_export.h>
00023 
00024 #include <QtCore/QMap>
00025 #include <QtCore/QStringList>
00026 
00027 class QDomDocument;
00028 class QDomElement;
00029 class QWidget;
00030 
00031 class QAction;
00032 class KActionCollection;
00033 class KComponentData;
00034 class KXMLGUIClientPrivate;
00035 class KXMLGUIFactory;
00036 class KXMLGUIBuilder;
00037 
00038 namespace KDEPrivate { class KEditToolBarWidget; }
00039 
00046 class KDEUI_EXPORT KXMLGUIClient
00047 {
00048     friend class KDEPrivate::KEditToolBarWidget; // for setXMLFile(3 args)
00049 public:
00055   KXMLGUIClient();
00056 
00068   explicit KXMLGUIClient( KXMLGUIClient *parent );
00069 
00073   virtual ~KXMLGUIClient();
00074 
00080   QAction* action( const char* name ) const;
00081 
00087   virtual QAction *action( const QDomElement &element ) const;
00088 
00092   virtual KActionCollection* actionCollection() const;
00093 
00097   virtual KComponentData componentData() const;
00098 
00104   virtual QDomDocument domDocument() const;
00105 
00119   virtual QString xmlFile() const;
00120 
00121   virtual QString localXMLFile() const;
00122 
00126   void setXMLGUIBuildDocument( const QDomDocument &doc );
00130   QDomDocument xmlguiBuildDocument() const;
00131 
00136   void setFactory( KXMLGUIFactory *factory );
00142   KXMLGUIFactory *factory() const;
00143 
00149   KXMLGUIClient *parentClient() const;
00150 
00157   void insertChildClient( KXMLGUIClient *child );
00158 
00162   void removeChildClient( KXMLGUIClient *child );
00163 
00167   QList<KXMLGUIClient*> childClients();
00168 
00177   void setClientBuilder( KXMLGUIBuilder *builder );
00178 
00183   KXMLGUIBuilder *clientBuilder() const;
00184 
00192   void reloadXML();
00193 
00237   void plugActionList( const QString &name, const QList<QAction*> &actionList );
00238 
00246   void unplugActionList( const QString &name );
00247 
00248   static QString findMostRecentXMLFile( const QStringList &files, QString &doc );
00249 
00250   void addStateActionEnabled(const QString& state, const QString& action);
00251 
00252   void addStateActionDisabled(const QString& state, const QString& action);
00253 
00254   enum ReverseStateChange { StateNoReverse, StateReverse };
00255   struct StateChange
00256   {
00257     QStringList actionsToEnable;
00258     QStringList actionsToDisable;
00259   };
00260 
00261   StateChange getActionsToChangeForState(const QString& state);
00262 
00263   void beginXMLPlug( QWidget * );
00264   void endXMLPlug();
00265   void prepareXMLUnplug( QWidget * );
00266 
00267 protected:
00272   //bool addSuperClient( KXMLGUIClient * );
00273 
00280   virtual void setComponentData(const KComponentData &componentData);
00281 
00298   virtual void setXMLFile( const QString& file, bool merge = false, bool setXMLDoc = true );
00299 
00305   virtual void setLocalXMLFile( const QString &file );
00306 
00313   virtual void setXML( const QString &document, bool merge = false );
00314 
00321   virtual void setDOMDocument( const QDomDocument &document, bool merge = false );
00322 
00334    virtual void stateChanged(const QString &newstate, ReverseStateChange reverse = StateNoReverse);
00335 
00336 protected:
00337   virtual void virtual_hook( int id, void* data );
00338 
00339 private:
00340   KXMLGUIClientPrivate * const d;
00341 };
00342 
00343 #endif

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal