configinterfaceextension.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #ifndef __ktexteditor_configinterfaceextension_h__
00020 #define __ktexteditor_configinterfaceextension_h__
00021 
00022 #include <qwidget.h>
00023 #include <qpixmap.h>
00024 #include <kicontheme.h>
00025 
00026 namespace KTextEditor
00027 {
00028 
00029 class KTEXTEDITOR_EXPORT ConfigPage : public QWidget
00030 {
00031   Q_OBJECT
00032 
00033   public:
00034     ConfigPage ( QWidget *parent=0, const char *name=0 );
00035     virtual ~ConfigPage ();
00036 
00037   //
00038   // slots !!!
00039   //
00040   public:
00044     virtual void apply () = 0;
00045     
00049     virtual void reset () = 0;
00050     
00054     virtual void defaults () = 0;
00055 
00056   signals:
00060     void changed();
00061 };
00062 
00067 class KTEXTEDITOR_EXPORT ConfigInterfaceExtension
00068 {
00069   friend class PrivateConfigInterfaceExtension;
00070 
00071   public:
00072     ConfigInterfaceExtension();
00073     virtual ~ConfigInterfaceExtension();
00074 
00075     unsigned int configInterfaceExtensionNumber () const;
00076     
00077   protected:  
00078     void setConfigInterfaceExtensionDCOPSuffix (const QCString &suffix); 
00079 
00080   //
00081   // slots !!!
00082   //
00083   public:
00087     virtual uint configPages () const = 0;
00088     
00094     virtual ConfigPage *configPage (uint number = 0, QWidget *parent = 0, const char *name=0 ) = 0;
00095   
00096     virtual QString configPageName (uint number = 0) const = 0;
00097     virtual QString configPageFullName (uint number = 0) const = 0;
00098     virtual QPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const = 0;
00099     
00100     
00101   private:
00102     class PrivateConfigInterfaceExtension *d;
00103     static unsigned int globalConfigInterfaceExtensionNumber;
00104     unsigned int myConfigInterfaceExtensionNumber;
00105 };
00106 
00107 class Document;
00108 class Plugin;
00109 class ViewPlugin;
00110 
00111 KTEXTEDITOR_EXPORT ConfigInterfaceExtension *configInterfaceExtension (Document *doc);
00112 KTEXTEDITOR_EXPORT ConfigInterfaceExtension *configInterfaceExtension (Plugin *plugin);
00113 
00114 }
00115 
00116 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys