Dillo
|
#include <findtext.hh>
Public Types | |
enum | Result { SUCCESS, RESTART, NOT_FOUND } |
Public Member Functions | |
FindtextState () | |
~FindtextState () | |
void | setWidget (Widget *widget) |
Result | search (const char *key, bool caseSens, bool backwards) |
void | resetSearch () |
This method is called when the user closes the "find text" dialog. More... | |
Private Member Functions | |
bool | unhighlight () |
Unhighlight, and return whether a region was highlighted. More... | |
bool | search0 (bool backwards, bool firstTrial) |
Static Private Member Functions | |
static const char * | rev (const char *_str) |
static int * | createNexttab (const char *needle, bool caseSens, bool backwards) |
static bool | charsEqual (char c1, char c2, bool caseSens) |
Private Attributes | |
char * | key |
The key used for the last search. More... | |
bool | caseSens |
Whether the last search was case sensitive. More... | |
int * | nexttab |
The table used for KMP search. More... | |
Widget * | widget |
The top of the widget tree, in which the search is done. More... | |
CharIterator * | iterator |
The position from where the next search will start. More... | |
CharIterator * | hlIterator |
The position from where the characters are highlighted. More... | |
dw::core::FindtextState::FindtextState | ( | ) |
References DBG_OBJ_CREATE, hlIterator, iterator, key, nexttab, and widget.
dw::core::FindtextState::~FindtextState | ( | ) |
References DBG_OBJ_DELETE, hlIterator, iterator, key, and nexttab.
|
inlinestaticprivate |
Referenced by createNexttab(), and search0().
|
staticprivate |
References charsEqual(), key, nexttab, and rev().
Referenced by search().
void dw::core::FindtextState::resetSearch | ( | ) |
This method is called when the user closes the "find text" dialog.
References key, and unhighlight().
Referenced by dw::core::Layout::resetSearch().
|
staticprivate |
Referenced by createNexttab(), and search0().
FindtextState::Result dw::core::FindtextState::search | ( | const char * | key, |
bool | caseSens, | ||
bool | backwards | ||
) |
References caseSens, dw::core::CharIterator::cloneCharIterator(), createNexttab(), dw::core::CharIterator::highlight(), dw::core::HIGHLIGHT_FINDTEXT, hlIterator, dw::core::HPOS_INTO_VIEW, iterator, dw::core::CharIterator::next(), nexttab, NOT_FOUND, dw::core::CharIterator::prev(), RESTART, dw::core::CharIterator::scrollTo(), search0(), SUCCESS, unhighlight(), dw::core::VPOS_CENTER, and widget.
Referenced by dw::core::Layout::search().
|
private |
References caseSens, charsEqual(), dw::core::CharIterator::END, dw::core::CharIterator::getChar(), iterator, key, dw::core::CharIterator::next(), nexttab, dw::core::CharIterator::prev(), and rev().
Referenced by search().
void dw::core::FindtextState::setWidget | ( | Widget * | widget | ) |
References hlIterator, iterator, key, nexttab, and widget.
|
private |
Unhighlight, and return whether a region was highlighted.
References dw::core::CharIterator::cloneCharIterator(), dw::core::HIGHLIGHT_FINDTEXT, hlIterator, key, dw::core::CharIterator::prev(), and dw::core::CharIterator::unhighlight().
Referenced by resetSearch(), and search().
|
private |
|
private |
The position from where the characters are highlighted.
NULL, when no text is highlighted.
Referenced by FindtextState(), search(), setWidget(), unhighlight(), and ~FindtextState().
|
private |
The position from where the next search will start.
Referenced by FindtextState(), search(), search0(), setWidget(), and ~FindtextState().
|
private |
The key used for the last search.
If dw::core::Findtext::search is called with the same key, the search is continued, otherwise it is restarted.
Referenced by createNexttab(), FindtextState(), resetSearch(), search0(), setWidget(), unhighlight(), and ~FindtextState().
|
private |
The table used for KMP search.
Referenced by createNexttab(), FindtextState(), search(), search0(), setWidget(), and ~FindtextState().
|
private |
The top of the widget tree, in which the search is done.
From this, the iterator will be constructed. Set by dw::core::Findtext::widget
Referenced by FindtextState(), search(), and setWidget().