From 43bdebd085ad2a81188cceb717e4bcb8438c078f Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Mon, 14 Jun 1999 22:04:15 +0000 Subject: [PATCH] Session History. Initial checkins --- xpfe/appshell/public/Makefile.in | 1 + xpfe/appshell/public/makefile.win | 1 + xpfe/appshell/public/nsISessionHistory.h | 114 +++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 xpfe/appshell/public/nsISessionHistory.h diff --git a/xpfe/appshell/public/Makefile.in b/xpfe/appshell/public/Makefile.in index 72b79e1d1236..dbe7fbe7ea6b 100644 --- a/xpfe/appshell/public/Makefile.in +++ b/xpfe/appshell/public/Makefile.in @@ -35,6 +35,7 @@ EXPORTS = \ nsIDOMXPConnectFactory.h \ nsINetSupportDialogService.h \ nsIWindowMediator.h \ + nsISessionHistory.h \ $(NULL) EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) diff --git a/xpfe/appshell/public/makefile.win b/xpfe/appshell/public/makefile.win index c285d8b5046c..dcb220e586ab 100644 --- a/xpfe/appshell/public/makefile.win +++ b/xpfe/appshell/public/makefile.win @@ -33,6 +33,7 @@ EXPORTS = \ nsIFileLocator.h \ nsINetSupportDialogService.h \ nsIWindowMediator.h \ + nsISessionHistory.h \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/xpfe/appshell/public/nsISessionHistory.h b/xpfe/appshell/public/nsISessionHistory.h new file mode 100644 index 000000000000..86ef447eeba1 --- /dev/null +++ b/xpfe/appshell/public/nsISessionHistory.h @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and limitations + * under the License. + * + * The Original Code is Mozilla Communicator client code. + * + * The Initial Developer of the Original Code is Netscape Communications + * Corporation. Portions created by Netscape are Copyright (C) 1998 + * Netscape Communications Corporation. All Rights Reserved. + */ + +#ifndef nsISessionHistory_h_ +#define nsISessionHistory_h_ + +#include "nsISupports.h" +#include "nsIFactory.h" + +//Forward declarations +class nsHistoryEntry; +class nsISessionHistory; +class nsIWebShell; + +// Interface ID for nsISessionistory +#define NS_ISESSION_HISTORY_IID \ +{ 0x68e73d51, 0x12eb, 0x11d3, { 0xbd, 0xc0, 0x0, 0x50, 0x4, 0xa, 0x9b, 0x44 } \ +} + +//Class ID for nsISessionHistory +#define NS_SESSION_HISTORY_CID \ +{ 0x68e73d52, 0x12eb, 0x11d3, { 0xbd, 0xc0, 0x0, 0x50, 0x4, 0xa, 0x9b, 0x44 } \ +} + +class nsISessionHistory : public nsISupports +{ +public: + static const nsIID& GetIID() { static nsIID iid = NS_ISESSION_HISTORY_IID; return iid; } + + /** + * Get the history entry of the current document on screen + */ + // NS_IMETHOD getCurrentHistoryEntry(nsHistoryEntry *& aHistoryEntry) = 0; + + /** + * Go forward in history + */ + NS_IMETHOD Forward() = 0; + + /** + * Go Back in History + */ + NS_IMETHOD Back() = 0; + + /** + * whether you can go forward in History + */ + NS_IMETHOD canForward(PRBool &aResult) = 0; + + /** + * whether you can go back in History + */ + NS_IMETHOD canBack(PRBool &aResult) = 0; + + /** + * Add a new URL to the History List + */ + NS_IMETHOD add(nsIWebShell * aWebShell) = 0; + + /** + * Goto to a particular point in history + */ + NS_IMETHOD Goto(PRInt32 aHistoryIndex) = 0; + /** + * Get the length of the History list + */ + NS_IMETHOD getHistoryLength(PRInt32 & aResult) = 0; + + /** + * Get the index of the current document in the history list + */ + NS_IMETHOD getCurrentIndex(PRInt32 & aResult) = 0; + + /** + * Make a clone of the Session History. This will + * make a deep copy of the Session history data structures. + * This is used when you create a navigator window from the + * current browser window + */ + // NS_IMETHOD cloneHistory(nsISessionHistory * aSessionHistory) = 0; + /** + * Set the flag whether a history entry is in the middle of loading a + * doc. See comments below for details + */ + NS_IMETHOD SetLoadingFlag(PRBool aFlag) = 0; + + /** + * Set the historyentry that is in the middle of loading a doc + */ + NS_IMETHOD SetLoadingHistoryEntry(nsHistoryEntry * aHistoryEntry) = 0; + +}; + +extern "C" NS_APPSHELL nsresult +NS_NewSessionHistoryFactory(nsIFactory ** aFactory); + + +#endif /* nsISessionHistory_h_ */