nsCSSKeywords.h 1.2 KB

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