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