зеркало из https://github.com/mozilla/pjs.git
fix some warnings and add a new header file which does object construction
This commit is contained in:
Родитель
5599eefe9c
Коммит
43b6a4e8f6
|
@ -0,0 +1,26 @@
|
||||||
|
/* -*- 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
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __nsJSMsgAppCore_h
|
||||||
|
#define __nsJSMsgAppCore_h
|
||||||
|
|
||||||
|
extern "C" NS_DOM
|
||||||
|
nsresult
|
||||||
|
NS_NewScriptMsgAppCore(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn);
|
||||||
|
|
||||||
|
#endif
|
|
@ -20,7 +20,7 @@
|
||||||
#include "nsMsgAppCore.h"
|
#include "nsMsgAppCore.h"
|
||||||
#include "nsIScriptObjectOwner.h"
|
#include "nsIScriptObjectOwner.h"
|
||||||
#include "nsIDOMBaseAppCore.h"
|
#include "nsIDOMBaseAppCore.h"
|
||||||
|
#include "nsJSMsgAppCore.h"
|
||||||
|
|
||||||
static NS_DEFINE_IID(kIMsgAppCoreIID, NS_IDOMMSGAPPCORE_IID);
|
static NS_DEFINE_IID(kIMsgAppCoreIID, NS_IDOMMSGAPPCORE_IID);
|
||||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||||
|
@ -46,8 +46,9 @@ public:
|
||||||
NS_IMETHOD GetNewMail();
|
NS_IMETHOD GetNewMail();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsString m_Id;
|
|
||||||
|
|
||||||
|
nsString mId;
|
||||||
|
void *mScriptObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -56,6 +57,7 @@ private:
|
||||||
nsMsgAppCore::nsMsgAppCore()
|
nsMsgAppCore::nsMsgAppCore()
|
||||||
{
|
{
|
||||||
NS_INIT_REFCNT();
|
NS_INIT_REFCNT();
|
||||||
|
mScriptObject = nsnull;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,8 +112,18 @@ nsMsgAppCore::QueryInterface(REFNSIID aIID,void** aInstancePtr)
|
||||||
nsresult
|
nsresult
|
||||||
nsMsgAppCore::GetScriptObject(nsIScriptContext *aContext, void **aScriptObject)
|
nsMsgAppCore::GetScriptObject(nsIScriptContext *aContext, void **aScriptObject)
|
||||||
{
|
{
|
||||||
|
NS_PRECONDITION(nsnull != aScriptObject, "null arg");
|
||||||
|
nsresult res = NS_OK;
|
||||||
|
if (nsnull == mScriptObject)
|
||||||
|
{
|
||||||
|
res = NS_NewScriptMsgAppCore(aContext,
|
||||||
|
(nsISupports *)(nsIDOMMsgAppCore*)this,
|
||||||
|
nsnull,
|
||||||
|
&mScriptObject);
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
*aScriptObject = mScriptObject;
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
@ -127,7 +139,7 @@ nsMsgAppCore::SetScriptObject(void* aScriptObject)
|
||||||
nsresult
|
nsresult
|
||||||
nsMsgAppCore::Init(const nsString& aId)
|
nsMsgAppCore::Init(const nsString& aId)
|
||||||
{
|
{
|
||||||
m_Id = aId;
|
mId = aId;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +147,7 @@ nsMsgAppCore::Init(const nsString& aId)
|
||||||
nsresult
|
nsresult
|
||||||
nsMsgAppCore::GetId(nsString& aId)
|
nsMsgAppCore::GetId(nsString& aId)
|
||||||
{
|
{
|
||||||
aId = m_Id;
|
aId = mId;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +157,7 @@ nsMsgAppCore::GetId(nsString& aId)
|
||||||
nsresult
|
nsresult
|
||||||
nsMsgAppCore::GetNewMail()
|
nsMsgAppCore::GetNewMail()
|
||||||
{
|
{
|
||||||
|
printf("nsMsgAppCore::GetNewMail()\n");
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче