|
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 /* keywords used within CSS property values */ |
|
7 |
|
8 #ifndef nsCSSKeywords_h___ |
|
9 #define nsCSSKeywords_h___ |
|
10 |
|
11 #include "nsStringFwd.h" |
|
12 |
|
13 /* |
|
14 Declare the enum list using the magic of preprocessing |
|
15 enum values are "eCSSKeyword_foo" (where foo is the keyword) |
|
16 |
|
17 To change the list of keywords, see nsCSSKeywordList.h |
|
18 |
|
19 */ |
|
20 #define CSS_KEY(_name,_id) eCSSKeyword_##_id, |
|
21 enum nsCSSKeyword { |
|
22 eCSSKeyword_UNKNOWN = -1, |
|
23 #include "nsCSSKeywordList.h" |
|
24 eCSSKeyword_COUNT |
|
25 }; |
|
26 #undef CSS_KEY |
|
27 |
|
28 |
|
29 class nsCSSKeywords { |
|
30 public: |
|
31 static void AddRefTable(void); |
|
32 static void ReleaseTable(void); |
|
33 |
|
34 // Given a keyword string, return the enum value |
|
35 static nsCSSKeyword LookupKeyword(const nsACString& aKeyword); |
|
36 static nsCSSKeyword LookupKeyword(const nsAString& aKeyword); |
|
37 |
|
38 // Given a keyword enum, get the string value |
|
39 static const nsAFlatCString& GetStringValue(nsCSSKeyword aKeyword); |
|
40 }; |
|
41 |
|
42 #endif /* nsCSSKeywords_h___ */ |