- Main Page
- Packages
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# smjg.libs.sdwf.findreplace.FindReplaceHandler Class Reference

The smjg.libs.sdwf.findreplace.FindReplaceHandler abstract class is used to handle messages from the Find and Replace common dialogs. More...

List of all members.

## Protected Member Functions
abstract bool | find (string findWhat, bool matchCase, bool wholeWord, bool backward)
| Called when the user issues a Find Next command, to perform the search.
abstract void | notFound (string findWhat, bool matchCase, bool wholeWord, bool backward)
| Called after a Find operation has failed.
abstract void | replace (string findWhat, bool matchCase, bool wholeWord, string replaceWith)
| Called when the user issuse a Replace command, to replace the found string with another.
uint | replaceAll (string findWhat, bool matchCase, bool wholeWord, string replaceWith)
| Called when the user issues a Replace All command, to replace all occurrences of a given string.
void | replaceAllDone (string findWhat, bool matchCase, bool wholeWord, string replaceWith, uint count)
| Called when a Replace All operation has completed.
void | closeFindReplace ()
| Called when the user closes the Find or Replace dialog.

## Detailed Description

The smjg.libs.sdwf.findreplace.FindReplaceHandler abstract class is used to handle messages from the Find and Replace common dialogs.

Limitations:
  For the time being, SDWF doesn't convert ANSI strings used by Windows into UTF-8. Consequently, any D library functions used to perform case-insensitive search or whole-word matching are not guaranteed to work if either the search string or the text to be searched contains non-ASCII characters.

Since:
  0.5

## Member Function Documentation

abstract bool smjg.libs.sdwf.findreplace.FindReplaceHandler.find | ( | string | findWhat,
|  | bool | matchCase,
|  | bool | wholeWord,
|  | bool | backward |
| ) |  |  | `[protected, pure virtual]`

Called when the user issues a Find Next command, to perform the search.

Parameters:

  | findWhat | text to find.
  | matchCase | whether the search is to be case-sensitive.
  | wholeWord | whether only whole words should be matched.
  | backward | whether to perform the search backwards from the current cursor position.

Returns:
  whether the text was found.

abstract void smjg.libs.sdwf.findreplace.FindReplaceHandler.notFound | ( | string | findWhat,
|  | bool | matchCase,
|  | bool | wholeWord,
|  | bool | backward |
| ) |  |  | `[protected, pure virtual]`

Called after a Find operation has failed.

Define this method in order to display a message to the user stating that the text was not found.

Parameters:

  | findWhat | text that was to be found.
  | matchCase | whether the search was case-sensitive.
  | wholeWord | whether only whole words were matched.
  | backward | whether the search was performed backwards from the current cursor position.

abstract void smjg.libs.sdwf.findreplace.FindReplaceHandler.replace | ( | string | findWhat,
|  | bool | matchCase,
|  | bool | wholeWord,
|  | string | replaceWith |
| ) |  |  | `[protected, pure virtual]`

Called when the user issuse a Replace command, to replace the found string with another.

If your application never displays the Replace dialog, then define this method to do an `assert(false)`.

Parameters:

  | findWhat | text to find.
  | matchCase | whether the search is to be case-sensitive.
  | wholeWord | whether only whole words should be matched.
  | replaceWith | the replacement text.

uint smjg.libs.sdwf.findreplace.FindReplaceHandler.replaceAll | ( | string | findWhat,
|  | bool | matchCase,
|  | bool | wholeWord,
|  | string | replaceWith |
| ) |  |  | `[protected]`

Called when the user issues a Replace All command, to replace all occurrences of a given string.

The default implementation makes alternate `find` and `replace` calls until all occurrences have been replaced.

Parameters:

  | findWhat | text to find.
  | matchCase | whether the search is to be case-sensitive.
  | wholeWord | whether only whole words should be matched.
  | replaceWith | the replacement text.

Returns:
  the number of occurrences that were replaced.

void smjg.libs.sdwf.findreplace.FindReplaceHandler.replaceAllDone | ( | string | findWhat,
|  | bool | matchCase,
|  | bool | wholeWord,
|  | string | replaceWith,
|  | uint | count |
| ) |  |  | `[protected]`

Called when a Replace All operation has completed.

This can be used to display user feedback on the result of the Replace All operation.

The default implementation merely calls notFound if no occurrences were found to replace.

Parameters:

  | findWhat | text that was to be found.
  | matchCase | whether the search was case-sensitive.
  | wholeWord | whether only whole words were matched.
  | replaceWith | the replacement text.
  | count | the number of occurrences that were replaced.

void smjg.libs.sdwf.findreplace.FindReplaceHandler.closeFindReplace | ( |  | ) | `[protected]`

Called when the user closes the Find or Replace dialog.

The default implementation does nothing.

The documentation for this class was generated from the following file:

- findreplace.d