Added new interface nsIAppShellService

This commit is contained in:
rods%netscape.com 1999-02-10 16:38:51 +00:00
Родитель 2fa9b73118
Коммит 8b8fdc8ec0
4 изменённых файлов: 62 добавлений и 4 удалений

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

@ -24,6 +24,7 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
EXPORTS = \
nsIWebShellWindow.h \
nsAppShellCIDs.h \
nsIAppShellService.h \
nsICmdLineService.h \

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

@ -22,6 +22,7 @@ IGNORE_MANIFEST=1
MODULE=raptor
EXPORTS = \
nsIWebShellWindow.h \
nsAppShellCIDs.h \
nsIAppShellService.h \
nsICmdLineService.h \

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

@ -29,6 +29,7 @@ class nsIFactory;
class nsIURL;
class nsIWidget;
class nsString;
class nsIStreamObserver;
// e5e5af70-8a38-11d2-9938-0080c7cb1080
#define NS_IAPPSHELL_SERVICE_IID \
@ -39,14 +40,21 @@ class nsString;
class nsIAppShellService : public nsISupports
{
public:
static const nsIID& IID() { static nsIID iid = NS_IAPPSHELL_SERVICE_IID; return iid; }
NS_IMETHOD Initialize(void) = 0;
NS_IMETHOD Run(void) = 0;
NS_IMETHOD GetNativeEvent(void *& aEvent, nsIWidget* aWidget, PRBool &aIsInWindow, PRBool &aIsMouseEvent) = 0;
NS_IMETHOD DispatchNativeEvent(void * aEvent) = 0;
NS_IMETHOD Shutdown(void) = 0;
NS_IMETHOD CreateTopLevelWindow(nsIURL* aUrl,
nsString& aControllerIID,
nsIWidget*& aResult) = 0;
nsIWidget*& aResult, nsIStreamObserver* anObserver) = 0;
NS_IMETHOD CreateDialogWindow(nsIWidget * aParent,
nsIURL* aUrl,
nsString& aControllerIID,
nsIWidget*& aResult, nsIStreamObserver* anObserver) = 0;
NS_IMETHOD CloseTopLevelWindow(nsIWidget* aWindow) = 0;
};

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

@ -32,6 +32,7 @@
#include "nsWebShellWindow.h"
#include "nsWidgetsCID.h"
#include "nsIStreamObserver.h"
#ifdef MOZ_FULLCIRCLE
#include "fullsoft.h"
@ -59,9 +60,15 @@ public:
NS_IMETHOD Initialize(void);
NS_IMETHOD Run(void);
NS_IMETHOD GetNativeEvent(void *& aEvent, nsIWidget* aWidget, PRBool &aIsInWindow, PRBool &aIsMouseEvent);
NS_IMETHOD DispatchNativeEvent(void * aEvent);
NS_IMETHOD Shutdown(void);
NS_IMETHOD CreateTopLevelWindow(nsIURL* aUrl, nsString& aControllerIID,
nsIWidget*& aResult);
nsIWidget*& aResult, nsIStreamObserver* anObserver);
NS_IMETHOD CreateDialogWindow(nsIWidget * aParent,
nsIURL* aUrl,
nsString& aControllerIID,
nsIWidget*& aResult, nsIStreamObserver* anObserver);
NS_IMETHOD CloseTopLevelWindow(nsIWidget* aWindow);
@ -138,6 +145,18 @@ nsAppShellService::Run(void)
return mAppShell->Run();
}
NS_IMETHODIMP
nsAppShellService::GetNativeEvent(void *& aEvent, nsIWidget* aWidget, PRBool &aIsInWindow, PRBool &aIsMouseEvent)
{
return mAppShell->GetNativeEvent(aEvent, aWidget, aIsInWindow, aIsMouseEvent);
}
NS_IMETHODIMP
nsAppShellService::DispatchNativeEvent(void * aEvent)
{
return mAppShell->DispatchNativeEvent(aEvent);
}
NS_IMETHODIMP
nsAppShellService::Shutdown(void)
{
@ -154,7 +173,7 @@ nsAppShellService::Shutdown(void)
*/
NS_IMETHODIMP
nsAppShellService::CreateTopLevelWindow(nsIURL* aUrl, nsString& aControllerIID,
nsIWidget*& aResult)
nsIWidget*& aResult, nsIStreamObserver* anObserver)
{
nsresult rv;
nsWebShellWindow* window;
@ -163,7 +182,7 @@ nsAppShellService::CreateTopLevelWindow(nsIURL* aUrl, nsString& aControllerIID,
if (nsnull == window) {
rv = NS_ERROR_OUT_OF_MEMORY;
} else {
rv = window->Initialize(mAppShell, aUrl, aControllerIID);
rv = window->Initialize(mAppShell, aUrl, aControllerIID, anObserver);
if (NS_SUCCEEDED(rv)) {
mWindowList->AppendElement((nsIWebShellContainer*)window);
aResult = window->GetWidget();
@ -173,6 +192,35 @@ nsAppShellService::CreateTopLevelWindow(nsIURL* aUrl, nsString& aControllerIID,
return rv;
}
/*
* Create a new top level window and display the given URL within it...
*
* XXX:
* Currently, the IID of the Controller object for the URL is provided as an
* argument. In the future, this argument will be specified by the XUL document
* itself.
*/
NS_IMETHODIMP
nsAppShellService::CreateDialogWindow(nsIWidget * aParent,
nsIURL* aUrl, nsString& aControllerIID,
nsIWidget*& aResult, nsIStreamObserver* anObserver)
{
nsresult rv;
nsWebShellWindow* window;
window = new nsWebShellWindow();
if (nsnull == window) {
rv = NS_ERROR_OUT_OF_MEMORY;
} else {
rv = window->Initialize(nsnull, mAppShell, aUrl, aControllerIID, anObserver);
if (NS_SUCCEEDED(rv)) {
mWindowList->AppendElement((nsIWebShellContainer*)window);
aResult = window->GetWidget();
}
}
return rv;
}
NS_IMETHODIMP
nsAppShellService::CloseTopLevelWindow(nsIWidget* aWindow)