Added GetDocumentURLGroup() methodnsIDocument.h

This commit is contained in:
rpotts%netscape.com 1998-10-01 21:43:02 +00:00
Родитель 384b20fa6a
Коммит c70c256c86
4 изменённых файлов: 30 добавлений и 0 удалений

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

@ -36,6 +36,7 @@ class nsIStreamObserver;
class nsIStyleSet; class nsIStyleSet;
class nsIStyleSheet; class nsIStyleSheet;
class nsIURL; class nsIURL;
class nsIURLGroup;
class nsIViewManager; class nsIViewManager;
class nsString; class nsString;
class nsIScriptContextOwner; class nsIScriptContextOwner;
@ -88,6 +89,11 @@ public:
*/ */
virtual nsIURL* GetDocumentURL() const = 0; virtual nsIURL* GetDocumentURL() const = 0;
/**
* Return the URLGroup for the document. May return null.
*/
virtual nsIURLGroup* GetDocumentURLGroup() const = 0;
/** /**
* Return a standard name for the document's character set. This will * Return a standard name for the document's character set. This will
* trigger a startDocumentLoad if necessary to answer the question. * trigger a startDocumentLoad if necessary to answer the question.

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

@ -20,6 +20,7 @@
#include "nsDocument.h" #include "nsDocument.h"
#include "nsIArena.h" #include "nsIArena.h"
#include "nsIURL.h" #include "nsIURL.h"
#include "nsIURLGroup.h"
#include "nsString.h" #include "nsString.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "nsIStyleSet.h" #include "nsIStyleSet.h"
@ -146,6 +147,7 @@ nsDocument::nsDocument()
mArena = nsnull; mArena = nsnull;
mDocumentTitle = nsnull; mDocumentTitle = nsnull;
mDocumentURL = nsnull; mDocumentURL = nsnull;
mDocumentURLGroup = nsnull;
mCharacterSet = eCharSetID_IsoLatin1; mCharacterSet = eCharSetID_IsoLatin1;
mParentDocument = nsnull; mParentDocument = nsnull;
mRootContent = nsnull; mRootContent = nsnull;
@ -180,6 +182,7 @@ nsDocument::~nsDocument()
mDocumentTitle = nsnull; mDocumentTitle = nsnull;
} }
NS_IF_RELEASE(mDocumentURL); NS_IF_RELEASE(mDocumentURL);
NS_IF_RELEASE(mDocumentURLGroup);
mParentDocument = nsnull; mParentDocument = nsnull;
@ -288,6 +291,12 @@ nsIURL* nsDocument::GetDocumentURL() const
return mDocumentURL; return mDocumentURL;
} }
nsIURLGroup* nsDocument::GetDocumentURLGroup() const
{
NS_IF_ADDREF(mDocumentURLGroup);
return mDocumentURLGroup;
}
nsCharSetID nsDocument::GetDocumentCharacterSet() const nsCharSetID nsDocument::GetDocumentCharacterSet() const
{ {
return mCharacterSet; return mCharacterSet;

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

@ -36,6 +36,7 @@ class nsIStreamObserver;
class nsIStyleSet; class nsIStyleSet;
class nsIStyleSheet; class nsIStyleSheet;
class nsIURL; class nsIURL;
class nsIURLGroup;
class nsIViewManager; class nsIViewManager;
class nsString; class nsString;
class nsIScriptContextOwner; class nsIScriptContextOwner;
@ -88,6 +89,11 @@ public:
*/ */
virtual nsIURL* GetDocumentURL() const = 0; virtual nsIURL* GetDocumentURL() const = 0;
/**
* Return the URLGroup for the document. May return null.
*/
virtual nsIURLGroup* GetDocumentURLGroup() const = 0;
/** /**
* Return a standard name for the document's character set. This will * Return a standard name for the document's character set. This will
* trigger a startDocumentLoad if necessary to answer the question. * trigger a startDocumentLoad if necessary to answer the question.

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

@ -20,6 +20,7 @@
#include "nsDocument.h" #include "nsDocument.h"
#include "nsIArena.h" #include "nsIArena.h"
#include "nsIURL.h" #include "nsIURL.h"
#include "nsIURLGroup.h"
#include "nsString.h" #include "nsString.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "nsIStyleSet.h" #include "nsIStyleSet.h"
@ -146,6 +147,7 @@ nsDocument::nsDocument()
mArena = nsnull; mArena = nsnull;
mDocumentTitle = nsnull; mDocumentTitle = nsnull;
mDocumentURL = nsnull; mDocumentURL = nsnull;
mDocumentURLGroup = nsnull;
mCharacterSet = eCharSetID_IsoLatin1; mCharacterSet = eCharSetID_IsoLatin1;
mParentDocument = nsnull; mParentDocument = nsnull;
mRootContent = nsnull; mRootContent = nsnull;
@ -180,6 +182,7 @@ nsDocument::~nsDocument()
mDocumentTitle = nsnull; mDocumentTitle = nsnull;
} }
NS_IF_RELEASE(mDocumentURL); NS_IF_RELEASE(mDocumentURL);
NS_IF_RELEASE(mDocumentURLGroup);
mParentDocument = nsnull; mParentDocument = nsnull;
@ -288,6 +291,12 @@ nsIURL* nsDocument::GetDocumentURL() const
return mDocumentURL; return mDocumentURL;
} }
nsIURLGroup* nsDocument::GetDocumentURLGroup() const
{
NS_IF_ADDREF(mDocumentURLGroup);
return mDocumentURLGroup;
}
nsCharSetID nsDocument::GetDocumentCharacterSet() const nsCharSetID nsDocument::GetDocumentCharacterSet() const
{ {
return mCharacterSet; return mCharacterSet;