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