These files got checked in with win32 EOL characters, re-checking these in. r=radha,akkana

This commit is contained in:
mcafee%netscape.com 1999-11-23 01:07:29 +00:00
Родитель 632ed6e972
Коммит bade3df4a7
7 изменённых файлов: 0 добавлений и 852 удалений

Просмотреть файл

@ -1,59 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (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/MPL/
*
* 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 the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications, Inc. Portions created by Netscape are
* Copyright (C) 1999, Mozilla. All Rights Reserved.
*
* Contributor(s):
* Radha Kulkarni <radha@netscape.com>
*/
#include "nsISupports.idl"
#include "nsIEnumerator.idl"
#include "nsISHEntry.idl"
/**
* The nsISHEntryContainer. The interface to access child entries
* of an nsISHEntry.
*
*/
[scriptable, uuid(65281BA2-988A-11d3-BDC7-0050040A9B44)]
interface nsISHContainer : nsISupports
{
/**
* The current number of nsISHEntries which are immediate children of the
* current SHEntry
*/
readonly attribute long childCount;
/**
* Add a new child SHEntry. Adds to the end of the list.
*/
void AddChild(in nsISHEntry child);
/**
* Removes a child SHEntry
*/
void RemoveChild(in nsISHEntry child);
/**
* Enumerator to walk child list.
*/
readonly attribute nsIEnumerator childEnumerator;
};

Просмотреть файл

@ -1,62 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (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.org 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.
*
* Contributor(s):
* Radha Kulkarni <radha@netscape.com>
*/
/**
* The interface to nsISHentry. Each document or subframe in
* Session History will have a nsISHEntry associated with it which will
* hold all information required to recreate the document from history
*
*/
#include "nsISupports.idl"
#include "nsIURI.idl"
#include "domstubs.idl"
#include "nsIInputStream.idl"
[scriptable, uuid(65281BA1-988A-11d3-BDC7-0050040A9B44)]
interface nsISHEntry : nsISupports
{
/** URI for the document */
attribute nsIURI uri;
/** DOM Document */
attribute nsIDOMDocument document;
/** Title for the document */
attribute wstring title;
/** Post Data for the document */
attribute nsIInputStream postData;
/** LayoutHistoryState for scroll position and form values */
attribute nsISupports layoutHistoryState;
/** Parent of the current entry */
attribute nsISHEntry parent;
/** Additional ways to create an entry */
void create(in nsIURI aURI, in wstring aTitle, in nsIDOMDocument aDocument,
in nsIInputStream aInputStream, in nsISupports aHistoryLayoutState);
};

Просмотреть файл

@ -1,61 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (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/MPL/
*
* 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 the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications, Inc. Portions created by Netscape are
* Copyright (C) 1999, Mozilla. All Rights Reserved.
*
* Contributor(s):
* Radha Kulkarni <radha@netscape.com>
*/
#include "nsISupports.idl"
#include "nsISHEntry.idl"
#include "nsIEnumerator.idl"
/**
* The nsISHTransaction.
*/
[scriptable, uuid(2F0C3A72-988B-11d3-BDC7-0050040A9B44)]
interface nsISHTransaction : nsISupports
{
/**
* The nsISHEntry for the current transaction
*/
readonly attribute nsISHEntry currentSHistoryEntry;
/**
* The parent of this transaction
*/
readonly attribute nsISHTransaction parent;
/**
* The legitimate child of this transaction
*/
readonly attribute nsISHTransaction child;
/**
* The *other* children of this transaction.
*/
readonly attribute nsISHTransaction lrvList;
/**
* Create a transaction with parent and History Entry
*/
void create(in nsISHEntry aSHEntry, in nsISHTransaction aParent);
};

Просмотреть файл

@ -1,405 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (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/MPL/
*
* 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 the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications, Inc. Portions created by Netscape are
* Copyright (C) 1999, Mozilla. All Rights Reserved.
*
* Contributor(s):
* Radha Kulkarni <radha@netscape.com>
*/
#include "nsISupportsUtils.h"
//#include "nsCOMPtr.h"
#include "nsIDOMDocument.h"
#include "nsSHEntry.h"
#ifdef XXX_NS_DEBUG // XXX: we'll need a logging facility for debugging
#define WEB_TRACE(_bit,_args) \
PR_BEGIN_MACRO \
if (WEB_LOG_TEST(gLogModule,_bit)) { \
PR_LogPrint _args; \
} \
PR_END_MACRO
#else
#define WEB_TRACE(_bit,_args)
#endif
//*****************************************************************************
//*** nsSHEnumerator: Object Management
//*****************************************************************************
class nsSHEnumerator : public nsIEnumerator
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIENUMERATOR
NS_IMETHOD CurrentItem(nsISHEntry ** aItem);
private:
friend class nsSHEntry;
nsSHEnumerator(nsSHEntry * aEntry);
virtual ~nsSHEnumerator();
PRInt32 mIndex;
nsSHEntry * mSHEntry;
};
//*****************************************************************************
//*** nsSHEntry: Object Management
//*****************************************************************************
nsSHEntry::nsSHEntry()
{
NS_INIT_REFCNT();
mURI = (nsnull);
mPostData = (nsnull);
mDocument= (nsnull);
mLayoutHistoryState= (nsnull);
}
NS_IMETHODIMP
nsSHEntry::Create(nsIURI * aURI, const PRUnichar * aTitle, nsIDOMDocument * aDOMDocument,
nsIInputStream * aInputStream, nsISupports * aHistoryLayoutState)
{
SetUri(aURI);
SetTitle(aTitle);
SetDocument(aDOMDocument);
SetPostData(aInputStream);
SetLayoutHistoryState(aHistoryLayoutState);
return NS_OK;
}
nsSHEntry::~nsSHEntry()
{
NS_IF_RELEASE(mURI);
NS_IF_RELEASE(mPostData);
NS_IF_RELEASE(mDocument);
NS_IF_RELEASE(mLayoutHistoryState);
if (mTitle)
delete mTitle;
DestroyChildren();
}
void
nsSHEntry::DestroyChildren() {
PRInt32 i, n;
n = GetChildCount(&n);
for (i = 0; i < n; i++) {
nsISHEntry* child = (nsISHEntry *) mChildren.ElementAt(i);
child->SetParent(nsnull); // Weak reference to parent
delete child;
}
mChildren.Clear();
}
// nsSHEntry::nsISupports
NS_IMPL_ISUPPORTS2(nsSHEntry, nsISHEntry, nsISHContainer)
NS_IMETHODIMP
nsSHEntry::GetUri(nsIURI **aUri)
{
NS_ENSURE_ARG_POINTER(aUri);
*aUri = mURI;
NS_IF_ADDREF(mURI);
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::SetUri(nsIURI * aUri)
{
NS_IF_RELEASE(mURI);
mURI = aUri;
NS_IF_ADDREF(mURI);
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::SetDocument(nsIDOMDocument * aDocument)
{
NS_IF_RELEASE(mDocument);
mDocument = aDocument;
NS_IF_ADDREF(mDocument);
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::GetDocument(nsIDOMDocument ** aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = mDocument;
NS_IF_ADDREF(mDocument);
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::GetTitle(PRUnichar** aTitle)
{
NS_ENSURE_ARG_POINTER(aTitle);
if (mTitle)
*aTitle = mTitle->ToNewUnicode();
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::SetTitle(const PRUnichar* aTitle)
{
if (mTitle)
delete mTitle;
if (aTitle)
mTitle = new nsString(aTitle);
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::GetPostData(nsIInputStream ** aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = mPostData;
NS_IF_ADDREF(mPostData);
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::SetPostData(nsIInputStream * aPostData)
{
NS_IF_RELEASE(mPostData);
mPostData = aPostData;
NS_IF_ADDREF(aPostData);
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::GetLayoutHistoryState(nsISupports ** aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = mLayoutHistoryState;
NS_IF_ADDREF(mLayoutHistoryState);
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::SetLayoutHistoryState(nsISupports * aState)
{
NS_IF_RELEASE(mLayoutHistoryState);
mLayoutHistoryState = aState;
NS_IF_ADDREF(aState);
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::GetParent(nsISHEntry ** aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = mParent;
NS_IF_ADDREF(*aResult);
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::SetParent(nsISHEntry * aParent)
{
/* parent not Addrefed on purpose to avoid cyclic reference
* Null parent is OK
*/
mParent = aParent;
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::GetChildCount(PRInt32 * aCount)
{
NS_ENSURE_ARG_POINTER(aCount);
*aCount = mChildren.Count();
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::AddChild(nsISHEntry * aChild)
{
NS_ENSURE_ARG_POINTER(aChild);
NS_ENSURE_SUCCESS(aChild->SetParent(this), NS_ERROR_FAILURE);
mChildren.AppendElement((void *)aChild);
NS_ADDREF(aChild);
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::RemoveChild(nsISHEntry * aChild)
{
NS_ENSURE_ARG_POINTER(aChild);
PRBool childRemoved = mChildren.RemoveElement((void *)aChild);
if (childRemoved) {
aChild->SetParent(nsnull);
NS_RELEASE(aChild);
}
return NS_OK;
}
NS_IMETHODIMP
nsSHEntry::GetChildEnumerator(nsIEnumerator** aChildEnumerator)
{
nsresult status = NS_OK;
NS_ENSURE_ARG_POINTER(aChildEnumerator);
nsSHEnumerator * iterator = new nsSHEnumerator(this);
if (iterator && !!NS_SUCCEEDED(status = CallQueryInterface(iterator, aChildEnumerator)))
delete iterator;
return status;
}
//*****************************************************************************
//*** nsSHEnumerator: Object Management
//*****************************************************************************
nsSHEnumerator::nsSHEnumerator(nsSHEntry * aEntry):mIndex(0)
{
NS_INIT_REFCNT();
mSHEntry = aEntry;
}
nsSHEnumerator::~nsSHEnumerator()
{
}
NS_IMETHODIMP
nsSHEnumerator::Next()
{
mIndex++;
PRUint32 cnt=0;
cnt = mSHEntry->mChildren.Count();
if (mIndex < (PRInt32)cnt)
return NS_OK;
return NS_ERROR_FAILURE;
}
#if 0
NS_IMETHODIMP
nsSHEnumerator::Prev()
{
mIndex--;
if (mIndex >= 0 )
return NS_OK;
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsSHEnumerator::Last()
{
PRUint32 cnt;
nsresult rv = mSHEntry->mChildren.Count(&cnt);
if (NS_FAILED(rv)) return rv;
mIndex = (PRInt32)cnt-1;
return NS_OK;
}
#endif /* 0 */
NS_IMETHODIMP
nsSHEnumerator::First()
{
mIndex = 0;
return NS_OK;
}
NS_IMETHODIMP
nsSHEnumerator::CurrentItem(nsISupports **aItem)
{
if (!aItem)
return NS_ERROR_NULL_POINTER;
PRUint32 cnt= mSHEntry->mChildren.Count();
if (mIndex >=0 && mIndex < (PRInt32)cnt){
*aItem = (nsISupports *)mSHEntry->mChildren.ElementAt(mIndex);
NS_IF_ADDREF(*aItem);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
NS_IMPL_ISUPPORTS1(nsSHEnumerator, nsIEnumerator)
NS_IMETHODIMP
nsSHEnumerator::CurrentItem(nsISHEntry **aItem)
{
if (!aItem)
return NS_ERROR_NULL_POINTER;
PRUint32 cnt = mSHEntry->mChildren.Count();
if (mIndex >=0 && mIndex < (PRInt32)cnt){
nsCOMPtr<nsISupports> indexIsupports = (nsISHEntry *) mSHEntry->mChildren.ElementAt(mIndex);
return indexIsupports->QueryInterface(nsISHEntry::GetIID(),(void **)aItem);
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsSHEnumerator::IsDone()
{
PRUint32 cnt;
cnt = mSHEntry->mChildren.Count();
if (mIndex >= 0 && mIndex < (PRInt32)cnt ) {
return NS_ENUMERATOR_FALSE;
}
return NS_OK;
}
#if 0
NS_IMETHODIMP
nsRangeListIterator::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
if (nsnull == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsIEnumerator::GetIID())) {
*aInstancePtr = NS_STATIC_CAST(nsIEnumerator*, this);
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIBidirectionalEnumerator::GetIID())) {
*aInstancePtr = NS_STATIC_CAST(nsIBidirectionalEnumerator*, this);
NS_ADDREF_THIS();
return NS_OK;
}
return mDomSelection->QueryInterface(aIID, aInstancePtr);
}
#endif
////////////END nsSHEnumerator methods

Просмотреть файл

@ -1,59 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (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/MPL/
*
* 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 the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications, Inc. Portions created by Netscape are
* Copyright (C) 1999, Mozilla. All Rights Reserved.
*
* Contributor(s):
* Radha Kulkarni <radha@netscape.com>
*/
#ifndef nsSHEntry_h
#define nsSHEntry_h
#include "nsCOMPtr.h"
#include "nsISHEntry.h"
#include "nsISHContainer.h"
#include "nsVoidArray.h"
#include "nsString.h"
class nsSHEnumerator;
class nsSHEntry : public nsISHEntry,
public nsISHContainer
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISHENTRY
NS_DECL_NSISHCONTAINER
protected:
nsSHEntry();
virtual ~nsSHEntry();
void DestroyChildren();
private:
friend class nsSHEnumerator;
nsIURI * mURI;
nsIDOMDocument * mDocument;
nsString * mTitle;
nsIInputStream * mPostData;
nsISupports * mLayoutHistoryState;
nsVoidArray mChildren;
nsISHEntry * mParent; // weak reference to parent
};
#endif /* nsSHEntry_h */

Просмотреть файл

@ -1,151 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (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/MPL/
*
* 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 the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications, Inc. Portions created by Netscape are
* Copyright (C) 1999, Mozilla. All Rights Reserved.
*
* Contributor(s):
* Radha Kulkarni <radha@netscape.com>
*/
#include "nsISupportsUtils.h"
#include "nsCOMPtr.h"
#include "nsIDOMDocument.h"
#include "nsSHTransaction.h"
#ifdef XXX_NS_DEBUG // XXX: we'll need a logging facility for debugging
#define WEB_TRACE(_bit,_args) \
PR_BEGIN_MACRO \
if (WEB_LOG_TEST(gLogModule,_bit)) { \
PR_LogPrint _args; \
} \
PR_END_MACRO
#else
#define WEB_TRACE(_bit,_args)
#endif
NS_IMPL_ISUPPORTS1(nsSHTransaction, nsISHTransaction)
nsSHTransaction::nsSHTransaction() : mSHEntry(nsnull), mParent(nsnull),
mChild(nsnull), mLRVList(nsnull)
{
NS_INIT_REFCNT();
}
nsSHTransaction::~nsSHTransaction()
{
NS_IF_RELEASE(mSHEntry);
mParent = nsnull; //Weak reference to parent transaction
NS_IF_RELEASE(mChild);
NS_IF_RELEASE(mLRVList);
}
NS_IMETHODIMP
nsSHTransaction::Create(nsISHEntry * aSHEntry, nsISHTransaction * aParent)
{
SetCurrentSHistoryEntry(aSHEntry);
if (aParent) {
// This will correctly set the parent child pointers
((nsSHTransaction *)aParent)->SetChild(this);
}
else
SetParent(aParent);
return NS_OK;
}
NS_IMETHODIMP
nsSHTransaction::GetCurrentSHistoryEntry(nsISHEntry ** aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = mSHEntry;
NS_IF_ADDREF(mSHEntry);
return NS_OK;
}
nsresult
nsSHTransaction::SetCurrentSHistoryEntry(nsISHEntry * aSHEntry)
{
NS_IF_RELEASE(mSHEntry);
mSHEntry = aSHEntry;
NS_IF_ADDREF(mSHEntry);
return NS_OK;
}
NS_IMETHODIMP
nsSHTransaction::GetChild(nsISHTransaction * * aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = mChild;
NS_IF_ADDREF(mChild);
return NS_OK;
}
nsresult
nsSHTransaction::SetChild(nsISHTransaction * aChild)
{
if (mChild) {
// There is already a child. Move the child to the LRV list
if (mLRVList) {
//Delete any old LRV item that was there.
}
// Make the child the LRV item
}
NS_ENSURE_SUCCESS(((nsSHTransaction *)aChild)->SetParent(this), NS_ERROR_FAILURE);
mChild = aChild;
NS_IF_ADDREF(aChild);
return NS_OK;
}
nsresult
nsSHTransaction::SetParent(nsISHTransaction * aParent)
{
/* This is weak reference to parent. Do not Addref it */
mParent = aParent;
return NS_OK;
}
nsresult
nsSHTransaction::GetParent(nsISHTransaction ** aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = mParent;
NS_IF_ADDREF(*aResult);
return NS_OK;
}
NS_IMETHODIMP
nsSHTransaction::GetLrvList(nsISHTransaction ** aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = mLRVList;
NS_IF_ADDREF(mLRVList);
return NS_OK;
}

Просмотреть файл

@ -1,55 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (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/MPL/
*
* 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 the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications, Inc. Portions created by Netscape are
* Copyright (C) 1999, Mozilla. All Rights Reserved.
*
* Contributor(s):
* Radha Kulkarni <radha@netscape.com>
*/
#ifndef nsSHTransaction_h
#define nsSHTransaction_h
#include "nsISHTransaction.h"
#include "nsISHEntry.h"
class nsSHTransaction: public nsISHTransaction
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISHTRANSACTION
nsSHTransaction();
protected:
virtual ~nsSHTransaction();
private:
nsresult SetChild(nsISHTransaction * aChild);
nsresult SetParent(nsISHTransaction * aParent);
nsresult SetCurrentSHistoryEntry(nsISHEntry * aSHEntry);
nsISHEntry * mSHEntry;
/* Weak reference to parent */
nsISHTransaction * mParent;
nsISHTransaction * mChild;
nsISHTransaction * mLRVList;
};
#endif /* nsSHTransaction_h */