From 8e529ac72a5cbbda7fed6b9030d4ba93be94de64 Mon Sep 17 00:00:00 2001 From: "rhp%netscape.com" Date: Mon, 27 Mar 2000 08:18:10 +0000 Subject: [PATCH] Adding addbook: URL support --- mailnews/addrbook/build/nsAbBaseCID.h | 22 +++++++++++++++++++ mailnews/addrbook/build/nsAbFactory.cpp | 18 ++++++++++++--- mailnews/addrbook/public/Makefile.in | 1 + mailnews/addrbook/public/makefile.win | 1 + mailnews/addrbook/src/Makefile.in | 4 ++++ mailnews/addrbook/src/makefile.win | 4 ++++ .../addrbook/src/nsAddbookProtocolHandler.h | 4 ++-- 7 files changed, 49 insertions(+), 5 deletions(-) diff --git a/mailnews/addrbook/build/nsAbBaseCID.h b/mailnews/addrbook/build/nsAbBaseCID.h index e2230990459..d5b549bef94 100644 --- a/mailnews/addrbook/build/nsAbBaseCID.h +++ b/mailnews/addrbook/build/nsAbBaseCID.h @@ -166,4 +166,26 @@ {0xa5, 0x63, 0x00, 0x60, 0xb0, 0xfc, 0x4, 0xb7} \ } +// +// addbook URL +// +#define NS_ADDBOOKURL_PROGID \ + "component://netscape/addressbook/services/addbookurl" +#define NS_ADDBOOKURL_CID \ +{ /* ff04c8e6-501e-11d3-a527-0060b0fc0444 */ \ + 0xff04c8e6, 0x501e, 0x11d3, \ + {0xa5, 0x27, 0x0, 0x60, 0xb0, 0xfc, 0x4, 0x44} \ +} + +// +// addbook Protocol Handler +// +#define NS_ADDBOOK_HANDLER_PROGID \ + "component://netscape/addressbook/services/addbook" +#define NS_ADDBOOK_HANDLER_CID \ +{ /* ff04c8e6-501e-11d3-ffcc-0060b0fc0444 */ \ + 0xff04c8e6, 0x501e, 0x11d3, \ + {0xff, 0xcc, 0x0, 0x60, 0xb0, 0xfc, 0x4, 0x44} \ +} + #endif // nsAbBaseCID_h__ diff --git a/mailnews/addrbook/build/nsAbFactory.cpp b/mailnews/addrbook/build/nsAbFactory.cpp index 4bf5c323dff..11803a15473 100644 --- a/mailnews/addrbook/build/nsAbFactory.cpp +++ b/mailnews/addrbook/build/nsAbFactory.cpp @@ -46,6 +46,8 @@ #include "nsAbDirProperty.h" #include "nsAbAutoCompleteSession.h" #include "nsAbAddressCollecter.h" +#include "nsAddbookProtocolHandler.h" +#include "nsAddbookUrl.h" NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddressBook) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAbDirectoryDataSource,Init) @@ -58,7 +60,10 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbDirProperty) NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddrBookSession) NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbAutoCompleteSession) NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbAddressCollecter) - +NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddbookUrl) + +//NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddbookProtocolHandler) + static nsModuleComponentInfo components[] = { { "Address Book", @@ -110,8 +115,15 @@ static nsModuleComponentInfo components[] = { "Address Book Address Collector", NS_ABADDRESSCOLLECTER_CID, NS_ABADDRESSCOLLECTER_PROGID, - nsAbAddressCollecterConstructor } + nsAbAddressCollecterConstructor }, + { "The addbook URL Interface", + NS_ADDBOOKURL_CID, + NS_ADDBOOKURL_PROGID, + nsAddbookUrlConstructor }, + { "The addbook Protocol Handler", + NS_ADDBOOK_HANDLER_CID, + NS_NETWORK_PROTOCOL_PROGID_PREFIX "addbook", + nsAddbookProtocolHandler::Create } }; - NS_IMPL_NSGETMODULE("nsAbModule", components) diff --git a/mailnews/addrbook/public/Makefile.in b/mailnews/addrbook/public/Makefile.in index 28e41514640..3fb38b5e929 100644 --- a/mailnews/addrbook/public/Makefile.in +++ b/mailnews/addrbook/public/Makefile.in @@ -42,6 +42,7 @@ XPIDLSRCS = \ nsIAutoCompleteSession.idl \ nsIAbAddressCollecter.idl \ nsIAbUpgrader.idl \ + nsIAddbookUrl.idl \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/mailnews/addrbook/public/makefile.win b/mailnews/addrbook/public/makefile.win index 02812f779e3..983c2d844c6 100644 --- a/mailnews/addrbook/public/makefile.win +++ b/mailnews/addrbook/public/makefile.win @@ -36,6 +36,7 @@ XPIDLSRCS = \ .\nsIAutoCompleteListener.idl \ .\nsIAbAddressCollecter.idl \ .\nsIAbUpgrader.idl \ + .\nsIAddbookUrl.idl \ $(NULL) diff --git a/mailnews/addrbook/src/Makefile.in b/mailnews/addrbook/src/Makefile.in index 419ed3d27a7..e7b23dd3cb0 100644 --- a/mailnews/addrbook/src/Makefile.in +++ b/mailnews/addrbook/src/Makefile.in @@ -44,6 +44,8 @@ CPPSRCS = \ nsAbDirProperty.cpp \ nsAbAutoCompleteSession.cpp \ nsAbAddressCollecter.cpp \ + nsAddbookProtocolHandler.cpp \ + nsAddbookUrl.cpp \ $(NULL) EXPORTS = \ @@ -61,6 +63,8 @@ EXPORTS = \ nsAbDirProperty.h \ nsAbAutoCompleteSession.h \ nsAbAddressCollecter.h \ + nsAddbookProtocolHandler.h \ + nsAddbookUrl.h \ $(NULL) # we don't want the shared lib, but we want to force the creation of a static lib. diff --git a/mailnews/addrbook/src/makefile.win b/mailnews/addrbook/src/makefile.win index bfcff2d359c..ac1daeab0ea 100644 --- a/mailnews/addrbook/src/makefile.win +++ b/mailnews/addrbook/src/makefile.win @@ -42,6 +42,8 @@ EXPORTS= \ nsAbDirProperty.h \ nsAbAutoCompleteSession.h \ nsAbAddressCollecter.h \ + nsAddbookProtocolHandler.h \ + nsAddbookUrl.h \ $(NULL) ################################################################################ @@ -64,6 +66,8 @@ CPP_OBJS= \ .\$(OBJDIR)\nsAbDirProperty.obj \ .\$(OBJDIR)\nsAbAutoCompleteSession.obj \ .\$(OBJDIR)\nsAbAddressCollecter.obj \ + .\$(OBJDIR)\nsAddbookProtocolHandler.obj \ + .\$(OBJDIR)\nsAddbookUrl.obj \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mailnews/addrbook/src/nsAddbookProtocolHandler.h b/mailnews/addrbook/src/nsAddbookProtocolHandler.h index c4e99ec0df9..b0a0881b494 100644 --- a/mailnews/addrbook/src/nsAddbookProtocolHandler.h +++ b/mailnews/addrbook/src/nsAddbookProtocolHandler.h @@ -32,8 +32,8 @@ #include "nsIAddrDatabase.h" typedef struct { - char *abField; - PRBool includeIt; + const char *abField; + PRBool includeIt; } reportColumnStruct; class nsAddbookProtocolHandler : public nsIProtocolHandler