Backed out changeset 1d9301697aa0 (bug 1887752) for causing failures on browser_all_f...
[gecko.git] / dom / base / PlacesBookmarkRemoved.h
blobc8743a7fe4d61b69a15908c5ba88225baca23009
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_PlacesBookmarkRemoved_h
8 #define mozilla_dom_PlacesBookmarkRemoved_h
10 #include "mozilla/dom/PlacesBookmark.h"
12 namespace mozilla {
13 namespace dom {
14 class PlacesBookmarkRemoved final : public PlacesBookmark {
15 public:
16 explicit PlacesBookmarkRemoved()
17 : PlacesBookmark(PlacesEventType::Bookmark_removed) {}
19 static already_AddRefed<PlacesBookmarkRemoved> Constructor(
20 const GlobalObject& aGlobal, const PlacesBookmarkRemovedInit& aInitDict) {
21 RefPtr<PlacesBookmarkRemoved> event = new PlacesBookmarkRemoved();
22 event->mItemType = aInitDict.mItemType;
23 event->mId = aInitDict.mId;
24 event->mParentId = aInitDict.mParentId;
25 event->mIndex = aInitDict.mIndex;
26 event->mUrl = aInitDict.mUrl;
27 event->mTitle = aInitDict.mTitle;
28 event->mGuid = aInitDict.mGuid;
29 event->mParentGuid = aInitDict.mParentGuid;
30 event->mSource = aInitDict.mSource;
31 event->mIsTagging = aInitDict.mIsTagging;
32 event->mIsDescendantRemoval = aInitDict.mIsDescendantRemoval;
33 return event.forget();
36 JSObject* WrapObject(JSContext* aCx,
37 JS::Handle<JSObject*> aGivenProto) override {
38 return PlacesBookmarkRemoved_Binding::Wrap(aCx, this, aGivenProto);
41 const PlacesBookmarkRemoved* AsPlacesBookmarkRemoved() const override {
42 return this;
45 int32_t Index() { return mIndex; }
46 void GetTitle(nsString& aTitle) { aTitle = mTitle; }
47 bool IsDescendantRemoval() { return mIsDescendantRemoval; }
49 int32_t mIndex;
50 nsString mTitle;
51 bool mIsDescendantRemoval;
53 private:
54 ~PlacesBookmarkRemoved() = default;
57 } // namespace dom
58 } // namespace mozilla
60 #endif