• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kutils
 

kutils

  • kutils
kfinddialog.cpp
1 /*
2  Copyright (C) 2001, S.R.Haque <srhaque@iee.org>.
3  Copyright (C) 2002, David Faure <david@mandrakesoft.com>
4  This file is part of the KDE project
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 
21 #include "kfinddialog.h"
22 #include <tqcheckbox.h>
23 #include <tqcursor.h>
24 #include <tqgroupbox.h>
25 #include <tqlabel.h>
26 #include <tqlayout.h>
27 #include <tqpopupmenu.h>
28 #include <tqpushbutton.h>
29 #include <tqregexp.h>
30 #include <kcombobox.h>
31 #include <kdebug.h>
32 #include <klocale.h>
33 #include <kmessagebox.h>
34 #include <assert.h>
35 #include <tqwhatsthis.h>
36 
37 #include <kregexpeditorinterface.h>
38 #include <kparts/componentfactory.h>
39 
40 class KFindDialog::KFindDialogPrivate
41 {
42 public:
43  KFindDialogPrivate() : m_regexpDialog(0),
44  m_regexpDialogQueryDone(false),
45  m_enabled(WholeWordsOnly | FromCursor | SelectedText | CaseSensitive | FindBackwards | RegularExpression), m_initialShowDone(false) {}
46  TQDialog* m_regexpDialog;
47  bool m_regexpDialogQueryDone;
48  long m_enabled; // uses Options to define which search options are enabled
49  bool m_initialShowDone;
50  TQStringList findStrings;
51  TQString pattern;
52 };
53 
54 KFindDialog::KFindDialog(TQWidget *parent, const char *name, long options, const TQStringList &findStrings, bool hasSelection) :
55  KDialogBase(parent, name, true, i18n("Find Text"), Ok | Cancel, Ok),
56  m_findExtension (0),
57  m_replaceExtension (0)
58 {
59  d = new KFindDialogPrivate;
60  init(false, findStrings, hasSelection);
61  setOptions(options);
62  setButtonCancel( KStdGuiItem::close() );
63 }
64 
65 KFindDialog::KFindDialog(bool modal, TQWidget *parent, const char *name, long options, const TQStringList &findStrings, bool hasSelection) :
66  KDialogBase(parent, name, modal, i18n("Find Text"), Ok | Cancel, Ok),
67  m_findExtension (0),
68  m_replaceExtension (0)
69 {
70  d = new KFindDialogPrivate;
71  init(false, findStrings, hasSelection);
72  setOptions(options);
73  setButtonCancel( KStdGuiItem::close() );
74 }
75 
76 KFindDialog::KFindDialog(TQWidget *parent, const char *name, bool /*forReplace*/) :
77  KDialogBase(parent, name, true, i18n("Replace Text"), Ok | Cancel, Ok),
78  m_findExtension (0),
79  m_replaceExtension (0)
80 {
81  d = new KFindDialogPrivate;
82  setButtonCancel( KStdGuiItem::close() );
83 }
84 
85 KFindDialog::~KFindDialog()
86 {
87  delete d;
88 }
89 
90 TQWidget *KFindDialog::findExtension()
91 {
92  if (!m_findExtension)
93  {
94  m_findExtension = new TQWidget(m_findGrp);
95  m_findLayout->addMultiCellWidget(m_findExtension, 3, 3, 0, 1);
96  }
97 
98  return m_findExtension;
99 }
100 
101 TQStringList KFindDialog::findHistory() const
102 {
103  return m_find->historyItems();
104 }
105 
106 void KFindDialog::init(bool forReplace, const TQStringList &findStrings, bool hasSelection)
107 {
108  TQVBoxLayout *topLayout;
109  TQGridLayout *optionsLayout;
110 
111  // Create common parts of dialog.
112  TQWidget *page = new TQWidget(this);
113  setMainWidget(page);
114 
115  topLayout = new TQVBoxLayout(page);
116  topLayout->setSpacing( KDialog::spacingHint() );
117  topLayout->setMargin( 0 );
118 
119  m_findGrp = new TQGroupBox(0, Qt::Vertical, i18n("Find"), page);
120  m_findGrp->layout()->setSpacing( KDialog::spacingHint() );
121  // m_findGrp->layout()->setMargin( KDialog::marginHint() );
122  m_findLayout = new TQGridLayout(m_findGrp->layout());
123  m_findLayout->setSpacing( KDialog::spacingHint() );
124  // m_findLayout->setMargin( KDialog::marginHint() );
125 
126  m_findLabel = new TQLabel(i18n("&Text to find:"), m_findGrp);
127  m_find = new KHistoryCombo(true, m_findGrp);
128  m_find->setMaxCount(10);
129  m_find->setDuplicatesEnabled(false);
130  m_regExp = new TQCheckBox(i18n("Regular e&xpression"), m_findGrp);
131  m_regExpItem = new TQPushButton(i18n("&Edit..."), m_findGrp);
132  m_regExpItem->setEnabled(false);
133 
134  m_findLayout->addWidget(m_findLabel, 0, 0);
135  m_findLayout->addMultiCellWidget(m_find, 1, 1, 0, 1);
136  m_findLayout->addWidget(m_regExp, 2, 0);
137  m_findLayout->addWidget(m_regExpItem, 2, 1);
138  topLayout->addWidget(m_findGrp);
139 
140  m_replaceGrp = new TQGroupBox(0, Qt::Vertical, i18n("Replace With"), page);
141  m_replaceGrp->layout()->setSpacing( KDialog::spacingHint() );
142  // m_replaceGrp->layout()->setMargin( KDialog::marginHint() );
143  m_replaceLayout = new TQGridLayout(m_replaceGrp->layout());
144  m_replaceLayout->setSpacing( KDialog::spacingHint() );
145 // m_replaceLayout->setMargin( KDialog::marginHint() );
146 
147  m_replaceLabel = new TQLabel(i18n("Replace&ment text:"), m_replaceGrp);
148  m_replace = new KHistoryCombo(true, m_replaceGrp);
149  m_replace->setMaxCount(10);
150  m_replace->setDuplicatesEnabled(false);
151  m_backRef = new TQCheckBox(i18n("Use p&laceholders"), m_replaceGrp);
152  m_backRef->setEnabled(m_regExp->isChecked());
153  m_backRefItem = new TQPushButton(i18n("Insert Place&holder"), m_replaceGrp);
154  m_backRefItem->setEnabled(m_regExp->isChecked() && m_backRef->isChecked());
155 
156  m_replaceLayout->addWidget(m_replaceLabel, 0, 0);
157  m_replaceLayout->addMultiCellWidget(m_replace, 1, 1, 0, 1);
158  m_replaceLayout->addWidget(m_backRef, 2, 0);
159  m_replaceLayout->addWidget(m_backRefItem, 2, 1);
160  topLayout->addWidget(m_replaceGrp);
161 
162  m_optionGrp = new TQGroupBox(0, Qt::Vertical, i18n("Options"), page);
163  m_optionGrp->layout()->setSpacing(KDialog::spacingHint());
164  // m_optionGrp->layout()->setMargin(KDialog::marginHint());
165  optionsLayout = new TQGridLayout(m_optionGrp->layout());
166  optionsLayout->setSpacing( KDialog::spacingHint() );
167  // optionsLayout->setMargin( KDialog::marginHint() );
168 
169  m_caseSensitive = new TQCheckBox(i18n("C&ase sensitive"), m_optionGrp);
170  m_wholeWordsOnly = new TQCheckBox(i18n("&Whole words only"), m_optionGrp);
171  m_fromCursor = new TQCheckBox(i18n("From c&ursor"), m_optionGrp);
172  m_findBackwards = new TQCheckBox(i18n("Find &backwards"), m_optionGrp);
173  m_selectedText = new TQCheckBox(i18n("&Selected text"), m_optionGrp);
174  setHasSelection( hasSelection );
175  // If we have a selection, we make 'find in selection' default
176  // and if we don't, then the option has to be unchecked, obviously.
177  m_selectedText->setChecked( hasSelection );
178  slotSelectedTextToggled( hasSelection );
179 
180  m_promptOnReplace = new TQCheckBox(i18n("&Prompt on replace"), m_optionGrp);
181  m_promptOnReplace->setChecked( true );
182 
183  optionsLayout->addWidget(m_caseSensitive, 0, 0);
184  optionsLayout->addWidget(m_wholeWordsOnly, 1, 0);
185  optionsLayout->addWidget(m_fromCursor, 2, 0);
186  optionsLayout->addWidget(m_findBackwards, 0, 1);
187  optionsLayout->addWidget(m_selectedText, 1, 1);
188  optionsLayout->addWidget(m_promptOnReplace, 2, 1);
189  topLayout->addWidget(m_optionGrp);
190 
191  // We delay creation of these until needed.
192  m_patterns = 0L;
193  m_placeholders = 0L;
194 
195  // signals and slots connections
196  connect(m_selectedText, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSelectedTextToggled(bool)));
197  connect(m_regExp, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotRegexCheckBoxToggled(bool)));
198  connect(m_backRef, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPlaceholdersCheckBoxToggled(bool)));
199  connect(m_regExpItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(showPatterns()));
200  connect(m_backRefItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(showPlaceholders()));
201 
202  connect(m_find, TQT_SIGNAL(textChanged ( const TQString & )),this, TQT_SLOT(textSearchChanged( const TQString & )));
203 
204  // tab order
205  setTabOrder(m_find, m_regExp);
206  setTabOrder(m_regExp, m_regExpItem);
207  setTabOrder(m_regExpItem, m_replace);
208  setTabOrder(m_replace, m_backRef);
209  setTabOrder(m_backRef, m_backRefItem);
210  setTabOrder(m_backRefItem, m_caseSensitive);
211  setTabOrder(m_caseSensitive, m_wholeWordsOnly);
212  setTabOrder(m_wholeWordsOnly, m_fromCursor);
213  setTabOrder(m_fromCursor, m_findBackwards);
214  setTabOrder(m_findBackwards, m_selectedText);
215  setTabOrder(m_selectedText, m_promptOnReplace);
216 
217  // buddies
218  m_findLabel->setBuddy(m_find);
219  m_replaceLabel->setBuddy(m_replace);
220 
221  if (!forReplace)
222  {
223  m_promptOnReplace->hide();
224  m_replaceGrp->hide();
225  }
226 
227  d->findStrings = findStrings;
228  m_find->setFocus();
229  enableButtonOK( !pattern().isEmpty() );
230  if (forReplace)
231  {
232  setButtonOK(KGuiItem( i18n("&Replace"), TQString::null,
233  i18n("Start replace"),
234  i18n("<qt>If you press the <b>Replace</b> button, the text you entered "
235  "above is searched for within the document and any occurrence is "
236  "replaced with the replacement text.</qt>")));
237  }
238  else
239  {
240  setButtonOK(KGuiItem( i18n("&Find"), "find",
241  i18n("Start searching"),
242  i18n("<qt>If you press the <b>Find</b> button, the text you entered "
243  "above is searched for within the document.</qt>")));
244  }
245 
246  // QWhatsthis texts
247  TQWhatsThis::add ( m_find, i18n(
248  "Enter a pattern to search for, or select a previous pattern from "
249  "the list.") );
250  TQWhatsThis::add ( m_regExp, i18n(
251  "If enabled, search for a regular expression.") );
252  TQWhatsThis::add ( m_regExpItem, i18n(
253  "Click here to edit your regular expression using a graphical editor.") );
254  TQWhatsThis::add ( m_replace, i18n(
255  "Enter a replacement string, or select a previous one from the list.") );
256  TQWhatsThis::add( m_backRef, i18n(
257  "<qt>If enabled, any occurrence of <code><b>\\N</b></code>, where "
258  "<code><b>N</b></code> is a integer number, will be replaced with "
259  "the corresponding capture (\"parenthesized substring\") from the "
260  "pattern.<p>To include (a literal <code><b>\\N</b></code> in your "
261  "replacement, put an extra backslash in front of it, like "
262  "<code><b>\\\\N</b></code>.</qt>") );
263  TQWhatsThis::add ( m_backRefItem, i18n(
264  "Click for a menu of available captures.") );
265  TQWhatsThis::add ( m_wholeWordsOnly, i18n(
266  "Require word boundaries in both ends of a match to succeed.") );
267  TQWhatsThis::add ( m_fromCursor, i18n(
268  "Start searching at the current cursor location rather than at the top.") );
269  TQWhatsThis::add ( m_selectedText, i18n(
270  "Only search within the current selection.") );
271  TQWhatsThis::add ( m_caseSensitive, i18n(
272  "Perform a case sensitive search: entering the pattern "
273  "'Joe' will not match 'joe' or 'JOE', only 'Joe'.") );
274  TQWhatsThis::add ( m_findBackwards, i18n(
275  "Search backwards.") );
276  TQWhatsThis::add ( m_promptOnReplace, i18n(
277  "Ask before replacing each match found.") );
278 }
279 
280 void KFindDialog::textSearchChanged(const TQString & text)
281 {
282  enableButtonOK( !text.isEmpty() );
283 }
284 
285 void KFindDialog::slotRegexCheckBoxToggled(bool checked)
286 {
287  m_regExpItem->setEnabled(checked);
288  m_backRef->setEnabled(checked);
289  m_backRefItem->setEnabled(checked && m_backRef->isChecked());
290 }
291 
292 void KFindDialog::slotPlaceholdersCheckBoxToggled(bool checked)
293 {
294  m_backRefItem->setEnabled(checked && m_regExp->isChecked());
295 }
296 
297 void KFindDialog::showEvent( TQShowEvent *e )
298 {
299  if ( !d->m_initialShowDone )
300  {
301  d->m_initialShowDone = true; // only once
302  kdDebug() << "showEvent\n";
303  if (!d->findStrings.isEmpty())
304  setFindHistory(d->findStrings);
305  d->findStrings = TQStringList();
306  if (!d->pattern.isEmpty()) {
307  m_find->lineEdit()->setText( d->pattern );
308  m_find->lineEdit()->selectAll();
309  d->pattern = TQString::null;
310  }
311  }
312  KDialogBase::showEvent(e);
313 }
314 
315 long KFindDialog::options() const
316 {
317  long options = 0;
318 
319  if (m_caseSensitive->isChecked())
320  options |= CaseSensitive;
321  if (m_wholeWordsOnly->isChecked())
322  options |= WholeWordsOnly;
323  if (m_fromCursor->isChecked())
324  options |= FromCursor;
325  if (m_findBackwards->isChecked())
326  options |= FindBackwards;
327  if (m_selectedText->isChecked())
328  options |= SelectedText;
329  if (m_regExp->isChecked())
330  options |= RegularExpression;
331  return options;
332 }
333 
334 TQString KFindDialog::pattern() const
335 {
336  return m_find->currentText();
337 }
338 
339 void KFindDialog::setPattern (const TQString &pattern)
340 {
341  m_find->lineEdit()->setText( pattern );
342  m_find->lineEdit()->selectAll();
343  d->pattern = pattern;
344  kdDebug() << "setPattern " << pattern<<endl;
345 }
346 
347 void KFindDialog::setFindHistory(const TQStringList &strings)
348 {
349  if (strings.count() > 0)
350  {
351  m_find->setHistoryItems(strings, true);
352  m_find->lineEdit()->setText( strings.first() );
353  m_find->lineEdit()->selectAll();
354  }
355  else
356  m_find->clearHistory();
357 }
358 
359 void KFindDialog::setHasSelection(bool hasSelection)
360 {
361  if (hasSelection) d->m_enabled |= SelectedText;
362  else d->m_enabled &= ~SelectedText;
363  m_selectedText->setEnabled( hasSelection );
364  if ( !hasSelection )
365  {
366  m_selectedText->setChecked( false );
367  slotSelectedTextToggled( hasSelection );
368  }
369 }
370 
371 void KFindDialog::slotSelectedTextToggled(bool selec)
372 {
373  // From cursor doesn't make sense if we have a selection
374  m_fromCursor->setEnabled( !selec && (d->m_enabled & FromCursor) );
375  if ( selec ) // uncheck if disabled
376  m_fromCursor->setChecked( false );
377 }
378 
379 void KFindDialog::setHasCursor(bool hasCursor)
380 {
381  if (hasCursor) d->m_enabled |= FromCursor;
382  else d->m_enabled &= ~FromCursor;
383  m_fromCursor->setEnabled( hasCursor );
384  m_fromCursor->setChecked( hasCursor && (options() & FromCursor) );
385 }
386 
387 void KFindDialog::setSupportsBackwardsFind( bool supports )
388 {
389  // ########## Shouldn't this hide the checkbox instead?
390  if (supports) d->m_enabled |= FindBackwards;
391  else d->m_enabled &= ~FindBackwards;
392  m_findBackwards->setEnabled( supports );
393  m_findBackwards->setChecked( supports && (options() & FindBackwards) );
394 }
395 
396 void KFindDialog::setSupportsCaseSensitiveFind( bool supports )
397 {
398  // ########## This should hide the checkbox instead
399  if (supports) d->m_enabled |= CaseSensitive;
400  else d->m_enabled &= ~CaseSensitive;
401  m_caseSensitive->setEnabled( supports );
402  m_caseSensitive->setChecked( supports && (options() & CaseSensitive) );
403 }
404 
405 void KFindDialog::setSupportsWholeWordsFind( bool supports )
406 {
407  // ########## This should hide the checkbox instead
408  if (supports) d->m_enabled |= WholeWordsOnly;
409  else d->m_enabled &= ~WholeWordsOnly;
410  m_wholeWordsOnly->setEnabled( supports );
411  m_wholeWordsOnly->setChecked( supports && (options() & WholeWordsOnly) );
412 }
413 
414 void KFindDialog::setSupportsRegularExpressionFind( bool supports )
415 {
416  // ########## This should hide the checkbox instead
417  if (supports) d->m_enabled |= RegularExpression;
418  else d->m_enabled &= ~RegularExpression;
419  m_regExp->setEnabled( supports );
420  m_regExp->setChecked( supports && (options() & RegularExpression) );
421 }
422 
423 void KFindDialog::setOptions(long options)
424 {
425  m_caseSensitive->setChecked((d->m_enabled & CaseSensitive) && (options & CaseSensitive));
426  m_wholeWordsOnly->setChecked((d->m_enabled & WholeWordsOnly) && (options & WholeWordsOnly));
427  m_fromCursor->setChecked((d->m_enabled & FromCursor) && (options & FromCursor));
428  m_findBackwards->setChecked((d->m_enabled & FindBackwards) && (options & FindBackwards));
429  m_selectedText->setChecked((d->m_enabled & SelectedText) && (options & SelectedText));
430  m_regExp->setChecked((d->m_enabled & RegularExpression) && (options & RegularExpression));
431 }
432 
433 // Create a popup menu with a list of regular expression terms, to help the user
434 // compose a regular expression search pattern.
435 void KFindDialog::showPatterns()
436 {
437  if ( !d->m_regexpDialogQueryDone )
438  {
439  d->m_regexpDialog = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>( "KRegExpEditor/KRegExpEditor", TQString(), TQT_TQOBJECT(this) );
440  d->m_regexpDialogQueryDone = true;
441  }
442 
443  if ( d->m_regexpDialog )
444  {
445  KRegExpEditorInterface *iface = tqt_dynamic_cast<KRegExpEditorInterface *>( d->m_regexpDialog );
446  assert( iface );
447 
448  iface->setRegExp( pattern() );
449  if ( d->m_regexpDialog->exec() == TQDialog::Accepted )
450  setPattern( iface->regExp() );
451  }
452  else // No complete regexp-editor available, bring up the old popupmenu
453  {
454  typedef struct
455  {
456  const char *description;
457  const char *regExp;
458  int cursorAdjustment;
459  } term;
460  static const term items[] =
461  {
462  { I18N_NOOP("Any Character"), ".", 0 },
463  { I18N_NOOP("Start of Line"), "^", 0 },
464  { I18N_NOOP("End of Line"), "$", 0 },
465  { I18N_NOOP("Set of Characters"), "[]", -1 },
466  { I18N_NOOP("Repeats, Zero or More Times"), "*", 0 },
467  { I18N_NOOP("Repeats, One or More Times"), "+", 0 },
468  { I18N_NOOP("Optional"), "?", 0 },
469  { I18N_NOOP("Escape"), "\\", 0 },
470  { I18N_NOOP("TAB"), "\\t", 0 },
471  { I18N_NOOP("Newline"), "\\n", 0 },
472  { I18N_NOOP("Carriage Return"), "\\r", 0 },
473  { I18N_NOOP("White Space"), "\\s", 0 },
474  { I18N_NOOP("Digit"), "\\d", 0 },
475  };
476  int i;
477 
478  // Populate the popup menu.
479  if (!m_patterns)
480  {
481  m_patterns = new TQPopupMenu(this);
482  for (i = 0; (unsigned)i < sizeof(items) / sizeof(items[0]); i++)
483  {
484  m_patterns->insertItem(i18n(items[i].description), i, i);
485  }
486  }
487 
488  // Insert the selection into the edit control.
489  i = m_patterns->exec(m_regExpItem->mapToGlobal(m_regExpItem->rect().bottomLeft()));
490  if (i != -1)
491  {
492  TQLineEdit *editor = m_find->lineEdit();
493 
494  editor->insert(items[i].regExp);
495  editor->setCursorPosition(editor->cursorPosition() + items[i].cursorAdjustment);
496  }
497  }
498 }
499 
500 // Create a popup menu with a list of backreference terms, to help the user
501 // compose a regular expression replacement pattern.
502 void KFindDialog::showPlaceholders()
503 {
504  // Populate the popup menu.
505  if (!m_placeholders)
506  {
507  m_placeholders = new TQPopupMenu(this);
508  connect( m_placeholders, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(slotPlaceholdersAboutToShow()) );
509  }
510 
511  // Insert the selection into the edit control.
512  int i = m_placeholders->exec(m_backRefItem->mapToGlobal(m_backRefItem->rect().bottomLeft()));
513  if (i != -1)
514  {
515  TQLineEdit *editor = m_replace->lineEdit();
516  editor->insert( TQString("\\%1").arg( i ) );
517  }
518 }
519 
520 void KFindDialog::slotPlaceholdersAboutToShow()
521 {
522  m_placeholders->clear();
523  m_placeholders->insertItem( i18n("Complete Match"), 0 );
524 
525  TQRegExp r( pattern() );
526  uint n = r.numCaptures();
527  for ( uint i=0; i < n; i++ )
528  m_placeholders->insertItem( i18n("Captured Text (%1)").arg( i+1 ), i+1 );
529 }
530 
531 void KFindDialog::slotOk()
532 {
533  // Nothing to find?
534  if (pattern().isEmpty())
535  {
536  KMessageBox::error(this, i18n("You must enter some text to search for."));
537  return;
538  }
539 
540  if (m_regExp->isChecked())
541  {
542  // Check for a valid regular expression.
543  TQRegExp regExp(pattern());
544 
545  if (!regExp.isValid())
546  {
547  KMessageBox::error(this, i18n("Invalid regular expression."));
548  return;
549  }
550  }
551  m_find->addToHistory(pattern());
552  emit okClicked();
553  if ( testWFlags( WShowModal ) )
554  accept();
555 }
556 // kate: space-indent on; indent-width 4; replace-tabs on;
557 #include "kfinddialog.moc"
KDialogBase
KDialogBase::setButtonOK
void setButtonOK(const KGuiItem &item=KStdGuiItem::ok())
KDialogBase::setButtonCancel
void setButtonCancel(const KGuiItem &item=KStdGuiItem::cancel())
KDialogBase::setMainWidget
void setMainWidget(TQWidget *widget)
KDialogBase::enableButtonOK
void enableButtonOK(bool state)
KDialogBase::okClicked
void okClicked()
KDialog::spacingHint
static int spacingHint()
KFindDialog::setPattern
void setPattern(const TQString &pattern)
Sets the pattern to find.
Definition: kfinddialog.cpp:339
KFindDialog::setFindHistory
void setFindHistory(const TQStringList &history)
Provide the list of strings to be displayed as the history of find strings.
Definition: kfinddialog.cpp:347
KFindDialog::~KFindDialog
virtual ~KFindDialog()
Destructor.
Definition: kfinddialog.cpp:85
KFindDialog::setSupportsBackwardsFind
void setSupportsBackwardsFind(bool supports)
Enable/disable the 'Find backwards' option, depending on whether the application supports it.
Definition: kfinddialog.cpp:387
KFindDialog::setHasCursor
void setHasCursor(bool hasCursor)
Hide/show the 'from cursor' option, depending on whether the application implements a cursor.
Definition: kfinddialog.cpp:379
KFindDialog::KFindDialog
KFindDialog(TQWidget *parent=0, const char *name=0, long options=0, const TQStringList &findStrings=TQStringList(), bool hasSelection=false)
Construct a modal find dialog.
Definition: kfinddialog.cpp:54
KFindDialog::setSupportsWholeWordsFind
void setSupportsWholeWordsFind(bool supports)
Enable/disable the 'Whole words only' option, depending on whether the application supports it.
Definition: kfinddialog.cpp:405
KFindDialog::setSupportsCaseSensitiveFind
void setSupportsCaseSensitiveFind(bool supports)
Enable/disable the 'Case sensitive' option, depending on whether the application supports it.
Definition: kfinddialog.cpp:396
KFindDialog::setSupportsRegularExpressionFind
void setSupportsRegularExpressionFind(bool supports)
Enable/disable the 'Regular expression' option, depending on whether the application supports it.
Definition: kfinddialog.cpp:414
KFindDialog::options
long options() const
Returns the state of the options.
Definition: kfinddialog.cpp:315
KFindDialog::setHasSelection
void setHasSelection(bool hasSelection)
Enable/disable the 'search in selection' option, depending on whether there actually is a selection.
Definition: kfinddialog.cpp:359
KFindDialog::findHistory
TQStringList findHistory() const
Returns the list of history items.
Definition: kfinddialog.cpp:101
KFindDialog::findExtension
TQWidget * findExtension()
Returns an empty widget which the user may fill with additional UI elements as required.
Definition: kfinddialog.cpp:90
KFindDialog::pattern
TQString pattern() const
Returns the pattern to find.
Definition: kfinddialog.cpp:334
KFindDialog::setOptions
void setOptions(long options)
Set the options which are checked.
Definition: kfinddialog.cpp:423
KFindDialog::FromCursor
@ FromCursor
Start from current cursor position.
Definition: kfinddialog.h:90
KFindDialog::WholeWordsOnly
@ WholeWordsOnly
Match whole words only.
Definition: kfinddialog.h:89
KFindDialog::SelectedText
@ SelectedText
Only search selected area.
Definition: kfinddialog.h:91
KFindDialog::CaseSensitive
@ CaseSensitive
Consider case when matching.
Definition: kfinddialog.h:92
KFindDialog::RegularExpression
@ RegularExpression
Interpret the pattern as a regular expression.
Definition: kfinddialog.h:94
KFindDialog::FindBackwards
@ FindBackwards
Go backwards.
Definition: kfinddialog.h:93
KGuiItem
KHistoryCombo
KHistoryCombo::historyItems
TQStringList historyItems() const
KHistoryCombo::clearHistory
void clearHistory()
KHistoryCombo::setHistoryItems
void setHistoryItems(TQStringList items)
KHistoryCombo::addToHistory
void addToHistory(const TQString &item)
I18N_NOOP
#define I18N_NOOP(x)
KMessageBox::error
static void error(TQWidget *parent, const TQString &text, const TQString &caption=TQString::null, int options=Notify)
endl
kndbgstream & endl(kndbgstream &s)
kdDebug
kdbgstream kdDebug(int area=0)
klocale.h
KStdAccel::description
TQString description(StdAccel id)

kutils

Skip menu "kutils"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kutils

Skip menu "kutils"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kutils by doxygen 1.9.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |