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
|
|
|
|
|
|
|
#ifndef nsTextEditUtils_h__
|
|
|
|
#define nsTextEditUtils_h__
|
|
|
|
|
2012-07-13 10:33:42 +04:00
|
|
|
#include "nscore.h"
|
2012-01-11 12:23:07 +04:00
|
|
|
|
2001-04-06 03:34:08 +04:00
|
|
|
class nsIDOMNode;
|
2014-12-02 08:06:55 +03:00
|
|
|
class nsINode;
|
2001-04-06 03:34:08 +04:00
|
|
|
class nsPlaintextEditor;
|
|
|
|
|
|
|
|
class nsTextEditUtils
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// from nsTextEditRules:
|
2012-01-11 12:23:07 +04:00
|
|
|
static bool IsBody(nsIDOMNode* aNode);
|
|
|
|
static bool IsBreak(nsIDOMNode* aNode);
|
2014-04-25 14:34:42 +04:00
|
|
|
static bool IsBreak(nsINode* aNode);
|
2012-01-11 12:23:07 +04:00
|
|
|
static bool IsMozBR(nsIDOMNode* aNode);
|
2013-04-04 16:02:24 +04:00
|
|
|
static bool IsMozBR(nsINode* aNode);
|
2012-01-11 12:23:07 +04:00
|
|
|
static bool HasMozAttr(nsIDOMNode* 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
|
|
|
*/
|
|
|
|
class nsAutoEditInitRulesTrigger
|
|
|
|
{
|
2012-01-11 12:23:07 +04:00
|
|
|
private:
|
|
|
|
nsPlaintextEditor* mEd;
|
|
|
|
nsresult& mRes;
|
|
|
|
public:
|
|
|
|
nsAutoEditInitRulesTrigger(nsPlaintextEditor* aEd, nsresult& aRes);
|
2001-04-06 03:34:08 +04:00
|
|
|
~nsAutoEditInitRulesTrigger();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsTextEditUtils_h__ */
|