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 / kspelldlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.7 KB  |  115 lines

  1. /* This file is part of the KDE libraries
  2.    Copyright (C) 1997 David Sweet <dsweet@kde.org>
  3.    Copyright (C) 2000 Rik Hemsley <rik@kde.org>
  4.    Copyright (C) 2003 Zack Rusin  <zack@kde.org>
  5.  
  6.    This library is free software; you can redistribute it and/or
  7.    modify it under the terms of the GNU Library General Public
  8.    License version 2 as published by the Free Software Foundation.
  9.  
  10.    This library is distributed in the hope that it will be useful,
  11.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.    Library General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU Library General Public License
  16.    along with this library; see the file COPYING.LIB.  If not, write to
  17.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.    Boston, MA 02110-1301, USA.
  19. */
  20. #ifndef __KSPELLDLG_H__
  21. #define __KSPELLDLG_H__
  22.  
  23. #include <kdialogbase.h>
  24.  
  25. class QStringList;
  26. class QLabel;
  27. class QListViewItem;
  28. class QPushButton;
  29. class KListBox;
  30. class KLineEdit;
  31. class KProgress;
  32.  
  33. //Possible result codes
  34. enum KS_RESULT {
  35.   KS_CANCEL=     0,
  36.   KS_REPLACE=    1,
  37.   KS_REPLACEALL= 2,
  38.   KS_IGNORE=     3,
  39.   KS_IGNOREALL=  4,
  40.   KS_ADD=        5,
  41.   KS_STOP=       7,
  42.   KS_SUGGEST=    8,
  43.   KS_CONFIG=     9
  44. };
  45.  
  46. class KDEUI_EXPORT KSpellDlg : public KDialogBase
  47. {
  48.   Q_OBJECT
  49.  
  50.   class KSpellDlgPrivate;
  51.   KSpellDlgPrivate *d;
  52.   KLineEdit *editbox;
  53.   KProgress *progbar;
  54.   KListBox *listbox;
  55.   QStringList *sugg;
  56.   QPushButton *qpbrep, *qpbrepa;
  57.   QLabel *wordlabel;
  58.   QString word, newword;
  59.   bool progressbar;
  60.  
  61. public:
  62.   KSpellDlg( QWidget *parent, const char *name,
  63.          bool _progressbar = false, bool _modal = false );
  64.   ~KSpellDlg();
  65.  
  66.   QString replacement() const
  67.     { return newword; }
  68.  
  69.   /**
  70.    * Change the misspelled word and suggested replacements
  71.    *  and enable the disabled buttons on the dialog box.
  72.    * (Buttons are disabled by standby().)
  73.    **/
  74.   void init( const QString& _word, QStringList* _sugg );
  75.   void init( const QString& _word, QStringList* _sugg,
  76.              const QString& context );
  77.  
  78.   void standby() { emit ready( false ); }
  79.  
  80.   public slots:
  81.   /**
  82.    * Adjust the progress bar to @p p percent.
  83.    **/
  84.   void slotProgress( unsigned int p );
  85.  
  86. protected:
  87.   virtual void closeEvent( QCloseEvent * e );
  88.   void done( int i );
  89.  
  90.  signals:
  91.     /**
  92.       This signal is emitted when a button is pressed.
  93.       */
  94.   void command( int );
  95.  
  96.   void ready( bool );
  97.  
  98. protected slots:
  99.   void ignore();
  100.   void add();
  101.   void ignoreAll();
  102.   void cancel();
  103.   void replace();
  104.   void replaceAll();
  105.   void suggest();
  106.   void stop();
  107.   void slotConfigChanged();
  108.  
  109.   void textChanged( const QString & );
  110.  
  111.   void slotSelectionChanged( QListViewItem* item );
  112. };
  113.  
  114. #endif
  115.