• Skip to content
  • Skip to link menu
KDE 4.3 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 
00079   virtual ~KXMLGUIClient();
00080 
00086   QAction* action( const char* name ) const;
00087 
00093   virtual QAction *action( const QDomElement &element ) const;
00094 
00098   virtual KActionCollection* actionCollection() const;
00099 
00103   virtual KComponentData componentData() const;
00104 
00110   virtual QDomDocument domDocument() const;
00111 
00125   virtual QString xmlFile() const;
00126 
00127   virtual QString localXMLFile() const;
00128 
00132   void setXMLGUIBuildDocument( const QDomDocument &doc );
00136   QDomDocument xmlguiBuildDocument() const;
00137 
00142   void setFactory( KXMLGUIFactory *factory );
00148   KXMLGUIFactory *factory() const;
00149 
00155   KXMLGUIClient *parentClient() const;
00156 
00163   void insertChildClient( KXMLGUIClient *child );
00164 
00168   void removeChildClient( KXMLGUIClient *child );
00169 
00173   QList<KXMLGUIClient*> childClients();
00174 
00183   void setClientBuilder( KXMLGUIBuilder *builder );
00184 
00189   KXMLGUIBuilder *clientBuilder() const;
00190 
00198   void reloadXML();
00199 
00243   void plugActionList( const QString &name, const QList<QAction*> &actionList );
00244 
00252   void unplugActionList( const QString &name );
00253 
00254   static QString findMostRecentXMLFile( const QStringList &files, QString &doc );
00255 
00256   void addStateActionEnabled(const QString& state, const QString& action);
00257 
00258   void addStateActionDisabled(const QString& state, const QString& action);
00259 
00260   enum ReverseStateChange { StateNoReverse, StateReverse };
00261   struct StateChange
00262   {
00263     QStringList actionsToEnable;
00264     QStringList actionsToDisable;
00265   };
00266 
00267   StateChange getActionsToChangeForState(const QString& state);
00268 
00269   void beginXMLPlug( QWidget * );
00270   void endXMLPlug();
00271   void prepareXMLUnplug( QWidget * );
00272 
00273 protected:
00278   //bool addSuperClient( KXMLGUIClient * );
00279 
00286   virtual void setComponentData(const KComponentData &componentData);
00287 
00304   virtual void setXMLFile( const QString& file, bool merge = false, bool setXMLDoc = true );
00305 
00311   virtual void setLocalXMLFile( const QString &file );
00312 
00319   virtual void setXML( const QString &document, bool merge = false );
00320 
00327   virtual void setDOMDocument( const QDomDocument &document, bool merge = false );
00328 
00340    virtual void stateChanged(const QString &newstate, ReverseStateChange reverse = StateNoReverse);
00341 
00342 protected:
00343   virtual void virtual_hook( int id, void* data );
00344 
00345 private:
00346   KXMLGUIClientPrivate * const d;
00347 };
00348 
00349 #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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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