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"
14 class PlacesBookmarkRemoved final
: public PlacesBookmark
{
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
{
45 int32_t Index() { return mIndex
; }
46 void GetTitle(nsString
& aTitle
) { aTitle
= mTitle
; }
47 bool IsDescendantRemoval() { return mIsDescendantRemoval
; }
51 bool mIsDescendantRemoval
;
54 ~PlacesBookmarkRemoved() = default;
58 } // namespace mozilla