From 0cd03c8ac6e1b88ba68395a705bdef1eec6bab9d Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Mon, 9 Apr 2001 00:42:12 +0000 Subject: [PATCH] make DoDialog available from idl. bug 72112 continues git-svn-id: svn://10.0.0.236/trunk@91716 18797224-902f-48f8-a5cc-f745e15eee43 --- .../public/nsPIPromptService.idl | 36 +++++++++++++++++++ .../windowwatcher/src/nsPromptService.cpp | 8 ++--- .../windowwatcher/src/nsPromptService.h | 9 +++-- 3 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 mozilla/embedding/components/windowwatcher/public/nsPIPromptService.idl diff --git a/mozilla/embedding/components/windowwatcher/public/nsPIPromptService.idl b/mozilla/embedding/components/windowwatcher/public/nsPIPromptService.idl new file mode 100644 index 00000000000..9d90346b87a --- /dev/null +++ b/mozilla/embedding/components/windowwatcher/public/nsPIPromptService.idl @@ -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); +}; + diff --git a/mozilla/embedding/components/windowwatcher/src/nsPromptService.cpp b/mozilla/embedding/components/windowwatcher/src/nsPromptService.cpp index 0a9174ad634..630bccda392 100644 --- a/mozilla/embedding/components/windowwatcher/src/nsPromptService.cpp +++ b/mozilla/embedding/components/windowwatcher/src/nsPromptService.cpp @@ -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(); diff --git a/mozilla/embedding/components/windowwatcher/src/nsPromptService.h b/mozilla/embedding/components/windowwatcher/src/nsPromptService.h index 9f700938abd..e40ff0b70c8 100644 --- a/mozilla/embedding/components/windowwatcher/src/nsPromptService.h +++ b/mozilla/embedding/components/windowwatcher/src/nsPromptService.h @@ -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 mWatcher; };