Bug #286282 --> Thunderbird should be building toolkit\components\alerts instead of xpfe\components\alerts.

Will work on converting the download manager next so we an remove the alerts service ifdef in xpfe\download-manager.

Also, port xpfe's API change to nsIAlertsService to use AString's to toolkit
This commit is contained in:
scott%scott-macgregor.org 2005-03-15 19:41:41 +00:00
parent 291f1674b1
commit 5dcef92bbc
12 changed files with 54 additions and 65 deletions

View File

@ -46,6 +46,7 @@ MODULE = msgbase
LIBRARY_NAME = msgbase_s
META_COMPONENT = mail
REQUIRES = xpcom \
alerts \
xpcom_obsolete \
string \
necko \

View File

@ -73,6 +73,7 @@
#include "nsISupportsPrimitives.h"
#ifdef MOZ_THUNDERBIRD
#include "nsToolkitCompsCID.h"
#define PROFILE_COMMANDLINE_ARG " -profile "
#else
#include "nsIProfile.h"

View File

@ -61,6 +61,7 @@ IS_COMPONENT = 1
MODULE_NAME = nsMailModule
REQUIRES = xpcom \
alerts \
xpcom_obsolete \
xpobsolete \
addrbook \

View File

@ -42,26 +42,28 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifdef MOZ_THUNDERBIRD
DIRS = console filepicker printing viewsource
else
ifdef MOZ_STANDALONE_COMPOSER
DIRS = console filepicker printing viewsource
else
DIRS = \
autocomplete \
console \
cookie \
DIRS = console \
filepicker \
printing \
viewsource \
$(NULL)
ifdef MOZ_PHOENIX
DIRS += \
autocomplete \
cookie \
help \
history \
passwordmgr \
printing \
satchel \
typeaheadfind \
viewconfig \
viewsource \
$(NULL)
endif
ifeq ($(OS_ARCH),WINNT)
DIRS += alerts
@ -69,7 +71,6 @@ endif
DIRS += downloads
endif
endif
DIRS += \

View File

