Added nsIBrowserWindow interface
git-svn-id: svn://10.0.0.236/trunk@37568 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
/* -*- 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.0 (the "NPL"); you may not use this file except in
|
||||
@@ -54,6 +54,13 @@ nsresult CWebShellContainer::QueryInterface(const nsIID& aIID, void** aInstanceP
|
||||
|
||||
*aInstancePtrResult = NULL;
|
||||
|
||||
if (aIID.Equals(kIBrowserWindowIID))
|
||||
{
|
||||
*aInstancePtrResult = (void*) ((nsIBrowserWindow*)this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aIID.Equals(kIStreamObserverIID))
|
||||
{
|
||||
*aInstancePtrResult = (void*) ((nsIStreamObserver*)this);
|
||||
@@ -86,6 +93,160 @@ nsresult CWebShellContainer::QueryInterface(const nsIID& aIID, void** aInstanceP
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsIBrowserWindow implementation
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::Init(nsIAppShell* aAppShell, nsIPref* aPrefs, const nsRect& aBounds, PRUint32 aChromeMask, PRBool aAllowPlugins)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::MoveTo(PRInt32 aX, PRInt32 aY)
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::MoveTo);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::SizeTo(PRInt32 aWidth, PRInt32 aHeight)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::GetBounds(nsRect& aResult)
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::GetBounds);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::GetWindowBounds(nsRect& aResult)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::Show()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::Hide()
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::Hide);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::Close()
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::Close);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::SetChrome(PRUint32 aNewChromeMask)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::GetChrome(PRUint32& aChromeMaskResult)
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::GetChrome);
|
||||
aChromeMaskResult = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::SetTitle(const PRUnichar* aTitle)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::GetTitle(const PRUnichar** aResult)
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::GetTitle);
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::SetStatus(const PRUnichar* aStatus)
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::SetStatus);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::GetStatus(const PRUnichar** aResult)
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::GetStatus);
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::SetProgress(PRInt32 aProgress, PRInt32 aProgressMax)
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::SetProgress);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::ShowMenuBar(PRBool aShow)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::IsMenuBarVisible(PRBool *aVisible)
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::IsMenuBarVisible);
|
||||
*aVisible = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::GetWebShell(nsIWebShell*& aResult)
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::GetWebShell);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::GetContentWebShell(nsIWebShell **aResult)
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::GetContentWebShell);
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsIWebShellContainer implementation
|
||||
|
||||
@@ -222,7 +383,7 @@ CWebShellContainer::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell)
|
||||
{
|
||||
NG_TRACE(_T("CWebShellContainer::NewWebShell()\n"));
|
||||
NG_TRACE_METHOD(CWebShellContainer::NewWebShell);
|
||||
nsresult rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
return rv;
|
||||
}
|
||||
@@ -251,7 +412,7 @@ CWebShellContainer::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& a
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken)
|
||||
{
|
||||
NG_TRACE(_T("CWebShellContainer::FocusAvailable()\n"));
|
||||
NG_TRACE_METHOD(CWebShellContainer::FocusAvailable);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -259,10 +420,12 @@ CWebShellContainer::FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocus
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::ContentShellAdded(nsIWebShell* aWebShell, nsIContent* frameNode)
|
||||
{
|
||||
NG_TRACE_METHOD(CWebShellContainer::ContentShellAdded);
|
||||
nsresult rv = NS_OK;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
CWebShellContainer::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
@@ -270,7 +433,11 @@ CWebShellContainer::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupCo
|
||||
const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow)
|
||||
{
|
||||
return NS_OK;
|
||||
NG_TRACE_METHOD(CWebShellContainer::CreatePopup);
|
||||
HMENU hMenu = ::CreatePopupMenu();
|
||||
InsertMenu(hMenu, 0, MF_BYPOSITION, 1, _T("TODO"));
|
||||
TrackPopupMenu(hMenu, TPM_LEFTALIGN, aXPos, aYPos, NULL, NULL, NULL);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
// interfaces into the web shell and so forth.
|
||||
|
||||
class CWebShellContainer :
|
||||
public nsIBrowserWindow,
|
||||
public nsIWebShellContainer,
|
||||
public nsIStreamObserver,
|
||||
public nsIDocumentLoaderObserver
|
||||
@@ -44,22 +45,43 @@ public:
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIBrowserWindow
|
||||
NS_IMETHOD Init(nsIAppShell* aAppShell, nsIPref* aPrefs, const nsRect& aBounds, PRUint32 aChromeMask, PRBool aAllowPlugins = PR_TRUE);
|
||||
NS_IMETHOD MoveTo(PRInt32 aX, PRInt32 aY);
|
||||
NS_IMETHOD SizeTo(PRInt32 aWidth, PRInt32 aHeight);
|
||||
NS_IMETHOD GetBounds(nsRect& aResult);
|
||||
NS_IMETHOD GetWindowBounds(nsRect& aResult);
|
||||
NS_IMETHOD Show();
|
||||
NS_IMETHOD Hide();
|
||||
NS_IMETHOD Close();
|
||||
NS_IMETHOD SetChrome(PRUint32 aNewChromeMask);
|
||||
NS_IMETHOD GetChrome(PRUint32& aChromeMaskResult);
|
||||
NS_IMETHOD SetTitle(const PRUnichar* aTitle);
|
||||
NS_IMETHOD GetTitle(const PRUnichar** aResult);
|
||||
NS_IMETHOD SetStatus(const PRUnichar* aStatus);
|
||||
NS_IMETHOD GetStatus(const PRUnichar** aResult);
|
||||
NS_IMETHOD SetProgress(PRInt32 aProgress, PRInt32 aProgressMax);
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow);
|
||||
NS_IMETHOD IsMenuBarVisible(PRBool *aVisible);
|
||||
NS_IMETHOD GetWebShell(nsIWebShell*& aResult);
|
||||
NS_IMETHOD GetContentWebShell(nsIWebShell **aResult);
|
||||
|
||||
// nsIWebShellContainer
|
||||
NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason);
|
||||
NS_IMETHOD BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL);
|
||||
NS_IMETHOD ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax);
|
||||
NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus);
|
||||
NS_IMETHOD NewWebShell(PRUint32 aChromeMask,
|
||||
PRBool aVisible,
|
||||
nsIWebShell *&aNewWebShell);
|
||||
PRBool aVisible,
|
||||
nsIWebShell *&aNewWebShell);
|
||||
NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult);
|
||||
NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken);
|
||||
NS_IMETHOD ContentShellAdded(nsIWebShell* aWebShell, nsIContent* frameNode);
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& anAnchorAlignment,
|
||||
const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow);
|
||||
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent,
|
||||
PRInt32 aXPos, PRInt32 aYPos,
|
||||
const nsString& aPopupType, const nsString& anAnchorAlignment,
|
||||
const nsString& aPopupAlignment,
|
||||
nsIDOMWindow* aWindow);
|
||||
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType);
|
||||
|
||||
Reference in New Issue
Block a user