nsCSSPropertyID.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. /* enum types for CSS properties and their values */
  6. #ifndef nsCSSPropertyID_h___
  7. #define nsCSSPropertyID_h___
  8. #include <nsHashKeys.h>
  9. /*
  10. Declare the enum list using the magic of preprocessing
  11. enum values are "eCSSProperty_foo" (where foo is the property)
  12. To change the list of properties, see nsCSSPropList.h
  13. */
  14. enum nsCSSPropertyID {
  15. eCSSProperty_UNKNOWN = -1,
  16. #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
  17. kwtable_, stylestruct_, stylestructoffset_, animtype_) \
  18. eCSSProperty_##id_,
  19. #define CSS_PROP_LIST_INCLUDE_LOGICAL
  20. #include "nsCSSPropList.h"
  21. #undef CSS_PROP_LIST_INCLUDE_LOGICAL
  22. #undef CSS_PROP
  23. eCSSProperty_COUNT_no_shorthands,
  24. // Make the count continue where it left off:
  25. eCSSProperty_COUNT_DUMMY = eCSSProperty_COUNT_no_shorthands - 1,
  26. #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
  27. eCSSProperty_##id_,
  28. #include "nsCSSPropList.h"
  29. #undef CSS_PROP_SHORTHAND
  30. eCSSProperty_COUNT,
  31. // Make the count continue where it left off:
  32. eCSSProperty_COUNT_DUMMY2 = eCSSProperty_COUNT - 1,
  33. #define CSS_PROP_ALIAS(aliasname_, id_, method_, pref_) \
  34. eCSSPropertyAlias_##method_,
  35. #include "nsCSSPropAliasList.h"
  36. #undef CSS_PROP_ALIAS
  37. eCSSProperty_COUNT_with_aliases,
  38. // Make the count continue where it left off:
  39. eCSSProperty_COUNT_DUMMY3 = eCSSProperty_COUNT_with_aliases - 1,
  40. // Some of the values below could probably overlap with each other
  41. // if we had a need for them to do so.
  42. // Extra values for use in the values of the 'transition-property'
  43. // property.
  44. eCSSPropertyExtra_no_properties,
  45. eCSSPropertyExtra_all_properties,
  46. // Extra dummy values for nsCSSParser internal use.
  47. eCSSPropertyExtra_x_none_value,
  48. eCSSPropertyExtra_x_auto_value,
  49. // Extra value to represent custom properties (--*).
  50. eCSSPropertyExtra_variable,
  51. // Extra value for use in the DOM API's
  52. eCSSProperty_DOM
  53. };
  54. namespace mozilla {
  55. template<>
  56. inline PLDHashNumber
  57. Hash<nsCSSPropertyID>(const nsCSSPropertyID& aValue)
  58. {
  59. return uint32_t(aValue);
  60. }
  61. } // namespace mozilla
  62. // The "descriptors" that can appear in a @font-face rule.
  63. // They have the syntax of properties but different value rules.
  64. enum nsCSSFontDesc {
  65. eCSSFontDesc_UNKNOWN = -1,
  66. #define CSS_FONT_DESC(name_, method_) eCSSFontDesc_##method_,
  67. #include "nsCSSFontDescList.h"
  68. #undef CSS_FONT_DESC
  69. eCSSFontDesc_COUNT
  70. };
  71. // The "descriptors" that can appear in a @counter-style rule.
  72. // They have the syntax of properties but different value rules.
  73. enum nsCSSCounterDesc {
  74. eCSSCounterDesc_UNKNOWN = -1,
  75. #define CSS_COUNTER_DESC(name_, method_) eCSSCounterDesc_##method_,
  76. #include "nsCSSCounterDescList.h"
  77. #undef CSS_COUNTER_DESC
  78. eCSSCounterDesc_COUNT
  79. };
  80. enum nsCSSPropertyLogicalGroup {
  81. eCSSPropertyLogicalGroup_UNKNOWN = -1,
  82. #define CSS_PROP_LOGICAL_GROUP_AXIS(name_) \
  83. eCSSPropertyLogicalGroup_##name_,
  84. #define CSS_PROP_LOGICAL_GROUP_BOX(name_) \
  85. eCSSPropertyLogicalGroup_##name_,
  86. #define CSS_PROP_LOGICAL_GROUP_SHORTHAND(name_) \
  87. eCSSPropertyLogicalGroup_##name_,
  88. #include "nsCSSPropLogicalGroupList.h"
  89. #undef CSS_PROP_LOGICAL_GROUP_SHORTHAND
  90. #undef CSS_PROP_LOGICAL_GROUP_BOX
  91. #undef CSS_PROP_LOGICAL_GROUP_AXIS
  92. eCSSPropertyLogicalGroup_COUNT
  93. };
  94. #endif /* nsCSSPropertyID_h___ */