@ -40,7 +40,7 @@
#include "nsISupports.idl"
#include "nsIObserver.idl"
[scriptable, uuid(F6D34CCE-EAC6-42BF-8F3B-9A8865493F31)]
[scriptable, uuid(647248FD-F925-4e30-93DD-CDE26D7E3A90)]
interface nsIAlertsService : nsISupports
{
/* showAlertNotification: shows an animated alert icon
@ -55,9 +55,9 @@ interface nsIAlertsService : nsISupports
alert goes away, or "alertclickcallback" when the text is clicked. Data
is aAlertCookie.
*/
void showAlertNotification(in string aImageUrl, in wstring aAlertTitle,
in wstring aAlertText, in boolean alertTextClickable,
in wstring aAlertCookie,
void showAlertNotification(in AString aImageUrl, in AString aAlertTitle,
in AString aAlertText, in boolean alertTextClickable,
in AString aAlertCookie,
in nsIObserver aAlertListener );
};

View File

@ -62,9 +62,9 @@ nsAlertsService::nsAlertsService()
nsAlertsService::~nsAlertsService()
{}
NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const char * aImageUrl, const PRUnichar * aAlertTitle,
const PRUnichar * aAlertText, PRBool aAlertTextClickable,
const PRUnichar * aAlertCookie,
NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const nsAString & aImageUrl, const nsAString & aAlertTitle,
const nsAString & aAlertText, PRBool aAlertTextClickable,
const nsAString & aAlertCookie,
nsIObserver * aAlertListener)
{
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
@ -76,22 +76,22 @@ NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const char * aImageUrl, con
NS_ENSURE_SUCCESS(rv, rv);
// create scriptable versions of our strings that we can store in our nsISupportsArray....
nsCOMPtr<nsISupportsCString> scriptableImageUrl (do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
nsCOMPtr<nsISupportsString> scriptableImageUrl (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
NS_ENSURE_TRUE(scriptableImageUrl, NS_ERROR_FAILURE);
scriptableImageUrl->SetData(nsDependentCString(aImageUrl));
scriptableImageUrl->SetData(aImageUrl);
argsArray->AppendElement(scriptableImageUrl);
nsCOMPtr<nsISupportsString> scriptableAlertTitle (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
NS_ENSURE_TRUE(scriptableAlertTitle, NS_ERROR_FAILURE);
scriptableAlertTitle->SetData(nsDependentString(aAlertTitle));
scriptableAlertTitle->SetData(aAlertTitle);
argsArray->AppendElement(scriptableAlertTitle);
nsCOMPtr<nsISupportsString> scriptableAlertText (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
NS_ENSURE_TRUE(scriptableAlertText, NS_ERROR_FAILURE);
scriptableAlertText->SetData(nsDependentString(aAlertText));
scriptableAlertText->SetData(aAlertText);
argsArray->AppendElement(scriptableAlertText);
nsCOMPtr<nsISupportsPRBool> scriptableIsClickable (do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID));
@ -103,7 +103,7 @@ NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const char * aImageUrl, con
nsCOMPtr<nsISupportsString> scriptableAlertCookie (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
NS_ENSURE_TRUE(scriptableAlertCookie, NS_ERROR_FAILURE);
scriptableAlertCookie->SetData(nsDependentString(aAlertCookie));
scriptableAlertCookie->SetData(aAlertCookie);
argsArray->AppendElement(scriptableAlertCookie);
if (aAlertListener)

View File

@ -109,6 +109,10 @@ SHARED_LIBRARY_LIBS = \
../startup/src/$(LIB_PREFIX)appstartup_s.$(LIB_SUFFIX) \
$(NULL)
ifeq ($(OS_ARCH),WINNT)
SHARED_LIBRARY_LIBS += $(DIST)/lib/$(LIB_PREFIX)alerts_s.$(LIB_SUFFIX)
endif
ifneq (,$(MOZ_PHOENIX)$(MOZ_SUNBIRD))
SHARED_LIBRARY_LIBS += \
$(DIST)/lib/$(LIB_PREFIX)autocomplete_s.$(LIB_SUFFIX) \
@ -119,10 +123,6 @@ SHARED_LIBRARY_LIBS += \
$(DIST)/lib/$(LIB_PREFIX)fastfind_s.$(LIB_SUFFIX) \
$(NULL)
ifeq ($(OS_ARCH),WINNT)
SHARED_LIBRARY_LIBS += $(DIST)/lib/$(LIB_PREFIX)alerts_s.$(LIB_SUFFIX)
endif
EXTRA_DSO_LIBS = gkgfx
endif # MOZ_PHOENIX

View File

@ -39,12 +39,12 @@
#include "nsAppStartup.h"
#include "nsUserInfo.h"
#include "nsXPFEComponentsCID.h"
#if defined(MOZ_PHOENIX) || defined(MOZ_SUNBIRD)
#include "nsToolkitCompsCID.h"
#ifdef XP_WIN
#include "nsAlertsService.h"
#endif
#include "nsToolkitCompsCID.h"
#if defined(MOZ_PHOENIX) || defined(MOZ_SUNBIRD)
#include "nsDocShellCID.h"
#include "nsAutoCompleteController.h"
#include "nsAutoCompleteMdbResult.h"
@ -63,15 +63,16 @@
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAppStartup, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUserInfo)
#if defined(MOZ_PHOENIX) || defined(MOZ_SUNBIRD)
#ifdef XP_WIN
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService)
#endif
#if defined(MOZ_PHOENIX) || defined(MOZ_SUNBIRD)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAutoCompleteController)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAutoCompleteMdbResult)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTypeAheadFind)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloadProxy)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDownloadManager, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDownloadManager, Init)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsFormHistory, nsFormHistory::GetInstance)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFormFillController)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGlobalHistory, Init)
@ -103,14 +104,13 @@ static const nsModuleComponentInfo components[] =
NS_USERINFO_CID,
NS_USERINFO_CONTRACTID,
nsUserInfoConstructor },
#if defined(MOZ_PHOENIX) || defined(MOZ_SUNBIRD)
#ifdef XP_WIN
{ "Alerts Service",
NS_ALERTSSERVICE_CID,
NS_ALERTSERVICE_CONTRACTID,
nsAlertsServiceConstructor },
#endif
#if defined(MOZ_PHOENIX) || defined(MOZ_SUNBIRD)
{ "AutoComplete Controller",
NS_AUTOCOMPLETECONTROLLER_CID,
NS_AUTOCOMPLETECONTROLLER_CONTRACTID,
@ -120,7 +120,7 @@ static const nsModuleComponentInfo components[] =
NS_AUTOCOMPLETEMDBRESULT_CID,
NS_AUTOCOMPLETEMDBRESULT_CONTRACTID,
nsAutoCompleteMdbResultConstructor },
{ "Download Manager",
NS_DOWNLOADMANAGER_CID,
NS_DOWNLOADMANAGER_CONTRACTID,

View File

@ -2122,8 +2122,8 @@ nsDownload::OnStateChange(nsIWebProgress* aWebProgress,
// there's no reason to make the text clickable because if it is, they'll
// click open the download manager and the items they downloaded will have
// been removed.
alerts->ShowAlertNotification(DOWNLOAD_MANAGER_ALERT_ICON, title, message, !removeWhenDone,
EmptyString().get(), mDownloadManager);
alerts->ShowAlertNotification(NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title, message, !removeWhenDone,
NS_LITERAL_STRING(""), mDownloadManager);
}
}
}

View File

@ -116,17 +116,19 @@ DIRS = \
intl \
find \
filepicker \
download-manager \
autocomplete \
windowds \
prefwindow \
console \
download-manager \
history/public \
sidebar/public \
bookmarks/public \
alerts \
$(NULL)
ifdef MOZ_HAVE_BROWSER
DIRS += alerts prefwindow
endif
ifeq ($(OS_ARCH),WINNT)
DIRS += winhooks
endif

View File

@ -61,16 +61,15 @@ REQUIRES = xpcom \
mork \
widget \
dom \
alerts\
uriloader \
mimetype \
webbrowserpersist \
progressDlg \
uriloader \
mimetype \
webbrowserpersist \
progressDlg \
pref \
docshell \
webshell \
appshell \
downloadmanager \
downloadmanager \
$(NULL)
CPPSRCS = nsModule.cpp
@ -90,22 +89,20 @@ SHARED_LIBRARY_LIBS = \
LOCAL_INCLUDES = \
-I$(srcdir)/../windowds \
-I$(srcdir)/../../browser/src \
-I$(srcdir)/../download-manager/src \
-I$(srcdir)/../autocomplete/src \
-I$(srcdir)/../download-manager/src \
-I$(srcdir)/../autocomplete/src \
$(NULL)
ifeq ($(OS_ARCH),WINNT)
SHARED_LIBRARY_LIBS += \
$(DIST)/lib/$(LIB_PREFIX)alerts_s.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)winhooks_s.$(LIB_SUFFIX) \
$(NULL)
OS_LIBS += $(call EXPAND_LIBNAME,ole32 shell32)
LOCAL_INCLUDES += \
-I$(srcdir)/../alerts/src \
-I$(srcdir)/../winhooks \
$(NULL)
endif

