HTMLEditUtils.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #ifndef HTMLEditUtils_h
  6. #define HTMLEditUtils_h
  7. #include <stdint.h>
  8. #ifdef DEBUG
  9. // Used by various files for debug logging; included here to reduce duplication
  10. #include "nsDocument.h"
  11. #endif
  12. class nsIDOMNode;
  13. class nsINode;
  14. namespace mozilla {
  15. class HTMLEditUtils final
  16. {
  17. public:
  18. // from nsHTMLEditRules:
  19. static bool IsInlineStyle(nsINode* aNode);
  20. static bool IsInlineStyle(nsIDOMNode *aNode);
  21. static bool IsFormatNode(nsINode* aNode);
  22. static bool IsFormatNode(nsIDOMNode* aNode);
  23. static bool IsNodeThatCanOutdent(nsIDOMNode* aNode);
  24. static bool IsHeader(nsINode& aNode);
  25. static bool IsHeader(nsIDOMNode* aNode);
  26. static bool IsParagraph(nsIDOMNode* aNode);
  27. static bool IsHR(nsIDOMNode* aNode);
  28. static bool IsListItem(nsINode* aNode);
  29. static bool IsListItem(nsIDOMNode* aNode);
  30. static bool IsTable(nsIDOMNode* aNode);
  31. static bool IsTable(nsINode* aNode);
  32. static bool IsTableRow(nsIDOMNode* aNode);
  33. static bool IsTableElement(nsINode* aNode);
  34. static bool IsTableElement(nsIDOMNode* aNode);
  35. static bool IsTableElementButNotTable(nsINode* aNode);
  36. static bool IsTableElementButNotTable(nsIDOMNode* aNode);
  37. static bool IsTableCell(nsINode* node);
  38. static bool IsTableCell(nsIDOMNode* aNode);
  39. static bool IsTableCellOrCaption(nsINode& aNode);
  40. static bool IsList(nsINode* aNode);
  41. static bool IsList(nsIDOMNode* aNode);
  42. static bool IsOrderedList(nsIDOMNode* aNode);
  43. static bool IsUnorderedList(nsIDOMNode* aNode);
  44. static bool IsBlockquote(nsIDOMNode* aNode);
  45. static bool IsPre(nsIDOMNode* aNode);
  46. static bool IsAnchor(nsIDOMNode* aNode);
  47. static bool IsImage(nsINode* aNode);
  48. static bool IsImage(nsIDOMNode* aNode);
  49. static bool IsLink(nsIDOMNode* aNode);
  50. static bool IsLink(nsINode* aNode);
  51. static bool IsNamedAnchor(nsINode* aNode);
  52. static bool IsNamedAnchor(nsIDOMNode* aNode);
  53. static bool IsDiv(nsIDOMNode* aNode);
  54. static bool IsMozDiv(nsINode* aNode);
  55. static bool IsMozDiv(nsIDOMNode* aNode);
  56. static bool IsMailCite(nsINode* aNode);
  57. static bool IsMailCite(nsIDOMNode* aNode);
  58. static bool IsFormWidget(nsINode* aNode);
  59. static bool IsFormWidget(nsIDOMNode* aNode);
  60. static bool SupportsAlignAttr(nsIDOMNode* aNode);
  61. static bool CanContain(int32_t aParent, int32_t aChild);
  62. static bool IsContainer(int32_t aTag);
  63. };
  64. } // namespace mozilla
  65. #endif // #ifndef HTMLEditUtils_h