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

tdeutils

  • tdeutils
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 <tdelocale.h>
33#include <tdemessagebox.h>
34#include <assert.h>
35#include <tqwhatsthis.h>
36
37#include <kregexpeditorinterface.h>
38#include <tdeparts/componentfactory.h>
39
40class KFindDialog::KFindDialogPrivate
41{
42public:
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
54KFindDialog::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
65KFindDialog::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
76KFindDialog::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
85KFindDialog::~KFindDialog()
86{
87 delete d;
88}
89
90TQWidget *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
101TQStringList KFindDialog::findHistory() const
102{
103 return m_find->historyItems();
104}
105
106void 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, TQt::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, TQt::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, TQt::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, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(slotSelectedTextToggled(bool)));
197 connect(m_regExp, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(slotRegexCheckBoxToggled(bool)));
198 connect(m_backRef, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(slotPlaceholdersCheckBoxToggled(bool)));
199 connect(m_regExpItem, TQ_SIGNAL(clicked()), this, TQ_SLOT(showPatterns()));
200 connect(m_backRefItem, TQ_SIGNAL(clicked()), this, TQ_SLOT(showPlaceholders()));
201
202 connect(m_find, TQ_SIGNAL(textChanged ( const TQString & )),this, TQ_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"), "edit-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>When regular expressions are enabled, you can select part of the searched text by "
258 "enclosing it within parenthesis. Placeholders allow you to insert such text in the "
259 "replacement string, similar to how backreferences are used in sed. When enabled, "
260 "any occurrence of <code><b>\\N</b></code> (where <code><b>N</b></code> "
261 "is a integer number, e.g. \\1, \\2, ...), will be replaced with "
262 "the corresponding capture (\"parenthesized substring\") from the "
263 "pattern.<p>To include a literal <code><b>\\N</b></code> in your "
264 "replacement, put an extra backslash in front of it, like "
265 "<code><b>\\\\N</b></code>.</qt>") );
266 TQWhatsThis::add ( m_backRefItem, i18n(
267 "Click for a menu of available captures.") );
268 TQWhatsThis::add ( m_wholeWordsOnly, i18n(
269 "Require word boundaries in both ends of a match to succeed.") );
270 TQWhatsThis::add ( m_fromCursor, i18n(
271 "Start searching at the current cursor location rather than at the top.") );
272 TQWhatsThis::add ( m_selectedText, i18n(
273 "Only search within the current selection.") );
274 TQWhatsThis::add ( m_caseSensitive, i18n(
275 "Perform a case sensitive search: entering the pattern "
276 "'Joe' will not match 'joe' or 'JOE', only 'Joe'.") );
277 TQWhatsThis::add ( m_findBackwards, i18n(
278 "Search backwards.") );
279 TQWhatsThis::add ( m_promptOnReplace, i18n(
280 "Ask before replacing each match found.") );
281}
282
283void KFindDialog::textSearchChanged(const TQString & text)
284{
285 enableButtonOK( !text.isEmpty() );
286}
287
288void KFindDialog::slotRegexCheckBoxToggled(bool checked)
289{
290 m_regExpItem->setEnabled(checked);
291 m_backRef->setEnabled(checked);
292 m_backRefItem->setEnabled(checked && m_backRef->isChecked());
293}
294
295void KFindDialog::slotPlaceholdersCheckBoxToggled(bool checked)
296{
297 m_backRefItem->setEnabled(checked && m_regExp->isChecked());
298}
299
300void KFindDialog::showEvent( TQShowEvent *e )
301{
302 if ( !d->m_initialShowDone )
303 {
304 d->m_initialShowDone = true; // only once
305 kdDebug() << "showEvent\n";
306 if (!d->findStrings.isEmpty())
307 setFindHistory(d->findStrings);
308 d->findStrings = TQStringList();
309 if (!d->pattern.isEmpty()) {
310 m_find->lineEdit()->setText( d->pattern );
311 m_find->lineEdit()->selectAll();
312 d->pattern = TQString::null;
313 }
314 }
315 KDialogBase::showEvent(e);
316}
317
318long KFindDialog::options() const
319{
320 long options = 0;
321
322 if (m_caseSensitive->isChecked())
323 options |= CaseSensitive;
324 if (m_wholeWordsOnly->isChecked())
325 options |= WholeWordsOnly;
326 if (m_fromCursor->isChecked())
327 options |= FromCursor;
328 if (m_findBackwards->isChecked())
329 options |= FindBackwards;
330 if (m_selectedText->isChecked())
331 options |= SelectedText;
332 if (m_regExp->isChecked())
333 options |= RegularExpression;
334 return options;
335}
336
337TQString KFindDialog::pattern() const
338{
339 return m_find->currentText();
340}
341
342void KFindDialog::setPattern (const TQString &pattern)
343{
344 m_find->lineEdit()->setText( pattern );
345 m_find->lineEdit()->selectAll();
346 d->pattern = pattern;
347 kdDebug() << "setPattern " << pattern<<endl;
348}
349
350void KFindDialog::setFindHistory(const TQStringList &strings)
351{
352 if (strings.count() > 0)
353 {
354 m_find->setHistoryItems(strings, true);
355 m_find->lineEdit()->setText( strings.first() );
356 m_find->lineEdit()->selectAll();
357 }
358 else
359 m_find->clearHistory();
360}
361
362void KFindDialog::setHasSelection(bool hasSelection)
363{
364 if (hasSelection) d->m_enabled |= SelectedText;
365 else d->m_enabled &= ~SelectedText;
366 m_selectedText->setEnabled( hasSelection );
367 if ( !hasSelection )
368 {
369 m_selectedText->setChecked( false );
370 slotSelectedTextToggled( hasSelection );
371 }
372}
373
374void KFindDialog::slotSelectedTextToggled(bool selec)
375{
376 // From cursor doesn't make sense if we have a selection
377 m_fromCursor->setEnabled( !selec && (d->m_enabled & FromCursor) );
378 if ( selec ) // uncheck if disabled
379 m_fromCursor->setChecked( false );
380}
381
382void KFindDialog::setHasCursor(bool hasCursor)
383{
384 if (hasCursor) d->m_enabled |= FromCursor;
385 else d->m_enabled &= ~FromCursor;
386 m_fromCursor->setEnabled( hasCursor );
387 m_fromCursor->setChecked( hasCursor && (options() & FromCursor) );
388}
389
390void KFindDialog::setSupportsBackwardsFind( bool supports )
391{
392 // ########## Shouldn't this hide the checkbox instead?
393 if (supports) d->m_enabled |= FindBackwards;
394 else d->m_enabled &= ~FindBackwards;
395 m_findBackwards->setEnabled( supports );
396 m_findBackwards->setChecked( supports && (options() & FindBackwards) );
397}
398
399void KFindDialog::setSupportsCaseSensitiveFind( bool supports )
400{
401 // ########## This should hide the checkbox instead
402 if (supports) d->m_enabled |= CaseSensitive;
403 else d->m_enabled &= ~CaseSensitive;
404 m_caseSensitive->setEnabled( supports );
405 m_caseSensitive->setChecked( supports && (options() & CaseSensitive) );
406}
407
408void KFindDialog::setSupportsWholeWordsFind( bool supports )
409{
410 // ########## This should hide the checkbox instead
411 if (supports) d->m_enabled |= WholeWordsOnly;
412 else d->m_enabled &= ~WholeWordsOnly;
413 m_wholeWordsOnly->setEnabled( supports );
414 m_wholeWordsOnly->setChecked( supports && (options() & WholeWordsOnly) );
415}
416
417void KFindDialog::setSupportsRegularExpressionFind( bool supports )
418{
419 // ########## This should hide the checkbox instead
420 if (supports) d->m_enabled |= RegularExpression;
421 else d->m_enabled &= ~RegularExpression;
422 m_regExp->setEnabled( supports );
423 m_regExp->setChecked( supports && (options() & RegularExpression) );
424}
425
426void KFindDialog::setOptions(long options)
427{
428 m_caseSensitive->setChecked((d->m_enabled & CaseSensitive) && (options & CaseSensitive));
429 m_wholeWordsOnly->setChecked((d->m_enabled & WholeWordsOnly) && (options & WholeWordsOnly));
430 m_fromCursor->setChecked((d->m_enabled & FromCursor) && (options & FromCursor));
431 m_findBackwards->setChecked((d->m_enabled & FindBackwards) && (options & FindBackwards));
432 m_selectedText->setChecked((d->m_enabled & SelectedText) && (options & SelectedText));
433 m_regExp->setChecked((d->m_enabled & RegularExpression) && (options & RegularExpression));
434}
435
436// Create a popup menu with a list of regular expression terms, to help the user
437// compose a regular expression search pattern.
438void KFindDialog::showPatterns()
439{
440 if ( !d->m_regexpDialogQueryDone )
441 {
442 d->m_regexpDialog = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>( "KRegExpEditor/KRegExpEditor", TQString(), this );
443 d->m_regexpDialogQueryDone = true;
444 }
445
446 if ( d->m_regexpDialog )
447 {
448 KRegExpEditorInterface *iface = dynamic_cast<KRegExpEditorInterface *>( d->m_regexpDialog );
449 assert( iface );
450
451 iface->setRegExp( pattern() );
452 if ( d->m_regexpDialog->exec() == TQDialog::Accepted )
453 setPattern( iface->regExp() );
454 }
455 else // No complete regexp-editor available, bring up the old popupmenu
456 {
457 typedef struct
458 {
459 const char *description;
460 const char *regExp;
461 int cursorAdjustment;
462 } term;
463 static const term items[] =
464 {
465 { I18N_NOOP("Any Character"), ".", 0 },
466 { I18N_NOOP("Start of Line"), "^", 0 },
467 { I18N_NOOP("End of Line"), "$", 0 },
468 { I18N_NOOP("Set of Characters"), "[]", -1 },
469 { I18N_NOOP("Repeats, Zero or More Times"), "*", 0 },
470 { I18N_NOOP("Repeats, One or More Times"), "+", 0 },
471 { I18N_NOOP("Optional"), "?", 0 },
472 { I18N_NOOP("Escape"), "\\", 0 },
473 { I18N_NOOP("TAB"), "\\t", 0 },
474 { I18N_NOOP("Newline"), "\\n", 0 },
475 { I18N_NOOP("Carriage Return"), "\\r", 0 },
476 { I18N_NOOP("White Space"), "\\s", 0 },
477 { I18N_NOOP("Digit"), "\\d", 0 },
478 };
479 int i;
480
481 // Populate the popup menu.
482 if (!m_patterns)
483 {
484 m_patterns = new TQPopupMenu(this);
485 for (i = 0; (unsigned)i < sizeof(items) / sizeof(items[0]); i++)
486 {
487 m_patterns->insertItem(i18n(items[i].description), i, i);
488 }
489 }
490
491 // Insert the selection into the edit control.
492 i = m_patterns->exec(m_regExpItem->mapToGlobal(m_regExpItem->rect().bottomLeft()));
493 if (i != -1)
494 {
495 TQLineEdit *editor = m_find->lineEdit();
496
497 editor->insert(items[i].regExp);
498 editor->setCursorPosition(editor->cursorPosition() + items[i].cursorAdjustment);
499 }
500 }
501}
502
503// Create a popup menu with a list of backreference terms, to help the user
504// compose a regular expression replacement pattern.
505void KFindDialog::showPlaceholders()
506{
507 // Populate the popup menu.
508 if (!m_placeholders)
509 {
510 m_placeholders = new TQPopupMenu(this);
511 connect( m_placeholders, TQ_SIGNAL(aboutToShow()), this, TQ_SLOT(slotPlaceholdersAboutToShow()) );
512 }
513
514 // Insert the selection into the edit control.
515 int i = m_placeholders->exec(m_backRefItem->mapToGlobal(m_backRefItem->rect().bottomLeft()));
516 if (i != -1)
517 {
518 TQLineEdit *editor = m_replace->lineEdit();
519 editor->insert( TQString("\\%1").arg( i ) );
520 }
521}
522
523void KFindDialog::slotPlaceholdersAboutToShow()
524{
525 m_placeholders->clear();
526 m_placeholders->insertItem( i18n("Complete Match"), 0 );
527
528 TQRegExp r( pattern() );
529 uint n = r.numCaptures();
530 for ( uint i=0; i < n; i++ )
531 m_placeholders->insertItem( i18n("Captured Text (%1)").arg( i+1 ), i+1 );
532}
533
534void KFindDialog::slotOk()
535{
536 // Nothing to find?
537 if (pattern().isEmpty())
538 {
539 KMessageBox::error(this, i18n("You must enter some text to search for."));
540 return;
541 }
542
543 if (m_regExp->isChecked())
544 {
545 // Check for a valid regular expression.
546 TQRegExp regExp(pattern());
547
548 if (!regExp.isValid())
549 {
550 KMessageBox::error(this, i18n("Invalid regular expression."));
551 return;
552 }
553 }
554 m_find->addToHistory(pattern());
555 emit okClicked();
556 if ( testWFlags( WShowModal ) )
557 accept();
558}
559#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:342
KFindDialog::setFindHistory
void setFindHistory(const TQStringList &history)
Provide the list of strings to be displayed as the history of find strings.
Definition: kfinddialog.cpp:350
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:390
KFindDialog::setHasCursor
void setHasCursor(bool hasCursor)
Hide/show the 'from cursor' option, depending on whether the application implements a cursor.
Definition: kfinddialog.cpp:382
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:408
KFindDialog::setSupportsCaseSensitiveFind
void setSupportsCaseSensitiveFind(bool supports)
Enable/disable the 'Case sensitive' option, depending on whether the application supports it.
Definition: kfinddialog.cpp:399
KFindDialog::setSupportsRegularExpressionFind
void setSupportsRegularExpressionFind(bool supports)
Enable/disable the 'Regular expression' option, depending on whether the application supports it.
Definition: kfinddialog.cpp:417
KFindDialog::options
long options() const
Returns the state of the options.
Definition: kfinddialog.cpp:318
KFindDialog::setHasSelection
void setHasSelection(bool hasSelection)
Enable/disable the 'search in selection' option, depending on whether there actually is a selection.
Definition: kfinddialog.cpp:362
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:337
KFindDialog::setOptions
void setOptions(long options)
Set the options which are checked.
Definition: kfinddialog.cpp:426
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)
KMessageBox::error
static void error(TQWidget *parent, const TQString &text, const TQString &caption=TQString::null, int options=Notify)
I18N_NOOP
#define I18N_NOOP(x)
endl
kndbgstream & endl(kndbgstream &s)
kdDebug
kdbgstream kdDebug(int area=0)
TDEStdAccel::description
TQString description(StdAccel id)
tdelocale.h

tdeutils

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

tdeutils

Skip menu "tdeutils"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeutils by doxygen 1.9.4
This website is maintained by Timothy Pearson.