interfaces Library API Documentation

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., 59 Temple Place - Suite 330,
00016    Boston, MA 02111-1307, 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 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 
00057 /*
00058 *  This is an interface for the KTextEditor::Document/Plugin/ViewPlugin classes !!!
00059 */
00060 class ConfigInterfaceExtension
00061 {
00062   friend class PrivateConfigInterfaceExtension;
00063 
00064   public:
00065     ConfigInterfaceExtension();
00066     virtual ~ConfigInterfaceExtension();
00067 
00068     unsigned int configInterfaceExtensionNumber () const;
00069     
00070   protected:  
00071     void setConfigInterfaceExtensionDCOPSuffix (const QCString &suffix); 
00072 
00073   //
00074   // slots !!!
00075   //
00076   public:
00080     virtual uint configPages () const = 0;
00081     
00087     virtual ConfigPage *configPage (uint number = 0, QWidget *parent = 0, const char *name=0 ) = 0;
00088   
00089     virtual QString configPageName (uint number = 0) const = 0;
00090     virtual QString configPageFullName (uint number = 0) const = 0;
00091     virtual QPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const = 0;
00092     
00093     
00094   private:
00095     class PrivateConfigInterfaceExtension *d;
00096     static unsigned int globalConfigInterfaceExtensionNumber;
00097     unsigned int myConfigInterfaceExtensionNumber;
00098 };
00099 
00100 class Document;
00101 class Plugin;
00102 class ViewPlugin;
00103 
00104 ConfigInterfaceExtension *configInterfaceExtension (Document *doc);
00105 ConfigInterfaceExtension *configInterfaceExtension (Plugin *plugin);
00106 
00107 }
00108 
00109 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:30:49 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001