/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef DOM_VIEWTRANSITIONTYPESET_H_
#define DOM_VIEWTRANSITIONTYPESET_H_

#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"

namespace mozilla {
class ErrorResult;
namespace dom {

class ViewTransition;

class ViewTransitionTypeSet final : public nsISupports, public nsWrapperCache {
 public:
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ViewTransitionTypeSet)

 public:
  explicit ViewTransitionTypeSet(ViewTransition&);

  MOZ_CAN_RUN_SCRIPT ViewTransitionTypeSet* Add(const nsAString&, ErrorResult&);
  MOZ_CAN_RUN_SCRIPT void Clear(ErrorResult&);
  MOZ_CAN_RUN_SCRIPT bool Delete(const nsAString&, ErrorResult&);

 protected:
  ~ViewTransitionTypeSet();

 public:
  nsISupports* GetParentObject() const;

  JSObject* WrapObject(JSContext* aCx,
                       JS::Handle<JSObject*> aGivenProto) override;

  RefPtr<ViewTransition> mTransition;
};

}  // namespace dom
}  // namespace mozilla

#endif  // DOM_VIEWTRANSITIONTYPESET_H_
