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 / kate / pluginconfiginterfaceextension.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-01-15  |  2.7 KB  |  105 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License version 2 as published by the Free Software Foundation.
  7.  
  8.    This library is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  11.    Library General Public License for more details.
  12.  
  13.    You should have received a copy of the GNU Library General Public License
  14.    along with this library; see the file COPYING.LIB.  If not, write to
  15.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16.    Boston, MA 02110-1301, USA.
  17. */
  18.  
  19. #ifndef __kate_pluginconfiginterfaceextension_h__
  20. #define __kate_pluginconfiginterfaceextension_h__
  21.  
  22. #include <qwidget.h>
  23. #include <qpixmap.h>
  24. #include <kicontheme.h>
  25.  
  26. namespace Kate
  27. {
  28.  
  29. class KDE_EXPORT PluginConfigPage : public QWidget
  30. {
  31.   Q_OBJECT
  32.  
  33.   public:
  34.     PluginConfigPage ( QWidget *parent=0, const char *name=0 );
  35.     virtual ~PluginConfigPage ();
  36.  
  37.   //
  38.   // slots !!!
  39.   //
  40.   public:
  41.     /**
  42.       Applies the changes to the document
  43.     */
  44.     virtual void apply () = 0;
  45.     
  46.     /**
  47.       Reset the changes
  48.     */
  49.     virtual void reset () = 0;
  50.     
  51.     /**
  52.       Sets default options
  53.     */
  54.     virtual void defaults () = 0;
  55.  
  56.   signals:
  57.     void changed();
  58. };
  59.  
  60. /*
  61. *  This is an interface for the KTextEditor::Document/Plugin/ViewPlugin classes !!!
  62. */
  63. class KDE_EXPORT PluginConfigInterfaceExtension
  64. {
  65.   friend class PrivatePluginConfigInterfaceExtension;
  66.  
  67.   public:
  68.     PluginConfigInterfaceExtension();
  69.     virtual ~PluginConfigInterfaceExtension();
  70.  
  71.     unsigned int pluginConfigInterfaceExtensionNumber () const;
  72.  
  73.   //
  74.   // slots !!!
  75.   //
  76.   public:    
  77.     /**
  78.       Number of available config pages
  79.     */
  80.     virtual uint configPages () const = 0;
  81.     
  82.     /**
  83.       returns config page with the given number,
  84.       config pages from 0 to configPages()-1 are available
  85.       if configPages() > 0
  86.     */ 
  87.     virtual PluginConfigPage *configPage (uint number = 0, QWidget *parent = 0, const char *name=0 ) = 0;
  88.   
  89.     virtual QString configPageName (uint number = 0) const = 0;
  90.     virtual QString configPageFullName (uint number = 0) const = 0;
  91.     virtual QPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const = 0;    
  92.     
  93.   private:
  94.     class PrivatePluginConfigInterfaceExtension *d;
  95.     static unsigned int globalPluginConfigInterfaceExtensionNumber;
  96.     unsigned int myPluginConfigInterfaceExtensionNumber;
  97. };
  98.  
  99. class Plugin;
  100. KDE_EXPORT PluginConfigInterfaceExtension *pluginConfigInterfaceExtension (Plugin *plugin);
  101.  
  102. }
  103.  
  104. #endif
  105.