dom/base/nsHistory.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* vim: set ts=2 sw=2 et tw=79: */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6 #ifndef nsHistory_h___
michael@0 7 #define nsHistory_h___
michael@0 8
michael@0 9 #include "mozilla/Attributes.h"
michael@0 10 #include "mozilla/ErrorResult.h"
michael@0 11 #include "nsCOMPtr.h"
michael@0 12 #include "nsCycleCollectionParticipant.h"
michael@0 13 #include "nsIDOMHistory.h"
michael@0 14 #include "nsPIDOMWindow.h" // for GetParentObject
michael@0 15 #include "nsStringFwd.h"
michael@0 16 #include "nsWrapperCache.h"
michael@0 17
michael@0 18 class nsIDocShell;
michael@0 19 class nsISHistory;
michael@0 20 class nsIWeakReference;
michael@0 21 class nsPIDOMWindow;
michael@0 22
michael@0 23 // Script "History" object
michael@0 24 class nsHistory MOZ_FINAL : public nsIDOMHistory, // Empty, needed for extension
michael@0 25 // backwards compat
michael@0 26 public nsWrapperCache
michael@0 27 {
michael@0 28 public:
michael@0 29 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
michael@0 30 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsHistory)
michael@0 31
michael@0 32 public:
michael@0 33 nsHistory(nsPIDOMWindow* aInnerWindow);
michael@0 34 virtual ~nsHistory();
michael@0 35
michael@0 36 nsPIDOMWindow* GetParentObject() const;
michael@0 37 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
michael@0 38
michael@0 39 uint32_t GetLength(mozilla::ErrorResult& aRv) const;
michael@0 40 void GetState(JSContext* aCx, JS::MutableHandle<JS::Value> aResult,
michael@0 41 mozilla::ErrorResult& aRv) const;
michael@0 42 void Go(int32_t aDelta, mozilla::ErrorResult& aRv);
michael@0 43 void Back(mozilla::ErrorResult& aRv);
michael@0 44 void Forward(mozilla::ErrorResult& aRv);
michael@0 45 void PushState(JSContext* aCx, JS::Handle<JS::Value> aData,
michael@0 46 const nsAString& aTitle, const nsAString& aUrl,
michael@0 47 mozilla::ErrorResult& aRv);
michael@0 48 void ReplaceState(JSContext* aCx, JS::Handle<JS::Value> aData,
michael@0 49 const nsAString& aTitle, const nsAString& aUrl,
michael@0 50 mozilla::ErrorResult& aRv);
michael@0 51
michael@0 52 protected:
michael@0 53 nsIDocShell* GetDocShell() const;
michael@0 54
michael@0 55 void PushOrReplaceState(JSContext* aCx, JS::Handle<JS::Value> aData,
michael@0 56 const nsAString& aTitle, const nsAString& aUrl,
michael@0 57 mozilla::ErrorResult& aRv, bool aReplace);
michael@0 58
michael@0 59 already_AddRefed<nsISHistory> GetSessionHistory() const;
michael@0 60
michael@0 61 nsCOMPtr<nsIWeakReference> mInnerWindow;
michael@0 62 };
michael@0 63
michael@0 64 #endif /* nsHistory_h___ */

mercurial