CSSKeywordValue.h (1759B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim:set ts=2 sw=2 sts=2 et cindent: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef LAYOUT_STYLE_TYPEDOM_CSSKEYWORDVALUE_H_ 8 #define LAYOUT_STYLE_TYPEDOM_CSSKEYWORDVALUE_H_ 9 10 #include "js/TypeDecls.h" 11 #include "mozilla/dom/CSSStyleValue.h" 12 #include "nsString.h" 13 14 template <class T> 15 struct already_AddRefed; 16 template <class T> 17 class nsCOMPtr; 18 class nsISupports; 19 20 namespace mozilla { 21 22 struct CSSPropertyId; 23 class ErrorResult; 24 25 namespace dom { 26 27 class GlobalObject; 28 29 class CSSKeywordValue final : public CSSStyleValue { 30 public: 31 CSSKeywordValue(nsCOMPtr<nsISupports> aParent, const nsACString& aValue); 32 33 JSObject* WrapObject(JSContext* aCx, 34 JS::Handle<JSObject*> aGivenProto) override; 35 36 // start of CSSKeywordValue Web IDL declarations 37 38 // https://drafts.css-houdini.org/css-typed-om-1/#dom-csskeywordvalue-csskeywordvalue 39 static already_AddRefed<CSSKeywordValue> Constructor( 40 const GlobalObject& aGlobal, const nsACString& aValue, ErrorResult& aRv); 41 42 void GetValue(nsCString& aRetVal) const; 43 44 // https://drafts.css-houdini.org/css-typed-om-1/#dom-csskeywordvalue-value 45 void SetValue(const nsACString& aArg, ErrorResult& aRv); 46 47 // end of CSSKeywordValue Web IDL declarations 48 49 void ToCssTextWithProperty(const CSSPropertyId& aPropertyId, 50 nsACString& aDest) const; 51 52 private: 53 virtual ~CSSKeywordValue() = default; 54 55 nsCString mValue; 56 }; 57 58 } // namespace dom 59 } // namespace mozilla 60 61 #endif // LAYOUT_STYLE_TYPEDOM_CSSKEYWORDVALUE_H_