1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/editor/libeditor/text/nsTextEditUtils.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsTextEditUtils_h__ 1.10 +#define nsTextEditUtils_h__ 1.11 + 1.12 +#include "nscore.h" 1.13 + 1.14 +namespace mozilla { 1.15 +namespace dom { 1.16 +class Element; 1.17 +} // namespace dom 1.18 +} // namespace mozilla 1.19 + 1.20 +class nsIDOMNode; 1.21 +class nsPlaintextEditor; 1.22 + 1.23 +class nsTextEditUtils 1.24 +{ 1.25 +public: 1.26 + // from nsTextEditRules: 1.27 + static bool IsBody(nsIDOMNode* aNode); 1.28 + static bool IsBreak(nsIDOMNode* aNode); 1.29 + static bool IsMozBR(nsIDOMNode* aNode); 1.30 + static bool IsMozBR(nsINode* aNode); 1.31 + static bool HasMozAttr(nsIDOMNode* aNode); 1.32 +}; 1.33 + 1.34 +/*************************************************************************** 1.35 + * stack based helper class for detecting end of editor initialization, in 1.36 + * order to trigger "end of init" initialization of the edit rules. 1.37 + */ 1.38 +class nsAutoEditInitRulesTrigger 1.39 +{ 1.40 +private: 1.41 + nsPlaintextEditor* mEd; 1.42 + nsresult& mRes; 1.43 +public: 1.44 + nsAutoEditInitRulesTrigger(nsPlaintextEditor* aEd, nsresult& aRes); 1.45 + ~nsAutoEditInitRulesTrigger(); 1.46 +}; 1.47 + 1.48 +#endif /* nsTextEditUtils_h__ */