2015-05-12 09:30:00 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2002-01-16 10:05:40 +03:00
|
|
|
|
|
|
|
#ifndef nsFind_h__
|
|
|
|
#define nsFind_h__
|
|
|
|
|
|
|
|
#include "nsIFind.h"
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
2013-02-01 03:46:24 +04:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2018-03-27 07:35:21 +03:00
|
|
|
#include "nsINode.h"
|
2017-12-14 07:17:38 +03:00
|
|
|
#include "mozilla/intl/WordBreaker.h"
|
2002-01-16 10:05:40 +03:00
|
|
|
|
2008-10-15 13:40:28 +04:00
|
|
|
class nsIContent;
|
2018-03-27 07:35:21 +03:00
|
|
|
class nsRange;
|
2002-01-16 10:05:40 +03:00
|
|
|
|
2002-02-16 07:17:07 +03:00
|
|
|
#define NS_FIND_CONTRACTID "@mozilla.org/embedcomp/rangefind;1"
|
|
|
|
|
|
|
|
#define NS_FIND_CID \
|
2015-05-11 22:35:14 +03:00
|
|
|
{ \
|
|
|
|
0x471f4944, 0x1dd2, 0x11b2, { \
|
|
|
|
0x87, 0xac, 0x90, 0xbe, 0x0a, 0x51, 0xd6, 0x09 \
|
|
|
|
} \
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2002-02-16 07:17:07 +03:00
|
|
|
|
2007-04-19 00:05:42 +04:00
|
|
|
class nsFindContentIterator;
|
|
|
|
|
2002-01-16 10:05:40 +03:00
|
|
|
class nsFind : public nsIFind {
|
|
|
|
public:
|
2013-02-01 03:46:24 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2002-01-16 10:05:40 +03:00
|
|
|
NS_DECL_NSIFIND
|
2013-02-01 03:46:24 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS(nsFind)
|
2002-01-16 10:05:40 +03:00
|
|
|
|
|
|
|
nsFind();
|
|
|
|
|
|
|
|
protected:
|
2014-07-01 02:11:52 +04:00
|
|
|
virtual ~nsFind();
|
|
|
|
|
2002-01-16 10:05:40 +03:00
|
|
|
// Parameters set from the interface:
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mFindBackward;
|
|
|
|
bool mCaseSensitive;
|
2002-01-16 10:05:40 +03:00
|
|
|
|
2016-06-28 16:13:53 +03:00
|
|
|
// Use "find entire words" mode by setting to a word breaker or null, to
|
|
|
|
// disable "entire words" mode.
|
2017-12-14 07:17:38 +03:00
|
|
|
RefPtr<mozilla::intl::WordBreaker> mWordBreaker;
|
2002-01-16 10:05:40 +03:00
|
|
|
|
2018-06-25 14:09:17 +03:00
|
|
|
struct State;
|
|
|
|
class StateRestorer;
|
2002-01-16 10:05:40 +03:00
|
|
|
|
2016-06-28 16:13:53 +03:00
|
|
|
// Get the first character from the next node (last if mFindBackward).
|
2018-06-25 14:09:17 +03:00
|
|
|
//
|
|
|
|
// This will mutate the state, but then restore it afterwards.
|
2018-07-01 03:17:10 +03:00
|
|
|
char16_t PeekNextChar(State&) const;
|
2002-01-16 10:05:40 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsFind_h__
|