Bug 1850713: remove duplicated setting of early hint preloader id in `ScriptLoader...
[gecko.git] / dom / base / PlacesBookmarkMoved.h
blob67b0ba191f3f7bd0092301735e15f08a33bfc536
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_PlacesBookmarkMoved_h
8 #define mozilla_dom_PlacesBookmarkMoved_h
10 #include "mozilla/dom/PlacesBookmark.h"
12 namespace mozilla {
13 namespace dom {
14 class PlacesBookmarkMoved final : public PlacesBookmark {
15 public:
16 explicit PlacesBookmarkMoved()
17 : PlacesBookmark(PlacesEventType::Bookmark_moved) {}
19 static already_AddRefed<PlacesBookmarkMoved> Constructor(
20 const GlobalObject& aGlobal, const PlacesBookmarkMovedInit& aInitDict) {
21 RefPtr<PlacesBookmarkMoved> event = new PlacesBookmarkMoved();
22 event->mId = aInitDict.mId;
23 event->mItemType = aInitDict.mItemType;
24 event->mUrl = aInitDict.mUrl;
25 event->mGuid = aInitDict.mGuid;
26 event->mParentGuid = aInitDict.mParentGuid;
27 event->mIndex = aInitDict.mIndex;
28 event->mOldParentGuid = aInitDict.mOldParentGuid;
29 event->mOldIndex = aInitDict.mOldIndex;
30 event->mSource = aInitDict.mSource;
31 event->mIsTagging = aInitDict.mIsTagging;
32 event->mTitle = aInitDict.mTitle;
33 event->mTags = aInitDict.mTags;
34 event->mFrecency = aInitDict.mFrecency;
35 event->mHidden = aInitDict.mHidden;
36 event->mVisitCount = aInitDict.mVisitCount;
37 if (!aInitDict.mLastVisitDate.IsNull()) {
38 event->mLastVisitDate.SetValue(aInitDict.mLastVisitDate.Value());
39 } else {
40 event->mLastVisitDate.SetNull();
42 return event.forget();
45 JSObject* WrapObject(JSContext* aCx,
46 JS::Handle<JSObject*> aGivenProto) override {
47 return PlacesBookmarkMoved_Binding::Wrap(aCx, this, aGivenProto);
50 const PlacesBookmarkMoved* AsPlacesBookmarkMoved() const override {
51 return this;
54 int32_t Index() { return mIndex; }
55 int32_t OldIndex() { return mOldIndex; }
56 void GetOldParentGuid(nsCString& aOldParentGuid) {
57 aOldParentGuid = mOldParentGuid;
59 void GetTitle(nsString& aTitle) { aTitle = mTitle; }
60 void GetTags(nsString& aTags) { aTags = mTags; }
61 uint64_t Frecency() { return mFrecency; }
62 bool Hidden() { return mHidden; }
63 uint32_t VisitCount() { return mVisitCount; }
64 Nullable<uint64_t> GetLastVisitDate() { return mLastVisitDate; }
66 int32_t mIndex;
67 int32_t mOldIndex;
68 nsCString mOldParentGuid;
69 nsString mTitle;
70 nsString mTags;
71 int64_t mFrecency;
72 bool mHidden;
73 uint32_t mVisitCount;
74 Nullable<uint64_t> mLastVisitDate;
76 private:
77 ~PlacesBookmarkMoved() = default;
80 } // namespace dom
81 } // namespace mozilla
83 #endif