CSSVariableReferenceValue.h (1903B)
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_CSSVARIABLEREFERENCEVALUE_H_ 8 #define LAYOUT_STYLE_TYPEDOM_CSSVARIABLEREFERENCEVALUE_H_ 9 10 #include "js/TypeDecls.h" 11 #include "mozilla/dom/CSSUnparsedValueBindingFwd.h" 12 #include "nsCOMPtr.h" 13 #include "nsISupports.h" 14 #include "nsISupportsImpl.h" 15 #include "nsStringFwd.h" 16 #include "nsWrapperCache.h" 17 18 template <class T> 19 struct already_AddRefed; 20 21 namespace mozilla { 22 23 class ErrorResult; 24 25 namespace dom { 26 27 class GlobalObject; 28 29 class CSSVariableReferenceValue final : public nsISupports, 30 public nsWrapperCache { 31 public: 32 explicit CSSVariableReferenceValue(nsCOMPtr<nsISupports> aParent); 33 34 NS_DECL_CYCLE_COLLECTING_ISUPPORTS 35 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(CSSVariableReferenceValue) 36 37 nsISupports* GetParentObject() const; 38 39 JSObject* WrapObject(JSContext* aCx, 40 JS::Handle<JSObject*> aGivenProto) override; 41 42 // start of CSSVariableReferenceValue Web IDL declarations 43 44 static already_AddRefed<CSSVariableReferenceValue> Constructor( 45 const GlobalObject& aGlobal, const nsACString& aVariable, 46 CSSUnparsedValue* aFallback, ErrorResult& aRv); 47 48 void GetVariable(nsCString& aRetVal) const; 49 50 void SetVariable(const nsACString& aArg, ErrorResult& aRv); 51 52 CSSUnparsedValue* GetFallback() const; 53 54 // end of CSSVariableReferenceValue Web IDL declarations 55 56 private: 57 virtual ~CSSVariableReferenceValue() = default; 58 59 nsCOMPtr<nsISupports> mParent; 60 }; 61 62 } // namespace dom 63 } // namespace mozilla 64 65 #endif // LAYOUT_STYLE_TYPEDOM_CSSVARIABLEREFERENCEVALUE_H_