layout/style/nsCSSKeywords.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/style/nsCSSKeywords.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/* keywords used within CSS property values */
    1.10 +
    1.11 +#ifndef nsCSSKeywords_h___
    1.12 +#define nsCSSKeywords_h___
    1.13 +
    1.14 +#include "nsStringFwd.h"
    1.15 +
    1.16 +/*
    1.17 +   Declare the enum list using the magic of preprocessing
    1.18 +   enum values are "eCSSKeyword_foo" (where foo is the keyword)
    1.19 +
    1.20 +   To change the list of keywords, see nsCSSKeywordList.h
    1.21 +
    1.22 + */
    1.23 +#define CSS_KEY(_name,_id) eCSSKeyword_##_id,
    1.24 +enum nsCSSKeyword {
    1.25 +  eCSSKeyword_UNKNOWN = -1,
    1.26 +#include "nsCSSKeywordList.h"
    1.27 +  eCSSKeyword_COUNT
    1.28 +};
    1.29 +#undef CSS_KEY
    1.30 +
    1.31 +
    1.32 +class nsCSSKeywords {
    1.33 +public:
    1.34 +  static void AddRefTable(void);
    1.35 +  static void ReleaseTable(void);
    1.36 +
    1.37 +  // Given a keyword string, return the enum value
    1.38 +  static nsCSSKeyword LookupKeyword(const nsACString& aKeyword);
    1.39 +  static nsCSSKeyword LookupKeyword(const nsAString& aKeyword);
    1.40 +
    1.41 +  // Given a keyword enum, get the string value
    1.42 +  static const nsAFlatCString& GetStringValue(nsCSSKeyword aKeyword);
    1.43 +};
    1.44 +
    1.45 +#endif /* nsCSSKeywords_h___ */

mercurial