View File

@ -39,7 +39,7 @@
#include "nsIGenericFactory.h"
#include "nsICategoryManager.h"
#include "nsServiceManagerUtils.h"
#include "rdf.h"
#include "nsXPIDLString.h"
#include "nsCharsetMenu.h"
@ -47,15 +47,12 @@
#include "nsWindowDataSource.h"
#include "nsRDFCID.h"
#include "nsAutoComplete.h"
#include "nsDownloadManager.h"
#include "nsDownloadProxy.h"
#if defined(MOZ_LDAP_XPCOM)
#include "nsLDAPAutoCompleteSession.h"
#endif
#if defined(XP_WIN)
#include "nsAlertsService.h"
#include "nsWindowsHooks.h"
#endif // Windows
@ -67,15 +64,12 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowDataSource, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAutoCompleteItem)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAutoCompleteResults)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontPackageHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDownloadManager, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloadProxy)
#if defined(MOZ_LDAP_XPCOM)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLDAPAutoCompleteSession)
#endif
#if defined(XP_WIN)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsHooks)
#endif // Windows
@ -93,14 +87,11 @@ RegisterWindowDS(nsIComponentManager *aCompMgr,
return catman->AddCategoryEntry("app-startup", "Window Data Source",
"service," NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator",
PR_TRUE, PR_TRUE, nsnull);
return NS_OK;
}
static const nsModuleComponentInfo components[] = {
{ "Download Manager", NS_DOWNLOADMANAGER_CID, NS_DOWNLOADMANAGER_CONTRACTID,
nsDownloadManagerConstructor },
{ "Download", NS_DOWNLOAD_CID, NS_TRANSFER_CONTRACTID,
nsDownloadProxyConstructor },
{ "AutoComplete Search Results", NS_AUTOCOMPLETERESULTS_CID, NS_AUTOCOMPLETERESULTS_CONTRACTID,
nsAutoCompleteResultsConstructor},
{ "AutoComplete Search Item", NS_AUTOCOMPLETEITEM_CID, NS_AUTOCOMPLETEITEM_CONTRACTID,
@ -112,11 +103,6 @@ static const nsModuleComponentInfo components[] = {
nsLDAPAutoCompleteSessionConstructor },
#endif
#if defined(XP_WIN)
{ "nsAlertsService", NS_ALERTSSERVICE_CID, NS_ALERTSERVICE_CONTRACTID, nsAlertsServiceConstructor},
{ NS_IWINDOWSHOOKS_CLASSNAME, NS_IWINDOWSHOOKS_CID, NS_IWINDOWSHOOKS_CONTRACTID, nsWindowsHooksConstructor },
#endif // Windows
{ "nsCharsetMenu", NS_CHARSETMENU_CID,
NS_RDF_DATASOURCE_CONTRACTID_PREFIX NS_CHARSETMENU_PID,
NS_NewCharsetMenu },