InPageSearchManager.h [plain text]
#ifndef InPageSearchManager_h
#define InPageSearchManager_h
#include "FindOptions.h"
#include <wtf/text/WTFString.h>
namespace WebCore {
class Frame;
class Range;
class VisibleSelection;
}
namespace BlackBerry {
namespace WebKit {
class WebPagePrivate;
class InPageSearchManager {
public:
InPageSearchManager(WebPagePrivate*);
~InPageSearchManager();
bool findNextString(const String&, WebCore::FindOptions, bool wrap, bool highlightAllMatches, bool selectActiveMatchOnClear);
void frameUnloaded(const WebCore::Frame*);
private:
class DeferredScopeStringMatches;
friend class DeferredScopeStringMatches;
void clearTextMatches(bool selectActiveMatchOnClear = false);
void setActiveMatchAndMarker(PassRefPtr<WebCore::Range>);
bool findAndMarkText(const String&, WebCore::Range*, WebCore::Frame*, const WebCore::FindOptions&, bool , bool );
bool shouldSearchForText(const String&);
void scopeStringMatches(const String& text, bool reset, bool locateActiveMatchOnly, WebCore::Frame* scopingFrame = 0);
void scopeStringMatchesSoon(WebCore::Frame* scopingFrame, const String& text, bool reset, bool locateActiveMatchOnly);
void callScopeStringMatches(DeferredScopeStringMatches* caller, WebCore::Frame* scopingFrame, const String& text, bool reset, bool locateActiveMatchOnly);
void cancelPendingScopingEffort();
Vector<DeferredScopeStringMatches*> m_deferredScopingWork;
WebPagePrivate* m_webPage;
RefPtr<WebCore::Range> m_activeMatch;
RefPtr<WebCore::Range> m_resumeScopingFromRange;
String m_activeSearchString;
int m_activeMatchCount;
bool m_scopingComplete;
bool m_scopingCaseInsensitive;
bool m_locatingActiveMatch;
bool m_highlightAllMatches;
int m_activeMatchIndex;
};
}
}
#endif // InPageSearchManager_h