зеркало из https://github.com/mozilla/pjs.git
make DoDialog available from idl. bug 72112 continues
This commit is contained in:
Родитель
c41d4426ab
Коммит
f51a753bf8
|
@ -0,0 +1,36 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 2001 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
/* The general dialog posing function within nsPromptService, for
|
||||
private consumption, only. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMWindow;
|
||||
interface nsIDialogParamBlock;
|
||||
|
||||
[uuid(d16e906d-bab3-49e0-8688-7f49a6f4293a)]
|
||||
interface nsPIPromptService : nsISupports
|
||||
{
|
||||
void doDialog(in nsIDOMWindow aParent, in nsIDialogParamBlock aParamBlock, in string aChromeURL);
|
||||
};
|
||||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "nsPromptService.h"
|
||||
|
||||
#include "nsDialogParamBlock.h"
|
||||
#include "nsXPComFactory.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIDialogParamBlock.h"
|
||||
|
@ -29,8 +30,6 @@
|
|||
#include "nsIServiceManager.h"
|
||||
#include "nsISupportsUtils.h"
|
||||
|
||||
static NS_DEFINE_CID(kDialogParamBlockCID, NS_DialogParamBlock_CID);
|
||||
|
||||
const char *kPromptURL="chrome://global/content/commonDialog.xul";
|
||||
const char *kSelectPromptURL="chrome://global/content/selectDialog.xul";
|
||||
const char *kQuestionIconURL ="chrome://global/skin/question-icon.gif";
|
||||
|
@ -51,7 +50,8 @@ public:
|
|||
NS_IF_RELEASE(mBlock);
|
||||
}
|
||||
nsresult Init() {
|
||||
return nsComponentManager::CreateInstance(kDialogParamBlockCID,
|
||||
return nsComponentManager::CreateInstance(
|
||||
NS_DIALOGPARAMBLOCK_CONTRACTID,
|
||||
0, NS_GET_IID(nsIDialogParamBlock),
|
||||
(void**) &mBlock);
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ private:
|
|||
************************ nsPromptService ***********************
|
||||
****************************************************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsPromptService, nsIPromptService)
|
||||
NS_IMPL_ISUPPORTS2(nsPromptService, nsIPromptService, nsPIPromptService)
|
||||
|
||||
nsPromptService::nsPromptService() {
|
||||
NS_INIT_REFCNT();
|
||||
|
|
|
@ -31,12 +31,14 @@
|
|||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIPromptService.h"
|
||||
#include "nsPIPromptService.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
|
||||
class nsIDOMWindow;
|
||||
class nsIDialogParamBlock;
|
||||
|
||||
class nsPromptService: public nsIPromptService {
|
||||
class nsPromptService: public nsIPromptService,
|
||||
public nsPIPromptService {
|
||||
|
||||
public:
|
||||
|
||||
|
@ -46,14 +48,11 @@ public:
|
|||
nsresult Init();
|
||||
|
||||
NS_DECL_NSIPROMPTSERVICE
|
||||
NS_DECL_NSPIPROMPTSERVICE
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
private:
|
||||
|
||||
nsresult DoDialog(nsIDOMWindow *aParent,
|
||||
nsIDialogParamBlock *aParamBlock,
|
||||
const char *aChromeURL);
|
||||
|
||||
nsCOMPtr<nsIWindowWatcher> mWatcher;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче