зеркало из https://github.com/mozilla/pjs.git
add new AccountManager() method to bring up account manager
This commit is contained in:
Родитель
3ea2fa19a4
Коммит
751190b93d
|
@ -11,11 +11,12 @@
|
|||
#include "nsIDOMXULElement.h" /* interface nsIDOMXULElement */
|
||||
#include "nsICollection.h" /* interface nsICollection */
|
||||
#include "nsRDFInterfaces.h" /* interface nsRDFInterfaces */
|
||||
#include "nsrootidl.h" /* interface nsrootidl */
|
||||
#include "nsIEnumerator.h" /* interface nsIEnumerator */
|
||||
#include "nsID.h" /* interface nsID */
|
||||
#include "nsIDOMXULTreeElement.h" /* interface nsIDOMXULTreeElement */
|
||||
#include "nsIDOMBaseAppCore.h" /* interface nsIDOMBaseAppCore */
|
||||
#include "nsIDOMNodeList.h" /* interface nsIDOMNodeList */
|
||||
#include "nsISimpleEnumerator.h" /* interface nsISimpleEnumerator */
|
||||
|
||||
#ifdef XPIDL_JS_STUBS
|
||||
#include "jsapi.h"
|
||||
|
@ -69,6 +70,9 @@ class nsIDOMMsgAppCore : public nsIDOMBaseAppCore {
|
|||
/* void NewFolder (in nsIRDFCompositeDataSource database, in nsIDOMXULElement parentFolderElement, in string name); */
|
||||
NS_IMETHOD NewFolder(nsIRDFCompositeDataSource *database, nsIDOMXULElement *parentFolderElement, const char *name) = 0;
|
||||
|
||||
/* void AccountManager (in nsIDOMWindow parent); */
|
||||
NS_IMETHOD AccountManager(nsIDOMWindow *parent) = 0;
|
||||
|
||||
#ifdef XPIDL_JS_STUBS
|
||||
static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx);
|
||||
static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIDOMMsgAppCore *priv);
|
||||
|
|
|
@ -17,26 +17,6 @@
|
|||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
/* this should eventually derive from some sort of BaseAppCore */
|
||||
/* -*- Mode: IDL; 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
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsIDOMBaseAppCore.idl"
|
||||
#include "nsIDOMWindow.idl"
|
||||
#include "nsIDOMNodeList.idl"
|
||||
|
@ -61,6 +41,7 @@ interface nsIDOMMsgAppCore : nsIDOMBaseAppCore {
|
|||
void ViewAllThreadMessages(in nsIRDFCompositeDataSource database);
|
||||
void NewFolder(in nsIRDFCompositeDataSource database, in nsIDOMXULElement parentFolderElement,
|
||||
in string name);
|
||||
void AccountManager(in nsIDOMWindow parent);
|
||||
};
|
||||
|
||||
/* hack to make MsgAppCore visible from AppCore */
|
||||
|
|
|
@ -654,6 +654,50 @@ MsgAppCoreNewFolder(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
|||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method ShowWindow
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
MsgAppCoreAccountManager(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMMsgAppCore *nativeThis = (nsIDOMMsgAppCore*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
nsIDOMWindowPtr b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (argc >= 1) {
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&b0,
|
||||
kIWindowIID,
|
||||
"Window",
|
||||
cx,
|
||||
argv[0])) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (NS_OK != nativeThis->AccountManager(b0)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
else {
|
||||
JS_ReportError(cx, "Function AccountManager requires 1 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
//
|
||||
// class for MsgAppCore
|
||||
|
@ -699,6 +743,7 @@ static JSFunctionSpec MsgAppCoreMethods[] =
|
|||
{"ViewUnreadMessages", MsgAppCoreViewUnreadMessages, 1},
|
||||
{"ViewAllThreadMessages", MsgAppCoreViewAllThreadMessages, 1},
|
||||
{"NewFolder", MsgAppCoreNewFolder, 3},
|
||||
{"AccountManager", MsgAppCoreAccountManager, 1},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* 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
|
||||
|
@ -115,7 +115,7 @@ public:
|
|||
NS_IMETHOD ViewAllThreadMessages(nsIRDFCompositeDataSource *database);
|
||||
NS_IMETHOD NewFolder(nsIRDFCompositeDataSource *database, nsIDOMXULElement *parentFolderElement,
|
||||
const char *name);
|
||||
|
||||
NS_IMETHOD AccountManager(nsIDOMWindow *parent);
|
||||
|
||||
|
||||
private:
|
||||
|
@ -826,6 +826,14 @@ nsMsgAppCore::NewFolder(nsIRDFCompositeDataSource *database, nsIDOMXULElement *p
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMsgAppCore::AccountManager(nsIDOMWindow *parent)
|
||||
{
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
}
|
||||
|
||||
// to load the webshell!
|
||||
// mWebShell->LoadURL(nsAutoString("http://www.netscape.com"),
|
||||
// nsnull, PR_TRUE, nsURLReload, 0);
|
||||
|
|
Загрузка…
Ссылка в новой задаче