PlacesEvent.h (2523B)
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/. */ 6 7 #ifndef mozilla_dom_PlacesEvent_h 8 #define mozilla_dom_PlacesEvent_h 9 10 #include "mozilla/dom/PlacesEventBinding.h" 11 #include "nsWrapperCache.h" 12 13 namespace mozilla { 14 class ErrorResult; 15 16 namespace dom { 17 18 class PlacesEvent : public nsWrapperCache { 19 public: 20 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PlacesEvent) 21 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(PlacesEvent) 22 23 nsISupports* GetParentObject() const; 24 25 PlacesEventType Type() const { return mType; } 26 27 virtual const PlacesVisit* AsPlacesVisit() const { return nullptr; } 28 virtual const PlacesBookmark* AsPlacesBookmark() const { return nullptr; } 29 virtual const PlacesBookmarkAddition* AsPlacesBookmarkAddition() const { 30 return nullptr; 31 } 32 virtual const PlacesBookmarkRemoved* AsPlacesBookmarkRemoved() const { 33 return nullptr; 34 } 35 virtual const PlacesBookmarkMoved* AsPlacesBookmarkMoved() const { 36 return nullptr; 37 } 38 virtual const PlacesBookmarkGuid* AsPlacesBookmarkGuid() const { 39 return nullptr; 40 } 41 virtual const PlacesBookmarkKeyword* AsPlacesBookmarkKeyword() const { 42 return nullptr; 43 } 44 virtual const PlacesBookmarkTags* AsPlacesBookmarkTags() const { 45 return nullptr; 46 } 47 virtual const PlacesBookmarkTime* AsPlacesBookmarkTime() const { 48 return nullptr; 49 } 50 virtual const PlacesBookmarkTitle* AsPlacesBookmarkTitle() const { 51 return nullptr; 52 } 53 virtual const PlacesBookmarkUrl* AsPlacesBookmarkUrl() const { 54 return nullptr; 55 } 56 virtual const PlacesFavicon* AsPlacesFavicon() const { return nullptr; } 57 virtual const PlacesVisitTitle* AsPlacesVisitTitle() const { return nullptr; } 58 virtual const PlacesHistoryCleared* AsPlacesHistoryCleared() const { 59 return nullptr; 60 } 61 virtual const PlacesRanking* AsPlacesRanking() const { return nullptr; } 62 virtual const PlacesVisitRemoved* AsPlacesVisitRemoved() const { 63 return nullptr; 64 } 65 virtual const PlacesPurgeCaches* AsPlacesPurgeCaches() const { 66 return nullptr; 67 } 68 69 protected: 70 explicit PlacesEvent(PlacesEventType aType) : mType(aType) {} 71 virtual ~PlacesEvent() = default; 72 PlacesEventType mType; 73 }; 74 75 } // namespace dom 76 } // namespace mozilla 77 78 #endif // mozilla_dom_PlacesEvent_h