2001-09-26 02:53:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
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/. */
|
2001-04-06 03:34:08 +04:00
|
|
|
|
2016-07-07 07:44:32 +03:00
|
|
|
#ifndef TextEditUtils_h
|
|
|
|
#define TextEditUtils_h
|
2001-04-06 03:34:08 +04:00
|
|
|
|
2012-07-13 10:33:42 +04:00
|
|
|
#include "nscore.h"
|
2012-01-11 12:23:07 +04:00
|
|
|
|
2014-12-02 08:06:55 +03:00
|
|
|
class nsINode;
|
2001-04-06 03:34:08 +04:00
|
|
|
|
2016-07-07 07:44:32 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
2016-07-09 05:54:50 +03:00
|
|
|
class TextEditor;
|
|
|
|
|
2016-07-07 07:44:32 +03:00
|
|
|
class TextEditUtils final {
|
2001-04-06 03:34:08 +04:00
|
|
|
public:
|
2016-07-09 05:34:41 +03:00
|
|
|
// from TextEditRules:
|
2017-11-28 16:28:07 +03:00
|
|
|
static bool IsBody(nsINode* aNode);
|
2014-04-25 14:34:42 +04:00
|
|
|
static bool IsBreak(nsINode* aNode);
|
2001-04-06 03:34:08 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* stack based helper class for detecting end of editor initialization, in
|
2012-01-11 12:23:07 +04:00
|
|
|
* order to trigger "end of init" initialization of the edit rules.
|
2001-04-06 03:34:08 +04:00
|
|
|
*/
|
2016-06-23 13:18:13 +03:00
|
|
|
class AutoEditInitRulesTrigger final {
|
2012-01-11 12:23:07 +04:00
|
|
|
private:
|
2019-03-30 14:55:29 +03:00
|
|
|
RefPtr<TextEditor> mTextEditor;
|
2016-06-23 13:18:13 +03:00
|
|
|
nsresult& mResult;
|
|
|
|
|
2012-01-11 12:23:07 +04:00
|
|
|
public:
|
2016-07-09 05:54:50 +03:00
|
|
|
AutoEditInitRulesTrigger(TextEditor* aTextEditor, nsresult& aResult);
|
2019-03-30 14:55:29 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
2016-06-23 13:18:13 +03:00
|
|
|
~AutoEditInitRulesTrigger();
|
2001-04-06 03:34:08 +04:00
|
|
|
};
|
|
|
|
|
2016-06-23 13:18:13 +03:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2016-07-07 07:44:32 +03:00
|
|
|
#endif // #ifndef TextEditUtils_h
|