|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef nsTextEditUtils_h__ |
|
7 #define nsTextEditUtils_h__ |
|
8 |
|
9 #include "nscore.h" |
|
10 |
|
11 namespace mozilla { |
|
12 namespace dom { |
|
13 class Element; |
|
14 } // namespace dom |
|
15 } // namespace mozilla |
|
16 |
|
17 class nsIDOMNode; |
|
18 class nsPlaintextEditor; |
|
19 |
|
20 class nsTextEditUtils |
|
21 { |
|
22 public: |
|
23 // from nsTextEditRules: |
|
24 static bool IsBody(nsIDOMNode* aNode); |
|
25 static bool IsBreak(nsIDOMNode* aNode); |
|
26 static bool IsMozBR(nsIDOMNode* aNode); |
|
27 static bool IsMozBR(nsINode* aNode); |
|
28 static bool HasMozAttr(nsIDOMNode* aNode); |
|
29 }; |
|
30 |
|
31 /*************************************************************************** |
|
32 * stack based helper class for detecting end of editor initialization, in |
|
33 * order to trigger "end of init" initialization of the edit rules. |
|
34 */ |
|
35 class nsAutoEditInitRulesTrigger |
|
36 { |
|
37 private: |
|
38 nsPlaintextEditor* mEd; |
|
39 nsresult& mRes; |
|
40 public: |
|
41 nsAutoEditInitRulesTrigger(nsPlaintextEditor* aEd, nsresult& aRes); |
|
42 ~nsAutoEditInitRulesTrigger(); |
|
43 }; |
|
44 |
|
45 #endif /* nsTextEditUtils_h__ */ |