Bug 1812499 [wpt PR 38184] - Simplify handling of name-to-subdir mapping in canvas...
[gecko.git] / dom / base / PlacesEvent.h
blobc03297b652879eee5e181449b3729ac26e614c65
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_PlacesEvent_h
8 #define mozilla_dom_PlacesEvent_h
10 #include "mozilla/dom/PlacesEventBinding.h"
11 #include "nsWrapperCache.h"
13 namespace mozilla {
14 class ErrorResult;
16 namespace dom {
18 class PlacesEvent : public nsWrapperCache {
19 public:
20 explicit PlacesEvent(PlacesEventType aType) : mType(aType) {}
22 static already_AddRefed<PlacesEvent> Constructor(const GlobalObject& aGlobal,
23 PlacesEventType aType,
24 ErrorResult& aRv);
26 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PlacesEvent)
27 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(PlacesEvent)
29 nsISupports* GetParentObject() const;
31 JSObject* WrapObject(JSContext* aCx,
32 JS::Handle<JSObject*> aGivenProto) override;
34 PlacesEventType Type() const { return mType; }
36 virtual const PlacesVisit* AsPlacesVisit() const { return nullptr; }
37 virtual const PlacesBookmark* AsPlacesBookmark() const { return nullptr; }
38 virtual const PlacesBookmarkAddition* AsPlacesBookmarkAddition() const {
39 return nullptr;
41 virtual const PlacesBookmarkRemoved* AsPlacesBookmarkRemoved() const {
42 return nullptr;
44 virtual const PlacesBookmarkMoved* AsPlacesBookmarkMoved() const {
45 return nullptr;
47 virtual const PlacesBookmarkGuid* AsPlacesBookmarkGuid() const {
48 return nullptr;
50 virtual const PlacesBookmarkTags* AsPlacesBookmarkTags() const {
51 return nullptr;
53 virtual const PlacesBookmarkTime* AsPlacesBookmarkTime() const {
54 return nullptr;
56 virtual const PlacesBookmarkTitle* AsPlacesBookmarkTitle() const {
57 return nullptr;
59 virtual const PlacesBookmarkUrl* AsPlacesBookmarkUrl() const {
60 return nullptr;
62 virtual const PlacesFavicon* AsPlacesFavicon() const { return nullptr; }
63 virtual const PlacesVisitTitle* AsPlacesVisitTitle() const { return nullptr; }
64 virtual const PlacesHistoryCleared* AsPlacesHistoryCleared() const {
65 return nullptr;
67 virtual const PlacesRanking* AsPlacesRanking() const { return nullptr; }
68 virtual const PlacesVisitRemoved* AsPlacesVisitRemoved() const {
69 return nullptr;
71 virtual const PlacesPurgeCaches* AsPlacesPurgeCaches() const {
72 return nullptr;
75 protected:
76 virtual ~PlacesEvent() = default;
77 PlacesEventType mType;
80 } // namespace dom
81 } // namespace mozilla
83 #endif // mozilla_dom_PlacesEvent_h