kdeui Library API Documentation

keditcl.h

00001 /* This file is part of the KDE libraries 00002 00003 Copyright (C) 1996 Bernd Johannes Wuebben <wuebben@math.cornell.edu> 00004 Copyright (C) 2000 Waldo Bastian <bastian@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 00020 */ 00021 #ifndef __KEDITCL_H__ 00022 #define __KEDITCL_H__ 00023 00024 #include <qmultilineedit.h> 00025 #include <qstring.h> 00026 #include <kdialogbase.h> 00027 00028 class QDropEvent; 00029 class QPushButton; 00030 class QCheckBox; 00031 class QRadioButton; 00032 class QTextStream; 00033 class KHistoryCombo; 00034 class KIntNumInput; 00035 class QVButtonGroup; 00036 00037 class KEdGotoLine : public KDialogBase 00038 { 00039 Q_OBJECT 00040 00041 public: 00042 KEdGotoLine( QWidget *parent=0, const char *name=0, bool modal=true ); 00043 int getLineNumber(); 00044 00045 public slots: 00046 void selected( int ); 00047 00048 private: 00049 KIntNumInput *lineNum; 00050 00051 protected: 00052 virtual void virtual_hook( int id, void* data ); 00053 private: 00054 class KEdGotoLinePrivate; 00055 KEdGotoLinePrivate *d; 00056 }; 00057 00059 class KEdFind : public KDialogBase 00060 { 00061 Q_OBJECT 00062 Q_PROPERTY( QString text READ getText WRITE setText ) 00063 Q_PROPERTY( bool caseSensitivity READ case_sensitive WRITE setCaseSensitive ) 00064 Q_PROPERTY( bool direction READ get_direction WRITE setDirection ) 00065 public: 00066 00067 KEdFind( QWidget *parent = 0, const char *name=0, bool modal=true); 00068 ~KEdFind(); 00069 00070 QString getText() const; 00071 void setText(QString string); 00072 void setCaseSensitive( bool b ); 00073 bool case_sensitive() const; 00074 void setDirection( bool b ); 00075 bool get_direction() const; 00076 00081 KHistoryCombo *searchCombo() const; 00082 00083 protected slots: 00084 void slotCancel( void ); 00085 void slotUser1( void ); 00086 void textSearchChanged ( const QString & ); 00087 00088 protected: 00089 QVButtonGroup* group; 00090 00091 private: 00092 QCheckBox *sensitive; 00093 QCheckBox *direction; 00094 00095 virtual void done(int i ) { KDialogBase::done(i); } 00096 00097 signals: 00098 00099 void search(); 00100 void done(); 00101 protected: 00102 virtual void virtual_hook( int id, void* data ); 00103 private: 00104 class KEdFindPrivate; 00105 KEdFindPrivate *d; 00106 }; 00107 00109 class KEdReplace : public KDialogBase 00110 { 00111 Q_OBJECT 00112 00113 public: 00114 00115 KEdReplace ( QWidget *parent = 0, const char *name=0, bool modal=true ); 00116 ~KEdReplace(); 00117 00118 QString getText(); 00119 QString getReplaceText(); 00120 void setText(QString); 00121 00126 KHistoryCombo *searchCombo() const; 00127 00132 KHistoryCombo *replaceCombo() const; 00133 00134 bool case_sensitive(); 00135 bool get_direction(); 00136 00137 protected slots: 00138 void slotCancel( void ); 00139 void slotClose( void ); 00140 void slotUser1( void ); 00141 void slotUser2( void ); 00142 void slotUser3( void ); 00143 void textSearchChanged ( const QString & ); 00144 00145 private: 00146 QCheckBox *sensitive; 00147 QCheckBox *direction; 00148 00149 virtual void done(int i ) { KDialogBase::done(i); } 00150 00151 signals: 00152 void replace(); 00153 void find(); 00154 void replaceAll(); 00155 void done(); 00156 protected: 00157 virtual void virtual_hook( int id, void* data ); 00158 private: 00159 class KEdReplacePrivate; 00160 KEdReplacePrivate *d; 00161 }; 00162 00163 00171 class KDE_DEPRECATED KEdit : public QMultiLineEdit 00172 { 00173 Q_OBJECT 00174 00175 public: 00179 KEdit (QWidget *_parent=NULL, const char *name=NULL); 00180 00181 ~KEdit(); 00182 00187 enum { NONE, 00188 FORWARD, 00189 BACKWARD }; 00193 void insertText(QTextStream *); 00194 00201 void saveText(QTextStream *, bool softWrap); 00202 void saveText(QTextStream *); // KDE 4.0: remove 00203 00208 void selectFont(); 00209 00213 void search(); 00214 00223 bool repeatSearch(); 00224 00228 void replace(); 00229 00233 void doGotoLine(); 00234 00238 void cleanWhiteSpace(); 00239 00245 void installRBPopup( QPopupMenu* ); 00246 00252 int currentLine(); 00253 00263 int currentColumn(); 00264 00265 00269 void spellcheck_start(); 00270 00274 void spellcheck_stop(); 00275 00282 void setOverwriteEnabled(bool b); 00283 00284 QString selectWordUnderCursor(); 00285 00286 QPopupMenu *createPopupMenu( const QPoint& pos ); 00287 00288 signals: 00295 void gotUrlDrop(QDropEvent* e); 00296 00302 void CursorPositionChanged(); 00303 00313 void toggle_overwrite_signal(); 00314 00315 public slots: 00319 void corrected (const QString &originalword, const QString &newword, unsigned int pos); 00323 void misspelling (const QString &word, const QStringList &, unsigned int pos); 00324 private slots: 00325 00330 void search_slot(); 00331 00335 void searchdone_slot(); 00336 00340 void replace_slot(); 00341 00345 void replace_all_slot(); 00346 00350 void replace_search_slot(); 00351 00355 void replacedone_slot(); 00356 00360 void slotCursorPositionChanged(); 00361 00362 protected: 00363 void computePosition(); 00364 int doSearch(QString s_pattern, bool case_sensitive, 00365 bool regex, bool forward,int line, int col); 00366 00367 int doReplace(QString s_pattern, bool case_sensitive, 00368 bool regex, bool forward,int line, int col,bool replace); 00369 00373 void posToRowCol(unsigned int pos, unsigned int &line, unsigned int &col); 00374 00378 virtual void create( WId = 0, bool initializeWindow = true, 00379 bool destroyOldWindow = true ); 00380 00381 00382 protected: 00383 00384 void keyPressEvent ( QKeyEvent * ); 00385 00386 // DnD interface 00387 void dragMoveEvent(QDragMoveEvent* e); 00388 void dragEnterEvent(QDragEnterEvent* e); 00389 void dropEvent(QDropEvent* e); 00390 void contentsDragMoveEvent(QDragMoveEvent* e); 00391 void contentsDragEnterEvent(QDragEnterEvent* e); 00392 void contentsDropEvent(QDropEvent* e); 00393 00394 private: 00395 QTimer* repaintTimer; 00396 00397 QString killbufferstring; 00398 QWidget *parent; 00399 KEdFind *srchdialog; 00400 KEdReplace *replace_dialog; 00401 KEdGotoLine *gotodialog; 00402 00403 QString pattern; 00404 00405 bool can_replace; 00406 bool killing; 00407 bool killtrue; 00408 bool lastwasanewline; 00409 bool saved_readonlystate; 00410 int last_search; 00411 int last_replace; 00412 int replace_all_line; 00413 int replace_all_col; 00414 00415 int line_pos, col_pos; 00416 bool fill_column_is_set; 00417 bool word_wrap_is_set; 00418 int fill_column_value; 00419 00420 protected: 00421 virtual void virtual_hook( int id, void* data ); 00422 private: 00423 class KEditPrivate; 00424 KEditPrivate *d; 00425 }; 00426 00427 #endif
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Aug 30 22:53:56 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003