Bug 495232 Drop support for the Palm Sync Extension. mailnews part. r=Mnyromyr,sr=bienvenu
authorMark Banner <bugzilla@standard8.plus.com>
Thu, 04 Jun 2009 08:56:52 +0100
changeset 2766 2c2aabae129f
parent 2765 61c769c3dd7b
child 2767 3c14e195490c
push id2241
push userbugzilla@standard8.plus.com
push dateThu, 04 Jun 2009 07:58:17 +0000
treeherdercomm-central@dd584408d621 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMnyromyr, bienvenu
bugs495232
Bug 495232 Drop support for the Palm Sync Extension. mailnews part. r=Mnyromyr,sr=bienvenu
mailnews/Makefile.in
mailnews/addrbook/src/Makefile.in
mailnews/extensions/Makefile.in
mailnews/extensions/palmsync/Makefile.in
mailnews/extensions/palmsync/build/IPalmSync.idl
mailnews/extensions/palmsync/build/Makefile.in
mailnews/extensions/palmsync/build/PalmSyncProxy.def
mailnews/extensions/palmsync/conduit/Makefile.in
mailnews/extensions/palmsync/conduit/MozABConduitGenCond.cpp
mailnews/extensions/palmsync/conduit/MozABConduitGenCond.h
mailnews/extensions/palmsync/conduit/MozABConduitGenCond.rc
mailnews/extensions/palmsync/conduit/MozABConduitRecord.cpp
mailnews/extensions/palmsync/conduit/MozABConduitRecord.h
mailnews/extensions/palmsync/conduit/MozABConduitSync.cpp
mailnews/extensions/palmsync/conduit/MozABConduitSync.h
mailnews/extensions/palmsync/conduit/MozABHHManager.cpp
mailnews/extensions/palmsync/conduit/MozABHHManager.h
mailnews/extensions/palmsync/conduit/MozABPCManager.cpp
mailnews/extensions/palmsync/conduit/MozABPCManager.h
mailnews/extensions/palmsync/conduit/install.js
mailnews/extensions/palmsync/conduit/res/DoNothing.bmp
mailnews/extensions/palmsync/conduit/res/HhToPc.bmp
mailnews/extensions/palmsync/conduit/res/PcToHh.bmp
mailnews/extensions/palmsync/conduit/res/Synchronize.bmp
mailnews/extensions/palmsync/conduit/resource.h
mailnews/extensions/palmsync/install.rdf
mailnews/extensions/palmsync/installer/Makefile.in
mailnews/extensions/palmsync/installer/PalmSyncInstall.cpp
mailnews/extensions/palmsync/installer/PalmSyncInstall.rc
mailnews/extensions/palmsync/installer/install.ico
mailnews/extensions/palmsync/installer/resource.h
mailnews/extensions/palmsync/installer/uninstall.ico
mailnews/extensions/palmsync/palmsync.js
mailnews/extensions/palmsync/public/Makefile.in
mailnews/extensions/palmsync/public/nsIPalmSyncSupport.idl
mailnews/extensions/palmsync/src/Makefile.in
mailnews/extensions/palmsync/src/PalmSyncFactory.cpp
mailnews/extensions/palmsync/src/PalmSyncFactory.h
mailnews/extensions/palmsync/src/PalmSyncImp.cpp
mailnews/extensions/palmsync/src/PalmSyncImp.h
mailnews/extensions/palmsync/src/Registry.cpp
mailnews/extensions/palmsync/src/Registry.h
mailnews/extensions/palmsync/src/nsAbIPCCard.cpp
mailnews/extensions/palmsync/src/nsAbIPCCard.h
mailnews/extensions/palmsync/src/nsAbPalmSync.cpp
mailnews/extensions/palmsync/src/nsAbPalmSync.h
mailnews/extensions/palmsync/src/nsPalmSyncSupport.cpp
mailnews/extensions/palmsync/src/nsPalmSyncSupport.h
mailnews/test/performance/common/mailnewsTestPrefs.js
--- a/mailnews/Makefile.in
+++ b/mailnews/Makefile.in
@@ -39,20 +39,17 @@ DEPTH		= ..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE       = mailnews
 
-PARALLEL_DIRS	+= base/search/src db/msgdb db/gloda news local mime compose imap addrbook import
-
-# extensions (e.g. palmsync) can depend of things built in other dirs
-DIRS	+= extensions
+PARALLEL_DIRS	+= base/search/src db/msgdb db/gloda news local mime compose imap addrbook import extensions
 
 ifeq ($(OS_ARCH),WINNT)
 ifndef GNU_CC
 PARALLEL_DIRS	+= mapi/mapiDLL mapi/mapihook
 endif
 endif
 
 ifdef MOZ_STATIC_MAIL_BUILD
--- a/mailnews/addrbook/src/Makefile.in
+++ b/mailnews/addrbook/src/Makefile.in
@@ -107,17 +107,16 @@ CPPSRCS		= \
 
 EXTRA_COMPONENTS += \
 		nsAbLDAPAttributeMap.js \
 		nsAbAutoCompleteMyDomain.js \
 		nsAbAutoCompleteSearch.js \
 		$(NULL)
 
 EXPORTS		= \
-		nsAbCardProperty.h \
                 nsVCardObj.h \
 		$(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 ifndef GNU_CC
 
 CPPSRCS		+= \
 		nsAbOutlookDirFactory.cpp \
--- a/mailnews/extensions/Makefile.in
+++ b/mailnews/extensions/Makefile.in
@@ -48,14 +48,10 @@ PARALLEL_DIRS	= mdn mailviews bayesian-s
 ifdef MOZ_PSM
 BUILD_SMIME=1
 endif
 
 ifdef BUILD_SMIME
 PARALLEL_DIRS	+= smime
 endif
 
-ifdef BUILD_PALMSYNC
-PARALLEL_DIRS	+= palmsync
-endif
-
 include $(topsrcdir)/config/rules.mk
 
deleted file mode 100644
--- a/mailnews/extensions/palmsync/Makefile.in
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla 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/MPL/
-#
-# 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 the Initial Developer are Copyright (C) 2002
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE			= palmsync
-XPI_NAME		= palmsync
-USE_EXTENSION_MANIFEST	= 1
-# make this id as short as possible due to a bug with the palm deskop and long path names.
-# Change installer/Makefile.in and nsPalmSyncSupport.cpp if this changes.
-INSTALL_EXTENSION_ID	= p@m
-XPI_PKGNAME		= palmsync-$(MOZ_APP_VERSION)
-DIST_FILES 		= install.rdf
-
-DIRS	= build public src installer
-
-PREF_JS_EXPORTS = $(srcdir)/palmsync.js
-
-ifdef MOZILLA_1_9_1_BRANCH
-THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version-191.txt)
-else
-THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt)
-endif
-SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/suite/config/version.txt)
-
-XULAPP_DEFINES = \
-	-DINSTALL_EXTENSION_ID=$(INSTALL_EXTENSION_ID) \
-	-DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
-	-DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION) \
-	-DEXTENSION_VERSION=$(MOZILLA_VERSION) \
-	$(NULL)
-
-ifdef PALM_CDK_DIR
-DIRS		+= conduit
-else
-libs::
-	@echo " "
-	@echo "PLEASE SET 'PALM_CDK_DIR' ENV VARIABLE to THE DIR WHERE YOU HAVE PALM CDK INSTALLED IF YOU WANT TO BUILD THE CONDUIT"
-	@echo " "
-endif
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/mailnews/extensions/palmsync/build/IPalmSync.idl
+++ /dev/null
@@ -1,168 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corp.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s): Rajiv Dayal (rdayal@netscape.com)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-// This idl will be compiled by MIDL.  MS-COM is used 
-// as brdige between MAPI clients and the Mozilla.
-
-import "unknwn.idl";
-
-// this is defined so that we can return an array of strings(i.e array of AB Description strings)
-typedef struct
-{
-	LPTSTR lpszABName;
-  LPTSTR lpszABUrl;
-}nsMozABDesc, *lpnsMozABDesc;
-
-const int kFirstTimeSyncDirFlag = 0x1;
-const int kIsPabDirFlag = 0x2;
-
-// This structure defines the data fields for MozAB based on "nsIAbCard.idl"
-// This structure is used for interaction with the other AddressBook Apps
-// nsIAbCard changes should be reflected here to take care of those changes
-// Take care when converting nsIAbCard to this struct
-typedef struct
-{
-    unsigned long   dwRecordId; // remote record Id for this card
-    unsigned long   dwCategoryId; // remote category Id for this card
-	unsigned long   dwStatus; // change status for this card
-
-	// standard AB fields for this card
-    LPTSTR          firstName;
-    LPTSTR          lastName;
-    LPTSTR          displayName;
-    LPTSTR          nickName;
-    LPTSTR          primaryEmail;
-    LPTSTR          secondEmail;
-    LPTSTR          workPhone;
-    LPTSTR          homePhone;
-    LPTSTR          faxNumber;
-    LPTSTR          pagerNumber;
-    LPTSTR          cellularNumber;
-    LPTSTR          homeAddress;
-    LPTSTR          homeAddress2;
-    LPTSTR          homeCity;
-    LPTSTR          homeState;
-    LPTSTR          homeZipCode;
-    LPTSTR          homeCountry;
-    LPTSTR          workAddress;
-    LPTSTR          workAddress2;
-    LPTSTR          workCity;
-    LPTSTR          workState;
-    LPTSTR          workZipCode;
-    LPTSTR          workCountry;
-    LPTSTR          jobTitle;
-    LPTSTR          department;
-    LPTSTR          company;
-    /**
-     * webPage1 is work web page
-     */
-    LPTSTR          webPage1;
-    /**
-     * webPage2 is home web page
-     */
-    LPTSTR          webPage2;
-    LPTSTR          birthYear;
-    LPTSTR          birthMonth;
-    LPTSTR          birthDay;
-    LPTSTR          custom1;
-    LPTSTR          custom2;
-    LPTSTR          custom3;
-    LPTSTR          custom4;
-    LPTSTR          notes;
-    unsigned long   lastModifiedDate;
-	unsigned long   addressToUse; // home, work, ... 
-    unsigned long   preferredPhoneNum; // this is displayed in the contact list
-    unsigned long   preferMailFormat;
-    boolean         isMailList;
-    /**
-     * If isMailList is true then mailListURI
-     * will contain the URI of the associated
-     * mail list
-     */
-    LPSTR           mailListURI;
-}nsABCOMCardStruct, *lpnsABCOMCardStruct;
-
-[
-    object,
-    uuid(C8CE6FC1-CCF1-11d6-B8A5-000064657374),
-    helpstring("nsIPalmSync Inteface"),
-    pointer_default(unique)
-]
-
-interface IPalmSync : IUnknown
-{
-    HRESULT IsValid();
-
-    // Get the list of Address Books for the currently logged in user profile
-    HRESULT nsGetABList([in] BOOL aIsUnicode, [out] short * aABListCount,
-						[out, size_is(, *aABListCount)] lpnsMozABDesc * aABList,
-						[out, size_is(, *aABListCount)] long ** aABCatIndexList,
-						[out, size_is(, *aABListCount)] BOOL ** aFirstTimeSyncList);
-
-    // Synchronize the Address Book represented by the aCategoryIndex and the corresponding aABName in Mozilla
-    // this will take care of ABs existing on both ends.
-    HRESULT nsSynchronizeAB([in] BOOL aIsUnicode, [in] long aCategoryIndex, [in] long aCategoryId, [in] LPTSTR aABName,
-                        [in] int aModRemoteRecCount, [in, size_is(aModRemoteRecCount)] lpnsABCOMCardStruct aModRemoteRecList,
-                        [out] int * aModMozRecCount, [out, size_is(, *aModMozRecCount)] lpnsABCOMCardStruct * aModMozRecList);
-
-    // All records from a AB represented by aCategoryIndex and aABName into a new or existing Mozilla AB
-    HRESULT nsAddAllABRecords([in] BOOL aIsUnicode, [in] BOOL aReplaceExisting, [in] long aCategoryIndex, [in] LPTSTR aABName,
-							[in] int aRemoteRecCount, [in, size_is(aRemoteRecCount)] lpnsABCOMCardStruct aRemoteRecList);
-
-    // Get All records from a Mozilla AB
-    HRESULT nsGetAllABCards([in] BOOL aIsUnicode, [in] long aCategoryIndex, [in] LPTSTR aABName,
-                        [out] int * aMozRecCount, [out, size_is(, *aMozRecCount)] lpnsABCOMCardStruct * aMozRecList);
-
-    // Send an ack for done and update the palm rec id for new records added
-    HRESULT nsAckSyncDone([in] BOOL aIsSuccess, [in] long aCatIndex, [in] int aNewRecCount, [in, size_is(aNewRecCount)] unsigned long * aNewPalmRecIDList);
-
-    // Update the Address Book's category id and mod time.
-    HRESULT nsUpdateABSyncInfo([in] BOOL aIsUnicode, [in] long aCategoryIndex, [in] LPTSTR aABName);
-
-    // Delete an addressbook
-    HRESULT nsDeleteAB([in] BOOL aIsUnicode, [in] long aCategoryIndex, [in] LPTSTR aABName, [in] LPTSTR aABUrl);
-
-    // was this address book deleted in Mozilla?
-    HRESULT nsGetABDeleted([in] LPTSTR aABName, [out] BOOL *abDeleted);
-
-    // Rename an addressbook
-    HRESULT nsRenameAB([in] BOOL aIsUnicode, [in] long aCategoryIndex, [in] LPTSTR aABName, [in] LPTSTR aABUrl);
-
-    HRESULT nsUseABHomeAddressForPalmAddress ([out] BOOL *useHomeAddress);
-
-    HRESULT nsPreferABHomePhoneForPalmPhone ([out] BOOL * preferHomePhone);
-};
-
deleted file mode 100644
--- a/mailnews/extensions/palmsync/build/Makefile.in
+++ /dev/null
@@ -1,89 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla 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/MPL/
-#
-# 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 the Initial Developer are Copyright (C) 2002
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= PalmSyncProxy
-LIBRARY_NAME	= $(MODULE)
-DEFFILE		= $(win_srcdir)/PalmSyncProxy.def
-ifndef MOZ_INCOMPLETE_EXTERNAL_LINKAGE
-MOZILLA_INTERNAL_API = 1
-endif
-USE_STATIC_LIBS = 1
-XPI_NAME	= palmsync
-
-EXPORTS		= IPalmSync.h
-
-CSRCS		= \
-		dlldata.c \
-		IPalmSync_p.c \
-		IPalmSync_i.c \
-		$(NULL)
-
-OS_LIBS		+= rpcrt4.lib
-
-MIDL_GENERATED_FILES = IPalmSync.h IPalmSync_p.c IPalmSync_i.c dlldata.c
-
-SRCDIR_CSRCS	= $(addprefix $(srcdir)/,$(CSRCS))
-
-GARBAGE	+= $(MIDL_GENERATED_FILES) done_gen $(CSRCS) $(SRCDIR_CSRCS)
-
-LOCAL_INCLUDES	= -I.
-
-# Force use of PIC
-FORCE_USE_PIC	= 1 
-FORCE_SHARED_LIB = 1
-SRCS_IN_OBJDIR	= 1
-include $(topsrcdir)/config/rules.mk
-
-DEFINES += -DREGISTER_PROXY_DLL -DUNICODE -D_UNICODE
-
-$(MIDL_GENERATED_FILES): done_gen
-
-done_gen: IPalmSync.idl
-	$(RM) $(SRCDIR_CSRCS)
-	$(MIDL) $(MIDL_FLAGS) -Oic $(UNICODE_FLAGS) $(srcdir)/IPalmSync.idl
-	touch $@
-
-export:: done_gen
-
-
deleted file mode 100644
--- a/mailnews/extensions/palmsync/build/PalmSyncProxy.def
+++ /dev/null
@@ -1,47 +0,0 @@
-; ***** BEGIN LICENSE BLOCK *****
-; Version: MPL 1.1/GPL 2.0/LGPL 2.1
-;
-; The contents of this file are subject to the Mozilla 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/MPL/
-;
-; 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.
-;
-; The Initial Developer of the Original Code is
-; Netscape Communications Corp.
-; Portions created by the Initial Developer are Copyright (C) 2002
-; the Initial Developer. All Rights Reserved.
-;
-; Contributor(s):  Rajiv Dayal (rdayal@netscape.com)
-;
-; Alternatively, the contents of this file may be used under the terms of
-; either the GNU General Public License Version 2 or later (the "GPL"), or
-; the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-; in which case the provisions of the GPL or the LGPL are applicable instead
-; of those above. If you wish to allow use of your version of this file only
-; under the terms of either the GPL or the LGPL, and not to allow others to
-; use your version of this file under the terms of the MPL, indicate your
-; decision by deleting the provisions above and replace them with the notice
-; and other provisions required by the GPL or the LGPL. If you do not delete
-; the provisions above, a recipient may use your version of this file under
-; the terms of any one of the MPL, the GPL or the LGPL.
-;
-; ***** END LICENSE BLOCK ***** 
-
-LIBRARY         PalmSyncProxy.dll
-DESCRIPTION     'Proxy/Stub DLL'
-
-EXPORTS
-                DllGetClassObject   @1  PRIVATE
-                DllCanUnloadNow     @2  PRIVATE
-                GetProxyDllInfo     @3  PRIVATE
-                DllRegisterServer   @4  PRIVATE
-                DllUnregisterServer @5  PRIVATE
-
-
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/Makefile.in
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla 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/MPL/
-#
-# 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 the Initial Developer are Copyright (C) 2002
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-PALM_CDK_INC	= $(PALM_CDK_DIR)/C++/Include
-PALM_CDK_LIB	= $(PALM_CDK_DIR)/C++/Lib
-PALM_PFC_INC	= $(PALM_CDK_DIR)/C++/Pfc/include
-PALM_PFC_SRC	= $(PALM_CDK_DIR)/C++/Pfc/Src
-PALM_CDK_BIN    = $(PALM_CDK_DIR)/Common/Bin
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= mozABConduit
-EXPORT_LIBRARY	= $(MODULE)
-LIBRARY_NAME	= $(MODULE)
-RESFILE         = MozABConduitGenCond.res
-USE_STATIC_LIBS = 1
-XPI_NAME	= palmsync
-
-REQUIRES	= PalmSyncProxy \
-		  $(NULL)
-
-CPPSRCS		= MozABConduitGenCond.cpp \
-		  MozABConduitRecord.cpp \
-		  MozABConduitSync.cpp \
-		  MozABHHManager.cpp \
-		  MozABPCManager.cpp \
-		  $(NULL)
-
-LOCAL_INCLUDES += -I$(PALM_CDK_INC) \
-		  -I$(PALM_PFC_INC) \
-		  -I$(PALM_PFC_SRC) \
-		   $(NULL)
-
-EXTRA_DSO_LDOPTS = \
-		   $(PALM_CDK_LIB)/sync20.$(LIB_SUFFIX) \
-		   $(PALM_CDK_LIB)/palmcmn.$(LIB_SUFFIX) \
-       $(PALM_CDK_LIB)/hslog20.$(LIB_SUFFIX) \
-		   $(NULL)
-
-OS_LIBS		+= ole32.lib comctl32.lib
-
-# Force use of PIC
-FORCE_USE_PIC	= 1 
-FORCE_SHARED_LIB = 1
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/MozABConduitGenCond.cpp
+++ /dev/null
@@ -1,494 +0,0 @@
-/***************************************************************************
- *
- * EXPORTED FUNCTIONS Conduit Entry Points Source File
- *
- **************************************************************************/
-#define STRICT 1
-#define ASSERT(f)          ((void)0)
-#define TRACE0(sz)
-#define TRACE(sz)
-
-#include <malloc.h>
-
-
-#include <CPalmRec.cpp>
-#include <CPString.cpp>
-#include <CPCatgry.cpp>
-
-#include <windows.h>
-#include <string.h>
-#include <stdio.h>
-#ifdef METROWERKS_WIN
-#include <wmem.h>
-#else
-#include <memory.h>
-#endif
-#include <sys/stat.h>
-#include <TCHAR.H>
-#include <COMMCTRL.H>
-
-#include <syncmgr.h>
-#include "MozABConduitGenCond.h"
-#include "resource.h"
-
-#include <logstrng.h>
-
-// TODO - Include custom sync header
-
-#include <PALM_CMN.H>
-#define CONDUIT_NAME "MozABConduit"
-#include "MozABConduitSync.h"
-
-HANDLE hLangInstance;
-HANDLE hAppInstance;
-extern HANDLE hLangInstance;
-extern HANDLE hAppInstance;
-
-long CALLBACK CondCfgDlgProc(HWND hWnd, UINT Message, WPARAM wParam, 
-                             LPARAM lParam);
-void LdCfgDlgBmps(HWND hDlg);
-
-/////////////////////////////////////////////////////////////////////////////
-//
-/////////////////////////////////////////////////////////////////////////////
-//
-//     Function:        DllMain()
-//
-//     Description:    main entry point to the MozABConduitProto component
-//
-//     Parameters:    hInstance - instance handle of the DLL
-//                    dwReason  - why the entry point was called
-//                    lpReserved - reserved
-//
-//     Returns:        1 if okay
-//
-/////////////////////////////////////////////////////////////////////////////
-#ifndef _68K_
-
-static int iTerminationCount = 0;
-
-DWORD tId = 0;
-
-
-extern "C" int APIENTRY
-DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
-{
-
-
-    if (dwReason == DLL_PROCESS_ATTACH)
-    {
-        TRACE0("EXPORTED FUNCTIONS Initializing!\n");
-        
-        if (!iTerminationCount ) {
-            hAppInstance = hInstance;
-            // use PalmLoadLanguage here to load different languages
-            hLangInstance = hInstance;
-        }
-        ++iTerminationCount;
-
-        tId = TlsAlloc();
-        if (tId == 0xFFFFFFFF)
-            return FALSE;
-    }
-    else if (dwReason == DLL_PROCESS_DETACH)
-    {
-        TRACE0("EXPORTED FUNCTIONS Terminating!\n");
-
-        --iTerminationCount;
-        if (!iTerminationCount ) {
-            // use PalmFreeLanguage here to unload different languages
-        }
-        TlsFree(tId);
-    }
-    return 1;   // ok
-}
-#endif
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-/////////////////////////////////////////////////////////////////////////////
-//
-//     Function:        OpenConduit()
-//
-//     Description:  Extern "C" entry point into this conduit which starts 
-//                   the process of synchronizing the local database table 
-//                   with a remote conterpart residing on the remote view 
-//                   device. 
-//
-//     Parameters:   Pointer to a callback function used to report progress.
-//                    
-//                
-//
-//     Returns:        
-//
-/////////////////////////////////////////////////////////////////////////////
-ExportFunc long OpenConduit(PROGRESSFN pFn, CSyncProperties& rProps)
-{
-    long retval = -1;
-    if (pFn)
-    {
-       CMozABConduitSync * pABSync = new CMozABConduitSync(rProps);
-        if (pABSync)
-		{
-            retval = pABSync->Perform();
-            delete pABSync;
-        }
-    }
-    return(retval);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-//
-/////////////////////////////////////////////////////////////////////////////
-//
-//       Function:              GetConduitName()
-//
-//       Description:  Extern "C" entry point into this conduit which returns
-//                                the name to be used when display messages 
-//                                regarding this conduit.
-//
-//       Parameters:   pszName - buffer in which to place the name
-//                                 nLen - maximum number of bytes of buffer     
-//                                      
-//                              
-//
-//       Returns:          -1 indicates erros
-//
-/////////////////////////////////////////////////////////////////////////////
-ExportFunc long GetConduitName(char* pszName,WORD nLen)
-{
-    strncpy(pszName,CONDUIT_NAME, nLen-1);   
-    *(pszName+nLen-1) = '\0';
-
-    return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-//
-/////////////////////////////////////////////////////////////////////////////
-//
-//       Function:     GetConduitVersion()
-//
-//       Description:  Extern "C" entry point into this conduit which returns
-//                     the conduits version
-//
-//       Parameters:   none
-//
-//       Returns:      DWORD indicating major and minor version number
-//                        HIWORD - reserved
-//                        HIBYTE(LOWORD) - major number
-//                        LOBYTE(LOWORD) - minor number
-//
-/////////////////////////////////////////////////////////////////////////////
-ExportFunc DWORD GetConduitVersion()
-{
-    return GENERIC_CONDUIT_VERSION;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-//
-/////////////////////////////////////////////////////////////////////////////
-//
-//       Function:     ConfigureConduit
-//
-//       Description:  Extern "C" entry point into this conduit which returns
-//                     should display the UI necessary to configure this 
-//                     conduit.
-//
-//       Parameters:   none
-//
-//       Returns:      0 - success, !0 - failure
-//
-/////////////////////////////////////////////////////////////////////////////
-ExportFunc long ConfigureConduit(CSyncPreference& pref)
-{
-
-    long nRtn = -1;
-    CfgConduitInfoType cfgcond;
-    cfgcond.dwVersion = CFGCONDUITINFO_VERSION_1;
-    cfgcond.dwSize  = sizeof(CfgConduitInfoType);
-    cfgcond.dwCreatorId = 0;
-    cfgcond.dwUserId = 0;
-    memset(cfgcond.szUser , 0, sizeof(cfgcond.szUser));
-    memset(cfgcond.m_PathName, 0, sizeof(cfgcond.m_PathName)); 
-    cfgcond.syncPermanent = pref.m_SyncType;
-    cfgcond.syncTemporary = pref.m_SyncType;
-    cfgcond.syncNew = pref.m_SyncType;
-    cfgcond.syncPref = eTemporaryPreference; 
-
-    int irv;
-    irv = DialogBoxParam((HINSTANCE)hLangInstance, 
-              MAKEINTRESOURCE(IDD_CONDUIT_ACTION), 
-              GetForegroundWindow(), 
-              (DLGPROC)CondCfgDlgProc,
-              (LPARAM)&cfgcond);
-    if (irv == 0) 
-	{
-        pref.m_SyncType = cfgcond.syncNew;
-        pref.m_SyncPref = cfgcond.syncPref;
-        nRtn = 0;
-    }
-
-    return nRtn;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// 
-/////////////////////////////////////////////////////////////////////////////
-//
-//   Method:        GetConduitInfo
-//
-//   Description:   This function provides a way for a Conduit to provide 
-//                  info to the caller.  In this version of the call, MFC 
-//                  Version, Conduit Name, and Default sync action are the 
-//                  types of information this call will return.
-//
-//   Parameters:    ConduitInfoEnum infoType - enum specifying what info is 
-//                                             being requested.
-//
-//                  void *pInArgs - This parameter may be null, except for 
-//                                  the Conduit name enum, this value will 
-//                                  be a ConduitRequestInfoType structure.
-//
-//                  This following two parameters vary depending upon the 
-//                  info being requested. 
-//
-//                  For enum eConduitName
-//                  void *pOut - will be a pointer to a character buffer
-//                  DWORD *pdwOutSize - will be a pointer to a DWORD 
-//                                      specifying the size of the 
-//                                      character buffer.
-//
-//                  For enum eMfcVersion
-//                  void *pOut - will be a pointer to a DWORD
-//                  DWORD *pdwOutSize - will be a pointer to a DWORD 
-//                                      specifying the size of pOut.
-//
-//                  For enum eDefaultAction
-//                  void *pOut - will be a pointer to a eSyncType variable
-//                  DWORD *pdwOutSize - will be a pointer to a DWORD 
-//                                      specifying the size of pOut.
-//
-//   Returns:       0   - Success.
-//                  !0  - error code.
-//
-/////////////////////////////////////////////////////////////////////////////
-ExportFunc long GetConduitInfo(ConduitInfoEnum infoType, void *pInArgs, 
-                               void *pOut, DWORD *pdwOutSize)
-{
-    if (!pOut)
-        return CONDERR_INVALID_PTR;
-    if (!pdwOutSize)
-        return CONDERR_INVALID_OUTSIZE_PTR;
-
-    switch (infoType) 
-	{
-        case eConduitName:
-
-            // This code is for example. This conduit does not use this code
-            
-            if (!pInArgs)
-                return CONDERR_INVALID_INARGS_PTR;
-            ConduitRequestInfoType *pInfo;
-            pInfo = (ConduitRequestInfoType *)pInArgs;
-            if ((pInfo->dwVersion != CONDUITREQUESTINFO_VERSION_1) ||
-                (pInfo->dwSize != SZ_CONDUITREQUESTINFO))
-                return CONDERR_INVALID_INARGS_STRUCT;
-           
-                pOut = CONDUIT_NAME;
-                return CONDERR_CONDUIT_RESOURCE_FAILURE;
-            break;
-        case eDefaultAction:
-            if (*pdwOutSize != sizeof(eSyncTypes))
-                return CONDERR_INVALID_BUFFER_SIZE;
-            (*(eSyncTypes*)pOut) = eFast;
-            break;
-        case eMfcVersion:
-            if (*pdwOutSize != sizeof(DWORD))
-                return CONDERR_INVALID_BUFFER_SIZE;
-            (*(DWORD*)pOut) = MFC_NOT_USED;
-            break;
-        default:
-            return CONDERR_UNSUPPORTED_CONDUITINFO_ENUM;
-    }
-    return 0;
-}
-
-long CALLBACK CondCfgDlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
-{
-    static CfgConduitInfoType *pCfgInfo;
-    TCHAR szPath[256];
-
-    switch (Message) 
-	{
-      case WM_INITDIALOG:
-
-        if (lParam != 0) {
-          TCHAR szBuffer[256];
-          TCHAR szBuf2[256];
-          LoadString((HINSTANCE)hLangInstance, IDS_SYNC_ACTION_TEXT, szBuffer, 
-                     sizeof(szBuffer));
-          SetDlgItemText(hWnd, IDC_ACTIONGROUPBOXTEXT, szBuffer);
-
-          LoadString((HINSTANCE)hLangInstance, IDS_CONDUIT_NAME, szBuffer, 
-                     sizeof(szBuffer));
-          SetWindowText(hWnd, szBuffer);
-     
-          // Load the bitmaps properly
-          LdCfgDlgBmps(hWnd);
-
-          pCfgInfo = (CfgConduitInfoType *)lParam;
-          switch (pCfgInfo->syncTemporary)
-		  {
-            case eFast:
-            case eSlow:
-              CheckRadioButton(hWnd, IDC_RADIO_SYNC, IDC_RADIO_DONOTHING, 
-                               IDC_RADIO_SYNC);
-              LoadString((HINSTANCE)hLangInstance, IDS_SYNC_FILES, szBuffer, 
-                         sizeof(szBuffer));
-              break;
-            case ePCtoHH:
-              CheckRadioButton( hWnd, IDC_RADIO_SYNC, IDC_RADIO_DONOTHING, IDC_RADIO_PCTOHH);
-              LoadString((HINSTANCE)hLangInstance, IDS_PCTOHH, szBuffer, sizeof(szBuffer));
-              break;
-            case eHHtoPC:
-              CheckRadioButton( hWnd, IDC_RADIO_SYNC, IDC_RADIO_DONOTHING, IDC_RADIO_HHTOPC);
-              LoadString((HINSTANCE)hLangInstance, IDS_HHTOPC, szBuffer, sizeof(szBuffer));
-              break;
-            case eDoNothing:
-            default:
-              CheckRadioButton(hWnd, IDC_RADIO_SYNC, IDC_RADIO_DONOTHING, 
-                               IDC_RADIO_DONOTHING);
-              LoadString((HINSTANCE)hLangInstance, IDS_DO_NOTHING, szBuffer,
-                         sizeof(szBuffer));
-              break;
-          }
-          // did we get called from the old config call or the new cfg call?
-          if (pCfgInfo->dwCreatorId != 0) 
-		  {
-            SetDlgItemText(hWnd, IDC_STATIC_TEMPORARY, szBuffer);
-
-            switch (pCfgInfo->syncPermanent)
-			{
-              case eFast:
-              case eSlow:
-                LoadString((HINSTANCE)hLangInstance, IDS_SYNC_FILES, szBuffer,
-                           sizeof(szBuffer));
-                break;
-              case ePCtoHH:
-                LoadString((HINSTANCE)hLangInstance, IDS_PCTOHH, szBuffer,
-                           sizeof(szBuffer));
-                break;
-
-              case eHHtoPC:
-                LoadString((HINSTANCE)hLangInstance, IDS_HHTOPC, szBuffer,
-                           sizeof(szBuffer));
-                break;
-              case eDoNothing:
-              default:
-                LoadString((HINSTANCE)hLangInstance, IDS_DO_NOTHING, szBuffer,
-                           sizeof(szBuffer));
-                break;
-            }
-            SetDlgItemText(hWnd, IDC_STATIC_PERMANENT, szBuffer);
-
-            LoadString((HINSTANCE)hLangInstance, IDS_CURRENT_SETTINGS_GROUP, 
-                       szBuffer, sizeof(szBuffer));
-            wsprintf(szBuf2, szBuffer, pCfgInfo->szUser);
-            SetDlgItemText(hWnd, IDC_CURRENT_SETTINGS_GROUP, szBuf2);
-          }
-        }
-        break;
-      case WM_COMMAND:
-        switch (wParam) 
-		{
-          case IDC_RADIO_SYNC:
-          case IDC_RADIO_DONOTHING:
-          case IDC_RADIO_HHTOPC:
-          case IDC_RADIO_PCTOHH:
-            CheckRadioButton( hWnd, IDC_RADIO_SYNC, IDC_RADIO_DONOTHING, wParam);
-            break;
-          case IDCANCEL:
-            EndDialog(hWnd, 1);
-            return TRUE;
-          case IDOK:
-            if (IsDlgButtonChecked(hWnd, IDC_RADIO_SYNC)) 
-                pCfgInfo->syncNew = eFast;
-            else if (IsDlgButtonChecked(hWnd, IDC_RADIO_PCTOHH)) 
-                pCfgInfo->syncNew = ePCtoHH;
-            else if (IsDlgButtonChecked(hWnd, IDC_RADIO_HHTOPC))
-                pCfgInfo->syncNew = eHHtoPC;
-            else
-                pCfgInfo->syncNew = eDoNothing;
-            pCfgInfo->syncPref = (IsDlgButtonChecked(hWnd, IDC_MAKEDEFAULT))
-				?  ePermanentPreference : eTemporaryPreference;
-            EndDialog(hWnd, 0);
-            return TRUE;
-          default:
-            break;
-        }
-        break;
-
-      case WM_SYSCOLORCHANGE:
-        LdCfgDlgBmps(hWnd);
-        break;
-
-      default:
-        break;
-    }
-    return FALSE;
-}
-
-void LdCfgDlgBmps(HWND hDlg)
-{
-  COLORMAP    cMap;
-  HWND        hwndButton;
-  HBITMAP     hBmp, hOldBmp;
-
-  //
-  // setup the bitmaps
-  //
-  cMap.to = GetSysColor(COLOR_BTNFACE);
-  cMap.from = RGB(192,192,192);
-
-  // Sync 
-  hBmp = CreateMappedBitmap((HINSTANCE)hLangInstance, IDB_SYNC, 0, &cMap, 1);
-  // associate the bitmap with the button.
-  if ((hwndButton = GetDlgItem(hDlg, IDC_SYNC)) != NULL)
-  {
-    hOldBmp = (HBITMAP)SendMessage(hwndButton, STM_SETIMAGE,
-                                   (WPARAM)IMAGE_BITMAP, (LPARAM)(HANDLE)hBmp);
-    if (hOldBmp != NULL)
-      DeleteObject((HGDIOBJ)hOldBmp);
-  }
-
-  // Do Nothing 
-  hBmp = CreateMappedBitmap((HINSTANCE)hLangInstance, IDB_DONOTHING, 0, &cMap, 1);
-  // associate the bitmap with the button.
-  if ((hwndButton = GetDlgItem(hDlg, IDC_DONOTHING)) != NULL)
-  {
-    hOldBmp = (HBITMAP)SendMessage(hwndButton, STM_SETIMAGE,
-                                   (WPARAM)IMAGE_BITMAP, (LPARAM)(HANDLE)hBmp);
-    if (hOldBmp != NULL)
-      DeleteObject((HGDIOBJ)hOldBmp);
-  }
-  hBmp = CreateMappedBitmap((HINSTANCE)hLangInstance, IDB_PCTOHH, 0, &cMap, 1);
-  // associate the bitmap with the button.
-  if ((hwndButton = GetDlgItem(hDlg, IDC_PCTOHH)) != NULL)
-  {
-    hOldBmp = (HBITMAP)SendMessage(hwndButton, STM_SETIMAGE,
-                                   (WPARAM)IMAGE_BITMAP, (LPARAM)(HANDLE)hBmp);
-    if (hOldBmp != NULL)
-      DeleteObject((HGDIOBJ)hOldBmp);
-  }
-  hBmp = CreateMappedBitmap((HINSTANCE)hLangInstance, IDB_HHTOPC, 0, &cMap, 1);
-  // associate the bitmap with the button.
-  if ((hwndButton = GetDlgItem(hDlg, IDC_HHTOPC)) != NULL)
-  {
-    hOldBmp = (HBITMAP)SendMessage(hwndButton, STM_SETIMAGE,
-                                   (WPARAM)IMAGE_BITMAP, (LPARAM)(HANDLE)hBmp);
-    if (hOldBmp != NULL)
-      DeleteObject((HGDIOBJ)hOldBmp);
-  }
-}
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/MozABConduitGenCond.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*****************************************************************************
- *
- * Generic Conduit Export Functions Header File
- *
- * THIS FILE IS GENERATED BY PALM CDK
- ****************************************************************************/
-
-
-#ifndef  __GENERIC_MAIN_CONDUIT__
-#define  __GENERIC_MAIN_CONDUIT__
-#include <condapi.h>
-
-#define GENERIC_CONDUIT_VERSION 0x00000102
-
-#ifndef ExportFunc
-#ifdef _68K_
-#define ExportFunc
-#else
-#define ExportFunc __declspec( dllexport )
-#endif
-#endif
-
-extern "C" {
-
-typedef  long (*PROGRESSFN) (char*);
-ExportFunc long OpenConduit(PROGRESSFN, CSyncProperties&);
-ExportFunc long GetConduitName(char*,WORD);
-ExportFunc DWORD GetConduitVersion();
-ExportFunc long ConfigureConduit(CSyncPreference& pref);
-ExportFunc long GetConduitInfo(ConduitInfoEnum infoType, void *pInArgs, void *pOut, DWORD *dwOutSize);
-
-}
-
-
-#endif
-
-
deleted file mode 100755
--- a/mailnews/extensions/palmsync/conduit/MozABConduitGenCond.rc
+++ /dev/null
@@ -1,130 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "winresrc.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#include ""winresrc.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_CONDUIT_ACTION DIALOG DISCARDABLE  0, 0, 294, 114
-STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION "Change HotSync Action"
-FONT 8, "MS Sans Serif"
-BEGIN
-    RADIOBUTTON     "&Synchronize the files",IDC_RADIO_SYNC,71,28,81,10,
-                    WS_GROUP | WS_TABSTOP
-    RADIOBUTTON     "&Desktop overwrites handheld",IDC_RADIO_PCTOHH,71,40,
-                    108,10,WS_GROUP
-    RADIOBUTTON     "&Handheld overwrites Desktop",IDC_RADIO_HHTOPC,71,52,
-                    109,10,WS_GROUP
-    RADIOBUTTON     "Do &nothing",IDC_RADIO_DONOTHING,71,64,51,10,WS_GROUP
-    CONTROL         "Set &as default",IDC_MAKEDEFAULT,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,196,64,58,10
-    DEFPUSHBUTTON   "OK",IDOK,196,11,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,196,27,50,14
-    GROUPBOX        "<PlaceHolder>",IDC_ACTIONGROUPBOXTEXT,5,6,186,105,
-                    WS_GROUP
-    CONTROL         103,IDC_SYNC,"Static",SS_BITMAP | WS_GROUP,18,26,32,15
-    CONTROL         106,IDC_DONOTHING,"Static",SS_BITMAP | WS_GROUP,18,62,15,
-                    13
-    CONTROL         105,IDC_PCTOHH,"Static",SS_BITMAP | WS_GROUP,18,39,32,15
-    CONTROL         102,IDC_HHTOPC,"Static",SS_BITMAP | WS_GROUP,18,49,32,15
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDB_DONOTHING           BITMAP  DISCARDABLE     "res\\DoNothing.bmp"
-IDB_SYNC                BITMAP  DISCARDABLE     "res\\Synchronize.bmp"
-IDB_HHTOPC              BITMAP  DISCARDABLE     "res\\HhToPc.bmp"
-IDB_PCTOHH              BITMAP  DISCARDABLE     "res\\PcToHh.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_CONDUIT_NAME        "Mozilla Address Book Conduit"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_CONNECTION          "Please check your connections and try again."
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_CURRENT_SETTINGS_GROUP "%s's Current Settings:"
-    IDS_SYNC_FILES          "Synchronize the files."
-    IDS_PCTOHH              "Desktop overwrites Palm organizer."
-    IDS_HHTOPC              "Palm organizer overwrites Desktop."
-    IDS_DO_NOTHING          "Do Nothing."
-    IDS_SYNC_ACTION_TEXT    "HotSync Action for Mozilla Address Book"
-END
-
-#endif    // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/MozABConduitRecord.cpp
+++ /dev/null
@@ -1,604 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include <windows.h>
-#include <string.h>
-#include <stdio.h>
-#include <memory.h>
-#include <sys/stat.h>
-#include <TCHAR.H>
-
-#include "MozABConduitRecord.h"
-#include "MozABPCManager.h"
-#include "MozABConduitSync.h"
-
-#define  STR_CRETURN  "\r" 
-#define  STR_NEWLINE  "\n" 
-
-#define  CH_CRETURN  0x0D 
-#define  CH_NEWLINE  0x0A 
-
-
-// constructor
-CMozABConduitRecord::CMozABConduitRecord(void)
-{
-    Reset();
-}
-
-// construct using Palm record
-CMozABConduitRecord::CMozABConduitRecord(CPalmRecord &rec)
-{
-    ConvertFromGeneric(rec);
-}
-
-// construct using Mozilla record
-CMozABConduitRecord::CMozABConduitRecord(nsABCOMCardStruct &rec)
-{
-    Reset();
-
-    memcpy(&m_nsCard, &rec, sizeof(nsABCOMCardStruct));
-
-    m_dwRecordID = m_nsCard.dwRecordId;
-    m_dwStatus = m_nsCard.dwStatus;
-    m_dwCategoryID = m_nsCard.dwCategoryId;
-
-    m_dwPhone1LabelID = PHONE_LABEL_WORK;
-    m_dwPhone2LabelID = PHONE_LABEL_HOME;
-    m_dwPhone3LabelID = PHONE_LABEL_FAX;
-    m_dwPhone4LabelID = PHONE_LABEL_MOBILE;
-    m_dwPhone5LabelID = PHONE_LABEL_EMAIL;
-    
-    m_csName = rec.lastName;
-    m_csFirst = rec.firstName;
-    m_csTitle = rec.jobTitle;
-    m_csCompany = rec.company;
-
-    m_csPhone1 = rec.workPhone;
-    m_csPhone2 = rec.homePhone;
-    m_csPhone3 = rec.faxNumber;
-    m_csPhone4 = rec.cellularNumber;
-    m_csPhone5 = rec.primaryEmail;
-
-    m_csAddress = (MozABPCManager::gUseHomeAddress)
-                    ? rec.homeAddress : rec.workAddress;
-
-    m_csCity = (MozABPCManager::gUseHomeAddress) ? rec.homeCity : rec.workCity;
-    m_csState = (MozABPCManager::gUseHomeAddress) ? rec.homeState : rec.workState;
-    m_csZipCode = (MozABPCManager::gUseHomeAddress) ? rec.homeZipCode : rec.workZipCode;
-    m_csCountry = (MozABPCManager::gUseHomeAddress) ? rec.homeCountry : rec.workCountry;
-//    CONDUIT_LOG3(gFD, "\nCMozABConduitRecord::CMozABConduitRecord(nsABCOMCardStruct &rec) gUseHomeAddress = %s card home address = %s card work address = %s\n", 
-//      (MozABPCManager::gUseHomeAddress) ? "true" : "false", (char *) rec.homeAddress, (char *) rec.workAddress);
-    m_dwDisplayPhone = rec.preferredPhoneNum;
-
-    m_csNote = rec.notes;
-
-    m_csCustom1 = rec.custom1;
-    m_csCustom2 = rec.custom2;
-    m_csCustom3 = rec.custom3;
-    m_csCustom4 = rec.custom4;
-}
-
-// destructor
-CMozABConduitRecord::~CMozABConduitRecord()
-{
-
-}
-
-// reset the internal data members
-void CMozABConduitRecord::Reset(void)
-{
-    memset(&m_nsCard, 0, sizeof(nsABCOMCardStruct));
-
-    m_dwRecordID = 0;
-    m_dwStatus = 0;
-    m_dwPosition = 0;
-    m_dwPhone1LabelID = 0;
-    m_dwPhone2LabelID = 0;
-    m_dwPhone3LabelID = 0;
-    m_dwPhone4LabelID = 0;
-    m_dwPhone5LabelID = 0;
-    m_dwPrivate = 0;
-    m_dwCategoryID = 0;
-    m_dwDisplayPhone = 1; // work 
-    m_csName.Empty();
-    m_csFirst.Empty();
-    m_csTitle.Empty();
-    m_csCompany.Empty();
-    m_csPhone1.Empty();
-    m_csPhone2.Empty();
-    m_csPhone3.Empty();
-    m_csPhone4.Empty();
-    m_csCustom1.Empty();
-    m_csCustom2.Empty();
-    m_csCustom3.Empty();
-    m_csCustom4.Empty();
-    m_csPhone5.Empty();
-    m_csAddress.Empty();
-    m_csCity.Empty();
-    m_csState.Empty();
-    m_csZipCode.Empty();
-    m_csCountry.Empty();
-    m_csNote.Empty();
-}
-
-// this method compares this object with another MozAB Conduit record
-eRecCompare CMozABConduitRecord::Compare(const CMozABConduitRecord &rec)
-{
-    if ( (m_dwPhone1LabelID != rec.m_dwPhone1LabelID) ||
-         (m_dwPhone2LabelID != rec.m_dwPhone2LabelID) ||
-         (m_dwPhone3LabelID != rec.m_dwPhone3LabelID ) ||
-         (m_dwPhone4LabelID != rec.m_dwPhone4LabelID ) ||
-         (m_dwPhone5LabelID != rec.m_dwPhone5LabelID ) ||
-         // comment this out until we can match 4.x's displayPhone algorithm
-//         (m_dwDisplayPhone !=  rec.m_dwDisplayPhone ) ||
-         (m_csName !=  rec.m_csName ) ||
-         (m_csFirst !=  rec.m_csFirst ) ||
-         (m_csTitle !=  rec.m_csTitle ) ||
-         (m_csCompany !=  rec.m_csCompany ) ||
-         (m_csPhone1 !=  rec.m_csPhone1 ) ||
-         (m_csPhone2 !=  rec.m_csPhone2 ) ||
-         (m_csPhone3 !=  rec.m_csPhone3 ) ||
-         (m_csPhone4 !=  rec.m_csPhone4 ) ||
-         (m_csCustom1 !=  rec.m_csCustom1 ) ||
-         (m_csCustom2 !=  rec.m_csCustom2 ) ||
-         (m_csCustom3 !=  rec.m_csCustom3 ) ||
-         (m_csCustom4 !=  rec.m_csCustom4 ) ||
-         (m_csPhone5 !=  rec.m_csPhone5 ) ||
-         (m_csAddress !=  rec.m_csAddress ) ||
-         (m_csCity !=  rec.m_csCity ) ||
-         (m_csState !=  rec.m_csState ) ||
-         (m_csZipCode !=  rec.m_csZipCode ) ||
-         (m_csCountry !=  rec.m_csCountry ) ||
-         (m_csNote !=  rec.m_csNote ))
-         return eData;
-    if (m_dwPrivate != rec.m_dwPrivate ) 
-        return ePrivateFlag;
-    if (m_dwCategoryID != rec.m_dwCategoryID ) 
-        return eCategory;
-
-    return eEqual;
-}
-
-#define COPY_FROM_GENERIC(m, d)  {  iLen = _tcslen((char *)pBuff);  \
-                                    CopyFromHHBuffer((char *)pBuff, m.GetBuffer(iLen * 2), iLen); \
-                                    m.ReleaseBuffer();              \
-                                    d = m.GetBuffer(0);             \
-                                    pBuff += iLen + 1;              \
-                                 }                                  \
-
-#define COPY_PHONE_FROM_GENERIC(m, d){  iLen = _tcslen((char *)pBuff);              \
-                                        CopyFromHHBuffer((char *)pBuff, m.GetBuffer(iLen * 2), iLen); \
-                                        m.ReleaseBuffer();                          \
-                                        AssignPhoneToMozData(d, m.GetBuffer(0));    \
-                                        pBuff += iLen + 1;                          \
-                                     }                                              \
-
-
-// this method converts CPalmRecord to MozAB Conduit record 
-long CMozABConduitRecord::ConvertFromGeneric(CPalmRecord &rec)
-{
-    long                retval = 0;
-    BYTE                *pBuff;
-    AddrDBRecordFlags   flags;
-    AddrOptionsType     options;
-    int iLen;
-
-    Reset();
-
-    if (rec.GetRawDataSize() == (sizeof(DWORD) + sizeof(DWORD) + sizeof(unsigned char))){
-        // then this is a deleted record because it has no data
-        return GEN_ERR_EMPTY_RECORD;
-    }
-
-    // palm specific data
-    m_dwRecordID = rec.GetID();
-    m_dwCategoryID = rec.GetCategory();
-    m_dwPrivate    = rec.IsPrivate();
-    m_dwStatus = rec.GetStatus();
-
-    m_nsCard.dwRecordId = m_dwRecordID;
-    m_nsCard.dwCategoryId = m_dwCategoryID;
-    m_nsCard.dwStatus = m_dwStatus;
-
-    // clear all values in the Address Record
-    m_dwPhone1LabelID = PHONE_LABEL_WORK;
-    m_dwPhone2LabelID = PHONE_LABEL_HOME;
-    m_dwPhone3LabelID = PHONE_LABEL_FAX;
-    m_dwPhone4LabelID = PHONE_LABEL_MOBILE;
-    m_dwPhone5LabelID = PHONE_LABEL_EMAIL;
-    m_dwDisplayPhone = m_nsCard.preferredPhoneNum;
-
-    DWORD dwRawSize = rec.GetRawDataSize();
-    if (!dwRawSize) {
-        // invalid record
-        return 0;
-    }
-
-    // get the data for moz card
-    pBuff = rec.GetRawData();
-
-    // AddrOptionsType
-    *(DWORD *)&options = CPalmRecord::SwapDWordToIntel(*((DWORD*)pBuff));
-    m_dwDisplayPhone  = (long)options.displayPhone + 1;
-    m_dwPhone1LabelID = (DWORD)options.phone1;
-    m_dwPhone2LabelID = (DWORD)options.phone2;
-    m_dwPhone3LabelID = (DWORD)options.phone3;
-    m_dwPhone4LabelID = (DWORD)options.phone4;
-    m_dwPhone5LabelID = (DWORD)options.phone5;
-
-    pBuff += sizeof(DWORD);
-
-    // The flag bits are used to indicate which fields exist
-    *(DWORD *)&flags = CPalmRecord::SwapDWordToIntel(*((DWORD*)pBuff));
-    pBuff += sizeof(DWORD) + sizeof(unsigned char);
-
-    // Name
-    if (flags.name) COPY_FROM_GENERIC(m_csName, m_nsCard.lastName)
-    // FirstName
-    if (flags.firstName) COPY_FROM_GENERIC(m_csFirst, m_nsCard.firstName)
-    // DisplayName
-    m_csDisplayName = m_nsCard.firstName;
-    m_csDisplayName += " ";
-    m_csDisplayName += m_nsCard.lastName;
-    m_nsCard.displayName = m_csDisplayName.GetBuffer(0);
-    // Company
-    if (flags.company) COPY_FROM_GENERIC(m_csCompany, m_nsCard.company)
-    // Phones
-    if (flags.phone1) COPY_PHONE_FROM_GENERIC(m_csPhone1, m_dwPhone1LabelID)
-    if (flags.phone2) COPY_PHONE_FROM_GENERIC(m_csPhone2, m_dwPhone2LabelID)
-    if (flags.phone3) COPY_PHONE_FROM_GENERIC(m_csPhone3, m_dwPhone3LabelID)
-    if (flags.phone4) COPY_PHONE_FROM_GENERIC(m_csPhone4, m_dwPhone4LabelID)
-    if (flags.phone5) COPY_PHONE_FROM_GENERIC(m_csPhone5, m_dwPhone5LabelID)
-    // Address
-    if (flags.address) 
-    {
-      if (MozABPCManager::gUseHomeAddress)
-        COPY_FROM_GENERIC(m_csAddress, m_nsCard.homeAddress)
-      else
-         COPY_FROM_GENERIC(m_csAddress, m_nsCard.workAddress)
-
-//      CONDUIT_LOG4(gFD, "\nConvertFromGeneric gUseHomeAddress = %s card home address = %s card work address = %s result = %s\n", 
-//        (MozABPCManager::gUseHomeAddress) ? "true" : "false", (char *) m_nsCard.homeAddress, (char *) m_nsCard.workAddress, (char *) m_csAddress);
-    }
-    // City
-    if (flags.city) 
-    {
-      if (MozABPCManager::gUseHomeAddress)
-        COPY_FROM_GENERIC(m_csCity, m_nsCard.homeCity)
-      else
-        COPY_FROM_GENERIC(m_csCity, m_nsCard.workCity)
-    }
-    // State
-    if (flags.state) 
-    {
-      if (MozABPCManager::gUseHomeAddress)
-        COPY_FROM_GENERIC(m_csState, m_nsCard.homeState)
-      else
-        COPY_FROM_GENERIC(m_csState, m_nsCard.workState)
-    }
-    // ZipCode
-    if (flags.zipCode) 
-    {
-      if (MozABPCManager::gUseHomeAddress)
-        COPY_FROM_GENERIC(m_csZipCode, m_nsCard.homeZipCode)
-      else
-        COPY_FROM_GENERIC(m_csZipCode, m_nsCard.workZipCode)
-    }
-    // Country
-    if (flags.country)
-    {
-      if (MozABPCManager::gUseHomeAddress)
-        COPY_FROM_GENERIC(m_csCountry, m_nsCard.homeCountry)
-      else
-        COPY_FROM_GENERIC(m_csCountry, m_nsCard.workCountry)
-    }
-    // Title
-    if (flags.title) COPY_FROM_GENERIC(m_csTitle, m_nsCard.jobTitle)
-    // Customs
-    if (flags.custom1) COPY_FROM_GENERIC(m_csCustom1, m_nsCard.custom1)
-    if (flags.custom2) COPY_FROM_GENERIC(m_csCustom2, m_nsCard.custom2)
-    if (flags.custom3) COPY_FROM_GENERIC(m_csCustom3, m_nsCard.custom3)
-    if (flags.custom4) COPY_FROM_GENERIC(m_csCustom4, m_nsCard.custom4)
-    // Note
-    if (flags.note) COPY_FROM_GENERIC(m_csNote, m_nsCard.notes)
-
-    return retval;
-}
-
-// this method assigns the phone #s to the Moz card data from Palm Record Phone buffer
-void CMozABConduitRecord::AssignPhoneToMozData(DWORD labelID, LPTSTR buf)
-{
-    switch(labelID) {
-    case PHONE_LABEL_WORK:
-        m_nsCard.workPhone = buf;
-        break;
-    case PHONE_LABEL_HOME:
-        m_nsCard.homePhone = buf;
-        break;
-    case PHONE_LABEL_FAX:
-        m_nsCard.faxNumber = buf;
-        break;
-    case PHONE_LABEL_OTHER:
-        break;
-    case PHONE_LABEL_EMAIL:
-        m_nsCard.primaryEmail = buf;
-        break;
-    case PHONE_LABEL_MAIN:
-        break;
-    case PHONE_LABEL_PAGER:
-        m_nsCard.pagerNumber = buf;
-        break;
-    case PHONE_LABEL_MOBILE:
-        m_nsCard.cellularNumber = buf;
-        break;
-    }
-}
-
-
-#define COPY_TO_GENERIC(m, f)      iLen = m.length();           \
-                                   if (iLen != 0)               \
-                                   {                            \
-                                        f = 1;                  \
-                                        destLen = StripCRs(pBuff, m.c_str(), iLen);  \
-                                        pBuff += destLen;       \
-                                        dwRecSize += destLen;   \
-                                    }                           \
-
-
-// This method converts records from the Moz type to the CPalmRecord record type.
-long CMozABConduitRecord::ConvertToGeneric(CPalmRecord &rec)
-{
-    long                retval = 0;
-    char                *pBuff, *pFlags, *pCompany, *pFirst;
-    AddrDBRecordFlags   flags;
-    AddrOptionsType     options;
-    int                 destLen;
-    BYTE                szRawData[MAX_RECORD_SIZE];
-    DWORD               dwRecSize = 0;
-    int                 iLen=0;
-
-
-    rec.SetID(m_dwRecordID);
-
-    rec.SetCategory(m_dwCategoryID);
-
-    rec.SetPrivate(m_dwPrivate);
-
-  	rec.SetAttribs(m_dwStatus);
-
-    pBuff = (char*)szRawData;
-
-    // AddrOptionsType
-    *(DWORD *)&options = 0;
-    options.displayPhone = m_dwDisplayPhone - 1;
-    options.phone1 = LOWORD(m_dwPhone1LabelID);
-    options.phone2 = LOWORD(m_dwPhone2LabelID);
-    options.phone3 = LOWORD(m_dwPhone3LabelID);
-    options.phone4 = LOWORD(m_dwPhone4LabelID);
-    options.phone5 = LOWORD(m_dwPhone5LabelID);
-    *((DWORD *)pBuff) = CPalmRecord::SwapDWordToMotor(*(DWORD *)&options);
-
-    pBuff += sizeof(DWORD);
-    dwRecSize += sizeof(DWORD);
-
-    // The flag bits are used to indicate which fields exist
-    pFlags = pBuff;
-    *(DWORD *)&flags = 0;
-    pBuff += sizeof(DWORD);
-    dwRecSize += sizeof(DWORD);
-    
-    // Company Field Offset - Initialize to zero
-    pCompany = pBuff;
-    *((unsigned char *)pCompany) = 0;
-    pBuff += sizeof(unsigned char);
-    dwRecSize += sizeof(unsigned char);
-    
-    // First Field
-    pFirst = pBuff;
-
-    // Name
-    COPY_TO_GENERIC(m_csName, flags.name)
-    // FirstName
-    COPY_TO_GENERIC(m_csFirst, flags.firstName)
-    // Company
-    COPY_TO_GENERIC(m_csCompany, flags.company)
-    // Phone1
-    COPY_TO_GENERIC(m_csPhone1, flags.phone1)
-    // Phone2
-    COPY_TO_GENERIC(m_csPhone2, flags.phone2)
-    // Phone3
-    COPY_TO_GENERIC(m_csPhone3, flags.phone3)
-    // Phone4
-    COPY_TO_GENERIC(m_csPhone4, flags.phone4)
-    // Phone5
-    COPY_TO_GENERIC(m_csPhone5, flags.phone5)
-    // Address
-    COPY_TO_GENERIC(m_csAddress, flags.address)
-    // City
-    COPY_TO_GENERIC(m_csCity, flags.city)
-    // State
-    COPY_TO_GENERIC(m_csState, flags.state)
-    // ZipCode
-    COPY_TO_GENERIC(m_csZipCode, flags.zipCode)
-    // Country
-    COPY_TO_GENERIC(m_csCountry, flags.country)
-    // Title
-    COPY_TO_GENERIC(m_csTitle, flags.title)
-    // Custom1
-    COPY_TO_GENERIC(m_csCustom1, flags.custom1)
-    // Custom2
-    COPY_TO_GENERIC(m_csCustom2, flags.custom2)
-    // Custom3
-    COPY_TO_GENERIC(m_csCustom3, flags.custom3)
-    // Custom4
-    COPY_TO_GENERIC(m_csCustom4, flags.custom4)
-    // Note
-    COPY_TO_GENERIC(m_csNote, flags.note)
-
-    // Store the AddrDBRecordFlags
-    *((DWORD *)pFlags) = CPalmRecord::SwapDWordToMotor(*(DWORD *)&flags);
-
-    
-    if (dwRecSize == (sizeof(DWORD) + sizeof(DWORD) + sizeof(unsigned char))){
-        // then this is a deleted record because it has no data
-        rec.SetDeleted();
-    }
-
-    retval = rec.SetRawData(dwRecSize, szRawData);
-
-    return(retval);
-}
-
-// this function copies data from the handheld into the passed destination,
-// and optionally adds carriage returns to handheld data
-long CMozABConduitRecord::CopyFromHHBuffer(TCHAR* pSrc, TCHAR* pDest, int len)
-{
-    long retval = GEN_ERR_INVALID_POINTER;
-    int off=0;
-
-    TCHAR* pCurr;
-
-    if (pDest) {
-
-        // Only add Cr's if newlines are present..
-        pCurr = (TCHAR*) _tcspbrk(pSrc, STR_NEWLINE);
-        if(pCurr) 
-        {
-            while (off < len && *pSrc)
-            {
-                if (*pSrc == CH_NEWLINE)
-                {
-                    *pDest = CH_CRETURN;
-                    pDest++;
-                }
-                *pDest = *pSrc;
-
-                pDest++ ; pSrc++;
-                off++;
-            }
-            *pDest = 0;
-        }
-        else 
-        {
-            strncpy(pDest, pSrc, len);
-            pDest[len] = 0;
-        }
-        retval = 0;
-    }
-    return(retval);
-}
-
-// this function strips extra carraige returns from PC data
-int CMozABConduitRecord::StripCRs(TCHAR* pDest, const TCHAR* pSrc, int len)
-{
-    int  retval = 0;
-    int  off    = 0;
-    TCHAR* pCurr; 
-    TCHAR* pStart = pDest;
-
-    // See if any cr's are present in the first place.
-    pCurr = (TCHAR*) _tcspbrk(pSrc, STR_CRETURN);
-    if (pCurr)
-    {
-        while (off < len && *pSrc)
-        {
-            if (*pSrc == CH_CRETURN)
-                pSrc++;
-
-            *pDest = *pSrc;
-
-            off++;
-            pDest++ ; pSrc++;
-        }
-        *pDest = 0;
-
-        retval = strlen(pStart) + 1;
-    }
-    else
-    {
-        strncpy(pDest, pSrc, len);
-        *(pDest + len) = '\0';
-        retval = len + 1;
-    }    
-
-    return(retval);
-}
-
-void CMozABConduitRecord::CleanUpABCOMCardStruct(nsABCOMCardStruct * card)
-{
-    if(!card)
-        return;
-
-    CoTaskMemFree(card->firstName);
-    CoTaskMemFree(card->lastName);
-    CoTaskMemFree(card->displayName);
-    CoTaskMemFree(card->nickName);
-    CoTaskMemFree(card->primaryEmail);
-    CoTaskMemFree(card->secondEmail);
-    CoTaskMemFree(card->workPhone);
-    CoTaskMemFree(card->homePhone);
-    CoTaskMemFree(card->faxNumber);
-    CoTaskMemFree(card->pagerNumber);
-    CoTaskMemFree(card->cellularNumber);
-    CoTaskMemFree(card->homeAddress);
-    CoTaskMemFree(card->homeAddress2);
-    CoTaskMemFree(card->homeCity);
-    CoTaskMemFree(card->homeState);
-    CoTaskMemFree(card->homeZipCode);
-    CoTaskMemFree(card->homeCountry);
-    CoTaskMemFree(card->workAddress);
-    CoTaskMemFree(card->workAddress2);
-    CoTaskMemFree(card->workCity);
-    CoTaskMemFree(card->workState);
-    CoTaskMemFree(card->workZipCode);
-    CoTaskMemFree(card->workCountry);
-    CoTaskMemFree(card->jobTitle);
-    CoTaskMemFree(card->department);
-    CoTaskMemFree(card->company);
-    CoTaskMemFree(card->webPage1);
-    CoTaskMemFree(card->webPage2);
-    CoTaskMemFree(card->birthYear);
-    CoTaskMemFree(card->birthMonth);
-    CoTaskMemFree(card->birthDay);
-    CoTaskMemFree(card->custom1);
-    CoTaskMemFree(card->custom2);
-    CoTaskMemFree(card->custom3);
-    CoTaskMemFree(card->custom4);
-    CoTaskMemFree(card->notes);
-    CoTaskMemFree(card->mailListURI);
-}
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/MozABConduitRecord.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef __MOZABCONDUIT_RECORD_H_
-#define __MOZABCONDUIT_RECORD_H_
-
-#include <syncmgr.h>
-#include "CPString.h"
-#include "CPalmRec.h"
-#include <PGenErr.h>
-#include <tables.h>
-
-#include "IPalmSync.h"
-
-// these identify the types of phone numbers in Palm record
-#define PHONE_LABEL_WORK        0
-#define PHONE_LABEL_HOME        1
-#define PHONE_LABEL_FAX         2
-#define PHONE_LABEL_OTHER       3
-#define PHONE_LABEL_EMAIL       4
-#define PHONE_LABEL_MAIN        5
-#define PHONE_LABEL_PAGER       6
-#define PHONE_LABEL_MOBILE      7
-
-// these are flags which says if a field in Palm record exist or not
-struct AddrDBRecordFlags {
-    unsigned name               :1;
-    unsigned firstName          :1;
-    unsigned company            :1;
-    unsigned phone1             :1;
-    unsigned phone2             :1;
-    unsigned phone3             :1;
-    unsigned phone4             :1;
-    unsigned phone5             :1;
-    unsigned address            :1;
-    unsigned city               :1;
-    unsigned state              :1;
-    unsigned zipCode            :1;
-    unsigned country            :1;
-    unsigned title              :1;
-    unsigned custom1            :1;
-    unsigned custom2            :1;
-    unsigned custom3            :1;
-    unsigned custom4            :1;
-    unsigned note               :1;
-    unsigned reserved           :13;
-};
-
-// these are the flag that identify the type of phone #s in Palm record
-struct AddrOptionsType {
-    unsigned phone1             :4;
-    unsigned phone2             :4;
-    unsigned phone3             :4;
-    unsigned phone4             :4;
-    unsigned phone5             :4;
-    unsigned displayPhone       :4;
-    unsigned reserved           :8;
-};
-
-// class implementation that represents the Mozilla AB Record type 
-// used along with Palm record type
-class CMozABConduitRecord {
-    
-public:
-    CMozABConduitRecord(void);
-    CMozABConduitRecord(CPalmRecord &rec);
-    CMozABConduitRecord(nsABCOMCardStruct &rec);
-    virtual ~CMozABConduitRecord();
-
-public:
-    // Mozilla AB card data structure member
-    nsABCOMCardStruct m_nsCard;
-
-    // the following data members are for Palm Record
-    DWORD m_dwRecordID;
-    DWORD m_dwStatus;
-    DWORD m_dwPosition;
-    CPString m_csName;
-    CPString m_csFirst;
-    CPString m_csDisplayName;
-    CPString m_csTitle;
-    CPString m_csCompany;
-    DWORD m_dwPhone1LabelID;
-    CPString m_csPhone1;
-    DWORD m_dwPhone2LabelID;
-    CPString m_csPhone2;
-    DWORD m_dwPhone3LabelID;
-    CPString m_csPhone3;
-    DWORD m_dwPhone4LabelID;
-    CPString m_csPhone4;
-    DWORD m_dwPhone5LabelID;
-    CPString m_csPhone5;
-    CPString m_csAddress;
-    CPString m_csCity;
-    CPString m_csState;
-    CPString m_csZipCode;
-    CPString m_csCountry;
-    CPString m_csNote;
-    DWORD m_dwPrivate;
-    DWORD m_dwCategoryID;
-    CPString m_csCustom1;
-    CPString m_csCustom2;
-    CPString m_csCustom3;
-    CPString m_csCustom4;
-    DWORD m_dwDisplayPhone; 
-
-protected:
-
-    // internal utility functions
-    long CopyFromHHBuffer(TCHAR* pSrc, TCHAR* pDest, int len, int iBufSize);
-    long CopyFromHHBuffer(TCHAR* pSrc, TCHAR* pDest, int len);
-    int  StripCRs(TCHAR* pDest, const TCHAR* pSrc, int len);
-
-    void AssignPhoneToMozData(DWORD labelID, LPTSTR buf);
-
-public:
-    // rests the data in this record object   
-    void Reset(void);
-    // compares with another record object
-    eRecCompare Compare(const CMozABConduitRecord &rec);
-
-    // converts from Palm record type to self(Mozilla AB) type
-    long ConvertFromGeneric(CPalmRecord &rec);
-    // converts from self(Mozilla AB) type to Palm record type
-    long ConvertToGeneric(CPalmRecord &rec);
-
-    static void CleanUpABCOMCardStruct(nsABCOMCardStruct * card);
-
-};
-
-#endif
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/MozABConduitSync.cpp
+++ /dev/null
@@ -1,1020 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include <windows.h>
-#include "syncmgr.h"
-#include <tchar.h>
-#include <time.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "CondAPI.h"
-#include "hslog.h"
-#include "MozABConduitSync.h"
-#include "MozABConduitRecord.h"
-
-
-#define MAX_PROD_ID_TEXT	255
-#define PERSONAL "Personal"
-
-// Global var
-FILE *gFD = NULL; // logging.
-
-CMozABConduitSync::CMozABConduitSync(CSyncProperties& rProps)
-{
-    m_dbHH = NULL;
-    m_dbPC = NULL;
-    m_remoteDB = NULL;
-    m_TotRemoteDBs = rProps.m_nRemoteCount; // Fixed 3/25/99 KRM
-    m_ConduitHandle =  (CONDHANDLE)0;
-    memcpy(&m_rSyncProperties, &rProps, sizeof(m_rSyncProperties));
-    memset(&m_SystemInfo, 0, sizeof(m_SystemInfo));
-
-    // See if logging is turned on (ie, check env variable "MOZ_CONDUIT_LOG"
-    // for a logfile like "c:\\temp\\conduitlog.txt").
-    char *envVar = getenv(ENV_VAR_CONDUTI_LOG);
-    if(envVar != NULL )
-      gFD = fopen(envVar, "a+");
-}
-
-CMozABConduitSync::~CMozABConduitSync()
-{
-    long retval;
-
-    if (m_SystemInfo.m_ProductIdText) {
-        delete m_SystemInfo.m_ProductIdText;
-	    m_SystemInfo.m_ProductIdText = NULL;
-	    m_SystemInfo.m_AllocedLen = 0; 
-    }
-    if ((!m_rSyncProperties.m_RemoteDbList) && (m_remoteDB)) {
-        delete m_remoteDB;
-        m_remoteDB = NULL;
-    }
-    if (m_ConduitHandle) {
-        retval = SyncUnRegisterConduit(m_ConduitHandle);
-        m_ConduitHandle = 0;
-    }
-
-    if (gFD)
-      fclose(gFD);
-}
-
-long CMozABConduitSync::Perform(void)
-{
-    long retval = 0;
-
-    // Log the start time.
-    time_t ltime;
-    time( &ltime );
-    CONDUIT_LOG1(gFD, "\n------------ START OF PALM SYNC ------------ at %s", ctime(&ltime));
-
-    if (m_rSyncProperties.m_SyncType > eProfileInstall)
-        return GEN_ERR_BAD_SYNC_TYPE;
-
-    if (m_rSyncProperties.m_SyncType == eDoNothing) {
-        return 0;
-    }
-
-    // Obtain System Information
-    m_SystemInfo.m_ProductIdText = (BYTE*) new char [MAX_PROD_ID_TEXT]; //deleted in d'ctor
-    if (!m_SystemInfo.m_ProductIdText)
-        return GEN_ERR_LOW_MEMORY;
-
-    m_SystemInfo.m_AllocedLen = (BYTE) MAX_PROD_ID_TEXT; 
-    retval = SyncReadSystemInfo(m_SystemInfo);
-    if (retval)
-        return retval;
-
-    // Register this conduit with SyncMgr.DLL for communication to HH
-    retval = SyncRegisterConduit(m_ConduitHandle);
-    if (retval) {
-        CONDUIT_LOG0(gFD, "Failed SyncRegisterConduit.\n");
-        return retval;
-    }
-
-    for (int iCount=0; iCount < m_TotRemoteDBs && !retval; iCount++) {
-        retval = GetRemoteDBInfo(iCount);
-        if (retval) {
-            retval = 0;
-            break;
-        }
-
-        m_dbHH = new MozABHHManager(GENERIC_FLAG_APPINFO_SUPPORTED | GENERIC_FLAG_CATEGORY_SUPPORTED,
-                    m_remoteDB->m_Name,
-                    m_remoteDB->m_Creator,
-                    m_remoteDB->m_DbType,
-                    m_remoteDB->m_DbFlags,
-                    0,
-					          m_remoteDB->m_CardNum,
-                    m_rSyncProperties.m_SyncType);
-        if(!m_dbHH) {
-            CONDUIT_LOG0(gFD, "Failed dbHH.\n");
-            return GEN_ERR_LOW_MEMORY;
-        }
-
-        m_dbPC = new MozABPCManager();
-        if(!m_dbPC) {
-            if (m_dbHH)
-                delete m_dbHH;
-            m_dbHH = NULL;
-            CONDUIT_LOG0(gFD, "Failed dbPC.\n");
-            return GEN_ERR_LOW_MEMORY;
-        }
-
-        char conduitName[32];
-        GetConduitName(conduitName, 32);
-        LogAddFormattedEntry(slSyncStarted, FALSE, "SYNC %s", conduitName);
-        CONDUIT_LOG1(gFD, "slSyncStarted. SyncType=%d\n", m_rSyncProperties.m_SyncType);
-
-        switch (m_rSyncProperties.m_SyncType) {
-            case eFast:
-                retval = PerformFastSync();
-                if ((retval) && (retval == GEN_ERR_CHANGE_SYNC_MODE)){
-                    if (m_rSyncProperties.m_SyncType == eHHtoPC)
-                        retval = CopyHHtoPC();
-                    else if (m_rSyncProperties.m_SyncType == ePCtoHH)
-                        retval = CopyPCtoHH();
-                }
-                break;
-            case eSlow:
-                retval = PerformSlowSync();  
-                if ((retval) && (retval == GEN_ERR_CHANGE_SYNC_MODE)){
-                    if (m_rSyncProperties.m_SyncType == eHHtoPC)
-                        retval = CopyHHtoPC();
-                    else if (m_rSyncProperties.m_SyncType == ePCtoHH)
-                        retval = CopyPCtoHH();
-                }
-                break;
-            case eHHtoPC:
-            case eBackup: 
-                retval = CopyHHtoPC();
-                break;
-            case eInstall:
-            case ePCtoHH:
-            case eProfileInstall:
-                retval = CopyPCtoHH();
-                break;
-            case eDoNothing:
-                break;
-            default:
-                retval = GEN_ERR_SYNC_TYPE_NOT_SUPPORTED;
-                break;
-        }
-
-        if (retval) {
-            LogAddFormattedEntry(slSyncAborted, FALSE, "retval=%d %s\n", retval, conduitName);
-            CONDUIT_LOG1(gFD, "Sync finished with errors retval=%d\n", retval);
-        }
-        else {
-            LogAddFormattedEntry(slSyncFinished, FALSE, "%s", conduitName);
-            CONDUIT_LOG0(gFD, "Sync Finished retval=0\n");
-        }
-
-        // remove the handheld and PC manager
-        if (m_dbHH)
-            delete m_dbHH;
-        m_dbHH = NULL;
-        if (m_dbPC)
-            delete m_dbPC;
-        m_dbPC = NULL;
-    }
-
-    // Log the end time.
-    time( &ltime );
-    CONDUIT_LOG1(gFD, "------------ END OF PALM SYNC -------------- at %s\n", ctime(&ltime));
-
-    // Unregister the conduit
-    long retval2 = 0;
-    if (m_ConduitHandle) {
-        retval2 = SyncUnRegisterConduit(m_ConduitHandle);
-        m_ConduitHandle = 0;
-    }
-
-    if (!retval)
-        return retval2;
-
-    return retval;
-}
-
-long CMozABConduitSync::GetRemoteDBInfo(int iIndex)
-{
-    long retval = 0;
-    if (m_rSyncProperties.m_RemoteDbList) {
-        m_remoteDB = m_rSyncProperties.m_RemoteDbList[iIndex];
-    } else {
-        if (m_remoteDB)
-            delete m_remoteDB;
-
-        m_remoteDB = new CDbList; // deleted in d'ctor
-        if (m_remoteDB) {
-            m_remoteDB->m_Creator  = m_rSyncProperties.m_Creator; 
-            m_remoteDB->m_DbFlags  = eRecord; // todo
-            m_remoteDB->m_DbType   = m_rSyncProperties.m_DbType; 
-            strncpy(m_remoteDB->m_Name, m_rSyncProperties.m_RemoteName[iIndex], sizeof(m_remoteDB->m_Name)-1);
-            m_remoteDB->m_Name[sizeof(m_remoteDB->m_Name)-1] = '\0';
-            m_remoteDB->m_Version   = 0;
-            m_remoteDB->m_CardNum   = 0;
-            m_remoteDB->m_ModNumber = 0;
-            m_remoteDB->m_CreateDate= 0;
-            m_remoteDB->m_ModDate   = 0;
-            m_remoteDB->m_BackupDate= 0;
-        } else {
-            retval = GEN_ERR_LOW_MEMORY;
-        }
-    }
-    return retval;
-}
-
-BOOL CMozABConduitSync::CategoryNameMatches(CPString &catName, CPString &cutOffMozABName, BOOL isPAB)
-{
-  if (!catName.CompareNoCase(cutOffMozABName.GetBuffer(0)))
-    return TRUE;
-  else 
-    return (isPAB && !catName.CompareNoCase("Personal"));
-}
-
-BOOL CMozABConduitSync::CategoryExists(CPString &mozABName, BOOL isPAB)
-{
-    CPCategory * pCategory = m_dbHH->GetFirstCategory();
-    // Palm only allows 15 chars for category names.
-    CPString cutOffName;
-    if (mozABName.Length() > 15)
-        cutOffName = mozABName.Left(15);
-    else
-        cutOffName = mozABName;
-    while (pCategory)
-    {
-        CPString catName(pCategory->GetName());
-        if (CategoryNameMatches(catName, cutOffName, isPAB))
-          return TRUE;
-        // Process next category
-        pCategory = m_dbHH->GetNextCategory();
-    }
-    return FALSE;
-}
-
-// this is done in separate thread since the main thread in this DLL
-// needs to call SyncYieldCycles(1) atleast once every 7 seconds
-DWORD WINAPI DoFastSync(LPVOID lpParameter)
-{
-    CONDUIT_LOG0(gFD, "-- SYNC DoFastSync --\n");
-
-    CMozABConduitSync * sync = (CMozABConduitSync * ) lpParameter;
-    if(!sync || !sync->m_dbHH)
-        return 0;
-    
-    BOOL initialHHSync = (sync->m_rSyncProperties.m_FirstDevice == eHH);
-    if (initialHHSync) // if HH has been reset, copy everything on pc to hh.
-      return sync->CopyPCtoHH();
-
-    long retval=0;
-    BOOL success = FALSE;
-
-    DWORD mozABCount=0;
-    LONG * mozCatIndexList = NULL; // freed by MSCOM/Mozilla
-    CPString ** mozABNameList = NULL; // freed by MSCOM/Mozilla
-    CPString ** mozABUrlList = NULL; // freed by MSCOM/Mozilla
-    BOOL * mozDirFlagsList = NULL; // freed by MSCOM/Mozilla
-    BOOL neverDidPalmSyncBefore = TRUE; // 1st time palm sync?
-    DWORD mozABIndex;
-
-    retval = sync->m_dbHH->OpenDB(FALSE);
-    if (!retval)
-        retval = sync->m_dbHH->LoadCategories();
-
-    CONDUIT_LOG0(gFD, "Getting moz AB List ... ");
-    if(!retval)
-        retval = sync->m_dbPC->GetPCABList(&mozABCount, &mozCatIndexList, &mozABNameList, &mozABUrlList, &mozDirFlagsList);
-    CONDUIT_LOG1(gFD, "done getting moz AB List. retval = %d\n", retval);
-
-    if (retval)
-      return retval;
-    
-    // Create an array to help us identify addrbooks that have been deleted on Palm.
-    DWORD *mozABSeen = (DWORD *) CoTaskMemAlloc(sizeof(DWORD) * mozABCount);
-    if (!mozABSeen)
-      return GEN_ERR_LOW_MEMORY;
-    else
-      memset(mozABSeen, FALSE, sizeof(DWORD) * mozABCount);
-
-    CONDUIT_LOG1(gFD, "first device = %lx\n", sync->m_rSyncProperties.m_FirstDevice);
-
-    // See if palm sync was performed before.
-    for(mozABIndex=0; mozABIndex<mozABCount; mozABIndex++)
-      if (! (mozDirFlagsList[mozABIndex] & kFirstTimeSyncDirFlag))
-      {
-        neverDidPalmSyncBefore = FALSE;
-        break;
-      }
-    
-    // Log moz addrbooks.
-    for (mozABIndex=0; mozABIndex<mozABCount; mozABIndex++)
-    {
-      CONDUIT_LOG5(gFD, "Moz AB[%d] category index/synced=%d/%d, name= '%s', url= '%s'\n",
-                   mozABIndex, mozCatIndexList[mozABIndex], ! (mozDirFlagsList[mozABIndex] & kFirstTimeSyncDirFlag), 
-                   mozABNameList[mozABIndex]->GetBuffer(0), mozABUrlList[mozABIndex]->GetBuffer(0));
-    }
-
-    // For each category, try to find the corresponding AB in the moz AB list
-    // and see if it has been synchronized before and take action accordingly.
-    CPCategory * pCategory = sync->m_dbHH->GetFirstCategory();
-    while (pCategory)
-    {
-        CPalmRecord ** recordListHH = NULL;
-        DWORD recordCountHH=0;
-
-        DWORD catID = pCategory->GetID();
-        DWORD catIndex = pCategory->GetIndex();
-        DWORD catFlags = pCategory->GetFlags();
-        CPString catName(pCategory->GetName());
-
-        CONDUIT_LOG3(gFD, "\nProcessing Palm AB '%s' (catIndex/catId) = (%d/%d)... \n", catName.GetBuffer(0), catIndex, catID);
-        BOOL abRenamed = FALSE;
-        BOOL foundInABList=FALSE;
-        for(mozABIndex=0; mozABIndex<mozABCount; mozABIndex++)
-        {
-            // Palm only allows 15 chars for category names.
-            CPString cutOffName;
-            if (mozABNameList[mozABIndex]->Length() > 15)
-                cutOffName = mozABNameList[mozABIndex]->Left(15);
-            else
-                cutOffName = *mozABNameList[mozABIndex];
-
-            // if this category has been synchronized before
-            if(catIndex == mozCatIndexList[mozABIndex]) 
-            {
-                retval = sync->m_dbHH->LoadUpdatedRecordsInCategory(catIndex, &recordListHH, &recordCountHH);
-                CONDUIT_LOG2(gFD, "Category index = %d, name = '%s' has been synced before\n", catID, catName.GetBuffer(0));
-                foundInABList = TRUE;
-                mozABSeen[mozABIndex] = TRUE; // mark it seen
-                // See if the name has been changed on Palm side. Note that if both
-                // Palm category and the corresponding moz addrbook are renamed then 
-                // Palm category name takes precedence.
-                if (!sync->CategoryNameMatches(catName, cutOffName, mozDirFlagsList[mozABIndex] & kIsPabDirFlag))
-                {
-                  abRenamed = TRUE;
-                  CONDUIT_LOG3(gFD, "Category index = %d, name = '%s' was renamed (from '%s') on Palm so do the same on moz\n", 
-                    catID, catName.GetBuffer(0), mozABNameList[mozABIndex]->GetBuffer(0));
-                }
-                break;
-            }
-
-            // if corresponding category exists but not synchronized before
-            if(sync->CategoryNameMatches(catName, cutOffName, mozDirFlagsList[mozABIndex] & kIsPabDirFlag))
-            {
-                retval = sync->m_dbHH->LoadAllRecordsInCategory(catIndex, &recordListHH, &recordCountHH);
-                CONDUIT_LOG2(gFD, "Category index = %d, name = '%s' has not been synced before\n", catID, catName.GetBuffer(0));
-                foundInABList = TRUE;
-                mozABSeen[mozABIndex] = TRUE; // mark it seen
-                break;
-            }
-        } // end of for
-
-        if(!retval && foundInABList)
-        {
-          CPalmRecord ** recordListPC=NULL;
-          DWORD recordCountPC=0;
-          DWORD newRecAddedCount = 0;
-          DWORD * newRecIDList=NULL;
-          CONDUIT_LOG1(gFD, "  Syncing with moz AB with %d modified Palm record(s) ... ", recordCountHH);
-          retval = sync->m_dbPC->SynchronizePCAB(catIndex, catID, catName,
-                                                 recordCountHH, recordListHH,
-                                                 &recordCountPC, &recordListPC);
-          CONDUIT_LOG1(gFD, "Done syncing AB. retval=%lx.\n", retval);
-
-          // SynchronizePCAB() returns a list of modified moz records so update those on Palm.
-          if (!retval) {
-              unsigned long i;
-              newRecIDList = (DWORD *) calloc(recordCountPC, sizeof(DWORD));
-              if (recordCountPC > 0)
-                CONDUIT_LOG1(gFD, "  Updating Palm AB with %d modified moz record(s) ...\n", recordCountPC);
-              for (i=0; i < recordCountPC; i++) {
-                  if(!recordListPC[i])
-                      continue;
-                  CPalmRecord palmRec = *recordListPC[i];
-                  palmRec.SetCategory(catIndex);
-                  if(palmRec.GetAttribs() == ATTR_DELETED)
-                  {
-                    CONDUIT_LOG0(gFD, "    - deleting a record\n");
-							      retval = sync->m_dbHH->DeleteARecord(palmRec);
-                  }
-                  else if(palmRec.GetAttribs() == ATTR_MODIFIED)
-                  {
-                    CONDUIT_LOG0(gFD, "    - modifying a record\n");
-							      retval = sync->m_dbHH->UpdateARecord(palmRec);
-                  }
-                  else if(palmRec.GetAttribs() == ATTR_NEW) {
-                      CONDUIT_LOG0(gFD, "    - adding a record\n");
- 							        retval = sync->m_dbHH->AddARecord(palmRec); // should we check existing recs?
-                      if(!retval && (newRecAddedCount < recordCountPC)) {
-                          newRecIDList[newRecAddedCount] = palmRec.GetID();
-                          newRecAddedCount++;
-                      }
-                  }
-                  delete recordListPC[i]; // once done with PC record, delete
-					    }
-              if (recordCountPC > 0)
-                CONDUIT_LOG0(gFD, "  Done updating Palm AB.\n");
-          }
-          // the MozAB is now synchronized
-          if(!retval)
-              mozDirFlagsList[mozABIndex] &= ~kFirstTimeSyncDirFlag;
-          // delete the PC recordList now that palm is updated
-          if(recordListPC)
-              free(recordListPC);  
-          // notify Mozilla that sync is done so that memory can be freed 
-          success = retval ? FALSE : TRUE;
-
-          if(newRecAddedCount) {
-              if(newRecAddedCount != recordCountPC)
-                  newRecIDList = (DWORD *) realloc(newRecIDList, newRecAddedCount);
-              retval = sync->m_dbPC->NotifySyncDone(success, catIndex, newRecAddedCount, newRecIDList);
-          }
-          else 
-              retval = sync->m_dbPC->NotifySyncDone(success);
-
-          if(newRecIDList)
-              free(newRecIDList);
-
-          // See if it was renamed on palm.
-          if (abRenamed)
-          {
-            // We should not rename personal and collected address books here.
-            if (! (mozDirFlagsList[mozABIndex] & kIsPabDirFlag) &&
-              mozABUrlList[mozABIndex]->CompareNoCase(COLLECTED_ADDRBOOK_URL))
-            {
-              CONDUIT_LOG0(gFD, "  Renaming AB ... ");
-              retval = sync->m_dbPC->RenamePCAB(catIndex, catName, *mozABUrlList[mozABIndex]);
-              CONDUIT_LOG1(gFD, "Done renaming AB. retval=%d.\n", retval);
-            }
-          }
-        }
-        
-        // If this category can't be found in the moz AB list then two cases here:
-        //    1. If catFlags is not CAT_DIRTY then this category has been deleted
-        //       on moz so remove it from palm side.
-        //    2. else, if we never did palm sync on moz before then it's a new one
-        //       on palm. So create a new AB in moz with all records in this category
-        //       (even if it's an empty AB).
-        if(!retval && !foundInABList) 
-        {
-            if (catFlags != CAT_DIRTY && !neverDidPalmSyncBefore && !initialHHSync)
-            {
-              BOOL abDeleted = sync->m_dbPC->PCABDeleted(catName);
-              if (abDeleted)
-              {
-                CONDUIT_LOG2(gFD, "Category index = %d, name = '%s' is removed from moz and needs to be removed from palm\n", catID, catName.GetBuffer(0));
-                CONDUIT_LOG0(gFD, "  Deleting AB from Palm ... ");
-                retval = sync->m_dbHH->DeleteCategory(catIndex, FALSE);
-                CONDUIT_LOG1(gFD, "Done deleting AB from Palm. retval=%d.\n", retval);
-              }
-            }
-            else
-            {
-              CONDUIT_LOG2(gFD, "Category index = %d, name = '%s' is new on palm and needs to be added to moz\n", catID, catName.GetBuffer(0));
-              retval = sync->m_dbHH->LoadAllRecordsInCategory(catIndex, &recordListHH, &recordCountHH);
-              CONDUIT_LOG1(gFD, "  Creating new moz AB with %d Palm record(s) ... ", recordCountHH);
-              if(!retval)
-                retval = sync->m_dbPC->AddRecords(FALSE, catIndex, catName, recordCountHH, recordListHH);
-              CONDUIT_LOG1(gFD, "Done creating new moz AB. retval=%d.\n", retval);
-            }
-        }
-
-        // delete and free HH records and recordList once synced
-        if(recordListHH) {
-            CPalmRecord ** tempRecordListHH = recordListHH;
-            for(DWORD i=0; i < recordCountHH; i++) 
-            {
-                if(*tempRecordListHH)
-                    delete *tempRecordListHH;
-                tempRecordListHH++;
-            }
-            free(recordListHH);
-        }
-
-        // Process next category
-        pCategory = sync->m_dbHH->GetNextCategory();
-    } // end of while
-
-    // Deal with any Moz AB not existing in Palm, ones not sync'ed above,
-    // and the case where Palm ABs have been deleted.
-    for(mozABIndex=0; mozABIndex<mozABCount; mozABIndex++)
-    {
-        if((mozDirFlagsList[mozABIndex] & kFirstTimeSyncDirFlag || neverDidPalmSyncBefore || initialHHSync) && !sync->CategoryExists(*mozABNameList[mozABIndex],  mozDirFlagsList[mozABIndex] & kIsPabDirFlag))
-        {
-            CONDUIT_LOG3(gFD, "\nMoz AB[%d] category index = %d, name = '%s' doesn't exist on Palm so needs to be added to palm\n",
-                    mozABIndex, mozCatIndexList[mozABIndex], mozABNameList[mozABIndex]->GetBuffer(0));
-            CPalmRecord ** recordListPC=NULL;
-            DWORD recordCountPC=0;
-            DWORD * newRecIDList=NULL;
-            CPCategory cat;
-            retval = sync->m_dbPC->LoadAllRecords(*mozABNameList[mozABIndex],
-						                      &recordCountPC, &recordListPC);
-            if(!retval) 
-            {
-                if (! (mozDirFlagsList[mozABIndex] & kIsPabDirFlag))
-                  cat.SetName(mozABNameList[mozABIndex]->GetBuffer(0));
-                else
-                  cat.SetName("Personal");
-
-                CONDUIT_LOG1(gFD, "  Creating new Palm AB with %d record(s) ... ", recordCountPC);
-                retval = sync->m_dbHH->AddCategory(cat);
-                CONDUIT_LOG2(gFD, "Done creating new Palm AB, new category index=%d. retval=%d.\n", cat.GetIndex(), retval);
-                if(!retval) 
-                {
-                    CONDUIT_LOG1(gFD, "  Adding %d record(s) to new Palm AB ... ", recordCountPC);
-                    newRecIDList = (DWORD *) calloc(recordCountPC, sizeof(DWORD));
-                    for (unsigned long i=0; i < recordCountPC; i++) 
-                    {
-                        if(!recordListPC[i])
-                            continue;
-                        CPalmRecord palmRec = *recordListPC[i];
-                        palmRec.SetCategory(cat.GetIndex());
-                        retval = sync->m_dbHH->AddARecord(palmRec); // should we check existing recs?
-                        newRecIDList[i] = palmRec.GetID();
-                        delete recordListPC[i]; // delete the record now that it is used
-                    }
-                    CONDUIT_LOG0(gFD, "Done adding new records to new Palm AB.\n");
-                }
-                else
-                  CONDUIT_LOG1(gFD, "Creating new Palm AB failed. retval=%d.\n", retval);
-            }
-            else
-              CONDUIT_LOG1(gFD, "  Loading moz AB records failed so can't create new Palm AB. retval=%d.\n", retval);
-
-
-            // the MozAB is now synchronized
-            if(!retval)
-              mozDirFlagsList[mozABIndex] &= ~kFirstTimeSyncDirFlag;
-            // delete the recordList now that palm is updated
-            if(recordListPC)
-                free(recordListPC);  
-            // notify Mozilla that sync is done so that memory can be freed 
-            if(!retval)
-                success = TRUE;
-            else
-            {
-                success = FALSE;
-                recordCountPC=0;
-            }
-            retval = sync->m_dbPC->NotifySyncDone(success, cat.GetIndex(), recordCountPC, newRecIDList);
-            if(newRecIDList)
-                free(newRecIDList);
-
-            // Lastly, update the AB with new category index and mod time.
-            retval = sync->m_dbPC->UpdatePCABSyncInfo(success ? cat.GetIndex() : -1, *mozABNameList[mozABIndex]);
-        }
-        else if (!mozABSeen[mozABIndex] && !neverDidPalmSyncBefore && !initialHHSync)
-        {
-          // We should not delete personal and collected address books here. Rather,
-          // reset the mod time so next time we can sync them back to Palm again.
-          // Note: make sure the moz addrbook has been synced before to avoid the case
-          // where early sync failed and we delete this un-synced addrbook by mistake.
-          if (mozCatIndexList[mozABIndex] > -1 &&
-              ! (mozDirFlagsList[mozABIndex] & kIsPabDirFlag) &&
-              mozABUrlList[mozABIndex]->CompareNoCase(COLLECTED_ADDRBOOK_URL))
-          {
-            CONDUIT_LOG3(gFD, "\nMoz AB[%d] category index = %d, name = '%s' is removed on Palm and needs to be removed from moz\n", 
-                    mozABIndex, mozCatIndexList[mozABIndex], mozABNameList[mozABIndex]->GetBuffer(0));
-            CONDUIT_LOG0(gFD, "  Deleting AB from moz ... ");
-            retval = sync->m_dbPC->DeletePCAB(mozCatIndexList[mozABIndex], *mozABNameList[mozABIndex], *mozABUrlList[mozABIndex]);
-            CONDUIT_LOG1(gFD, "Done deleting AB from moz. retval=%d.\n", retval);
-          }
-          else
-          {
-            CONDUIT_LOG3(gFD, "\nMoz AB[%d] category index = %d, name = '%s', is removed on Palm but only need to reset sync info on moz\n", 
-                    mozABIndex, mozCatIndexList[mozABIndex], mozABNameList[mozABIndex]->GetBuffer(0));
-            // Reset category index and mod time.
-            CONDUIT_LOG0(gFD, "  Resetting AB info on moz ... ");
-            retval = sync->m_dbPC->UpdatePCABSyncInfo(-1, *mozABNameList[mozABIndex]);
-            CONDUIT_LOG1(gFD, "  Done resetting AB info on moz. retval=%d.\n", retval);
-          }
-        }
-    } // end of mozAB not existing in Palm for loop
-
-    // Purge deleted Palm record permanently (in case they were logically deleted).
-    sync->m_dbHH->PurgeDeletedRecs();
-
-    // Free stuff we allocated.
-    CoTaskMemFree(mozABSeen);
-    
-    // update category info in HH
-    sync->m_dbHH->CompactCategoriesToHH();
-
-    // close the HH DB once synced
-    retval = sync->m_dbHH->CloseDB(FALSE);
-
-    return retval;
-}
-
-long CMozABConduitSync::PerformFastSync()
-{
-    CONDUIT_LOG0(gFD, "-- SYNC Palm -> PerformFastSync --\n");
-
-    DWORD ThreadId;
-    DWORD threadExitCode;
-    HANDLE hThread = CreateThread(NULL, 0, DoFastSync, this, 0, &ThreadId);
-    while (WaitForSingleObject(hThread, 1000) == WAIT_TIMEOUT) {
-        SyncYieldCycles(1); // every sec call this for feedback & keep Palm connection alive 
-        continue;
-    }
-    
-    // get and return thread's return code if available
-    BOOL ret = GetExitCodeThread(hThread, &threadExitCode);
-    if (!ret)
-        return GetLastError();
-    // thread failed
-    CONDUIT_LOG1(gFD, "GetExitCodeThread failed return code = %d\n", threadExitCode);
-    return threadExitCode;
-}
-
-
-long CMozABConduitSync::PerformSlowSync()
-{
-    // we take care of first time sync in fast sync in an optimized way
-    return PerformFastSync();
-}
-
-long CMozABConduitSync::CopyHHtoPC()
-{
-    long retval=0;
-    BOOL success = FALSE;
-    CONDUIT_LOG0(gFD, "-- SYNC Palm -> Destkop --\n");
-
-    if(!m_dbHH)
-        return retval;
-    
-    DWORD mozABCount=0;
-    LONG * mozCatIndexList = NULL; // freed by MSCOM/Mozilla
-    CPString ** mozABNameList = NULL; // freed by MSCOM/Mozilla
-    CPString ** mozABUrlList = NULL; // freed by MSCOM/Mozilla
-    BOOL * mozDirFlagsList = NULL; // freed by MSCOM/Mozilla
-    BOOL neverDidPalmSyncBefore = TRUE; // 1st time palm sync?
-    DWORD mozABIndex;
-
-    retval = m_dbHH->OpenDB(FALSE);
-    if (!retval)
-        retval = m_dbHH->LoadCategories();
-
-    CONDUIT_LOG0(gFD, "Getting moz AB List ... ");
-    if(!retval)
-        retval = m_dbPC->GetPCABList(&mozABCount, &mozCatIndexList, &mozABNameList, &mozABUrlList, &mozDirFlagsList);
-
-    CONDUIT_LOG1(gFD, "Done getting moz AB List. retval = %d\n", retval);
-    if (retval)
-      return retval;
-    
-    // Create an array to help us identify addrbooks that have been deleted on Palm.
-    DWORD *mozABSeen = (DWORD *) CoTaskMemAlloc(sizeof(DWORD) * mozABCount);
-    if (!mozABSeen)
-      return GEN_ERR_LOW_MEMORY;
-    else
-      memset(mozABSeen, FALSE, sizeof(DWORD) * mozABCount);
-
-    // See if palm sync was performed before.
-    for(mozABIndex=0; mozABIndex<mozABCount; mozABIndex++)
-      if (! (mozDirFlagsList[mozABIndex] & kFirstTimeSyncDirFlag))
-      {
-        neverDidPalmSyncBefore = FALSE;
-        break;
-      }
-    
-    // Log moz addrbooks.
-    for (mozABIndex=0; mozABIndex<mozABCount; mozABIndex++)
-    {
-      CONDUIT_LOG5(gFD, "Moz AB[%d] category index/synced=%d/%d, name= '%s', url= '%s'\n",
-                   mozABIndex, mozCatIndexList[mozABIndex], !(mozDirFlagsList[mozABIndex] & kFirstTimeSyncDirFlag), 
-                   mozABNameList[mozABIndex]->GetBuffer(0), mozABUrlList[mozABIndex]->GetBuffer(0));
-    }
-
-    // For each category, try to find the corresponding AB in the moz AB list
-    // and overwrite it with the HH category.
-    CPCategory * pCategory = m_dbHH->GetFirstCategory();
-    while (pCategory)
-    {
-        CPalmRecord ** recordListHH = NULL;
-        DWORD recordCountHH=0;
-
-        DWORD catID = pCategory->GetID();
-        DWORD catIndex = pCategory->GetIndex();
-        DWORD catFlags = pCategory->GetFlags();
-        CPString catName(pCategory->GetName());
-
-        CONDUIT_LOG3(gFD, "\nProcessing Palm AB '%s' (catIndex/catId) = (%d/%d)... \n", catName.GetBuffer(0), catIndex, catID);
-        BOOL abRenamed = FALSE;
-        BOOL foundInABList=FALSE;
-        for(mozABIndex = 0; mozABIndex < mozABCount; mozABIndex++)
-        {
-            // Palm only allows 15 chars for category names.
-            CPString cutOffName;
-            if (mozABNameList[mozABIndex]->Length() > 15)
-                cutOffName = mozABNameList[mozABIndex]->Left(15);
-            else
-                cutOffName = *mozABNameList[mozABIndex];
-
-            // if this category has been synchronized before, check if it has been renamed
-            if(catIndex == mozCatIndexList[mozABIndex]) 
-            {
-                  CONDUIT_LOG4(gFD, "Category index = %d, name = '%s' moz ab name = %s has been synced before uri = %s\n", 
-                    catID, catName.GetBuffer(0), mozABNameList[mozABIndex]->GetBuffer(0), mozABUrlList[mozABIndex]->GetBuffer(0));
-                foundInABList = TRUE;
-                mozABSeen[mozABIndex] = TRUE; // mark it seen
-                // See if the name has been changed on Palm side. Note that if both
-                // Palm category and the corresponding moz addrbook are renamed then 
-                // Palm category name takes precedence.
-                if (!CategoryNameMatches(catName, cutOffName, mozDirFlagsList[mozABIndex] & kIsPabDirFlag))
-                {
-                  abRenamed = TRUE;
-                  CONDUIT_LOG3(gFD, "Category index = %d, name = '%s' was renamed (from '%s') on Palm so do the same on moz\n", 
-                    catID, catName.GetBuffer(0), mozABNameList[mozABIndex]->GetBuffer(0));
-                }
-                break;
-            }
-            // if corresponding category exists 
-            if (CategoryNameMatches(catName, cutOffName, mozDirFlagsList[mozABIndex] & kIsPabDirFlag))
-            {
-                retval = m_dbHH->LoadAllRecordsInCategory(catIndex, &recordListHH, &recordCountHH);
-                CONDUIT_LOG3(gFD, "Category index = %d, name = '%s' matches moz ab %s\n", catID, catName.GetBuffer(0), mozABUrlList[mozABIndex]->GetBuffer(0));
-                foundInABList = TRUE;
-                mozABSeen[mozABIndex] = TRUE; // mark it seen
-                break;
-            }
-            else
-                CONDUIT_LOG3(gFD, "Category index = %d, name = '%s' doesn't match moz ab %s\n", catID, catName.GetBuffer(0), mozABUrlList[mozABIndex]->GetBuffer(0));
-
-        } // end of for
-
-        // we've got a matching moz AB. So, just delete all the cards in the Moz AB and copy over all the cards
-        // in the HH category.
-        if(!retval && foundInABList)
-        {
-          CPalmRecord ** recordListPC=NULL;
-          DWORD * newRecIDList=NULL;
-//          retval = m_dbPC->DeletePCAB(mozCatIndexList[mozABIndex], *mozABNameList[mozABIndex], *mozABUrlList[mozABIndex]);
-          retval = m_dbHH->LoadAllRecordsInCategory(catIndex, &recordListHH, &recordCountHH);
-          CONDUIT_LOG2(gFD, "  Creating new moz AB %s with %d Palm record(s) ... ", mozABNameList[mozABIndex]->GetBuffer(0), recordCountHH);
-          if(!retval)
-            retval = m_dbPC->AddRecords(TRUE, catIndex, *mozABNameList[mozABIndex], recordCountHH, recordListHH);
-
-          CONDUIT_LOG1(gFD, "Done creating new moz AB. retval=%d.\n", retval);
-          // the MozAB is now synchronized
-          if(!retval)
-              mozDirFlagsList[mozABIndex] &= ~kFirstTimeSyncDirFlag;
-          // delete the PC recordList now that palm is updated
-          if(recordListPC)
-              free(recordListPC);  
-          // notify Mozilla that sync is done so that memory can be freed 
-          success = retval ? FALSE : TRUE;
-
-          retval = m_dbPC->NotifySyncDone(success);
-
-          if(newRecIDList)
-              free(newRecIDList);
-
-          // See if it was renamed on palm.
-          if (abRenamed)
-          {
-            // We should not rename personal and collected address books here.
-            if (! (mozDirFlagsList[mozABIndex] & kIsPabDirFlag) &&
-              mozABUrlList[mozABIndex]->CompareNoCase(COLLECTED_ADDRBOOK_URL))
-            {
-              CONDUIT_LOG0(gFD, "  Renaming AB ... ");
-              retval = m_dbPC->RenamePCAB(catIndex, catName, *mozABUrlList[mozABIndex]);
-              CONDUIT_LOG1(gFD, "Done renaming AB. retval=%d.\n", retval);
-            }
-          }
-        }
-        
-        // If this category can't be found in the moz AB list, then
-        // create a new AB in moz with all records in this category
-        //  (even if it's an empty AB).
-        if(!retval && !foundInABList) 
-        {
-            CONDUIT_LOG2(gFD, "Category index = %d, name = '%s' is new on palm and needs to be added to moz\n", catID, catName.GetBuffer(0));
-            retval = m_dbHH->LoadAllRecordsInCategory(catIndex, &recordListHH, &recordCountHH);
-            CONDUIT_LOG2(gFD, "  Creating new moz AB %s with %d Palm record(s) ... ", catName.GetBuffer(0), recordCountHH);
-            if(!retval)
-            {
-              CPString mozABName;
-
-              retval = m_dbPC->AddRecords(FALSE, catIndex, catName, recordCountHH, recordListHH);
-            }
-            CONDUIT_LOG2(gFD, "Done creating new moz AB %s - retval=%d.\n", catName.GetBuffer(0), retval);
-        }
-
-        // delete and free HH records and recordList once synced
-        if(recordListHH) 
-        {
-            CPalmRecord ** tempRecordListHH = recordListHH;
-            for(DWORD i=0; i < recordCountHH; i++) 
-            {
-                delete *tempRecordListHH;
-                tempRecordListHH++;
-            }
-            free(recordListHH);
-        }
-
-        // Process next category
-        pCategory = m_dbHH->GetNextCategory();
-    } // end of while
-
-    // Free stuff we allocated.
-    CoTaskMemFree(mozABSeen);
-    
-    // update category info in HH
-    m_dbHH->CompactCategoriesToHH();
-
-    // close the HH DB once synced
-    retval = m_dbHH->CloseDB(FALSE);
-
-    return retval;
-}
-
-long CMozABConduitSync::CopyPCtoHH()
-{
-    long retval=0;
-    BOOL success = FALSE;
-
-    CONDUIT_LOG0(gFD, "-- SYNC Destkop-> Palm --\n");
-
-    if(!m_dbHH)
-        return retval;
-    
-    DWORD mozABCount=0;
-    LONG * mozCatIndexList = NULL; // freed by MSCOM/Mozilla
-    CPString ** mozABNameList = NULL; // freed by MSCOM/Mozilla
-    CPString ** mozABUrlList = NULL; // freed by MSCOM/Mozilla
-    BOOL * mozDirFlagsList = NULL; // freed by MSCOM/Mozilla
-    BOOL neverDidPalmSyncBefore = TRUE; // 1st time palm sync?
-    DWORD mozABIndex;
-
-    retval = m_dbHH->OpenDB(FALSE);
-    if (!retval)
-        retval = m_dbHH->LoadCategories();
-
-    CONDUIT_LOG0(gFD, "Getting moz AB List ... ");
-    if(!retval)
-        retval = m_dbPC->GetPCABList(&mozABCount, &mozCatIndexList, &mozABNameList, &mozABUrlList, &mozDirFlagsList);
-
-    if (retval)
-      return retval;
-    CONDUIT_LOG0(gFD, "Done getting moz AB List. \n");
-    
-    // Create an array to help us identify addrbooks that have been deleted on Palm.
-    DWORD *mozABSeen = (DWORD *) CoTaskMemAlloc(sizeof(DWORD) * mozABCount);
-    if (!mozABSeen)
-      return GEN_ERR_LOW_MEMORY;
-    else
-      memset(mozABSeen, FALSE, sizeof(DWORD) * mozABCount);
-
-    // See if palm sync was performed before.
-    for(mozABIndex=0; mozABIndex<mozABCount; mozABIndex++)
-      if (! (mozDirFlagsList[mozABIndex] & kFirstTimeSyncDirFlag))
-      {
-        neverDidPalmSyncBefore = FALSE;
-        break;
-      }
-    
-    // Log moz addrbooks.
-    for (mozABIndex=0; mozABIndex<mozABCount; mozABIndex++)
-    {
-      CONDUIT_LOG5(gFD, "Moz AB[%d] category index/synced=%d/%d, name= '%s', url= '%s'\n",
-                   mozABIndex, mozCatIndexList[mozABIndex], !(mozDirFlagsList[mozABIndex] & kFirstTimeSyncDirFlag), 
-                   mozABNameList[mozABIndex]->GetBuffer(0), mozABUrlList[mozABIndex]->GetBuffer(0));
-    }
-
-    // For each category, try to find the corresponding AB in the moz AB list
-    // and see if it has been synchronized before and take action accordingly.
-    CPCategory * pCategory = m_dbHH->GetFirstCategory();
-    while (pCategory)
-    {
-        CPalmRecord ** recordListHH = NULL;
-        DWORD recordCountHH=0;
-
-        DWORD catID = pCategory->GetID();
-        DWORD catIndex = pCategory->GetIndex();
-        DWORD catFlags = pCategory->GetFlags();
-        CPString catName(pCategory->GetName());
-
-        CONDUIT_LOG3(gFD, "\nProcessing Palm AB '%s' (catIndex/catId) = (%d/%d)... \n", catName.GetBuffer(0), catIndex, catID);
-        BOOL abRenamed = FALSE;
-        BOOL foundInABList=FALSE;
-
-        retval = m_dbHH->DeleteCategory(catIndex, FALSE); // delete the category - we'll recreate from moz ab.
-
-        // Process next category
-        pCategory = m_dbHH->GetNextCategory();
-    } // end of while
-
-    // Deal with any Moz AB not existing in Palm, ones not sync'ed above,
-    // and the case where Palm ABs have been deleted.
-    for(mozABIndex=0; mozABIndex<mozABCount; mozABIndex++)
-    {
-        CONDUIT_LOG3(gFD, "\nMoz AB[%d] category index = %d, name = '%s' doesn't exist on Palm so needs to be added to palm\n",
-                mozABIndex, mozCatIndexList[mozABIndex], mozABNameList[mozABIndex]->GetBuffer(0));
-        CPalmRecord ** recordListPC=NULL;
-        DWORD recordCountPC=0;
-        DWORD * newRecIDList=NULL;
-        CPCategory cat;
-        retval = m_dbPC->LoadAllRecords(*mozABNameList[mozABIndex],
-						                  &recordCountPC, &recordListPC);
-        if(!retval) 
-        {
-            if ((mozDirFlagsList[mozABIndex] & kIsPabDirFlag))
-              cat.SetName("Personal");
-            else
-              cat.SetName(mozABNameList[mozABIndex]->GetBuffer(0));
-            CONDUIT_LOG1(gFD, "  Creating new Palm AB with %d record(s) ... ", recordCountPC);
-            retval = m_dbHH->AddCategory(cat);
-            CONDUIT_LOG2(gFD, "Done creating new Palm AB, new category index=%d. retval=%d.\n", cat.GetIndex(), retval);
-            if(!retval) {
-                CONDUIT_LOG1(gFD, "  Adding %d record(s) to new Palm AB ... ", recordCountPC);
-                newRecIDList = (DWORD *) calloc(recordCountPC, sizeof(DWORD));
-                for (unsigned long i=0; i < recordCountPC; i++) 
-                {
-                    if(!recordListPC[i])
-                        continue;
-                    CPalmRecord palmRec = *recordListPC[i];
-                    palmRec.SetCategory(cat.GetIndex());
-                    retval = m_dbHH->AddARecord(palmRec); // should we check existing recs?
-                    newRecIDList[i] = palmRec.GetID();
-                    delete recordListPC[i]; // delete the record now that it is used
-                }
-                CONDUIT_LOG0(gFD, "Done adding new records to new Palm AB.\n");
-            }
-            else
-              CONDUIT_LOG1(gFD, "Creating new Palm AB failed. retval=%d.\n", retval);
-        }
-        else
-          CONDUIT_LOG1(gFD, "  Loading moz AB records failed so can't create new Palm AB. retval=%d.\n", retval);
-
-
-        // delete the recordList now that palm is updated
-        if(recordListPC)
-            free(recordListPC);  
-        // notify Mozilla that sync is done so that memory can be freed 
-        if(!retval)
-            success = TRUE;
-        else
-        {
-            success = FALSE;
-            recordCountPC=0;
-        }
-        retval = m_dbPC->NotifySyncDone(success, cat.GetIndex(), recordCountPC, newRecIDList);
-        if(newRecIDList)
-            free(newRecIDList);
-
-        // Lastly, update the AB with new category index and mod time.
-        retval = m_dbPC->UpdatePCABSyncInfo(success ? cat.GetIndex() : -1, *mozABNameList[mozABIndex]);
-    } // end of mozAB not existing in Palm for loop
-
-    // Purge deleted Palm record permanently (in case they were logically deleted).
-    m_dbHH->PurgeDeletedRecs();
-
-    // Free stuff we allocated.
-    CoTaskMemFree(mozABSeen);
-    
-    // update category info in HH
-    m_dbHH->CompactCategoriesToHH();
-
-    // close the HH DB once synced
-    retval = m_dbHH->CloseDB(FALSE);
-
-    return retval;
-}
-
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/MozABConduitSync.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef _MOZABCONDUIT_SYNC_H_
-#define _MOZABCONDUIT_SYNC_H_
-
-#include <Cpalmrec.h>
-#include <Pgenerr.h>
-
-#include "MozABHHManager.h"
-#include "MozABPCManager.h"
-
-#define PERSONAL_ADDRBOOK_URL   "moz-abmdbdirectory://abook.mab"
-#define COLLECTED_ADDRBOOK_URL  "moz-abmdbdirectory://history.mab"
-
-#define ENV_VAR_CONDUTI_LOG "MOZ_CONDUIT_LOG"
-
-#define CONDUIT_LOG0(fd, format) \
-  if (fd) \
-    {fprintf(fd, format); fflush(fd);}
-#define CONDUIT_LOG1(fd, format, arg1) \
-  if (fd) \
-    {fprintf(fd, format, arg1); fflush(fd);}
-#define CONDUIT_LOG2(fd, format, arg1, arg2) \
-  if (fd) \
-    {fprintf(fd, format, arg1, arg2); fflush(fd);}
-#define CONDUIT_LOG3(fd, format, arg1, arg2, arg3) \
-  if (fd) \
-    {fprintf(fd, format, arg1, arg2, arg3); fflush(fd);}
-#define CONDUIT_LOG4(fd, format, arg1, arg2, arg3, arg4) \
-  if (fd) \
-    {fprintf(fd, format, arg1, arg2, arg3, arg4); fflush(fd);}
-#define CONDUIT_LOG5(fd, format, arg1, arg2, arg3, arg4, arg5) \
-  if (fd) \
-    {fprintf(fd, format, arg1, arg2, arg3, arg4, arg5); fflush(fd);}
-
-extern FILE *gFD; // logging.
-
-class CMozABConduitSync
-{
-public:
-    // OpenConduit creates a new object using this constructor
-	CMozABConduitSync(CSyncProperties& rProps);
-    // destructor	
-    ~CMozABConduitSync();
-
-    // OpenConduit calls this function to begin the sync process
-    long Perform();
-
-    friend DWORD WINAPI DoFastSync(LPVOID lpParameter);
-
-protected:
-    // default constructor
-    CMozABConduitSync();
-    
-    // initialization method
-    long GetRemoteDBInfo(int iIndex);
-
-    // synchronization methods
-    long PerformFastSync();
-    long PerformSlowSync();
-    long CopyHHtoPC();
-    long CopyPCtoHH();
-    // utility methods
-    BOOL CategoryExists(CPString &mozABName, BOOL isPAB);
-    BOOL CategoryNameMatches(CPString &catName, CPString &cutOffMozABName, BOOL isPAB);
-
-private:
-    CSyncProperties m_rSyncProperties;
-
-    MozABHHManager *m_dbHH;
-    MozABPCManager *m_dbPC;
-    CDbList        *m_remoteDB; 
-    short           m_TotRemoteDBs;
-    CSystemInfo     m_SystemInfo;
-    CONDHANDLE      m_ConduitHandle;
-};
-
-#endif
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/MozABHHManager.cpp
+++ /dev/null
@@ -1,735 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include <windows.h>
-#include <string.h>
-#include <stdio.h>
-#include <memory.h>
-#include <sys/stat.h>
-#include <TCHAR.H>
-#include <malloc.h>
-#include <syncmgr.h>
-#include <Pgenerr.h>
-
-#include "MozABHHManager.h"
-
-MozABHHManager::MozABHHManager(DWORD dwGenericFlags, 
-               char *pName, 
-               DWORD dwCreator, 
-               DWORD dwType, 
-               WORD dbFlags, 
-               WORD dbVersion, 
-			   int  iCardNum,
-               eSyncTypes syncType)
-{
-    m_hhDB = 0;
-    
-    m_rInfo.m_pBytes = NULL;
-    m_rInfo.m_TotalBytes = 0;
-
-    m_dwMaxRecordCount = 0;
-    m_pCatMgr = NULL;
-    // since we are dealing with AB which is a Record DB in Palm
-    m_bRecordDB = TRUE;
-
-    m_szName[0] = '\0';
-    SetName( pName);
-    m_dwCreator = dwCreator;
-    m_dwType    = dwType;
-    m_wFlags    = dbFlags;
-    m_wVersion  = dbVersion;
-    m_CardNum = iCardNum;
-
-    memset(&m_appInfo, 0, sizeof(CDbGenInfo));
-}
-
-MozABHHManager::~MozABHHManager()
-{
-    if (m_rInfo.m_pBytes != NULL) {
-        delete m_rInfo.m_pBytes;
-    }
-    m_rInfo.m_pBytes = NULL;
-    m_rInfo.m_TotalBytes = 0;
-
-    if (m_appInfo.m_pBytes) {
-        delete m_appInfo.m_pBytes;
-        m_appInfo.m_pBytes = NULL;
-    }
-
-    if (m_pCatMgr) {
-        delete m_pCatMgr;
-        m_pCatMgr = NULL;
-    }
-
-    CloseDB(TRUE);
-}
-
-
-long MozABHHManager::AllocateDBInfo(CDbGenInfo &info, BOOL bClearData)
-{
-    BOOL bNew = FALSE;
-
-    if (!info.m_pBytes) {
-        info.m_pBytes = (BYTE *) new char[MAX_RECORD_SIZE];  // deleted in d'ctor or by caller
-        if (!info.m_pBytes)
-            return GEN_ERR_LOW_MEMORY;
-        info.m_TotalBytes = MAX_RECORD_SIZE;
-        bNew = TRUE;
-    } 
-
-    if ((bClearData) || (bNew)) {
-        memset(info.m_pBytes, 0, info.m_TotalBytes);
-    }
-    return 0;
-}
-
-long MozABHHManager::GetInfoBlock(CDbGenInfo &info, BOOL bSortInfo)
-{
-    long  retval=0;
-
-    // Allocate storage for app/sort info blocks
-    retval = AllocateDBInfo(info);
-    if (retval)
-        return retval;
-
-    _tcsncpy((char*)info.m_FileName, m_szName, sizeof(info.m_FileName)-1);
-    info.m_FileName[sizeof(info.m_FileName)-1] = '\0';
-    memset(info.m_pBytes, 0, info.m_TotalBytes);
-
-    if (!bSortInfo) {
-        // Read the AppInfo block
-        retval = SyncReadDBAppInfoBlock(m_hhDB, info);
-    } else {
-        // Read the SortInfo block
-        retval = SyncReadDBSortInfoBlock(m_hhDB, info);
-    }
-    if (retval) {// if error then clean up
-        delete info.m_pBytes;
-        info.m_pBytes = NULL;
-        info.m_TotalBytes = 0;
-    }
-
-    return retval;
-}
-
-
-long MozABHHManager::GetAppInfo(CDbGenInfo &rInfo)
-{
-    long retval = 0;
-    BYTE *pBuffer;
-
-    pBuffer = rInfo.m_pBytes; 
-    WORD wTotalBytes = rInfo.m_TotalBytes;
-    memset(&rInfo, 0, sizeof(CDbGenInfo));
-    if ((wTotalBytes > 0) && (pBuffer)) {
-        memset(pBuffer, 0, wTotalBytes);
-        rInfo.m_pBytes       = pBuffer; 
-        rInfo.m_TotalBytes   = wTotalBytes;
-    }
-
-    retval = GetInfoBlock(rInfo);
-
-    if (retval) { // if error cleanup
-        if (rInfo.m_pBytes) {
-            delete rInfo.m_pBytes;
-            rInfo.m_pBytes = NULL;
-            rInfo.m_TotalBytes   = 0;
-        }
-    }
-
-    return retval;
-}
-
-long MozABHHManager::SetName( char *pName)
-{
-    if (m_hhDB)
-        return GEN_ERR_DB_ALREADY_OPEN;
-
-    WORD wLen;
-    if (!pName){
-        *m_szName = '\0';
-        return 0;
-    } 
-    wLen = (WORD)strlen(pName);
-    if (!wLen) {
-        *m_szName = '\0';
-        return 0;
-    }
-    if (wLen >= sizeof(m_szName))
-        return GEN_ERR_DATA_TOO_LARGE;
-
-    strncpy(m_szName, pName, sizeof(m_szName)-1);
-    m_szName[sizeof(m_szName)-1] = '\0';
-    return 0;
-}
-
-long MozABHHManager::LoadCategories(void)
-{
-    long retval=0;
-
-    if (m_pCatMgr) {  // remove existing manager
-        delete m_pCatMgr;
-        m_pCatMgr = NULL;
-    }
-
-    if (m_appInfo.m_BytesRead == 0){
-        retval = GetAppInfo(m_appInfo);
-        if (retval)
-            return retval;
-    }
-
-    if ((m_appInfo.m_BytesRead > 0) && (m_appInfo.m_pBytes)){
-        m_pCatMgr = new CPCategoryMgr(m_appInfo.m_pBytes, m_appInfo.m_BytesRead); // deleted in d'ctor
-        if (!m_pCatMgr)
-            return GEN_ERR_LOW_MEMORY;
-    } else {
-        retval = GEN_ERR_NO_CATEGORIES;
-    }
-    return retval;
-}
-
-long MozABHHManager::AddCategory(CPCategory & cat)
-{
-    long retval=0;
-
-    if(!m_pCatMgr)
-        retval = LoadCategories();
-
-    // generate a new ID and Add the category
-    if(!retval) {
-        int id;
-        for(id = 0; id <= MAX_CATEGORIES; id++)
-            if(!m_pCatMgr->FindID(id))
-                break;
-        // if ID doesnot already exist
-        if(id < MAX_CATEGORIES) {
-            cat.SetID(MAKELONG(id, 0));
-            retval = m_pCatMgr->Add(cat);
-        }
-        else
-            retval = CAT_NO_ID;
-    }
-
-    if(!retval)
-        m_pCatMgr->SetChanged();
-
-    return retval;    
-}
-
-long MozABHHManager::DeleteCategory(DWORD dwCategory, BOOL bMoveToUnfiled)
-{
-    long retval=0;
-
-    if ((dwCategory < 0) || (dwCategory >= MAX_CATEGORIES))
-        return CAT_ERR_INDEX_OUT_OF_RANGE;
-
-    BYTE sCategory = LOBYTE(LOWORD(dwCategory));
-
-    if (!bMoveToUnfiled)
-    {
-        retval = SyncPurgeAllRecsInCategory(m_hhDB, sCategory);
-        m_pCatMgr->DeleteByIndex(dwCategory); // delete category itself
-    }
-    else 
-        retval = SyncChangeCategory(m_hhDB, sCategory, 0);
-    return retval;
-}
-
-long MozABHHManager::ChangeCategory(DWORD dwOldCatIndex, DWORD dwNewCatIndex)
-{
-    long retval=0;
-
-    if ((dwOldCatIndex < 0) || (dwOldCatIndex >= MAX_CATEGORIES))
-        return CAT_ERR_INDEX_OUT_OF_RANGE;
-
-    BYTE sCategory = LOBYTE(LOWORD(dwOldCatIndex));
-
-    if ((dwNewCatIndex < 0) || (dwNewCatIndex >= MAX_CATEGORIES))
-        return CAT_ERR_INDEX_OUT_OF_RANGE;
-
-    BYTE sNewCategory = LOBYTE(LOWORD(dwNewCatIndex));
-
-    retval = SyncChangeCategory(m_hhDB, sCategory, sNewCategory);
-    return retval;
-}
-
-long MozABHHManager::CompactCategoriesToHH()
-{
-    long retval = 0;
-
-    if ((!m_pCatMgr) || (!m_pCatMgr->IsChanged()))
-        return 0;
-
-    retval = AllocateDBInfo(m_appInfo);
-    if (retval)
-        return retval;
-
-    DWORD dwRecSize;
-
-    dwRecSize = m_appInfo.m_TotalBytes;
-
-    retval = m_pCatMgr->Compact(m_appInfo.m_pBytes, &dwRecSize);
-    if (!retval) {
-        // more than just the categories may be stored in the app info structure
-        // This code only replaces the category area.
-        if (!m_appInfo.m_BytesRead)
-            m_appInfo.m_BytesRead = LOWORD(dwRecSize);
-    }
-
-    if(!retval)
-        retval = SyncWriteDBAppInfoBlock(m_hhDB, m_appInfo);
-
-    return retval;
-}
-
-long MozABHHManager::OpenDB(BOOL bCreate)
-{
-    long retval=0;
-
-    if (bCreate) {
-       CDbCreateDB  createInfo;
-
-        // Delete any existing DB with the same name
-        SyncDeleteDB(m_szName, m_CardNum);
-
-        memset(&createInfo, 0, sizeof(CDbCreateDB));
-
-        createInfo.m_Creator     = m_dwCreator; 
-        createInfo.m_Type        = m_dwType; 
-        createInfo.m_Flags       = (eDbFlags) m_wFlags;
-        createInfo.m_CardNo     = m_CardNum;  
-        strncpy(createInfo.m_Name, m_szName, sizeof(createInfo.m_Name)-1);
-        createInfo.m_Name[sizeof(createInfo.m_Name)-1] = '\0';
-        createInfo.m_Version    = m_wVersion;
-
-        if ((retval = SyncCreateDB(createInfo)) == SYNCERR_NONE)
-            m_hhDB = createInfo.m_FileHandle;
-    }
-    else 
-    {
-        retval = SyncOpenDB(m_szName, 
-                            m_CardNum, 
-                            m_hhDB,
-                            eDbRead | eDbWrite);
-        if ((retval) && (retval == SYNCERR_NOT_FOUND))
-            retval = GEN_ERR_NO_HH_DB;
-    } 
-
-    return retval;
-}
-
-long MozABHHManager::CloseDB(BOOL bDontUpdate)
-{
-    long retval = 0;
-    long retval2 = 0;
-
-    if (m_hhDB == NULL) 
-        return GEN_ERR_DB_NOT_OPEN;
-
-    if (!bDontUpdate) {
-        retval = SyncResetSyncFlags(m_hhDB);
-    }
-    retval2 = SyncCloseDB(m_hhDB);
-    if (!retval)
-        retval = retval2;
-    m_hhDB = NULL;
-    return retval;
-}
-
-long MozABHHManager::LoadAllUpdatedRecords(CPalmRecord ***ppRecordList, DWORD * pListSize)
-{
-    return LoadUpdatedRecords(0, ppRecordList, pListSize);
-}
-
-long MozABHHManager::LoadUpdatedRecordsInCategory(DWORD catIndex, CPalmRecord ***ppRecordList, DWORD * pListSize)
-{
-    return LoadUpdatedRecords(catIndex, ppRecordList, pListSize);
-}
-
-// this function allocates the list as well as the records, caller should free list and delete records
-long MozABHHManager::LoadUpdatedRecords(DWORD catIndex, CPalmRecord ***ppRecordList, DWORD * pListSize)
-{
-    long retval=0;
-    WORD dwRecCount=0;
-
-    retval = SyncGetDBRecordCount(m_hhDB, dwRecCount);
-    if (retval)
-        return retval;
-
-    // resset the iteration index
-    retval = SyncResetRecordIndex(m_hhDB);
-    if (retval)
-        return retval;
-
-    // allocate buffer initially for the total record size and adjust after getting records
-    CPalmRecord ** palmRecordList = (CPalmRecord **) malloc(sizeof(CPalmRecord *) * dwRecCount);
-    if (!palmRecordList)
-        return GEN_ERR_LOW_MEMORY;
-    memset(palmRecordList, 0, sizeof(CPalmRecord *) * dwRecCount);
-    *ppRecordList = palmRecordList;
-
-    // SyncReadNextModifiedRecInCategory() does not seem to be returning
-    // deleted palm records, so SyncReadNextModifiedRec() is used instead.
-    CPalmRecord *pPalmRec;
-    *pListSize = 0;
-    while ((!retval) && (*pListSize < dwRecCount))  {
-        retval = AllocateRawRecord();
-        if(retval)
-            break;
-        m_rInfo.m_RecIndex = 0;
-        retval = SyncReadNextModifiedRec(m_rInfo);
-        // Does it belong to the category we care about?
-        if (!retval && m_rInfo.m_CatId == catIndex)
-        {
-            pPalmRec = new CPalmRecord(m_rInfo);
-            if (pPalmRec) {
-                *palmRecordList = pPalmRec;
-                palmRecordList++;
-                (*pListSize)++;
-            } else {
-                retval = GEN_ERR_LOW_MEMORY;
-            }
-        } 
-    }
-
-    // reallocate to the correct size
-    if((*pListSize) != dwRecCount)
-        *ppRecordList=(CPalmRecord **) realloc(*ppRecordList, sizeof(CPalmRecord *) * (*pListSize));
-
-    if (retval == SYNCERR_FILE_NOT_FOUND) // if there are no more records
-        retval = 0;
-
-    return retval;
-}
-
-long MozABHHManager::AllocateRawRecord(void)
-{
-    if (m_rInfo.m_pBytes != NULL) {
-        BYTE *pBytes;
-
-        pBytes = m_rInfo.m_pBytes;
-        memset(&m_rInfo, 0, sizeof(CRawRecordInfo));
-        memset(pBytes, 0, MAX_RECORD_SIZE);
-
-        m_rInfo.m_pBytes        = pBytes;
-        m_rInfo.m_TotalBytes    = MAX_RECORD_SIZE;
-        m_rInfo.m_FileHandle    = m_hhDB;
-        return 0;
-    }
-    
-    memset(&m_rInfo, 0, sizeof(CRawRecordInfo));
-    m_rInfo.m_pBytes        = (BYTE *) new char[MAX_RECORD_SIZE];
-    if (!m_rInfo.m_pBytes)
-        return GEN_ERR_LOW_MEMORY;
-
-    memset(m_rInfo.m_pBytes, 0, MAX_RECORD_SIZE);
-    m_rInfo.m_TotalBytes    = MAX_RECORD_SIZE;
-    m_rInfo.m_FileHandle    = m_hhDB;
-    return 0;
-}
-
-// this function allocates the list as well as the records, caller should free list and delete records
-long MozABHHManager::LoadAllRecords(CPalmRecord ***ppRecordList, DWORD * pListSize)
-{
-    long retval=0;
-    WORD dwRecCount, dwIndex;
-
-    retval = SyncGetDBRecordCount(m_hhDB, dwRecCount);
-    if (!retval)
-        return retval;
-    *pListSize = dwRecCount;
-
-    *ppRecordList = (CPalmRecord **) malloc(sizeof(CPalmRecord *) * dwRecCount);
-    if (!*ppRecordList)
-        return GEN_ERR_LOW_MEMORY;
-    memset(*ppRecordList, 0, sizeof(CPalmRecord *) * dwRecCount);
-
-    CPalmRecord *pPalmRec;
-    for (dwIndex = 0; (dwIndex < dwRecCount) && (!retval); dwIndex++){
-        retval = AllocateRawRecord();
-        if(retval)
-            break;
-
-        m_rInfo.m_RecIndex = LOWORD(dwIndex);
-
-        retval = SyncReadRecordByIndex(m_rInfo);
-        if (!retval) {
-            pPalmRec = new CPalmRecord(m_rInfo);
-            if (pPalmRec) {
-                *ppRecordList[dwIndex] = pPalmRec;
-            } else {
-                retval = GEN_ERR_LOW_MEMORY;
-            }
-        } else if (retval != SYNCERR_FILE_NOT_FOUND) {
-            pPalmRec = new CPalmRecord(m_rInfo);
-            pPalmRec->Initialize();
-            pPalmRec->SetIndex(dwIndex);
-            *ppRecordList[dwIndex] = pPalmRec;
-        }
-    }
-    m_dwMaxRecordCount = dwIndex + 1;
-
-    if (retval == SYNCERR_FILE_NOT_FOUND) // if there are no more records
-        retval = 0;
-
-    return retval;
-}
-
-// this function allocates the list as well as the records, caller should free list and delete records
-long MozABHHManager::LoadAllRecordsInCategory(DWORD catIndex, CPalmRecord ***ppRecordList, DWORD * pListSize)
-{
-    long retval=0;
-    WORD dwRecCount=0;
-
-    retval = SyncGetDBRecordCount(m_hhDB, dwRecCount);
-    if (retval)
-        return retval;
-
-    // resset the iteration index
-    retval = SyncResetRecordIndex(m_hhDB);
-    if (retval)
-        return retval;
-
-    // allocate buffer initially for the total record size and adjust after getting records
-    CPalmRecord ** palmRecordList = (CPalmRecord **) malloc(sizeof(CPalmRecord *) * dwRecCount);
-    if (!palmRecordList)
-        return GEN_ERR_LOW_MEMORY;
-    memset(palmRecordList, 0, sizeof(CPalmRecord *) * dwRecCount);
-    *ppRecordList = palmRecordList;
-
-    CPalmRecord *pPalmRec;
-
-    *pListSize = 0;
-    while ((!retval) && (*pListSize < dwRecCount))  {
-        retval = AllocateRawRecord();
-        if (retval) 
-            break;
-        m_rInfo.m_RecIndex = 0;
-        m_rInfo.m_CatId = catIndex;
-        retval = SyncReadNextRecInCategory(m_rInfo);
-        if (!retval) {
-            pPalmRec = new CPalmRecord(m_rInfo);
-            if (pPalmRec) {
-                *palmRecordList = pPalmRec;
-                palmRecordList++;
-                (*pListSize)++;
-            } else {
-                retval = GEN_ERR_LOW_MEMORY;
-            }
-        } 
-    }
-
-    // reallocate to the correct size
-    if((*pListSize) != dwRecCount)
-        *ppRecordList=(CPalmRecord **) realloc(*ppRecordList, sizeof(CPalmRecord *) * (*pListSize));
-
-    if (retval == SYNCERR_FILE_NOT_FOUND) // if there are no more records
-        retval = 0;
-
-    return retval;
-}
-
-long MozABHHManager::AddRecords(CPalmRecord **pRecordList, DWORD pCount)
-{
-    long retval=0;
-
-    for (unsigned long i=0; i < pCount; i++)
-    {
-        CPalmRecord palmRec = *pRecordList[i];
-
-        palmRec.ResetAttribs();
-
-        retval = AllocateRawRecord();
-        if (retval) 
-            return retval;
-
-        retval = palmRec.ConvertToHH(m_rInfo);
-        if (!retval) {
-            m_rInfo.m_FileHandle = m_hhDB;
-            m_rInfo.m_RecId = 0;
-            if (m_bRecordDB)
-                retval = SyncWriteRec(m_rInfo);
-            else 
-                retval = SyncWriteResourceRec(m_rInfo);
-            if (!retval) {
-                palmRec.SetIndex(m_rInfo.m_RecIndex);
-                palmRec.SetID(m_rInfo.m_RecId);
-            }
-        }
-        else
-            return retval;
-    }
-
-    return retval;
-}
-
-long MozABHHManager::UpdateRecords(CPalmRecord **pRecordList, DWORD pCount)
-{
-    long retval=0;
-
-    for (unsigned long i=0; i < pCount; i++)
-    {
-        CPalmRecord palmRec = *pRecordList[i];
-
-        retval = AllocateRawRecord();
-        if (retval) 
-            return retval;
-
-        retval = palmRec.ConvertToHH(m_rInfo);
-        if (!retval) {
-            m_rInfo.m_FileHandle = m_hhDB;
-            if (m_bRecordDB)
-                retval = SyncWriteRec(m_rInfo);
-            else 
-                retval = SyncWriteResourceRec(m_rInfo);
-            if (!retval) {
-                palmRec.SetIndex(m_rInfo.m_RecIndex);
-                palmRec.SetID(m_rInfo.m_RecId);
-            }
-        }
-        else
-            return retval;
-    }
-
-    return retval;
-}
-
-long MozABHHManager::DeleteRecords(CPalmRecord **pRecordList, DWORD pCount)
-{
-    long retval=0;
-
-    for (unsigned long i=0; i < pCount; i++)
-    {
-        CPalmRecord palmRec = *pRecordList[i];
-
-        retval = AllocateRawRecord();
-        if (retval) 
-            return retval;
-
-        retval = palmRec.ConvertToHH(m_rInfo);
-        if (!retval) {
-            m_rInfo.m_FileHandle = m_hhDB;
-            if (m_bRecordDB)
-                retval = SyncDeleteRec(m_rInfo);
-            else 
-                retval = SyncDeleteResourceRec(m_rInfo);
-        }
-        else
-            return retval;
-    }
-
-    return retval;
-}
-
-
-long MozABHHManager::AddARecord(CPalmRecord & palmRec)
-{
-    long retval=0;
-
-    palmRec.ResetAttribs();
-
-    retval = AllocateRawRecord();
-    if (retval) 
-        return retval;
-
-    retval = palmRec.ConvertToHH(m_rInfo);
-    if (!retval) {
-        m_rInfo.m_FileHandle = m_hhDB;
-        m_rInfo.m_RecId = 0;
-        if (m_bRecordDB)
-            retval = SyncWriteRec(m_rInfo);
-        else 
-            retval = SyncWriteResourceRec(m_rInfo);
-        if (!retval) {
-            palmRec.SetIndex(m_rInfo.m_RecIndex);
-            palmRec.SetID(m_rInfo.m_RecId);
-        }
-    }
-
-    return retval;
-}
-
-long MozABHHManager::UpdateARecord(CPalmRecord & palmRec)
-{
-    long retval=0;
-
-    retval = AllocateRawRecord();
-    if (retval) 
-        return retval;
-
-    retval = palmRec.ConvertToHH(m_rInfo);
-    if (!retval) {
-        m_rInfo.m_FileHandle = m_hhDB;
-        m_rInfo.m_Attribs = eRecAttrDirty;
-        if (m_bRecordDB)
-            retval = SyncWriteRec(m_rInfo);
-        else 
-            retval = SyncWriteResourceRec(m_rInfo);
-        if (!retval) {
-            palmRec.SetIndex(m_rInfo.m_RecIndex);
-            palmRec.SetID(m_rInfo.m_RecId);
-        }
-    }
-
-    return retval;
-}
-
-long MozABHHManager::DeleteARecord(CPalmRecord & palmRec)
-{
-    long retval=0;
-
-    retval = AllocateRawRecord();
-    if (retval) 
-        return retval;
-
-    retval = palmRec.ConvertToHH(m_rInfo);
-    if (!retval) {
-        m_rInfo.m_FileHandle = m_hhDB;
-        if (m_bRecordDB)
-            retval = SyncDeleteRec(m_rInfo);
-        else 
-            retval = SyncDeleteResourceRec(m_rInfo);
-    }
-
-    return retval;
-}
-
-long MozABHHManager::PurgeDeletedRecs(void)
-{
-    return (SyncPurgeDeletedRecs(m_hhDB));
-}
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/MozABHHManager.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef _MOZAB_HHMANAGER_H_
-#define _MOZAB_HHMANAGERT_H_
-
-#include <CPDbBMgr.h>
-
-class MozABHHManager
-{
-public:
-    MozABHHManager(DWORD dwGenericFlags, 
-               char *pName, 
-               DWORD dwCreator, 
-               DWORD dwType, 
-               WORD dbFlags, 
-               WORD dbVersion, 
-			   int  iCardNum,
-               eSyncTypes syncType);
-    ~MozABHHManager();
-
-    long OpenDB(BOOL bCreate);
-    long CloseDB(BOOL bDontUpdate);
-
-    // this will load categories in m_pCatMgr member
-    long LoadCategories();
-    CPCategory * GetFirstCategory() { return m_pCatMgr->FindFirst(); }
-    CPCategory * GetNextCategory() { return m_pCatMgr->FindNext(); }
-    long DeleteCategory(DWORD dwCategory, BOOL bMoveToUnfiled);
-    long ChangeCategory(DWORD dwOldCatIndex, DWORD dwNewCatIndex);
-    long AddCategory(CPCategory & cat);
-    long CompactCategoriesToHH();
-
-    long LoadAllRecords(CPalmRecord ***ppRecordList, DWORD * pListSize);
-    long LoadAllRecordsInCategory(DWORD catIndex, CPalmRecord ***ppRecordList, DWORD * pListSize);
-    long LoadAllUpdatedRecords(CPalmRecord ***ppRecordList, DWORD * pListSize);
-    long LoadUpdatedRecordsInCategory(DWORD catIndex, CPalmRecord ***ppRecordList, DWORD * pListSize);
-
-    long AddRecords(CPalmRecord **m_pRecordList, DWORD pCount);
-    long DeleteRecords(CPalmRecord **m_pRecordList, DWORD pCount);
-    long UpdateRecords(CPalmRecord **m_pRecordList, DWORD pCount);
-
-    long AddARecord(CPalmRecord & palmRec);
-    long DeleteARecord(CPalmRecord & palmRec);
-    long UpdateARecord(CPalmRecord & palmRec);
-    long PurgeDeletedRecs(void);
-
-protected:
-    char  m_szName[SYNC_DB_NAMELEN];
-    DWORD m_dwCreator;
-    DWORD m_dwType;
-    WORD  m_wFlags;
-    WORD  m_wVersion;
-    int   m_CardNum;
-    BOOL  m_bRecordDB;
-
-    DWORD m_dwMaxRecordCount;
-
-    CRawRecordInfo  m_rInfo;
-    CPCategoryMgr * m_pCatMgr;
-
-    BYTE m_hhDB;
-    CDbGenInfo m_appInfo;
-    
-    long AllocateRawRecord();
-    long AllocateDBInfo(CDbGenInfo &info, BOOL bClearData=FALSE);
-    long GetInfoBlock(CDbGenInfo &info, BOOL bSortInfo=FALSE);
-    long GetAppInfo(CDbGenInfo &rInfo);
-    long SetName( char *pName);
-    long LoadUpdatedRecords(DWORD catIndex, CPalmRecord ***ppRecordList, DWORD * pListSize);
-
-};
-
-#endif
\ No newline at end of file
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/MozABPCManager.cpp
+++ /dev/null
@@ -1,382 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include <windows.h>
-#include <string.h>
-#include <stdio.h>
-#include <memory.h>
-#include <sys/stat.h>
-#include <TCHAR.H>
-
-#include <syncmgr.h>
-#include <Pgenerr.h>
-
-#include "MozABConduitRecord.h"
-#include "MozABPCManager.h"
-
-const IID IID_IPalmSync = {0xC8CE6FC1,0xCCF1,0x11d6,{0xB8,0xA5,0x00,0x00,0x64,0x65,0x73,0x74}};
-const CLSID CLSID_CPalmSyncImp = { 0xb20b4521, 0xccf8, 0x11d6, { 0xb8, 0xa5, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } };
-
-extern DWORD tId;
-
-/* static */BOOL MozABPCManager::gUseHomeAddress;
-/* static */ BOOL MozABPCManager::gPreferHomePhone;
-
-
-BOOL MozABPCManager::InitMozPalmSyncInstance(IPalmSync **aRetValue)
-{
-    // Check wehther this thread has a valid Interface
-    // by looking into thread-specific-data variable
-
-    *aRetValue = (IPalmSync *)TlsGetValue(tId);
-
-    // Check whether the pointer actually resolves to
-    // a valid method call; otherwise mozilla is not running
-
-    if ((*aRetValue) && (*aRetValue)->IsValid() == S_OK)
-         return TRUE;
-
-    HRESULT hRes = ::CoInitialize(NULL) ;
-
-    hRes = ::CoCreateInstance(CLSID_CPalmSyncImp, NULL, CLSCTX_LOCAL_SERVER,
-                                         IID_IPalmSync, (LPVOID *)aRetValue);
-
-    if (hRes == S_OK)
-        if (TlsSetValue(tId, (LPVOID)(*aRetValue)))
-        {
-            (*aRetValue)->nsUseABHomeAddressForPalmAddress(&gUseHomeAddress);
-            (*aRetValue)->nsPreferABHomePhoneForPalmPhone(&gPreferHomePhone);
-            return TRUE;
-        }
-
-    // Either CoCreate or TlsSetValue failed; so return FALSE
-
-    if ((*aRetValue))
-        (*aRetValue)->Release();
-
-    ::CoUninitialize();
-    return FALSE;
-}
-
-// this function allocates the list as well as the strings, caller should free list and delete strings
-long MozABPCManager::GetPCABList(DWORD * pCategoryCount, LONG ** pCategoryIndexList, CPString *** pCategoryNameList, CPString *** pCategoryUrlList, BOOL ** pDirFlags)
-{
-    lpnsMozABDesc mozABNameList=NULL;
-
-    short  dwMozABCount=0;
-    long retval = 0;
-    IPalmSync *pNsPalmSync = NULL;
-
-    // get the interface 
-    if (!InitMozPalmSyncInstance(&pNsPalmSync))
-        return GEN_ERR_NOT_SUPPORTED;
-
-    // get the ABList
-    HRESULT hres = pNsPalmSync->nsGetABList(FALSE, &dwMozABCount, 
-                                        &mozABNameList, pCategoryIndexList, pDirFlags);
-    if (hres != S_OK) {
-        retval = (long) hres;
-        return retval;
-    }
-
-    *pCategoryCount = dwMozABCount;
-
-    CPString ** abNameList = (CPString **) malloc(sizeof(CPString *) * dwMozABCount);
-    if (!abNameList) {
-        free(mozABNameList);
-        return GEN_ERR_LOW_MEMORY;
-    }
-    memset(abNameList, 0, sizeof(CPString *) * dwMozABCount);
-    *pCategoryNameList = abNameList;
-
-    CPString ** abUrlList = (CPString **) malloc(sizeof(CPString *) * dwMozABCount);
-    if (!abUrlList) {
-        free(mozABNameList);
-        free(abNameList);
-        return GEN_ERR_LOW_MEMORY;
-    }
-    memset(abUrlList, 0, sizeof(CPString *) * dwMozABCount);
-    *pCategoryUrlList = abUrlList;
-
-    for (int i=0; i < dwMozABCount; i++) {
-        CPString * pABName = new CPString((LPCTSTR) mozABNameList[i].lpszABName);
-        if (pABName)
-            *abNameList = pABName;
-        else
-            return GEN_ERR_LOW_MEMORY;
-        CoTaskMemFree(mozABNameList[i].lpszABName);
-        abNameList++;
-
-        CPString * pABUrl = new CPString((LPCTSTR) mozABNameList[i].lpszABUrl);
-        if (pABUrl)
-            *abUrlList = pABUrl;
-        else
-            return GEN_ERR_LOW_MEMORY;
-        CoTaskMemFree(mozABNameList[i].lpszABUrl);
-        abUrlList++;
-    }
-    
-    CoTaskMemFree(mozABNameList);
-    return retval;
-}
-
-// this function allocates the mozlist as well as the mozRecs, caller should free list and delete recs
-long MozABPCManager::SynchronizePCAB(LONG categoryIndex, LONG categoryId, CPString & categoryName,
-					DWORD updatedPalmRecCount, CPalmRecord ** updatedPalmRecList,
-					DWORD * pUpdatedPCRecListCount, CPalmRecord *** updatedPCRecList)
-{
-    lpnsABCOMCardStruct mozCardList=NULL;  // freed by MSCOM/Mozilla.
-    int       dwMozCardCount=0;
-    long        retval = 0;
-    IPalmSync     *pNsPalmSync = NULL;
-
-    // get the interface 
-    if (!InitMozPalmSyncInstance(&pNsPalmSync))
-        return GEN_ERR_NOT_SUPPORTED;
-
-    CMozABConduitRecord ** tempMozABConduitRecList = new CMozABConduitRecord*[updatedPalmRecCount];
-    nsABCOMCardStruct * palmCardList = new nsABCOMCardStruct[updatedPalmRecCount];
-    if(palmCardList)
-    {
-        for(DWORD i=0; i<updatedPalmRecCount; i++) 
-        {
-            if(*updatedPalmRecList)
-            {
-                CMozABConduitRecord * pConduitRecord = new CMozABConduitRecord(**updatedPalmRecList);
-                memcpy(&palmCardList[i], &pConduitRecord->m_nsCard, sizeof(nsABCOMCardStruct));
-                tempMozABConduitRecList[i]=pConduitRecord;
-            }
-            updatedPalmRecList++;
-        }
-        // synchronize and get the updated cards in MozAB
-        HRESULT hres = pNsPalmSync->nsSynchronizeAB(FALSE, categoryIndex, categoryId, categoryName.GetBuffer(0),
-                                                updatedPalmRecCount, palmCardList,
-                                                &dwMozCardCount, &mozCardList);
-        if(hres == S_OK && mozCardList) 
-        {
-            *pUpdatedPCRecListCount = dwMozCardCount;
-            CPalmRecord ** mozRecordList = (CPalmRecord **) malloc(sizeof(CPalmRecord *) * dwMozCardCount);
-            *updatedPCRecList = mozRecordList;
-            if (mozRecordList) 
-            {
-                memset(mozRecordList, 0, sizeof(CPalmRecord *) * dwMozCardCount);
-                int i=0;
-                for (i=0; i < dwMozCardCount; i++) 
-                {
-                    CMozABConduitRecord * pConduitRecord = new CMozABConduitRecord(mozCardList[i]);
-                    CPalmRecord * pMozRecord = new CPalmRecord;
-                    pConduitRecord->ConvertToGeneric(*pMozRecord);
-                    *mozRecordList = pMozRecord;
-                    mozRecordList++;
-                    delete pConduitRecord;
-                    CMozABConduitRecord::CleanUpABCOMCardStruct(&mozCardList[i]);
-                }
-            }
-            else
-                retval = GEN_ERR_LOW_MEMORY;
-            CoTaskMemFree(mozCardList);
-        }
-        else
-            retval = (long) hres;
-    }
-    else
-        retval = GEN_ERR_LOW_MEMORY;
-
-
-        delete palmCardList;
-    if(tempMozABConduitRecList) 
-    {
-        for(DWORD j=0; j<updatedPalmRecCount; j++)
-            delete tempMozABConduitRecList[j];
-        delete tempMozABConduitRecList;
-    }
-
-    return retval;
-}
-
-// this will add all records in a Palm category into a new or existing Mozilla AB 
-long MozABPCManager::AddRecords(BOOL replaceExisting, LONG categoryIndex, CPString & categoryName,
-					DWORD updatedPalmRecCount, CPalmRecord ** updatedPalmRecList)
-{
-    long        retval = 0;
-    IPalmSync     *pNsPalmSync = NULL;
-
-    // get the interface 
-    if (!InitMozPalmSyncInstance(&pNsPalmSync))
-        return GEN_ERR_NOT_SUPPORTED;
-
-    CMozABConduitRecord ** tempMozABConduitRecList = new CMozABConduitRecord*[updatedPalmRecCount];
-    nsABCOMCardStruct * palmCardList = new nsABCOMCardStruct[updatedPalmRecCount];
-    if(palmCardList) 
-    {
-        for(DWORD i=0; i<updatedPalmRecCount; i++) 
-        {
-            if(*updatedPalmRecList) 
-            {
-                CMozABConduitRecord * pConduitRecord = new CMozABConduitRecord(**updatedPalmRecList);
-                memcpy(&palmCardList[i], &pConduitRecord->m_nsCard, sizeof(nsABCOMCardStruct));
-                tempMozABConduitRecList[i]=pConduitRecord;
-            }
-            updatedPalmRecList++;
-        }
-        // get the ABList
-        HRESULT hres = pNsPalmSync->nsAddAllABRecords(FALSE, replaceExisting, categoryIndex, categoryName.GetBuffer(0),
-                                                updatedPalmRecCount, palmCardList);
-        if (hres != S_OK)
-            retval = (long) hres;
-    }
-    else
-        retval = GEN_ERR_LOW_MEMORY;
-
-        delete palmCardList;
-    if(tempMozABConduitRecList) 
-    {
-
-        for(DWORD i=0; i<updatedPalmRecCount; i++)
-            delete tempMozABConduitRecList[i];
-        delete tempMozABConduitRecList;
-    }
-    return retval;
-}
-
-bool MozABPCManager::PCABDeleted(CPString &ABName)
-{
-    IPalmSync     *pNsPalmSync = NULL;
-    // get the interface 
-    if (!InitMozPalmSyncInstance(&pNsPalmSync))
-        return false;
-    BOOL abDeleted;
-    HRESULT hres = pNsPalmSync->nsGetABDeleted(ABName.GetBuffer(0), &abDeleted);
-    return (hres == S_OK) ? abDeleted : false; // assume false;
-
-}
-// this load all records in an Moz AB
-// this function allocates the mozlist as well as the mozRecs, caller should free list and delete recs
-long MozABPCManager::LoadAllRecords(CPString & ABName, DWORD * pPCRecListCount, CPalmRecord *** pPCRecList)
-{
-    lpnsABCOMCardStruct mozCardList=NULL; // freed by MSCOM/Mozilla.
-    int       dwMozCardCount=0;
-    long        retval = 0;
-    IPalmSync     *pNsPalmSync = NULL;
-
-    // get the interface 
-    if (!InitMozPalmSyncInstance(&pNsPalmSync))
-        return GEN_ERR_NOT_SUPPORTED;
-
-    // get the ABList
-    HRESULT hres = pNsPalmSync->nsGetAllABCards(FALSE, -1, ABName.GetBuffer(0),
-                                            &dwMozCardCount, &mozCardList);
-    if (hres == S_OK && mozCardList) {
-        *pPCRecListCount = dwMozCardCount;
-        CPalmRecord ** mozRecordList = (CPalmRecord **) malloc(sizeof(CPalmRecord *) * dwMozCardCount);
-        *pPCRecList = mozRecordList;
-        if (mozRecordList) {
-            memset(mozRecordList, 0, sizeof(CPalmRecord *) * dwMozCardCount);
-            for (int i=0; i < dwMozCardCount; i++) {
-                CMozABConduitRecord * pConduitRecord = new CMozABConduitRecord(mozCardList[i]);
-                CPalmRecord * pMozRecord = new CPalmRecord;
-                pConduitRecord->ConvertToGeneric(*pMozRecord);
-                *mozRecordList = pMozRecord;
-                mozRecordList++;
-                delete pConduitRecord;
-                CMozABConduitRecord::CleanUpABCOMCardStruct(&mozCardList[i]);
-            }
-        }
-        else
-            retval = GEN_ERR_LOW_MEMORY;
-        CoTaskMemFree(mozCardList);
-    }
-    else
-        retval = (long) hres;
-    
-    return retval;
-}
-
-long MozABPCManager::NotifySyncDone(BOOL success, LONG catIndex, DWORD newRecCount, DWORD * newRecIDList)
-{
-    IPalmSync     *pNsPalmSync = NULL;
-    // get the interface 
-    if (!InitMozPalmSyncInstance(&pNsPalmSync))
-        return GEN_ERR_NOT_SUPPORTED;
-
-    // MS COM Proxy stub Dll will not accept NULL for this address
-    if(!newRecIDList)
-        newRecIDList = &newRecCount;
-
-    HRESULT hres = pNsPalmSync->nsAckSyncDone(success, catIndex, newRecCount, newRecIDList);
-    long retval = (long) hres;
-
-    return retval;
-}
-
-long MozABPCManager::UpdatePCABSyncInfo(LONG categoryIndex, CPString & categoryName)
-{
-    IPalmSync     *pNsPalmSync = NULL;
-    // get the interface 
-    if (!InitMozPalmSyncInstance(&pNsPalmSync))
-        return GEN_ERR_NOT_SUPPORTED;
-
-    HRESULT hres = pNsPalmSync->nsUpdateABSyncInfo(FALSE, categoryIndex, categoryName);
-    long retval = (long) hres;
-
-    return retval;
-}
-
-long MozABPCManager::DeletePCAB(LONG categoryIndex, CPString & categoryName, CPString & categoryUrl)
-{
-    IPalmSync     *pNsPalmSync = NULL;
-    // get the interface 
-    if (!InitMozPalmSyncInstance(&pNsPalmSync))
-        return GEN_ERR_NOT_SUPPORTED;
-
-    HRESULT hres = pNsPalmSync->nsDeleteAB(FALSE, categoryIndex, categoryName, categoryUrl);
-    long retval = (long) hres;
-
-    return retval;
-}
-
-long MozABPCManager::RenamePCAB(LONG categoryIndex, CPString & categoryName, CPString & categoryUrl)
-{
-    IPalmSync     *pNsPalmSync = NULL;
-    // get the interface 
-    if (!InitMozPalmSyncInstance(&pNsPalmSync))
-        return GEN_ERR_NOT_SUPPORTED;
-
-    HRESULT hres = pNsPalmSync->nsRenameAB(FALSE, categoryIndex, categoryName, categoryUrl);
-    return (long) hres;
-}
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/MozABPCManager.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef _MOZAB_PCMANAGER_H_
-#define _MOZAB_PCMANAGER_H_
-
-#include <CPString.h>
-#include <CPDbBMgr.h>
-
-#include "IPalmSync.h"
-
-class MozABPCManager
-{
-public:
-    MozABPCManager() { }
-    ~MozABPCManager() { }
-
-	// this will return the list of ABs in Mozilla and some flags, including if they were synced before
-    long GetPCABList(DWORD * pCategoryCount, LONG ** pCategoryIndexList, 
-                        CPString *** pCategoryNameList, CPString *** pCategoryURLList, BOOL ** pDirFlags);
-	// this will update a Mozilla AB with updated Palm records and 
-	// return updated records in a Mozilla AB after the last sync
-    // this will take care of first time sync also in which case 
-    // updatedPalmRecList is the list of all palm records and 
-    // updatedPCRecList is the list of unique Moz AB cards / records.
-	long SynchronizePCAB(LONG categoryIndex, LONG categoryId, CPString & categoryName,
-						DWORD updatedPalmRecCount, CPalmRecord ** updatedPalmRecList,
-						DWORD * pUpdatedPCRecList, CPalmRecord *** updatedPCRecList);
-	// this will add all records in a Palm category into a new or existing Mozilla AB 
-	long AddRecords(BOOL replaceExisting, LONG categoryIndex, CPString & categoryName,
-						DWORD updatedPalmRecCount, CPalmRecord ** updatedPalmRecList);
-    // this load all records in an Moz AB
-	long LoadAllRecords(CPString & ABName, DWORD * pPCRecListCount, CPalmRecord *** pPCRecList);
-
-  long NotifySyncDone(BOOL success, LONG catIndex=-1, DWORD newRecCount=0, DWORD * newRecIDList=NULL);
-
-  // Update/Reset category id and mod time in an Moz AB
-  long UpdatePCABSyncInfo(LONG categoryIndex, CPString & categoryName);
-  // Delete an Moz AB
-  long DeletePCAB(LONG categoryIndex, CPString & categoryName, CPString & categoryUrl);
-  // Rename an Moz AB
-  long RenamePCAB(LONG categoryIndex, CPString & categoryName, CPString & categoryUrl);
-
-  bool PCABDeleted(CPString &abName);
-  static BOOL gUseHomeAddress;
-  static BOOL gPreferHomePhone;
-
-private:
-  	// this will initiate the communication with Mozilla
-	BOOL InitMozPalmSyncInstance(IPalmSync **aRetValue);
-
-};
-
-#endif
deleted file mode 100644
--- a/mailnews/extensions/palmsync/conduit/install.js
+++ /dev/null
@@ -1,105 +0,0 @@
-// Install script for palmsync
-
-var err;
-
-err = initInstall("Palmsync v0.4.0", // name for install UI
-                  "/palmsync",         // registered name
-                  "0.4.0.0");        // package version
-
-const APP_VERSION = "0.0.4";
-const APP_PACKAGE = "/XXX.mozdev.org/palmsync";
-
-logComment("initInstall: " + err);
-
-var srDest = 300;       // Disk space required for installation (KB)
-
-var fProgram    = getFolder("Program");
-logComment("fProgram: " + fProgram);
-
-if (!verifyDiskSpace(fProgram, srDest)) {
-  cancelInstall(INSUFFICIENT_DISK_SPACE);
-
-} else {
-
-  var fInstallDir = getFolder(".");
-  var fComponentsDir = getFolder("components");
-  err = addFile(APP_PACKAGE, APP_VERSION, "mozABConduit.dll", fProgram, null);
-  err = addFile(APP_PACKAGE, APP_VERSION, "CondMgr.dll", fProgram, null);
-  err = addFile(APP_PACKAGE, APP_VERSION, "HSAPI.dll", fProgram, null);
-  err = addFile(APP_PACKAGE, APP_VERSION, "PalmSyncProxy.dll", fProgram, null);
-  err = addFile(APP_PACKAGE, APP_VERSION, "PalmSyncInstall.exe", fProgram, null);
-  err = addFile(APP_PACKAGE, APP_VERSION, "palmsync.dll", fComponentsDir, null);
-  err = addFile(APP_PACKAGE, APP_VERSION, "palmSync.xpt", fComponentsDir, null);
-
-  err = getLastError();
-
-  if (err == ACCESS_DENIED) {
-    alert("Unable to write to installation directory "+fInstallDir+".\n You will need to restart the browser with administrator/root privileges to install this software. After installing as root (or administrator), you will need to restart the browser one more time to register the installed software.\n After the second restart, you can go back to running the browser without privileges!");
-
-    cancelInstall(ACCESS_DENIED);
-
-  } else if (err != SUCCESS) {
-    cancelInstall(err);
-
-  } else {
-    var args = "/p";
-    args += fProgram;
-	err = execute("PalmSyncInstall.exe", args, true);
-    performInstall();
-  }
-}
-
-// this function verifies disk space in kilobytes
-function verifyDiskSpace(dirPath, spaceRequired) {
-  var spaceAvailable;
-
-  // Get the available disk space on the given path
-  spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
-
-  // Convert the available disk space into kilobytes
-  spaceAvailable = parseInt(spaceAvailable / 1024);
-
-  // do the verification
-  if(spaceAvailable < spaceRequired) {
-    logComment("Insufficient disk space: " + dirPath);
-    logComment("  required : " + spaceRequired + " K");
-    logComment("  available: " + spaceAvailable + " K");
-    return false;
-  }
-
-  return true;
-}
-
-// OS type detection
-// which platform?
-function getPlatform() {
-  var platformStr;
-  var platformNode;
-
-  if('platform' in Install) {
-    platformStr = new String(Install.platform);
-
-    if (!platformStr.search(/^Macintosh/))
-      platformNode = 'mac';
-    else if (!platformStr.search(/^Win/))
-      platformNode = 'win';
-    else
-      platformNode = 'unix';
-  }
-  else {
-    var fOSMac  = getFolder("Mac System");
-    var fOSWin  = getFolder("Win System");
-
-    logComment("fOSMac: "  + fOSMac);
-    logComment("fOSWin: "  + fOSWin);
-
-    if(fOSMac != null)
-      platformNode = 'mac';
-    else if(fOSWin != null)
-      platformNode = 'win';
-    else
-      platformNode = 'unix';
-  }
-
-  return platformNode;
-}
deleted file mode 100755
index 095361ac1bdea3fc5877b10379a4dea5c906c7fc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index d33ceb685653be6abccafd947e717afff2116cde..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index c89c282e2fd7d5ff452fa99b63a1cf2cfc0c5b3b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index c8fb625a942a5ddb26f680bbe5eb084a0d31174f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
--- a/mailnews/extensions/palmsync/conduit/resource.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by MozABConduitGenCond.rc
-//
-#define IDS_CONDUIT_NAME                1
-#define IDB_HHTOPC                      102
-#define IDB_SYNC                        103
-#define IDB_DONOTHING                   104
-#define IDB_PCTOHH                      105
-#define IDD_CONDUIT_ACTION              399
-#define IDC_ACTIONGROUPBOXTEXT          403
-#define IDC_RADIO_SYNC                  404
-#define IDC_RADIO_PCTOHH                405
-#define IDC_RADIO_HHTOPC                406
-#define IDC_RADIO_DONOTHING             407
-#define IDC_MAKEDEFAULT                 411
-#define IDC_SYNC                        1000
-#define IDC_DONOTHING                   1001
-#define IDC_STATIC_PERMANENT            1002
-#define IDC_STATIC_TEMPORARY            1003
-#define IDC_CURRENT_SETTINGS_GROUP      1004
-#define IDC_PCTOHH                      1005
-#define IDC_HHTOPC                      1006
-#define IDS_CONNECTION                  3311
-#define IDS_CURRENT_SETTINGS_GROUP      8004
-#define IDS_SYNC_FILES                  8005
-#define IDS_DO_NOTHING                  8006
-#define IDS_PCTOHH                      8007
-#define IDS_HHTOPC                      8008
-#define IDS_SYNC_ACTION_TEXT            8009
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        106
-#define _APS_NEXT_COMMAND_VALUE         40001
-#define _APS_NEXT_CONTROL_VALUE         1000
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
deleted file mode 100644
--- a/mailnews/extensions/palmsync/install.rdf
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-
-#filter substitution
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>@INSTALL_EXTENSION_ID@</em:id>  
-    <em:version>@EXTENSION_VERSION@</em:version>
-
-    <em:targetApplication>
-      <!-- Thunderbird -->
-      <Description>
-        <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
-        <em:minVersion>@THUNDERBIRD_VERSION@</em:minVersion>
-        <em:maxVersion>@THUNDERBIRD_VERSION@</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <em:targetApplication>
-      <!-- SeaMonkey -->
-      <Description>
-        <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
-        <em:minVersion>@SEAMONKEY_VERSION@</em:minVersion>
-        <em:maxVersion>@SEAMONKEY_VERSION@</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <em:name>Palm Sync</em:name>
-    <em:description>Palm address book synchronization.</em:description>
-    <em:creator>Team Thunderbird</em:creator>
-    <em:homepageURL>http://kb.mozillazine.org/PalmSync_-_Thunderbird</em:homepageURL>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/mailnews/extensions/palmsync/installer/Makefile.in
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla 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/MPL/
-#
-# 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 the Initial Developer are Copyright (C) 2002
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-PALM_CDK_INC	= $(PALM_CDK_DIR)/C++/Include
-
-include $(DEPTH)/config/autoconf.mk
-
-XPI_NAME               = palmsync
-USE_EXTENSION_MANIFEST = 1
-# make this id as short as possible due to a bug with the palm deskop and long path names.
-# Change /mailnews/extensions/palmsync/Makefile.in and nsPalmSyncSupport.cpp if this changes.
-INSTALL_EXTENSION_ID   = p@m
-XPI_PKGNAME            = palmsync-$(MOZ_APP_VERSION)
-
-PROGRAM		= PalmSyncInstall$(BIN_SUFFIX)
-RESFILE		= PalmSyncInstall.res
-USE_STATIC_LIBS = 1
-
-LOCAL_INCLUDES += -I$(PALM_CDK_INC) \
-		   $(NULL)
-
-CPPSRCS		= PalmSyncInstall.cpp
-
-include $(topsrcdir)/config/rules.mk
-
-LDFLAGS		+= /SUBSYSTEM:WINDOWS /MACHINE:i386
deleted file mode 100644
--- a/mailnews/extensions/palmsync/installer/PalmSyncInstall.cpp
+++ /dev/null
@@ -1,844 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *    Rajiv Dayal <rdayal@netscape.com>
- *		David Bienvenu <bienvenu@nventure.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include <windows.h>
-#include <io.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <tchar.h>
-#include <Winreg.h>
-
-#include "CondMgr.h"
-#include "HSAPI.h"
-#include "resource.h"
-
-#define MOZ_PALMSYNC_PROXY      ".\\PalmSyncProxy.dll"
-#define CREATOR                  "addr"
-#define CONDUIT_FILENAME         "mozABConduit.dll"
-#define REMOTE_DB                "AddressDB"
-#define CONDUIT_NAME             "address"
-#define CONDUIT_PRIORITY         2
-
-#define CONDMGR_FILENAME         "CondMgr.dll"
-#define HSAPI_FILENAME           "HsApi.dll"
-#define DIRECTORY_SEPARATOR      '\\'
-#define DIRECTORY_SEPARATOR_STR  "\\"
-#define EXECUTABLE_EXTENSION     ".exe"
-#define HOTSYNC_MAX_WAIT         30         // wait for HotSync to start/stop in seconds
-
-#define MAX_LOADSTRING 256
-
-// Define any Conduit Manager function pointer types
-typedef int (WINAPI *CmGetCorePathPtr)(TCHAR *pPath, int *piSize);
-typedef int (WINAPI *CmGetHotSyncExecPathPtr)(char *szPath, int *iSize);
-
-typedef int (WINAPI *CmInstallCreatorPtr)(const char *pCreator, int iType);
-typedef int (WINAPI *CmRemoveConduitByCreatorIDPtr)(const char *pCreator);
-typedef int (WINAPI *CmRestoreHotSyncSettingsPtr)(BOOL bToDefaults);
-typedef int (WINAPI *CmSetCreatorRemotePtr)(const char *pCreator, const TCHAR *pRemote);
-typedef int (WINAPI *CmSetCreatorNamePtr)(const char *pCreator, const TCHAR *pConduitName);
-typedef int (WINAPI *CmSetCreatorTitlePtr)(const char *pCreator, const TCHAR *pConduitTitle);
-typedef int (WINAPI *CmSetCreatorFilePtr)(const char *pCreator, const TCHAR *pConduitFile);
-typedef int (WINAPI *CmSetCreatorDirectoryPtr)(const char *pCreator, const TCHAR *pConduitDirectory);
-
-typedef int (WINAPI *CmSetCreatorPriorityPtr)(const char *pCreator, DWORD dwPriority);
-typedef int (WINAPI *CmSetCreatorIntegratePtr)(const char *pCreator, DWORD dwIntegrate);
-typedef int (WINAPI *CmSetCreatorValueDwordPtr)(const char *pCreator, TCHAR *pValue, DWORD dwValue);
-typedef int (WINAPI *CmSetCreatorValueStringPtr)(const char *pCreator, TCHAR *pValueName, TCHAR *value);
-typedef int (WINAPI *CmSetCorePathPtr) (const char *pPath);
-typedef int (WINAPI *CmSetHotSyncExePathPtr) (const char *pPath);
-typedef int (WINAPI *CmSetCreatorModulePtr) (const char *pCreatorID, const TCHAR *pModule);
-
-typedef int (WINAPI *CmGetCreatorNamePtr)(const char *pCreator, TCHAR *pConduitName, int *pSize);
-typedef int (WINAPI *CmGetCreatorTitlePtr)(const char *pCreator, TCHAR *pConduitTitle, int *pSize);
-typedef int (WINAPI *CmGetCreatorPriorityPtr)(const char *pCreator, DWORD *dwPriority);
-typedef int (WINAPI *CmGetCreatorTypePtr)(const char *pCreator);
-typedef int (WINAPI *CmGetCreatorIntegratePtr)(const char *pCreator, DWORD *dwIntegrate);
-typedef int (WINAPI *CmGetCreatorValueDwordPtr)(const char *pCreator, TCHAR *pValueName, DWORD dwValue, DWORD dwDefault);
-typedef int (WINAPI *CmGetCreatorValueStringPtr)(const char *pCreator, TCHAR *pValueName, TCHAR *pValue, int *pSize, TCHAR *pDefault);
-typedef int (WINAPI *CmGetCreatorFilePtr) (const TCHAR *pCreatorID, TCHAR *pFile, int *piSize);
-typedef int (WINAPI *CmGetCreatorDirectoryPtr) (const TCHAR *pCreatorID, TCHAR *pFile, int *piSize);
-typedef int (WINAPI *CmGetCreatorModulePtr) (const char *pCreatorID, TCHAR *pModule, int *piSize);
-typedef int (WINAPI *CmGetCreatorRemotePtr)(const char *pCreator, const TCHAR *pRemote, int*pSize);
-
-// Define any HSAPI function pointer types
-typedef int (WINAPI *HsCheckApiStatusPtr)(void);
-typedef int (WINAPI *HsGetSyncStatusPtr)(DWORD *dwStatus);
-typedef int (WINAPI *HsSetAppStatusPtr)(HsStatusType statusType, DWORD dwStartFlags);
-
-// Define general registration fn pointer types
-typedef int (WINAPI *mozDllRegisterServerPtr)(void);
-typedef int (WINAPI *mozDllUnregisterServerPtr)(void);
-
-// forward declaration
-int  InstallConduit(HINSTANCE hInstance, TCHAR *installPath, TCHAR *appName);
-int UninstallConduit();
-void ConstructMessage(HINSTANCE hInstance, TCHAR *appName, DWORD dwMessageId, TCHAR *formattedMsg);
-
-// Global vars
-BOOL    gWasHotSyncRunning = FALSE;
-
-void ConstructMessage(HINSTANCE hInstance, TCHAR *appName, DWORD dwMessageId, TCHAR *formattedMsg)
-{
-  // Load brand name and the format string.
-  TCHAR formatString[MAX_LOADSTRING];
-  LoadString(hInstance, dwMessageId, formatString, MAX_LOADSTRING-1);
-
-  // A few msgs needs two app name substitutions.
-  if ((dwMessageId == IDS_SUCCESS_INSTALL) ||
-      (dwMessageId == IDS_CONFIRM_INSTALL))
-    _sntprintf(formattedMsg, MAX_LOADSTRING-1, formatString, appName, appName);
-  else
-    _sntprintf(formattedMsg, MAX_LOADSTRING-1, formatString, appName);
-
-  formattedMsg[MAX_LOADSTRING-1]='\0';
-}
-
-int APIENTRY WinMain(HINSTANCE hInstance,
-                     HINSTANCE hPrevInstance,
-                     LPSTR     lpCmdLine,
-                     int       nCmdShow)
-{
-  TCHAR appTitle[MAX_LOADSTRING];
-  TCHAR appName[MAX_LOADSTRING] = {0};
-  TCHAR msgStr[MAX_LOADSTRING];
-
-  enum eActionType
-  {
-    eInstall,
-    eSilentInstall,
-    eUninstall,
-    eSilentUninstall
-  };
-
-  int res = -1;
-
-  char* installDir = NULL;
-  eActionType action = eInstall;
-
-  if (__argc > 1)
-  {
-    char* arg;
-    // Skip the first arg
-    for (int i = 1; i < __argc; ++i)
-    {
-      // The calling's app brand name
-      arg = strstr(__argv[i], "/n");
-      if (arg)
-      {
-        // advance pass app name
-        arg += 2;
-
-        // now get the name
-        strncpy(appName, arg, MAX_LOADSTRING - 1);
-
-        // Add a space onto the name so that we get the display right
-        strcat(appName, " ");
-      }
-      else
-      {
-        // /p can only be used with a standard install,
-        // i.e., non-silent install
-        arg = strstr(__argv[i], "/p");
-        if (arg)
-          // move past the /p, default action is install.
-          installDir = arg + 2;
-        else if (!strcmpi(__argv[i], "/u"))
-          action = eUninstall;
-        else if (!strcmpi(__argv[i], "/us"))
-          action = eSilentUninstall;
-        else if (!strcmpi(__argv[i], "/s"))
-          action = eSilentInstall;
-      }
-    }
-  }
-
-  // Free the command line memory
-  LocalFree(__argv);
-
-  switch (action)
-  {
-  case eInstall:
-    ConstructMessage(hInstance, appName, IDS_APP_TITLE_INSTALL, appTitle);
-    ConstructMessage(hInstance, appName, IDS_CONFIRM_INSTALL, msgStr);
-
-    if (MessageBox(NULL, msgStr, appTitle, MB_YESNO | MB_TOPMOST) == IDYES) 
-    {
-      res = InstallConduit(hInstance, installDir, appName);
-      if (!res)
-        res = IDS_SUCCESS_INSTALL;
-    }
-    else
-      return 0;
-    break;
-
-  case eSilentInstall:
-    return InstallConduit(hInstance, installDir, appName);
-
-  case eUninstall:
-    ConstructMessage(hInstance, appName, IDS_APP_TITLE_UNINSTALL, appTitle);
-    ConstructMessage(hInstance, appName, IDS_CONFIRM_UNINSTALL, msgStr);
-
-    if (MessageBox(NULL, msgStr, appTitle, MB_YESNO) == IDYES) 
-    {
-      res = UninstallConduit();
-      if (!res)
-        res = IDS_SUCCESS_UNINSTALL;
-      break;
-    }
-    else
-      return 0;
-
-  case eSilentUninstall:
-    return UninstallConduit();
-  }
-
-  if (res > IDS_ERR_MAX || res < IDS_ERR_GENERAL)
-     res = IDS_ERR_GENERAL;
-
-  ConstructMessage(hInstance, appName, res, msgStr);
-  MessageBox(NULL, msgStr, appTitle, MB_OK);
-
-  return 0;
-}
-
-// this function gets the install dir for installation
-int GetPalmDesktopInstallDirectory(TCHAR *pPDInstallDirectory, unsigned long *pSize)
-{
-    HKEY   key;
-    // open the key
-    LONG rc = ::RegOpenKey(HKEY_CURRENT_USER, "Software\\U.S. Robotics\\Pilot Desktop\\Core", &key);
-    if (rc == ERROR_SUCCESS) {
-        // get key value
-        rc = ::RegQueryValueEx(key, "Path", NULL, NULL, 
-                               (LPBYTE)pPDInstallDirectory, pSize);
-        if (rc == ERROR_SUCCESS) {
-            *pSize = _tcslen(pPDInstallDirectory); // windows only
-            rc=0; // 0 is success for us
-        }
-        // close the key
-        ::RegCloseKey(key);
-    }
-
-    if(rc) {
-        HKEY   key2;
-        // open the key
-        rc = ::RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\palm.exe", &key2);
-        if (rc == ERROR_SUCCESS) {
-            // get the default key value
-            rc = ::RegQueryValueEx(key2, "", NULL, NULL, 
-                                   (LPBYTE)pPDInstallDirectory, pSize);
-            // get only the path (ie, strip out the exe name). note that we don't use string match
-            // for the exe name here since it's possilbe that the exe name in the default setting
-            // is different from the exe name in RegOpenKey() call. For example, the exe name in
-            // the default setting for "Software\\...\\App Paths\\pbrush.exe" is mspaint.exe.
-            if (rc == ERROR_SUCCESS) {
-              TCHAR *end = pPDInstallDirectory + _tcslen(pPDInstallDirectory);
-              while ((*end != '\\') && (end != pPDInstallDirectory))
-                end--;
-              *end = '\0';
-              rc=0; // 0 is success for us
-            }
-            // close the key
-            ::RegCloseKey(key2);
-        }
-    }
-    
-    return rc;
-}
-
-// this function loads the Conduit Manager
-int LoadConduitManagerDll(HINSTANCE* hCondMgrDll, const TCHAR * szPalmDesktopDirectory)
-{
-    // Initialize the return value
-    *hCondMgrDll=NULL;
-    
-    // Construct the path of the Palm Desktop Conduit Manager
-    TCHAR   szPDCondMgrPath[_MAX_PATH];
-    // take care of any possible string overwrites
-    if((strlen(szPalmDesktopDirectory) + strlen(DIRECTORY_SEPARATOR_STR) +  strlen(CONDMGR_FILENAME)) >= _MAX_PATH)
-        return IDS_ERR_LOADING_CONDMGR;
-    strcpy(szPDCondMgrPath, szPalmDesktopDirectory);
-    strcat(szPDCondMgrPath, DIRECTORY_SEPARATOR_STR);
-    strcat(szPDCondMgrPath, CONDMGR_FILENAME);
-    // Load the Conduit Manager library from the Palm Desktop directory
-    if( (*hCondMgrDll=LoadLibrary(szPDCondMgrPath)) != NULL )
-        // Successfully loaded CondMgr Library from Palm Desktop Directory
-    return 0;
-
-    return IDS_ERR_LOADING_CONDMGR;
-}
-
-// this function loads the Hsapi Dll
-int LoadHsapiDll(HINSTANCE* hHsapiDLL, const TCHAR * szPalmDesktopDirectory)
-{
-    // Initialize the return value
-    *hHsapiDLL=NULL;
-    
-    TCHAR   szHsapiPath[_MAX_PATH];
-    // take care of any possible string overwrites
-    if((strlen(szPalmDesktopDirectory) + strlen(DIRECTORY_SEPARATOR_STR) +  strlen(HSAPI_FILENAME)) >= _MAX_PATH)
-        return IDS_ERR_LOADING_CONDMGR;
-    strcpy(szHsapiPath, szPalmDesktopDirectory);
-    strcat(szHsapiPath, DIRECTORY_SEPARATOR_STR);
-    strcat(szHsapiPath, HSAPI_FILENAME);
-    if( (*hHsapiDLL=LoadLibrary(szHsapiPath)) != NULL )
-        // Successfully loaded HSAPI Library from Palm Desktop Directory
-        return 0;
-
-    // If we get here, then there was an error loading the library
-    return IDS_ERR_HSAPI_NOT_FOUND;
-}
-
-// finds if HotSync Manager is running
-BOOL IsHotSyncRunning(HINSTANCE hHsapiDLL)
-{
-    BOOL    bRetVal = FALSE;
-    
-    if(!hHsapiDLL)
-        return bRetVal;
-    
-    // Prepare to use the HSAPI functions
-    HsCheckApiStatusPtr lpfnHsCheckApiStatus;
-    lpfnHsCheckApiStatus = (HsCheckApiStatusPtr) GetProcAddress(hHsapiDLL, "HsCheckApiStatus");
-    
-    if( lpfnHsCheckApiStatus )
-    {
-        if( (*lpfnHsCheckApiStatus)() == 0 )
-            bRetVal = TRUE;
-    }
-    return bRetVal;
-}
-
-// finds if a sync process is going on
-BOOL IsHotSyncInProgress(HINSTANCE hHsapiDLL)
-{
-    DWORD dwStatus;
-    
-    if(!hHsapiDLL)
-        return FALSE;
-    
-    if(IsHotSyncRunning(hHsapiDLL))
-    {
-        // Prepare to use the HSAPI functions
-        HsGetSyncStatusPtr  lpfnHsGetSyncStatus;
-        lpfnHsGetSyncStatus = (HsGetSyncStatusPtr) GetProcAddress(hHsapiDLL, "HsGetSyncStatus");
-    
-        if( lpfnHsGetSyncStatus )
-        {
-            if( (*lpfnHsGetSyncStatus)(&dwStatus) == 0 )
-                if( dwStatus == HOTSYNC_STATUS_IDLE )
-                    return FALSE;
-        }
-    }
-    return TRUE;
-}
-
-// shuts down the HotSync Manager
-void ShutdownHotSync(HINSTANCE hHsapiDLL)
-{
-    if(!hHsapiDLL)
-        return;
-
-    BOOL    bHotSyncRunning=IsHotSyncRunning(hHsapiDLL);
-    
-    if(bHotSyncRunning)
-    {
-        // Prepare to use the HSAPI functions
-        HsSetAppStatusPtr   lpfnHsSetAppStatus;
-        lpfnHsSetAppStatus = (HsSetAppStatusPtr) GetProcAddress(hHsapiDLL, "HsSetAppStatus");
-    
-        if( lpfnHsSetAppStatus )
-            (*lpfnHsSetAppStatus)(HsCloseApp, HSFLAG_NONE);
-        
-        // Wait for HotSync to stop
-        for( int i=0; (i<HOTSYNC_MAX_WAIT*2) && bHotSyncRunning; i++ )
-        {
-            if( (bHotSyncRunning=IsHotSyncRunning(hHsapiDLL)) == TRUE )
-                Sleep(500);
-        }
-    }
-}
-
-// starts HotSync Manager if not runnning
-void StartHotSync(HINSTANCE hHsapiDLL)
-{
-    if(!hHsapiDLL)
-        return;
-
-    BOOL    bHotSyncRunning=IsHotSyncRunning(hHsapiDLL);
-    
-    if(!bHotSyncRunning)
-    {
-        // Prepare to use the HSAPI functions
-        HsSetAppStatusPtr   lpfnHsSetAppStatus;
-        lpfnHsSetAppStatus = (HsSetAppStatusPtr) GetProcAddress(hHsapiDLL, "HsSetAppStatus");
-    
-        if( lpfnHsSetAppStatus )
-            (*lpfnHsSetAppStatus)(HsStartApp, HSFLAG_NONE);
-        
-        // Wait for HotSync to start
-        for( int i=0; (i<HOTSYNC_MAX_WAIT*2) && !bHotSyncRunning; i++ )
-        {
-            if( (bHotSyncRunning=IsHotSyncRunning(hHsapiDLL)) == FALSE )
-                Sleep(500);
-        }
-    }
-}
-
-int RegisterMozPalmSyncDll()
-{
-    HINSTANCE hMozPalmSyncProxyDll = NULL;
-    if( (hMozPalmSyncProxyDll=LoadLibrary(MOZ_PALMSYNC_PROXY)) != NULL ) {
-        mozDllRegisterServerPtr lpfnmozDllRegisterServer;
-        lpfnmozDllRegisterServer = (mozDllRegisterServerPtr) GetProcAddress(hMozPalmSyncProxyDll, "DllRegisterServer");
-        DWORD dwReturnCode = (*lpfnmozDllRegisterServer)();
-        if(dwReturnCode == S_OK)
-            // Successfully registered
-            return 0;
-    }
-
-    return IDS_ERR_REGISTERING_MOZ_DLL;
-}
-
-int UnregisterMozPalmSyncDll()
-{
-    HINSTANCE hMozPalmSyncProxyDll = NULL;
-    if( (hMozPalmSyncProxyDll=LoadLibrary(MOZ_PALMSYNC_PROXY)) != NULL ) {
-        mozDllUnregisterServerPtr lpfnmozDllUnregisterServer;
-        lpfnmozDllUnregisterServer = (mozDllUnregisterServerPtr) GetProcAddress(hMozPalmSyncProxyDll, "DllUnregisterServer");
-        DWORD dwReturnCode = (*lpfnmozDllUnregisterServer)();
-        if(dwReturnCode == S_OK)
-            // Successfully registered
-            return 0;
-    }
-
-    return IDS_ERR_UNREGISTERING_MOZ_DLL;
-}
-
-
-char *mystrsep(char **stringp, char delim)
-{
-  char *endStr = strchr(*stringp, delim);
-  char *retStr;
-  if (endStr)
-  {
-    bool foundDelim = (*endStr == delim);
-    *endStr = '\0';
-    retStr = *stringp;
-    *stringp = endStr + !!foundDelim;
-  }
-  else
-    return NULL;
-  return retStr;
-}
-
-char oldSettingsStr[500];
-static char             gSavedCwd[_MAX_PATH];
-
-// installs our Conduit
-int InstallConduit(HINSTANCE hInstance, TCHAR *installDir, TCHAR *appName)
-{ 
-    int dwReturnCode;
-    BOOL    bHotSyncRunning = FALSE;
-
-    // Prepare the full path of the conduit.
-    // Applications should not place conduits in the Palm Desktop directory.
-    // The Palm Desktop installer only manages the Palm Desktop conduits.
-
-    TCHAR szConduitPath[_MAX_PATH];
-    if (!installDir)
-    {
-      if(!GetModuleFileName(NULL, szConduitPath, _MAX_PATH))
-          return IDS_ERR_CONDUIT_NOT_FOUND;
-
-      // extract the dir path (without the module name)
-      int index = strlen(szConduitPath)-1;
-      while((szConduitPath[index] != DIRECTORY_SEPARATOR) && index)
-          index--;
-      szConduitPath[index] = 0;
-    }
-    else
-      strncpy(szConduitPath, installDir, sizeof(szConduitPath) - 1);
-
-    // take care of any possible string overwrites
-    if((strlen(szConduitPath) + strlen(DIRECTORY_SEPARATOR_STR) + strlen(CONDUIT_FILENAME)) > _MAX_PATH)
-        return IDS_ERR_LOADING_CONDMGR;
-    // might already have conduit filename in szConduitPath if we're
-    // called recursively, also check for .DLL as that is the best option
-    // if we're passed a short patch name with a file in it.
-    if (!strstr(szConduitPath, ".DLL") && !strstr(szConduitPath, CONDUIT_FILENAME))
-    {
-      if (szConduitPath[strlen(szConduitPath) - 1] != DIRECTORY_SEPARATOR)
-        strcat(szConduitPath, DIRECTORY_SEPARATOR_STR);
-      strcat(szConduitPath, CONDUIT_FILENAME);
-    }
-
-    TCHAR shortConduitPath[_MAX_PATH];
-
-    // Try and get the short path name.
-    if (!GetShortPathName(szConduitPath, shortConduitPath, _MAX_PATH))
-      // If failed, so just use the long one
-      strncpy(shortConduitPath, szConduitPath, _MAX_PATH);
-
-    // Make sure the conduit dll exists
-    struct _finddata_t dll_file;
-    long hFile;
-    if( (hFile = _findfirst( shortConduitPath, &dll_file )) == -1L )
-        return IDS_ERR_CONDUIT_NOT_FOUND;
-
-    // now register the Mozilla Palm Sync Support Dll
-    if( (dwReturnCode = RegisterMozPalmSyncDll()) != 0)
-        return dwReturnCode;
-    
-    // Get the Palm Desktop Installation directory
-    TCHAR   szPalmDesktopDir[_MAX_PATH];
-    unsigned long desktopSize=_MAX_PATH;
-    
-    // old conduit settings - MAX_PATH is arbitrarily long...
-    TCHAR szOldCreatorName[_MAX_PATH];
-    TCHAR szOldRemote[_MAX_PATH];
-    TCHAR szOldCreatorTitle[_MAX_PATH];
-    TCHAR szOldCreatorFile[_MAX_PATH];
-    TCHAR szOldCreatorDirectory[_MAX_PATH];
-    DWORD oldPriority;
-    DWORD oldIntegrate;
-    int   oldType;
-
-    // Load the Conduit Manager DLL.
-    HINSTANCE hConduitManagerDLL;
-    if( (dwReturnCode=GetPalmDesktopInstallDirectory(szPalmDesktopDir, &desktopSize)) == 0 ) 
-    {
-        // need to switch current working directory to directory with palm dlls
-        // because of a bug in Palm Desktop 6.01
-
-        GetCurrentDirectory(sizeof(gSavedCwd), gSavedCwd);
-        SetCurrentDirectory(szPalmDesktopDir);
-
-        if( (dwReturnCode = LoadConduitManagerDll(&hConduitManagerDLL, szPalmDesktopDir)) != 0 )
-            return dwReturnCode;
-    }
-    else 
-        return IDS_ERR_CONDUIT_NOT_FOUND;
-    
-    // Prepare to install the conduit using Conduit Manager functions
-    CmInstallCreatorPtr lpfnCmInstallCreator;
-    lpfnCmInstallCreator = (CmInstallCreatorPtr) GetProcAddress(hConduitManagerDLL, "CmInstallCreator");
-    CmSetCreatorRemotePtr   lpfnCmSetCreatorRemote;
-    lpfnCmSetCreatorRemote = (CmSetCreatorRemotePtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorRemote");
-    CmSetCreatorNamePtr lpfnCmSetCreatorName;
-    lpfnCmSetCreatorName = (CmSetCreatorNamePtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorName");
-    CmSetCreatorTitlePtr lpfnCmSetCreatorTitle;
-    lpfnCmSetCreatorTitle = (CmSetCreatorTitlePtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorTitle");
-    CmSetCreatorPriorityPtr lpfnCmSetCreatorPriority;
-    lpfnCmSetCreatorPriority = (CmSetCreatorPriorityPtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorPriority");
-    CmSetCreatorIntegratePtr    lpfnCmSetCreatorIntegrate;
-    lpfnCmSetCreatorIntegrate = (CmSetCreatorIntegratePtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorIntegrate");
-    CmRemoveConduitByCreatorIDPtr   lpfnCmRemoveConduitByCreatorID;
-    lpfnCmRemoveConduitByCreatorID = (CmRemoveConduitByCreatorIDPtr) GetProcAddress(hConduitManagerDLL, "CmRemoveConduitByCreatorID");
-    CmSetCreatorValueStringPtr lpfnCmSetCreatorValueString = (CmSetCreatorValueStringPtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorValueString");
-
-    CmGetCreatorRemotePtr   lpfnCmGetCreatorRemote;
-    lpfnCmGetCreatorRemote = (CmGetCreatorRemotePtr) GetProcAddress(hConduitManagerDLL, "CmGetCreatorRemote");
-    CmGetCreatorNamePtr lpfnCmGetCreatorName;
-    lpfnCmGetCreatorName = (CmGetCreatorNamePtr) GetProcAddress(hConduitManagerDLL, "CmGetCreatorName");
-    CmGetCreatorTitlePtr lpfnCmGetCreatorTitle;
-    lpfnCmGetCreatorTitle = (CmGetCreatorTitlePtr) GetProcAddress(hConduitManagerDLL, "CmGetCreatorTitle");
-    CmGetCreatorPriorityPtr lpfnCmGetCreatorPriority;
-    lpfnCmGetCreatorPriority = (CmGetCreatorPriorityPtr) GetProcAddress(hConduitManagerDLL, "CmGetCreatorPriority");
-    CmGetCreatorIntegratePtr    lpfnCmGetCreatorIntegrate;
-    lpfnCmGetCreatorIntegrate = (CmGetCreatorIntegratePtr) GetProcAddress(hConduitManagerDLL, "CmGetCreatorIntegrate");
-    CmGetCreatorTypePtr lpfnCmGetCreatorType = (CmGetCreatorTypePtr) GetProcAddress(hConduitManagerDLL, "CmGetCreatorType");
-    CmGetCreatorFilePtr lpfnCmGetCreatorFile = (CmGetCreatorFilePtr) GetProcAddress(hConduitManagerDLL, "CmGetCreatorFile");
-    CmGetCreatorDirectoryPtr lpfnCmGetCreatorDirectory = (CmGetCreatorDirectoryPtr) GetProcAddress(hConduitManagerDLL, "CmGetCreatorDirectory");
-    if( (lpfnCmInstallCreator == NULL) 
-        || (lpfnCmSetCreatorRemote == NULL)
-        || (lpfnCmSetCreatorName == NULL)
-        || (lpfnCmSetCreatorTitle == NULL)
-        || (lpfnCmSetCreatorPriority == NULL)
-        || (lpfnCmSetCreatorIntegrate == NULL)
-        )
-    {
-        // Return error code.
-        return(IDS_ERR_LOADING_CONDMGR);
-    }
- 
-    szOldCreatorTitle[0] = '\0';
-    szOldCreatorName[0] = '\0';
-    szOldRemote[0] = '\0';
-    szOldCreatorTitle[0] = '\0';
-    szOldCreatorFile[0] = '\0';
-    szOldCreatorDirectory[0] = '\0';
-    // get settings for old conduit
-    int remoteBufSize = sizeof(szOldRemote);
-    (*lpfnCmGetCreatorRemote) (CREATOR, szOldRemote, &remoteBufSize);
-    int creatorBufSize = sizeof(szOldCreatorName);
-    (*lpfnCmGetCreatorName)(CREATOR, szOldCreatorName, &creatorBufSize);
-    int creatorTitleBufSize = sizeof(szOldCreatorTitle);
-    (*lpfnCmGetCreatorTitle)(CREATOR, szOldCreatorTitle, &creatorTitleBufSize);
-    int creatorFileBufSize = sizeof(szOldCreatorFile);
-    int creatorDirectoryBufSize = sizeof(szOldCreatorDirectory);
-    (*lpfnCmGetCreatorFile)(CREATOR, szOldCreatorFile, &creatorFileBufSize);
-    (*lpfnCmGetCreatorDirectory)(CREATOR, szOldCreatorDirectory, &creatorDirectoryBufSize);
-    (*lpfnCmGetCreatorPriority)(CREATOR, &oldPriority);
-    (*lpfnCmGetCreatorIntegrate)(CREATOR, &oldIntegrate);
-    oldType = (*lpfnCmGetCreatorType) (CREATOR);
-
-    // if not set by previous pass through here
-    if (!oldSettingsStr[0])
-      _snprintf(oldSettingsStr, sizeof(oldSettingsStr), "%s,%s,%s,%s,%s,%d,%d,%d", szOldRemote, szOldCreatorName, 
-        szOldCreatorTitle, szOldCreatorFile, szOldCreatorDirectory, oldType, oldPriority, oldIntegrate);
-
-    // Load the HSAPI DLL.
-    HINSTANCE hHsapiDLL;
-    if( (dwReturnCode = LoadHsapiDll(&hHsapiDLL, szPalmDesktopDir)) != 0 )
-        return dwReturnCode;
-        
-    // Shutdown the HotSync Process if it is running
-    if( (bHotSyncRunning=IsHotSyncRunning(hHsapiDLL)) )
-    {
-        // Check for any synchronizations in progress
-        if( IsHotSyncInProgress(hHsapiDLL) )
-            return IDS_ERR_HOTSYNC_IN_PROGRESS;
-            
-        ShutdownHotSync(hHsapiDLL);
-        // store the flag in temp global so that in the recursive call it is restarted
-        gWasHotSyncRunning = TRUE;
-    }
-    
-    // Actually install the conduit as an Application Conduit
-    dwReturnCode = (*lpfnCmInstallCreator)(CREATOR, CONDUIT_APPLICATION);
-    if(dwReturnCode == ERR_CREATORID_ALREADY_IN_USE) {
-        dwReturnCode = (*lpfnCmRemoveConduitByCreatorID)(CREATOR);
-        if(dwReturnCode >= 0 ) {
-            //free the library so that the existing AB Conduit is unloaded properly
-            FreeLibrary(hConduitManagerDLL);
-            FreeLibrary(hHsapiDLL);
-            return InstallConduit(hInstance, shortConduitPath, appName);
-        }
-    }
-    if( dwReturnCode == 0 )
-    {
-        (*lpfnCmSetCreatorValueString) (CREATOR, "oldConduitSettings", oldSettingsStr);
-        dwReturnCode = (*lpfnCmSetCreatorName)(CREATOR, shortConduitPath);
-        if( dwReturnCode != 0 ) return dwReturnCode;
-        TCHAR title[MAX_LOADSTRING];
-        // Construct conduit title (the one displayed in HotSync Mgr's Custom...list)..
-        ConstructMessage(hInstance, appName, IDS_CONDUIT_TITLE, title);
-        dwReturnCode = (*lpfnCmSetCreatorTitle)(CREATOR, title);
-        if( dwReturnCode != 0 ) return dwReturnCode;
-        dwReturnCode = (*lpfnCmSetCreatorRemote)(CREATOR, REMOTE_DB);
-        if( dwReturnCode != 0 ) return dwReturnCode;
-        dwReturnCode = (*lpfnCmSetCreatorPriority)(CREATOR, CONDUIT_PRIORITY);
-        if( dwReturnCode != 0 ) return dwReturnCode;
-        // Applications should always set Integrate to 0
-        dwReturnCode = (*lpfnCmSetCreatorIntegrate)(CREATOR, (DWORD)0);
-        (*lpfnCmSetCreatorValueString) (CREATOR, "oldConduitSettings", oldSettingsStr);
-    }
-    
-    // Re-start HotSync if it was running before
-    if( gWasHotSyncRunning )
-        StartHotSync(hHsapiDLL);
-
-    // restore cwd, if we changed it.        
-    if (gSavedCwd[0])
-      SetCurrentDirectory(gSavedCwd);
-
-    return(dwReturnCode);
-}
-
-// uninstalls our conduit
-int UninstallConduit()
-{ 
-    int dwReturnCode;
-    BOOL    bHotSyncRunning = FALSE;
-
-    // Get the Palm Desktop Installation directory
-    TCHAR   szPalmDesktopDir[_MAX_PATH];
-    unsigned long desktopSize=_MAX_PATH;
-    // Load the Conduit Manager DLL.
-    HINSTANCE hConduitManagerDLL;
-    if( (dwReturnCode=GetPalmDesktopInstallDirectory(szPalmDesktopDir, &desktopSize)) == 0 )
-    {
-        if( (dwReturnCode = LoadConduitManagerDll(&hConduitManagerDLL, szPalmDesktopDir)) != 0 )
-                return(dwReturnCode);
-    }
-    // if registery key not load it from local dir if present by any chance
-    else 
-          return(dwReturnCode);
-    
-    // need to switch current working directory to directory with palm dlls
-    // because of a bug in Palm Desktop 6.01
-
-    GetCurrentDirectory(sizeof(gSavedCwd), gSavedCwd);
-    SetCurrentDirectory(szPalmDesktopDir);
-
-    // Prepare to uninstall the conduit using Conduit Manager functions
-    CmRemoveConduitByCreatorIDPtr   lpfnCmRemoveConduitByCreatorID;
-    lpfnCmRemoveConduitByCreatorID = (CmRemoveConduitByCreatorIDPtr) GetProcAddress(hConduitManagerDLL, "CmRemoveConduitByCreatorID");
-    if( (lpfnCmRemoveConduitByCreatorID == NULL) )
-        return(IDS_ERR_LOADING_CONDMGR);
-        CmSetCorePathPtr lpfnCmSetCorePath = (CmSetCorePathPtr) GetProcAddress(hConduitManagerDLL, "CmSetCorePath");
-    CmSetHotSyncExePathPtr lpfnCmSetHotSyncExePath = (CmSetHotSyncExePathPtr) GetProcAddress(hConduitManagerDLL, "CmSetHotSyncExecPath");
-    CmRestoreHotSyncSettingsPtr lpfnCmRestoreHotSyncSettings;
-    lpfnCmRestoreHotSyncSettings = (CmRestoreHotSyncSettingsPtr) GetProcAddress(hConduitManagerDLL, "CmRestoreHotSyncSettings");
-    CmGetCreatorValueStringPtr lpfnCmGetCreatorValueString = (CmGetCreatorValueStringPtr) GetProcAddress(hConduitManagerDLL, "CmGetCreatorValueString");
-    CmInstallCreatorPtr lpfnCmInstallCreator;
-    lpfnCmInstallCreator = (CmInstallCreatorPtr) GetProcAddress(hConduitManagerDLL, "CmInstallCreator");
-    CmSetCreatorRemotePtr   lpfnCmSetCreatorRemote;
-    lpfnCmSetCreatorRemote = (CmSetCreatorRemotePtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorRemote");
-    CmSetCreatorNamePtr lpfnCmSetCreatorName;
-    lpfnCmSetCreatorName = (CmSetCreatorNamePtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorName");
-    CmSetCreatorTitlePtr lpfnCmSetCreatorTitle;
-    lpfnCmSetCreatorTitle = (CmSetCreatorTitlePtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorTitle");
-    CmSetCreatorPriorityPtr lpfnCmSetCreatorPriority;
-    lpfnCmSetCreatorPriority = (CmSetCreatorPriorityPtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorPriority");
-    CmSetCreatorIntegratePtr    lpfnCmSetCreatorIntegrate;
-    lpfnCmSetCreatorIntegrate = (CmSetCreatorIntegratePtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorIntegrate");
-    CmSetCreatorFilePtr lpfnCmSetCreatorFile = (CmSetCreatorFilePtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorFile");
-    CmSetCreatorDirectoryPtr lpfnCmSetCreatorDirectory = (CmSetCreatorDirectoryPtr) GetProcAddress(hConduitManagerDLL, "CmSetCreatorDirectory");
-    if( (lpfnCmRestoreHotSyncSettings == NULL) )
-        return(IDS_ERR_LOADING_CONDMGR);
-    
-    // Load the HSAPI DLL.
-    HINSTANCE hHsapiDLL;
-    if( (dwReturnCode = LoadHsapiDll(&hHsapiDLL, szPalmDesktopDir)) != 0 )
-          return(dwReturnCode);
-        
-    // Shutdown the HotSync Process if it is running
-    if( (bHotSyncRunning=IsHotSyncRunning(hHsapiDLL)) )
-    {
-        // Check for any synchronizations in progress
-        if( IsHotSyncInProgress(hHsapiDLL) )
-            return IDS_ERR_HOTSYNC_IN_PROGRESS;
-            
-        ShutdownHotSync(hHsapiDLL);
-    }
-    
-    TCHAR oldConduitSettings[500];
-    int strSize = sizeof(oldConduitSettings);
-    dwReturnCode = (*lpfnCmGetCreatorValueString)(CREATOR, "oldConduitSettings", oldConduitSettings, &strSize, "");
-
-    // Actually uninstall the conduit
-    dwReturnCode = (*lpfnCmRemoveConduitByCreatorID)(CREATOR);
-
-    if(dwReturnCode >= 0) 
-    {
-        // uninstall Mozilla Palm Sync Support Proxy Dll
-        dwReturnCode = UnregisterMozPalmSyncDll();
-//        dwReturnCode = (*lpfnCmRestoreHotSyncSettings)(TRUE);
-    }
-
-    if (dwReturnCode >= 0)
-    {
-      char * szOldCreatorName;
-      char *szOldRemote;
-      char *szOldCreatorTitle;
-      char *szOldCreatorFile;
-      char *szOldCreatorDirectory;
-      char *oldIntStr;
-      DWORD oldPriority;
-      DWORD oldIntegrate;
-      int   oldType;
-
-      char *strPtr = oldConduitSettings;
-      szOldRemote = mystrsep(&strPtr, ',');
-      szOldCreatorName = mystrsep(&strPtr, ',');
-      szOldCreatorTitle = mystrsep(&strPtr, ',');
-      szOldCreatorFile = mystrsep(&strPtr, ',');
-      szOldCreatorDirectory = mystrsep(&strPtr, ',');
-      oldIntStr = mystrsep(&strPtr, ',');
-      oldType = (oldIntStr) ? atoi(oldIntStr) : 0;
-      oldIntStr = mystrsep(&strPtr, ',');
-      oldPriority = (oldIntStr) ? atoi(oldIntStr) : 0;
-      oldIntStr = mystrsep(&strPtr, ',');
-      oldIntegrate = (oldIntStr) ? atoi(oldIntStr) : 0;
-
-      dwReturnCode = (*lpfnCmInstallCreator)(CREATOR, oldType);
-      if( dwReturnCode == 0 )
-      {
-          dwReturnCode = (*lpfnCmSetCreatorName)(CREATOR, szOldCreatorName);
-          if( dwReturnCode != 0 ) return dwReturnCode;
-          // Construct conduit title (the one displayed in HotSync Mgr's Custom...list)..
-          dwReturnCode = (*lpfnCmSetCreatorTitle)(CREATOR, szOldCreatorTitle);
-          if( dwReturnCode != 0 ) return dwReturnCode;
-          dwReturnCode = (*lpfnCmSetCreatorRemote)(CREATOR, szOldRemote);
-          if( dwReturnCode != 0 ) return dwReturnCode;
-          dwReturnCode = (*lpfnCmSetCreatorFile)(CREATOR, szOldCreatorFile);
-          if( dwReturnCode != 0 ) return dwReturnCode;
-          dwReturnCode = (*lpfnCmSetCreatorDirectory)(CREATOR, szOldCreatorDirectory);
-          if( dwReturnCode != 0 ) return dwReturnCode;
-          dwReturnCode = (*lpfnCmSetCreatorPriority)(CREATOR, oldPriority);
-          if( dwReturnCode != 0 ) return dwReturnCode;
-          // Applications should always set Integrate to 0
-          dwReturnCode = (*lpfnCmSetCreatorIntegrate)(CREATOR, oldIntegrate);
-      }
-    }
-
-//    if (lpfnCmSetCorePath)
-//      (*lpfnCmSetCorePath)(szPalmDesktopDir);
-//    if (lpfnCmSetHotSyncExePath)
-//      (*lpfnCmSetHotSyncExePath)(szPalmHotSyncInstallDir);
-    
-    // this registry key is set by the RestoreHotSyncSettings to point incorrectly to Mozilla dir
-    // this should point to the Palm directory to enable sync with Palm Desktop.
-#if 0
-    HKEY key;
-    LONG rc = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\U.S. Robotics\\Pilot Desktop\\Core",
-                                0, KEY_ALL_ACCESS, &key);
-    if(rc == ERROR_SUCCESS)
-        ::RegSetValueEx(key, "Path", 0, REG_SZ, (const BYTE *) szPalmDesktopDir, desktopSize);
- 
-    if(rc == ERROR_SUCCESS)
-        ::RegSetValueEx(key, "HotSyncPath", 0, REG_SZ, (const BYTE *) szPalmHotSyncInstallDir, installSize);
-#endif
-    // Re-start HotSync if it was running before
-    if( bHotSyncRunning )
-        StartHotSync(hHsapiDLL);
-        
-    // restore cwd, if we changed it.        
-    if (gSavedCwd[0])
-      SetCurrentDirectory(gSavedCwd);
-
-    if( dwReturnCode < 0 ) 
-        return dwReturnCode;
-    else 
-        return(0);
-}
-
deleted file mode 100644
--- a/mailnews/extensions/palmsync/installer/PalmSyncInstall.rc
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-#define APSTUDIO_HIDDEN_SYMBOLS
-#include "windows.h"
-#undef APSTUDIO_HIDDEN_SYMBOLS
-#include "resource.h"
-//
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-1                       ICON    DISCARDABLE     "install.ico"
-2                       ICON    DISCARDABLE     "uninstall.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-// Note these strings don't have a space after %s because the code adds that for us
-// (just in case we've not got a name to dispaly).
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_APP_TITLE_INSTALL   "%sAddress Book Palm Sync Install"
-    IDS_APP_TITLE_UNINSTALL "%sAddress Book Palm Sync Uninstall"
-    IDS_CONDUIT_TITLE       "%sAddress Book"
-    IDC_PALMSYNCINSTALL     "PALMSYNCINSTALL"
-    IDS_ERR_GENERAL         "Error in (un)installing the %sAddress Book Palm Sync Conduit"
-    IDS_ERR_LOADING_CONDMGR "Error in loading the Conduit Manager while (un)installing the %sAddress Book Palm Sync Conduit"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_ERR_HSAPI_NOT_FOUND "Could not find the HSAPI.dll while (un)installing the %sAddress Book Palm Sync Conduit"
-    IDS_ERR_CONDUIT_NOT_FOUND 
-                            "Could not find the %sAddress Book Palm Sync Conduit to install"
-    IDS_ERR_HOTSYNC_IN_PROGRESS 
-                            "A Palm HotSync operation is in progress, let it complete first then install the %sAddress Book Palm Sync Conduit"
-    IDS_ERR_FINDING_INSTALL_DIR 
-                            "Could not find the directory to install the %sAddress Book Palm Sync Conduit."
-    IDS_SUCCESS_INSTALL     "%sAddress Book Palm Sync was successfully installed. Using your Palm device, perform a HotSync operation to synchronize your Palm device's address book with your %saddress book."
-    IDS_SUCCESS_UNINSTALL   "%sAddress Book Palm Sync was successfully uninstalled. Palm Desktop synchronization with your Palm device is now restored."
-    IDS_CONFIRM_INSTALL     "You are about to add the %sAddress Book conduit to your Palm Hot Sync installation, which may remove the Palm Desktop conduit.  Do you want to continue?"
-    IDS_CONFIRM_UNINSTALL   "You are about to uninstall %sAddress Book Palm Sync. This will restore Palm Desktop synchronization. Do you want to continue?"
-    IDS_ERR_REGISTERING_MOZ_DLL 
-                            "Failed to register the Palm Sync Support Proxy Dll while installing the %sAddress Book Palm Sync Conduit."
-END
-
-#endif    // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
deleted file mode 100644
index f8acc71c2506733106ec3a9f48c16fbb7e52b064..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/mailnews/extensions/palmsync/installer/resource.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#define IDS_APP_TITLE_INSTALL           103
-#define IDS_APP_TITLE_UNINSTALL         104
-#define IDS_CONDUIT_TITLE               105
-#define IDI_PALMSYNCINSTALL             107
-#define IDI_SMALL                       108
-#define IDC_PALMSYNCINSTALL             109
-
-// all error messages should be between the range of 110 and 140
-#define IDS_ERR_GENERAL                 110
-#define IDS_ERR_LOADING_CONDMGR         111
-#define IDS_ERR_HSAPI_NOT_FOUND         112
-#define IDS_ERR_CONDUIT_NOT_FOUND       113
-#define IDS_ERR_HOTSYNC_IN_PROGRESS     114
-#define IDS_ERR_FINDING_INSTALL_DIR     115
-#define IDS_SUCCESS_INSTALL             116
-#define IDS_CONFIRM_INSTALL             117
-#define IDS_CONFIRM_UNINSTALL           118
-#define IDS_SUCCESS_UNINSTALL           119
-#define IDS_ERR_REGISTERING_MOZ_DLL     120
-#define IDS_ERR_UNREGISTERING_MOZ_DLL   121
-#define IDS_ERR_MAX			140
-
deleted file mode 100644
index e285f82c10038af3ed023278c9451d39d129f513..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/mailnews/extensions/palmsync/palmsync.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
-   Default pref values for the PalmSync Extension
-*/
-
-// global pref used to keep track of whether we have run PalmSyncInstall.exe 
-// for the current installation of the extension.
-pref("extensions.palmsync.conduitRegistered", false);
deleted file mode 100644
--- a/mailnews/extensions/palmsync/public/Makefile.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla 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/MPL/
-#
-# 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 the Initial Developer are Copyright (C) 2002
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= palmsync
-XPIDL_MODULE	= palmsync
-XPI_NAME	= palmsync
-
-XPIDLSRCS	= \
-		nsIPalmSyncSupport.idl \
-		$(NULL)
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/mailnews/extensions/palmsync/public/nsIPalmSyncSupport.idl
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *           Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsISupports.idl"
-
-/**
- * This interface provides support for registering Mozilla as a COM component
- * for enabling Palm-Mozilla Address Book (and also other when implemented) Synchronization
- * 
- */
-
-[noscript, uuid(0071C291-CE82-11d6-B8A6-00B0D06E5F27)]
-
-interface nsIPalmSyncSupport : nsISupports {
-
-   /** Initiates PalmSync support
-    */
-   void initializePalmSyncSupport();
-
-   /** Register the PalmSync COM interface for IPC
-     * This is called only once from the installer
-     */
-   void registerPalmSync();
-
-   /** Unregister the PalmSync COM interface for IPC
-     * This is called only once from the installer
-     */
-   void unRegisterPalmSync();
-
-   /**  Shuts down the PalmSync support
-    */
-   void shutdownPalmSyncSupport();
-};
-
-%{C++
-#define NS_IPALMSYNCSUPPORT_CONTRACTID    "@mozilla.org/palmsyncsupport;1"
-#define NS_IPALMSYNCSUPPORT_CLASSNAME     "Mozilla PalmSync Support"
-%}
-
-
deleted file mode 100644
--- a/mailnews/extensions/palmsync/src/Makefile.in
+++ /dev/null
@@ -1,125 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla 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/MPL/
-#
-# 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 the Initial Developer are Copyright (C) 2002
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH       = ../../../..
-topsrcdir   = @top_srcdir@
-srcdir      = @srcdir@
-VPATH       = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE			= palmsync
-LIBRARY_NAME		= $(MODULE)
-# Do not set EXPORT_LIBRARY as we do not want palmsync in the static libs list
-IS_COMPONENT		= 1
-FORCE_SHARED_LIB	= 1
-ifndef MOZ_INCOMPLETE_EXTERNAL_LINKAGE
-MOZILLA_INTERNAL_API	= 1
-endif
-XPI_NAME		= palmsync
-
-REQUIRES = \
-	xpcom \
-	PalmSyncProxy \
-	embedcomponents \
-	pref \
-	string \
-	rdf \
-	rdfutil \
-	mork \
-	unicharutil \
-	MapiProxy \
-	locale \
-	msgbase \
-	msgbaseutil \
-	necko \
-	addrbook \
-	xulapp \
-	extensions \
-	$(NULL)
-
-CPPSRCS = \
-        nsPalmSyncSupport.cpp \
-        PalmSyncFactory.cpp \
-        PalmSyncImp.cpp \
-        Registry.cpp \
-        nsAbIPCCard.cpp \
-        nsAbPalmSync.cpp \
-        $(NULL)
-
-EXPORTS = \
-        nsAbIPCCard.h \
-        nsAbPalmSync.h \
-        $(NULL)
-
-LOBJS = ../build/IPalmSync_i.$(OBJ_SUFFIX)
-
-ifndef MOZ_STATIC_MAIL_BUILD
-ifeq ($(USE_SHORT_LIBNAME),1)
-EXTRA_DSO_LIBS  = msgbsutl
-else
-EXTRA_DSO_LIBS  = msgbaseutil
-endif
-
-else
-SHARED_LIBRARY_LIBS = ../../../base/util/$(LIB_PREFIX)msgbsutl_s.$(LIB_SUFFIX)
-endif
-
-ifdef MOZILLA_INTERNAL_API
-EXTRA_DSO_LDOPTS= \
-        ../../../addrbook/src/$(LIB_PREFIX)addrbook_s.$(LIB_SUFFIX) \
-        $(EXTRA_DSO_LIBS) \
-        $(XPCOM_LIBS) \
-        $(MOZ_UNICHARUTIL_LIBS) \
-        $(NSPR_LIBS) \
-        $(NULL)
-else
-EXTRA_DSO_LDOPTS= \
-        ../../../addrbook/src/$(LIB_PREFIX)addrbook_s.$(LIB_SUFFIX) \
-	$(LIBS_DIR) \
-	$(EXTRA_DSO_LIBS) \
-	$(XPCOM_GLUE_LDOPTS) \
-	$(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib) \
-	$(NSPR_LIBS) \
-	$(NULL)
-endif
-
-OS_LIBS     += ole32.lib shell32.lib
-
-include $(topsrcdir)/config/rules.mk
-
-DEFINES += -DUNICODE -D_UNICODE
deleted file mode 100644
--- a/mailnews/extensions/palmsync/src/PalmSyncFactory.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corp.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributors:
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-// #undef UNICODE
-// #undef _UNICODE
-
-#include "PalmSyncImp.h"
-#include "PalmSyncFactory.h"
-
-CPalmSyncFactory ::CPalmSyncFactory()
-: m_cRef(1)
-{
-}
-
-CPalmSyncFactory::~CPalmSyncFactory()
-{
-}
-
-STDMETHODIMP CPalmSyncFactory::QueryInterface(const IID& aIid, void** aPpv)
-{    
-    if ((aIid == IID_IUnknown) || (aIid == IID_IClassFactory))
-    {
-        *aPpv = static_cast<IClassFactory*>(this); 
-    }
-    else
-    {
-        *aPpv = NULL;
-        return E_NOINTERFACE;
-    }
-    reinterpret_cast<IUnknown*>(*aPpv)->AddRef();
-    return S_OK;
-}
-
-STDMETHODIMP_(ULONG) CPalmSyncFactory::AddRef()
-{
-    return (PR_AtomicIncrement(&m_cRef));
-}
-
-STDMETHODIMP_(ULONG) CPalmSyncFactory::Release() 
-{
-    PRInt32 temp;
-    temp = PR_AtomicDecrement(&m_cRef);
-    if (m_cRef == 0)
-    {
-        delete this;
-        return 0;
-    }
-
-    return temp;
-}
-
-STDMETHODIMP CPalmSyncFactory::CreateInstance(IUnknown* aUnknownOuter,
-                                           const IID& aIid,
-                                           void** aPpv) 
-{
-    // Cannot aggregate.
-
-    if (aUnknownOuter != NULL)
-    {
-        return CLASS_E_NOAGGREGATION ;
-    }
-
-    // Create component.
-
-    CPalmSyncImp* pImp = new CPalmSyncImp();
-    if (pImp == NULL)
-    {
-        return E_OUTOFMEMORY ;
-    }
-
-    // Get the requested interface.
-    HRESULT hr = pImp->QueryInterface(aIid, aPpv);
-
-    // Release the IUnknown pointer.
-    // (If QueryInterface failed, component will delete itself.)
-
-    pImp->Release();
-    return hr;
-}
-
-STDMETHODIMP CPalmSyncFactory::LockServer(PRBool aLock) 
-{
-    return S_OK ;
-}
deleted file mode 100644
--- a/mailnews/extensions/palmsync/src/PalmSyncFactory.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corp.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributors:
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef MSG_PALMSYNC_FACTORY_H
-#define MSG_PALMSYNC_FACTORY_H
-
-#include <windows.h>
-#include <objbase.h>
-#include "nspr.h"
-
-
-class CPalmSyncFactory : public IClassFactory
-{
-public :
-
-    // IUnknown
-
-    STDMETHODIMP            QueryInterface (REFIID aIid, void** aPpv);
-    STDMETHODIMP_(ULONG)    AddRef(void);
-    STDMETHODIMP_(ULONG)    Release(void);
-
-    // IClassFactory
-
-    STDMETHODIMP        CreateInstance (LPUNKNOWN aUnkOuter, REFIID aIid, void **aPpv);
-    STDMETHODIMP        LockServer (BOOL aLock);
-
-    CPalmSyncFactory ();
-    ~CPalmSyncFactory ();
-
-private :
-
-    PRInt32 m_cRef;
-};
-
-#endif  // MSG_PALMSYNC_FACTORY_H
-
deleted file mode 100644
--- a/mailnews/extensions/palmsync/src/PalmSyncImp.cpp
+++ /dev/null
@@ -1,515 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corp.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *                 Rajiv Dayal (rdayal@netscape.com)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifdef MOZ_LOGGING
-// sorry, this has to be before the pre-compiled header
-#define FORCE_PR_LOG /* Allow logging in the release build */
-#endif
-
-#include "nsString.h"
-#include "nsCOMPtr.h"
-#include "nsISupports.h"
-
-#include "IPalmSync.h"
-#include "PalmSyncImp.h"
-#include "PalmSyncFactory.h"
-
-#include "nsAbPalmSync.h"
-#include "nsMsgI18N.h"
-#include "nsUnicharUtils.h"
-#include "nsRDFResource.h"
-#include "nsAbBaseCID.h"
-#include "nsIAbManager.h"
-#include "nsIAbDirectory.h"
-
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
-
-#include "nspr.h"
-PRLogModuleInfo *PALMSYNC;
-
-#define kPABDirectory  2  // defined in nsDirPrefs.h
-#define kMAPIDirectory 3
-
-CPalmSyncImp::CPalmSyncImp()
-: m_cRef(1),
-  m_PalmHotSync(nsnull)
-{
-  if (!PALMSYNC)
-    PALMSYNC = PR_NewLogModule("PALMSYNC");
-
-
-}
-
-CPalmSyncImp::~CPalmSyncImp() 
-{ 
-
-}
-
-STDMETHODIMP CPalmSyncImp::QueryInterface(const IID& aIid, void** aPpv)
-{    
-    if (aIid == IID_IUnknown)
-    {
-        *aPpv = static_cast<IPalmSync*>(this); 
-    }
-    else if (aIid == IID_IPalmSync)
-    {
-        *aPpv = static_cast<IPalmSync*>(this);
-    }
-    else
-    {
-        *aPpv = nsnull;
-        return E_NOINTERFACE;
-    }
-
-    reinterpret_cast<IUnknown*>(*aPpv)->AddRef();
-    return S_OK;
-}
-
-STDMETHODIMP_(ULONG) CPalmSyncImp::AddRef()
-{
-    return PR_AtomicIncrement(&m_cRef);
-}
-
-STDMETHODIMP_(ULONG) CPalmSyncImp::Release() 
-{
-    PRInt32 temp;
-    temp = PR_AtomicDecrement(&m_cRef);
-    if (m_cRef == 0)
-    {
-        delete this;
-        return 0;
-    }
-
-    return temp;
-}
-
-STDMETHODIMP CPalmSyncImp::IsValid()
-{
-    return S_OK;
-}
-
-// Get the list of Address Books for the currently logged in user profile
-STDMETHODIMP CPalmSyncImp::nsGetABList(BOOL aIsUnicode, short * aABListCount,
-                        lpnsMozABDesc * aABList, long ** aABCatIndexList, BOOL ** aDirFlagsList)
-{
-  if (!aABListCount || !aABList || !aABCatIndexList ||!aDirFlagsList)
-        return E_FAIL;
-  *aABListCount = 0;
-
-  nsresult rv;
-  nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID, &rv));
-  if (NS_FAILED(rv))
-    return E_FAIL;
-
-  nsCOMPtr<nsISimpleEnumerator> subDirectories;
-  if (NS_SUCCEEDED(abManager->GetDirectories(getter_AddRefs(subDirectories))) &&
-      subDirectories)
-  {
-    // Get the total number of addrbook.
-    PRInt16 count=0;
-    nsCOMPtr<nsISupports> item;
-    PRBool hasMore;
-    while (NS_SUCCEEDED(rv = subDirectories->HasMoreElements(&hasMore)) && hasMore)
-    {
-        if (NS_SUCCEEDED(subDirectories->GetNext(getter_AddRefs(item))))
-        {
-          nsCOMPtr<nsIAbDirectory> directory(do_QueryInterface(item, &rv));
-          if (NS_SUCCEEDED(rv))
-          {
-              nsCAutoString fileName;
-              rv = directory->GetFileName(fileName);
-              if(NS_FAILED(rv)) 
-                continue;
-              PRInt32 dirType;
-              rv = directory->GetDirType(&dirType);
-              if(NS_FAILED(rv)) 
-                continue;
-
-              PRBool disableThisAB;
-              rv = directory->GetBoolValue("disablePalmSync",
-                                           PR_FALSE, &disableThisAB);
-              if (NS_FAILED(rv))
-                continue;
-
-              // Skip/Ignore 4.X addrbooks (ie, with ".na2" extension), and non personal AB's
-              if (disableThisAB || ((fileName.Length() > kABFileName_PreviousSuffixLen) && 
-                   strcmp(fileName.get() + fileName.Length() - kABFileName_PreviousSuffixLen, kABFileName_PreviousSuffix) == 0) ||
-                    (dirType != kPABDirectory && dirType != kMAPIDirectory))
-                    continue;
-          }
-        }
-        count++;
-    }
-
-    if (!count)
-      return E_FAIL;  // should not happen but just in case.
-
-    lpnsMozABDesc serverDescList = (lpnsMozABDesc) CoTaskMemAlloc(sizeof(nsMozABDesc) * count);
-    BOOL *dirFlagsList = (BOOL *) CoTaskMemAlloc(sizeof(BOOL) * count);
-    long *catIndexList = (long *) CoTaskMemAlloc(sizeof(long) * count);
-
-    *aABListCount = count;
-    *aABList = serverDescList;
-    *aDirFlagsList = dirFlagsList;
-    *aABCatIndexList = catIndexList;
-
-    // reset enumerator
-    if (NS_FAILED(abManager->GetDirectories(getter_AddRefs(subDirectories))))
-      return E_FAIL;
-
-    // For each valid addrbook collect info.
-    while (NS_SUCCEEDED(rv = subDirectories->HasMoreElements(&hasMore)) && hasMore)
-    {
-      if (NS_SUCCEEDED(subDirectories->GetNext(getter_AddRefs(item))))
-      {
-        nsCOMPtr<nsIAbDirectory> directory(do_QueryInterface(item, &rv));
-        if (NS_SUCCEEDED(rv))
-        {
-          // We don't have to skip mailing list since there's no mailing lists at the top level.
-          nsCAutoString fileName;
-          nsCAutoString uri;
-          nsString description;
-          PRUint32 palmSyncTimeStamp;
-          PRInt32 dirType, palmCategoryIndex;
-
-          rv = directory->GetDescription(description);
-          if(NS_FAILED(rv)) return E_FAIL;
-          rv = directory->GetFileName(fileName);
-          if(NS_FAILED(rv)) return E_FAIL;
-          rv = directory->GetURI(uri);
-          if(NS_FAILED(rv)) return E_FAIL;
-          rv = directory->GetDirType(&dirType);
-          if(NS_FAILED(rv)) return E_FAIL;
-          rv = directory->GetIntValue("PalmCategoryId", -1, &palmCategoryIndex);
-          if (NS_FAILED(rv)) return E_FAIL;
-          rv = directory->GetIntValue("PalmSyncTimeStamp", 0,
-                                      (PRInt32*)&palmSyncTimeStamp);
-          if (NS_FAILED(rv)) return E_FAIL;
-
-          PRBool disableThisAB;
-          rv = directory->GetBoolValue("disablePalmSync", PR_FALSE, &disableThisAB);
-          if (NS_FAILED(rv)) return E_FAIL;
-
-          // Skip/Ignore 4.X addrbooks (ie, with ".na2" extension), and non personal AB's
-          if (disableThisAB || ((fileName.Length() > kABFileName_PreviousSuffixLen) && 
-               strcmp(fileName.get() + fileName.Length() - kABFileName_PreviousSuffixLen, kABFileName_PreviousSuffix) == 0) ||
-                (dirType != kPABDirectory && dirType != kMAPIDirectory))
-          {
-            continue;
-          }
-
-          if(aIsUnicode) 
-          {
-            // convert uri to Unicode
-            nsAutoString abUrl;
-            rv = ConvertToUnicode("UTF-8", uri, abUrl);
-            if (NS_FAILED(rv))
-              break;
-            // add to the list
-            CopyUnicodeString(&(serverDescList->lpszABName), description);
-            CopyUnicodeString(&(serverDescList->lpszABUrl), abUrl);
-          }
-          else {
-            // we need to convert uri to Unicode and then to ASCII
-            nsAutoString abUUrl;
-
-            rv = ConvertToUnicode("UTF-8", uri, abUUrl);
-            if (NS_FAILED(rv))
-              break;
-
-            CopyCString(&(serverDescList->lpszABName),
-                        NS_ConvertUTF16toUTF8(description));
-            CopyCString(&(serverDescList->lpszABUrl),
-                        NS_ConvertUTF16toUTF8(abUUrl));
-          }
-          serverDescList++;
-
-          PRUint32 dirFlag = 0;
-          if (palmSyncTimeStamp <= 0)
-            dirFlag |= kFirstTimeSyncDirFlag;
-          // was this the pab?
-          nsCAutoString prefName;
-          rv = directory->GetDirPrefId(prefName);
-          if (NS_FAILED(rv))
-            break;
-
-          if (prefName.Equals("ldap_2.servers.pab"))
-            dirFlag |= kIsPabDirFlag;
-          *dirFlagsList = (BOOL) dirFlag;
-          dirFlagsList++;
-
-          *catIndexList = palmCategoryIndex;
-          catIndexList++;
-        }
-      }
-    }
-
-    // assign member variables to the beginning of the list
-    serverDescList = *aABList;
-    dirFlagsList = *aDirFlagsList;
-    catIndexList = *aABCatIndexList;
-
-    if(NS_FAILED(rv))
-      return E_FAIL;
-  }
-  return S_OK;
-}
-
-// Synchronize the Address Book represented by the aCategoryIndex and/or corresponding aABName in Mozilla
-STDMETHODIMP CPalmSyncImp::nsSynchronizeAB(BOOL aIsUnicode, long aCategoryIndex,
-                    long aCategoryId, LPTSTR aABName,
-                    int aModRemoteRecCount, lpnsABCOMCardStruct aModRemoteRecList,
-                    int * aModMozRecCount, lpnsABCOMCardStruct * aModMozRecList)
-{
-    // let the already continuing sync complete
-    if(m_PalmHotSync)
-        return E_FAIL;
-
-    m_PalmHotSync = (nsAbPalmHotSync *) new nsAbPalmHotSync(aIsUnicode, aABName, (char*)aABName, aCategoryIndex, aCategoryId);
-    if(!m_PalmHotSync)
-        return E_FAIL;
-
-    nsresult rv = ((nsAbPalmHotSync *)m_PalmHotSync)->Initialize();
-    if (NS_SUCCEEDED(rv))
-        rv = ((nsAbPalmHotSync *)m_PalmHotSync)->DoSyncAndGetUpdatedCards(aModRemoteRecCount, aModRemoteRecList, aModMozRecCount, aModMozRecList);
-
-    if (NS_FAILED(rv))
-        return E_FAIL;
-
-    return S_OK;
-}
-
-// All records from a AB represented by aCategoryIndex and aABName into a new Mozilla AB
-STDMETHODIMP CPalmSyncImp::nsAddAllABRecords(BOOL aIsUnicode, BOOL replaceExisting, long aCategoryIndex, LPTSTR aABName,
-                            int aRemoteRecCount, lpnsABCOMCardStruct aRemoteRecList)
-{
-    // since we are not returning any data we don't need to keep the nsAbPalmHotSync reference
-    // in order to free the returned data in its destructor. Just create a local nsAbPalmHotSync var.
-    nsAbPalmHotSync palmHotSync(aIsUnicode, aABName, (const char*)aABName, aCategoryIndex, -1);
-
-    nsresult rv = palmHotSync.AddAllRecordsToAB(replaceExisting, aRemoteRecCount, aRemoteRecList);
-
-    if (NS_FAILED(rv))
-        return E_FAIL;
-
-    return S_OK;
-}
-
-STDMETHODIMP CPalmSyncImp::nsGetABDeleted(LPTSTR aABName, BOOL *abDeleted)
-{
-  nsCAutoString prefName("ldap_2.servers.");
-  prefName.Append((const char *)aABName);
-  prefName.Append(".position");
-  PRInt32 position = GetIntPref(prefName.get(), -1);
-  *abDeleted = (position == 0);
-  return S_OK;
-}
-
-
-// Get All records from a Mozilla AB
-STDMETHODIMP CPalmSyncImp::nsGetAllABCards(BOOL aIsUnicode, long aCategoryIndex, LPTSTR aABName,
-                            int * aMozRecCount, lpnsABCOMCardStruct * aMozRecList)
-{
-    // if sync is already going on wait for AckSyncDone to be called
-    if(m_PalmHotSync)
-        return E_FAIL;
-
-    m_PalmHotSync = (nsAbPalmHotSync *) new nsAbPalmHotSync(aIsUnicode, aABName, (char*)aABName, aCategoryIndex, -1);
-    if(!m_PalmHotSync)
-        return E_FAIL;
-
-    nsresult rv = ((nsAbPalmHotSync *)m_PalmHotSync)->Initialize();
-    if (NS_SUCCEEDED(rv))
-        rv = ((nsAbPalmHotSync *)m_PalmHotSync)->GetAllCards(aMozRecCount, aMozRecList);
-
-    if (NS_FAILED(rv))
-        return E_FAIL;
-
-    return S_OK;
-}
-
-// Send an ack for sync done on the remote AB to Mozilla, 
-// now we delete the data returned to the calling app.
-STDMETHODIMP CPalmSyncImp::nsAckSyncDone(BOOL aIsSuccess, long aCatIndex, int aNewRecCount, unsigned long * aNewPalmRecIDList)
-{
-    nsAbPalmHotSync * tempPalmHotSync = (nsAbPalmHotSync *) m_PalmHotSync;
-    if(tempPalmHotSync) {
-        if(aNewRecCount && (aCatIndex > -1))
-            tempPalmHotSync->Done(aIsSuccess, aCatIndex, aNewRecCount, aNewPalmRecIDList);
-        delete tempPalmHotSync;
-    }
-    m_PalmHotSync = nsnull;
-
-    return S_OK;
-}
-
-// Update the category id and mod tiem for the Address Book in Mozilla
-STDMETHODIMP CPalmSyncImp::nsUpdateABSyncInfo(BOOL aIsUnicode, long aCategoryIndex, LPTSTR aABName)
-{
-  nsresult rv;
-  if(m_PalmHotSync)
-    rv = ((nsAbPalmHotSync *)m_PalmHotSync)->UpdateSyncInfo(aCategoryIndex);
-  else
-  {
-    // Launch another ABpalmHotSync session.
-    nsAbPalmHotSync palmHotSync(aIsUnicode, aABName, (const char*)aABName, aCategoryIndex, -1);
-    rv = palmHotSync.Initialize();
-    if (NS_SUCCEEDED(rv))
-      rv = palmHotSync.UpdateSyncInfo(aCategoryIndex);
-  }
-
-  if (NS_FAILED(rv))
-    return E_FAIL;
-
-  return S_OK;
-}
-
-// Delete an Address Book in Mozilla
-STDMETHODIMP CPalmSyncImp::nsDeleteAB(BOOL aIsUnicode, long aCategoryIndex, LPTSTR aABName, LPTSTR aABUrl)
-{
-  // This is an independent operation so use a local nsAbPalmHotSync var
-  // (ie the callers don't need to call AckSyncdone after this is done).
-  nsAbPalmHotSync palmHotSync(aIsUnicode, aABName, (const char*)aABName, aCategoryIndex, -1);
-
-  nsresult rv = palmHotSync.DeleteAB((const char*)aABUrl);
-
-  if (NS_FAILED(rv))
-      return E_FAIL;
-
-  return S_OK;
-}
-
-// Rename an Address Book in Mozilla
-STDMETHODIMP CPalmSyncImp::nsRenameAB(BOOL aIsUnicode, long aCategoryIndex, LPTSTR aABName, LPTSTR aABUrl)
-{
-  // This is an independent operation so use a local nsAbPalmHotSync var
-  // (ie the callers don't need to call AckSyncdone after this is done).
-  nsAbPalmHotSync palmHotSync(aIsUnicode, aABName, (const char*)aABName, aCategoryIndex, -1);
-
-  nsresult rv = palmHotSync.RenameAB(aCategoryIndex, (const char*)aABUrl);
-
-  if (NS_FAILED(rv))
-    return E_FAIL;
-
-  return S_OK;
-}
-
-void CPalmSyncImp::CopyUnicodeString(LPTSTR *destStr, const nsString& srcStr)
-{
-  if (!destStr)
-    return;
-
-  PRInt32 length = srcStr.Length()+1;
-  *destStr = (LPTSTR) CoTaskMemAlloc(sizeof(PRUnichar) * length);
-  wcsncpy(*destStr, srcStr.get(), length-1);
-  (*destStr)[length-1] = '\0';
-}
-
-void CPalmSyncImp::CopyCString(LPTSTR *destStr, const nsCString& srcStr)
-{
-  if (!destStr)
-    return;
-
-  // these strings are defined as wide in the idl, so we need to add up to 3
-  // bytes of 0 byte padding at the end (if the string is an odd number of
-  // bytes long, we need one null byte to pad out the last char to a wide char
-  // and then  two more nulls as a wide null terminator. 
-  PRInt32 length = sizeof(char) * (srcStr.Length()+3);
-  *destStr = (LPTSTR) CoTaskMemAlloc(length);
-  char *sp = (char *)*destStr;
-  strncpy(sp, srcStr.get(), length-1); // this will null fill the end of destStr
-  sp[length-1] = '\0';
-}
-
-
-/* static */PRBool CPalmSyncImp::GetBoolPref(const char *prefName, PRBool defaultVal)
-{
-  PRBool boolVal = defaultVal;
-  
-  nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
-  if (prefBranch)
-    prefBranch->GetBoolPref(prefName, &boolVal);
-  return boolVal;
-}
-
-/* static */PRInt32 CPalmSyncImp::GetIntPref(const char *prefName, PRInt32 defaultVal)
-{
-  PRInt32 intVal = defaultVal;
-  
-  nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
-  if (prefBranch)
-    prefBranch->GetIntPref(prefName, &intVal);
-  return intVal;
-}
-
-
-STDMETHODIMP CPalmSyncImp::nsUseABHomeAddressForPalmAddress(BOOL *aUseHomeAddress)
-{
-  *aUseHomeAddress = nsUseABHomeAddressForPalmAddress();
-  return S_OK;
-}
-
-STDMETHODIMP CPalmSyncImp::nsPreferABHomePhoneForPalmPhone(BOOL *aPreferHomePhone)
-{
-  *aPreferHomePhone = nsPreferABHomePhoneForPalmPhone();
-  return S_OK;
-}
-
-/* static */ PRBool CPalmSyncImp::nsUseABHomeAddressForPalmAddress()
-{
-  static PRBool gGotAddressPref = PR_FALSE;
-  static PRBool gUseHomeAddress;
-  if (!gGotAddressPref)
-  {
-    gUseHomeAddress = GetBoolPref("mail.palmsync.useHomeAddress", PR_TRUE);
-    gGotAddressPref = PR_TRUE;
-  }
-  return gUseHomeAddress;
-}
-
-/* static */ PRBool CPalmSyncImp::nsPreferABHomePhoneForPalmPhone()
-{
-  static PRBool gGotPhonePref = PR_FALSE;
-  static PRBool gPreferHomePhone;
-  if (!gGotPhonePref)
-  {
-    gPreferHomePhone = GetBoolPref("mail.palmsync.preferHomePhone", PR_TRUE);
-    gGotPhonePref = PR_TRUE;
-  }
-  return gPreferHomePhone;
-}
deleted file mode 100644
--- a/mailnews/extensions/palmsync/src/PalmSyncImp.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corp.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *                 Rajiv Dayal (rdayal@netscape.com)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef PALMSYNC_IMP_H
-#define PALMSYNC_IMP_H
-
-#include <windows.h>
-#include "IPalmSync.h"
-#include "nspr.h"
-#include "nsString.h"
-
-const CLSID CLSID_CPalmSyncImp = { 0xb20b4521, 0xccf8, 0x11d6, { 0xb8, 0xa5, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } };
-
-// this class implements the MS COM interface IPalmSync that provides the methods
-// called by the Palm Conduit to perform the AB Sync operations.
-class CPalmSyncImp : public IPalmSync
-{
-
-public :
-
-    // IUnknown
-
-    STDMETHODIMP            QueryInterface(const IID& aIid, void** aPpv);
-    STDMETHODIMP_(ULONG)    AddRef();
-    STDMETHODIMP_(ULONG)    Release();
-
-    // Interface IPalmSync
-
-    STDMETHODIMP IsValid();
-
-    CPalmSyncImp();
-    ~CPalmSyncImp();
-
-    // Get the list of Address Books for the currently logged in user profile
-    STDMETHODIMP nsGetABList(BOOL aIsUnicode, short * aABListCount,
-                            lpnsMozABDesc * aABList, long ** aABCatIndexList, BOOL ** aDirFlags);
-
-    // Synchronize the Address Book represented by the aCategoryIndex and/or corresponding aABName in Mozilla
-    STDMETHODIMP nsSynchronizeAB(BOOL aIsUnicode, long aCategoryIndex, long aCategoryId, LPTSTR aABName,
-                        int aModRemoteRecCount, lpnsABCOMCardStruct aModRemoteRecList,
-                        int * aModMozRecCount, lpnsABCOMCardStruct * aModMozRecList);
-
-    STDMETHODIMP nsAddAllABRecords(BOOL aIsUnicode, BOOL replaceExisting, long aCategoryIndex, LPTSTR aABName,
-                            int aRemoteRecCount, lpnsABCOMCardStruct aRemoteRecList);
-
-
-    STDMETHODIMP nsGetAllABCards(BOOL aIsUnicode, long aCategoryIndex, LPTSTR aABName,
-                            int * aMozRecCount, lpnsABCOMCardStruct * aMozRecList);
-
-    STDMETHODIMP nsAckSyncDone(BOOL aIsSuccess, long aCatIndex, int aNewRecCount, unsigned long * aNewPalmRecIDList);
-
-    STDMETHODIMP nsUpdateABSyncInfo(BOOL aIsUnicode, long aCategoryIndex, LPTSTR aABName);
-
-    STDMETHODIMP nsDeleteAB(BOOL aIsUnicode, long aCategoryIndex, LPTSTR aABName, LPTSTR aABUrl);
- 
-    STDMETHODIMP nsRenameAB(BOOL aIsUnicode, long aCategoryIndex, LPTSTR aABName, LPTSTR aABUrl);
-
-    STDMETHODIMP nsUseABHomeAddressForPalmAddress(BOOL *aUseHomeAddress);
-
-    STDMETHODIMP nsPreferABHomePhoneForPalmPhone(BOOL *aPreferHomePhone);
-
-    STDMETHODIMP nsGetABDeleted(LPTSTR aABName, BOOL *abDeleted);
-
-    static PRBool GetBoolPref(const char *prefName, PRBool defaultVal);
-    static PRInt32 GetIntPref(const char *prefName, PRInt32 defaultVal);
-    static PRBool nsUseABHomeAddressForPalmAddress();
-    static PRBool nsPreferABHomePhoneForPalmPhone();
-private :
-    PRInt32 m_cRef;
-    void * m_PalmHotSync;
-    void CopyUnicodeString(LPTSTR *destStr, const nsString& srcStr);
-    void CopyCString(LPTSTR *destStr, const nsCString& srcStr);
-};
-
-#endif // MSG_MAPI_IMP_H
deleted file mode 100644
--- a/mailnews/extensions/palmsync/src/Registry.cpp
+++ /dev/null
@@ -1,312 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corp.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributors:
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#undef _UNICODE
-#undef UNICODE
-
-#include <objbase.h>
-#include "nsString.h"
-#include "Registry.h"
-
-#define PALMSYNC_PROXY_DLL_NAME   "PalmSyncProxy.dll"
-#define PALMSYNC_STARTUP_ARG      " -PalmSyncStartup"
-#define MAX_SIZE              2048
-
-// Size of a CLSID as a string
-const int CLSID_STRING_SIZE = 39;
-
-// Proxy/Stub Dll Routines
-
-typedef HRESULT (__stdcall ProxyServer)();
-
-
-// Convert a CLSID to a char string.
-
-BOOL CLSIDtochar(const CLSID& clsid, char* szCLSID,
-                 int length)
-{
-    LPOLESTR wszCLSID = NULL;
-
-    // Get CLSID
-    HRESULT hr = StringFromCLSID(clsid, &wszCLSID);
-    if (FAILED(hr))
-        return FALSE;
-
-    // Covert from wide characters to non-wide.
-    wcstombs(szCLSID, wszCLSID, length);
-
-    // Free memory.
-    CoTaskMemFree(wszCLSID);
-
-    return TRUE;
-}
-
-// Create a key and set its value.
-
-BOOL setKeyAndValue(nsCAutoString keyName, const char* subKey,
-                    const char* theValue)
-{
-    HKEY hKey;
-    BOOL retValue = TRUE;
-
-    nsCAutoString theKey(keyName);
-    if (subKey != NULL)
-    {
-        theKey += "\\";
-        theKey += subKey;
-    }
-
-    // Create and open key and subkey.
-    long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT, theKey.get(), 
-                                  0, NULL, REG_OPTION_NON_VOLATILE,
-                                  KEY_ALL_ACCESS, NULL, &hKey, NULL);
-    if (lResult != ERROR_SUCCESS)
-        return FALSE ;
-
-    // Set the Value.
-    if (theValue != NULL)
-    {
-       lResult = RegSetValueEx(hKey, NULL, 0, REG_SZ, (BYTE *)theValue, 
-                      strlen(theValue)+1);
-       if (lResult != ERROR_SUCCESS)
-           retValue = FALSE;
-    }
-
-    RegCloseKey(hKey);
-    return TRUE;
-}
-
-// Delete a key and all of its descendents.
-
-LONG recursiveDeleteKey(HKEY hKeyParent,           // Parent of key to delete
-                        const char* lpszKeyChild)  // Key to delete
-{
-    // Open the child.
-    HKEY hKeyChild ;
-    LONG lRes = RegOpenKeyEx(hKeyParent, lpszKeyChild, 0,
-                             KEY_ALL_ACCESS, &hKeyChild) ;
-    if (lRes != ERROR_SUCCESS)
-    {
-        return lRes ;
-    }
-
-    // Enumerate all of the decendents of this child.
-    FILETIME time ;
-    char szBuffer[MAX_SIZE] ;
-    DWORD dwSize = MAX_SIZE ;
-    while (RegEnumKeyEx(hKeyChild, 0, szBuffer, &dwSize, NULL,
-                        NULL, NULL, &time) == S_OK)
-    {
-        // Delete the decendents of this child.
-        lRes = recursiveDeleteKey(hKeyChild, szBuffer) ;
-        if (lRes != ERROR_SUCCESS)
-        {
-            // Cleanup before exiting.
-            RegCloseKey(hKeyChild) ;
-            return lRes;
-        }
-        dwSize = MAX_SIZE;
-    }
-
-    // Close the child.
-    RegCloseKey(hKeyChild) ;
-
-    // Delete this child.
-    return RegDeleteKey(hKeyParent, lpszKeyChild) ;
-}
-
-void RegisterProxy()
-{
-    HINSTANCE h = NULL;
-    ProxyServer *RegisterFunc = NULL;
-
-    char szModule[MAX_SIZE];
-    char *pTemp = NULL;
-
-    HMODULE hModule = GetModuleHandle(NULL);
-    DWORD dwResult  = ::GetModuleFileName(hModule, szModule,
-                                          sizeof(szModule)/sizeof(char));
-    if (dwResult == 0)
-        return;
-
-    pTemp = strrchr(szModule, '\\');
-    if (pTemp == NULL)
-        return;
-
-    *pTemp = '\0';
-    nsCAutoString proxyPath(szModule);
-
-    proxyPath += "\\";
-    proxyPath += PALMSYNC_PROXY_DLL_NAME;
-
-    h = LoadLibrary(proxyPath.get());
-    if (h == NULL)
-        return;
-
-    RegisterFunc = (ProxyServer *) GetProcAddress(h, "DllRegisterServer");
-    if (RegisterFunc)
-        RegisterFunc();
-
-    FreeLibrary(h);
-}
-
-void UnRegisterProxy()
-{
-    HINSTANCE h = NULL;
-    ProxyServer *UnRegisterFunc = NULL;
-
-    char szModule[MAX_SIZE];
-    char *pTemp = NULL;
-
-    HMODULE hModule = GetModuleHandle(NULL);
-    DWORD dwResult  = ::GetModuleFileName(hModule, szModule,
-                                          sizeof(szModule)/sizeof(char));
-    if (dwResult == 0)
-        return;
-
-    pTemp = strrchr(szModule, '\\');
-    if (pTemp == NULL)
-        return;
-
-    *pTemp = '\0';
-    nsCAutoString proxyPath(szModule);
-
-    proxyPath += "\\";
-    proxyPath += PALMSYNC_PROXY_DLL_NAME;
-
-    h = LoadLibrary(proxyPath.get());
-    if (h == NULL)
-        return;
-
-    UnRegisterFunc = (ProxyServer *) GetProcAddress(h, "DllUnregisterServer");
-    if (UnRegisterFunc)
-        UnRegisterFunc();
-
-    FreeLibrary(h);
-}
-
-// Register the component in the registry.
-
-HRESULT RegisterServerForPalmSync(const CLSID& clsid,         // Class ID
-                       const char* szFriendlyName, // Friendly Name
-                       const char* szVerIndProgID, // Programmatic
-                       const char* szProgID)       //   IDs
-{
-    HMODULE hModule = GetModuleHandle(NULL);
-    char szModuleName[MAX_SIZE];
-    char szCLSID[CLSID_STRING_SIZE];
-
-    nsCAutoString independentProgId(szVerIndProgID);
-    nsCAutoString progId(szProgID);
-
-    DWORD dwResult = ::GetModuleFileName(hModule, szModuleName,
-                              sizeof(szModuleName)/sizeof(char));
-
-    if (dwResult == 0)
-        return S_FALSE;
-
-    nsCAutoString moduleName(szModuleName);
-    nsCAutoString registryKey("CLSID\\");
-
-    moduleName += PALMSYNC_STARTUP_ARG;
-
-    // Convert the CLSID into a char.
-
-    if (!CLSIDtochar(clsid, szCLSID, sizeof(szCLSID)))
-        return S_FALSE;
-    registryKey += szCLSID;
-
-    // Add the CLSID to the registry.
-    if((!setKeyAndValue(registryKey, NULL, szFriendlyName))
-         || (!setKeyAndValue(registryKey, "LocalServer32", moduleName.get()))
-         // Add the ProgID subkey under the CLSID key.
-         || (!setKeyAndValue(registryKey, "ProgID", szProgID))
-         // Add the version-independent ProgID subkey under CLSID key.
-         || (!setKeyAndValue(registryKey, "VersionIndependentProgID", szVerIndProgID))
-         // Add the version-independent ProgID subkey under HKEY_CLASSES_ROOT.
-         || (!setKeyAndValue(independentProgId, NULL, szFriendlyName))
-         || (!setKeyAndValue(independentProgId, "CLSID", szCLSID))
-         || (!setKeyAndValue(independentProgId, "CurVer", szProgID))
-         // Add the versioned ProgID subkey under HKEY_CLASSES_ROOT.
-         || (!setKeyAndValue(progId, NULL, szFriendlyName))
-         || (!setKeyAndValue(progId, "CLSID", szCLSID))
-      )
-        return S_FALSE;
-
-    RegisterProxy();
-
-    return S_OK;
-}
-
-LONG UnregisterServerForPalmSync(const CLSID& clsid,         // Class ID
-                      const char* szVerIndProgID, // Programmatic
-                      const char* szProgID)       //   IDs
-{
-    LONG lResult = S_OK;
-
-    // Convert the CLSID into a char.
-
-    char szCLSID[CLSID_STRING_SIZE];
-    if (!CLSIDtochar(clsid, szCLSID, sizeof(szCLSID)))
-        return S_FALSE;
-
-    UnRegisterProxy();
-
-    nsCAutoString registryKey("CLSID\\");
-    registryKey += szCLSID;
-
-    lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, registryKey.get());
-    if (lResult == ERROR_SUCCESS || lResult == ERROR_FILE_NOT_FOUND)
-        return lResult;
-
-    registryKey += "\\LocalServer32";
-
-    // Delete only the path for this server.
-
-    lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, registryKey.get());
-    if (lResult != ERROR_SUCCESS && lResult != ERROR_FILE_NOT_FOUND)
-        return lResult;
-
-    // Delete the version-independent ProgID Key.
-    lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szVerIndProgID);
-    if (lResult != ERROR_SUCCESS && lResult != ERROR_FILE_NOT_FOUND)
-        return lResult;
-
-    lResult = recursiveDeleteKey(HKEY_CLASSES_ROOT, szProgID);
-
-    return lResult;
-}
deleted file mode 100644
--- a/mailnews/extensions/palmsync/src/Registry.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef _REGISTRY_H_
-#define _REGISTRY_H_
-
-#include <objbase.h>
-
-// This function will register a component in the Registry.
-
-HRESULT RegisterServerForPalmSync(const CLSID& clsid, 
-                       const char* szFriendlyName,
-                       const char* szVerIndProgID,
-                       const char* szProgID) ;
-
-// This function will unregister a component.
-
-HRESULT UnregisterServerForPalmSync(const CLSID& clsid,
-                         const char* szVerIndProgID,
-                         const char* szProgID) ;
-
-#endif
deleted file mode 100644
--- a/mailnews/extensions/palmsync/src/nsAbIPCCard.cpp
+++ /dev/null
@@ -1,1022 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Created by: Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include <windows.h>
-#include <tchar.h>
-
-#include "nsAbIPCCard.h"
-#include "nsUnicharUtils.h"
-#include "nsIAddrDatabase.h"
-#include "prdtoa.h"
-#include "PalmSyncImp.h"
-
-extern PRLogModuleInfo *PALMSYNC;
-
-#define CONVERT_ASSIGNTO_UNICODE(d, s, convertCRLF)  d.Truncate();\
-                                        if((char*) s) d.AppendASCII((char*)s);\
-                                        if (convertCRLF) \
-                                          d.ReplaceSubstring(NS_LITERAL_STRING("\x0D\x0A").get(),NS_LITERAL_STRING(" ").get());
-
-#define CONVERT_CRLF_TO_SPACE(d, s) d.Assign(s); \
-                                    d.ReplaceSubstring(NS_LITERAL_STRING("\x0D\x0A").get(),NS_LITERAL_STRING(" ").get());
-
-NS_IMPL_ISUPPORTS_INHERITED0(nsAbIPCCard, nsAbCardProperty)
-
-nsAbIPCCard::nsAbIPCCard()
-{
-    mRecordId = 0;
-    mCategoryId = -1;
-    mStatus = -1;
-    PR_LOG(PALMSYNC, PR_LOG_DEBUG, ("nsAbIPCCard::nsAbIPCCard \n"));
-}
-
-nsAbIPCCard::~nsAbIPCCard()
-{
-   
-}
-
-nsAbIPCCard::nsAbIPCCard(nsIAbCard *card)
-{
-    Copy(card);
-}
-
-nsAbIPCCard::nsAbIPCCard(nsABCOMCardStruct *card, PRBool isUnicode)
-{
-    if(isUnicode)
-        Copy(card);
-    else
-        ConvertToUnicodeAndCopy(card);
-}
-
-NS_IMETHODIMP nsAbIPCCard::Copy(nsIAbCard *srcCard)
-{
-    NS_ENSURE_ARG_POINTER(srcCard);
-
-    nsString palmIDStr;
-    nsresult rv = srcCard->GetPropertyAsAString(CARD_ATTRIB_PALMID, palmIDStr);
-   if (NS_SUCCEEDED(rv) && !palmIDStr.IsEmpty()) {
-     PRFloat64 f = PR_strtod(NS_LossyConvertUTF16toASCII(palmIDStr).get(), nsnull);
-     PRInt64 l;
-     LL_D2L(l, f);
-     LL_L2UI(mRecordId, l);
-   }
-   else
-     mRecordId = 0;
-
-   PRUint32 rowID = 0;
-   srcCard->GetPropertyAsUint32("DbRowID", &rowID);
-   SetPropertyAsUint32("DbRowID", rowID);
-
-   PRUint32 key = 0;
-   srcCard->GetPropertyAsUint32("RecordKey", &key);
-   SetPropertyAsUint32("RecordKey", key);
-
-   PRUint32 lastModifiedDate = 0;
-   srcCard->GetPropertyAsUint32(kLastModifiedDateProperty, &lastModifiedDate);
-   mStatus = (lastModifiedDate) ? ATTR_MODIFIED : ATTR_NEW;
-
-
-    rv = nsAbCardProperty::Copy(srcCard);
-    // do we need to join the work and home addresses?
-    // or split them?
-
-    return rv;
-}
-
-nsresult nsAbIPCCard::Copy(nsABCOMCardStruct * srcCard)
-{
-    NS_ENSURE_ARG_POINTER(srcCard);
-
-    mRecordId = srcCard->dwRecordId;
-    mCategoryId = srcCard->dwCategoryId;
-    mStatus = srcCard->dwStatus;
-    srcCard->addressToUse = CPalmSyncImp::nsUseABHomeAddressForPalmAddress(); // 0 == work, 1 == home
-    PR_LOG(PALMSYNC, PR_LOG_DEBUG, ("nsAbIPCCard::Copy using %d\n", srcCard->addressToUse));
-
-    // Each palm address field is allowed to have multiple lines
-    // so replace CRLFs with spaces (since other than Notes field
-    // moz only displays fields in a single line).
-    nsAutoString str;
-    CONVERT_CRLF_TO_SPACE(str, srcCard->firstName);
-    SetFirstName(str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->lastName);
-    SetLastName(str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->displayName);
-    SetDisplayName(str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->nickName);
-    SetPropertyAsAString(kNicknameProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->primaryEmail);
-    SetPrimaryEmail(str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->secondEmail);
-    SetPropertyAsAString(k2ndEmailProperty, str);
-
-    SetPropertyAsUint32(kPreferMailFormatProperty, srcCard->preferMailFormat);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->workPhone);
-    SetPropertyAsAString(kWorkPhoneProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->homePhone);
-    SetPropertyAsAString(kHomePhoneProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->faxNumber);
-    SetPropertyAsAString(kFaxProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->pagerNumber);
-    SetPropertyAsAString(kPagerProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->cellularNumber);
-    SetPropertyAsAString(kCellularProperty, str);
-
-    // See if home address contains multiple lines.
-    SplitHomeAndWorkAddresses(srcCard, PR_TRUE);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->homeCity);
-    SetPropertyAsAString(kHomeCityProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->homeState);
-    SetPropertyAsAString(kHomeStateProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->homeZipCode);
-    SetPropertyAsAString(kHomeZipCodeProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->homeCountry);
-    SetPropertyAsAString(kHomeCountryProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->workCity);
-    SetPropertyAsAString(kWorkCityProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->workState);
-    SetPropertyAsAString(kWorkStateProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->workZipCode);
-    SetPropertyAsAString(kWorkZipCodeProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->workCountry);
-    SetPropertyAsAString(kWorkCountryProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->jobTitle);
-    SetPropertyAsAString(kJobTitleProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->department);
-    SetPropertyAsAString(kDepartmentProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->company);
-    SetPropertyAsAString(kCompanyProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->webPage1);
-    SetPropertyAsAString(kWorkWebPageProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->webPage2);
-    SetPropertyAsAString(kHomeWebPageProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->birthYear);
-    SetPropertyAsAString(kBirthYearProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->birthMonth);
-    SetPropertyAsAString(kBirthMonthProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->birthDay);
-    SetPropertyAsAString(kBirthDayProperty, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->custom1);
-    SetPropertyAsAString(kCustom1Property, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->custom2);
-    SetPropertyAsAString(kCustom2Property, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->custom3);
-    SetPropertyAsAString(kCustom3Property, str);
-
-    CONVERT_CRLF_TO_SPACE(str, srcCard->custom4);
-    SetPropertyAsAString(kCustom4Property, str);
-
-    str.Assign(srcCard->notes);
-    SetPropertyAsAString(kNotesProperty, str);
-    SetPropertyAsUint32(kLastModifiedDateProperty, srcCard->lastModifiedDate);
-    SetIsMailList(srcCard->isMailList);
-    SetMailListURI(srcCard->mailListURI);
-
-    return NS_OK;
-}
-
-nsresult nsAbIPCCard::ConvertToUnicodeAndCopy(nsABCOMCardStruct * srcCard)
-{
-    NS_ENSURE_ARG_POINTER(srcCard);
-
-    mRecordId = srcCard->dwRecordId;
-    mCategoryId = srcCard->dwCategoryId;
-    mStatus = srcCard->dwStatus;
-
-    nsAutoString str;
-
-    // Each palm address field is allowed to have multiple lines
-    // so replace CRLFs with spaces (since other than Notes field
-    // moz only displays fields in a single line).
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->firstName, PR_TRUE);
-    SetFirstName(str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->lastName, PR_TRUE);
-    SetLastName(str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->displayName, PR_TRUE);
-    SetDisplayName(str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->nickName, PR_TRUE);
-    SetPropertyAsAString(kNicknameProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->primaryEmail, PR_TRUE);
-    SetPrimaryEmail(str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->secondEmail, PR_TRUE);
-    SetPropertyAsAString(k2ndEmailProperty, str);
-
-    SetPropertyAsUint32(kPreferMailFormatProperty, srcCard->preferMailFormat);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->workPhone, PR_TRUE);
-    SetPropertyAsAString(kWorkPhoneProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->homePhone, PR_TRUE);
-    SetPropertyAsAString(kHomePhoneProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->faxNumber, PR_TRUE);
-    SetPropertyAsAString(kFaxProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->pagerNumber, PR_TRUE);
-    SetPropertyAsAString(kPagerProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->cellularNumber, PR_TRUE);
-    SetPropertyAsAString(kCellularProperty, str);
-
-    // See if home address contains multiple lines.
-    SplitHomeAndWorkAddresses(srcCard, PR_FALSE);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->homeCity, PR_TRUE);
-    SetPropertyAsAString(kHomeCityProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->homeState, PR_TRUE);
-    SetPropertyAsAString(kHomeStateProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->homeZipCode, PR_TRUE);
-    SetPropertyAsAString(kHomeZipCodeProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->homeCountry, PR_TRUE);
-    SetPropertyAsAString(kHomeCountryProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->workCity, PR_TRUE);
-    SetPropertyAsAString(kWorkCityProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->workState, PR_TRUE);
-    SetPropertyAsAString(kWorkStateProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->workZipCode, PR_TRUE);
-    SetPropertyAsAString(kWorkZipCodeProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->workCountry, PR_TRUE);
-    SetPropertyAsAString(kWorkCountryProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->jobTitle, PR_TRUE);
-    SetPropertyAsAString(kJobTitleProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->department, PR_TRUE);
-    SetPropertyAsAString(kDepartmentProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->company, PR_TRUE);
-    SetPropertyAsAString(kCompanyProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->webPage1, PR_TRUE);
-    SetPropertyAsAString(kWorkWebPageProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->webPage2, PR_TRUE);
-    SetPropertyAsAString(kHomeWebPageProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->birthYear, PR_TRUE);
-    SetPropertyAsAString(kBirthYearProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->birthMonth, PR_TRUE);
-    SetPropertyAsAString(kBirthMonthProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->birthDay, PR_TRUE);
-    SetPropertyAsAString(kBirthDayProperty, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->custom1, PR_TRUE);
-    SetPropertyAsAString(kCustom1Property, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->custom2, PR_TRUE);
-    SetPropertyAsAString(kCustom2Property, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->custom3, PR_TRUE);
-    SetPropertyAsAString(kCustom3Property, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->custom4, PR_TRUE);
-    SetPropertyAsAString(kCustom4Property, str);
-
-    CONVERT_ASSIGNTO_UNICODE(str, srcCard->notes, PR_FALSE);
-    SetPropertyAsAString(kNotesProperty, str);
-
-    SetPropertyAsUint32(kLastModifiedDateProperty, srcCard->lastModifiedDate);
-    SetIsMailList(srcCard->isMailList);
-    SetMailListURI(srcCard->mailListURI);
-
-    return NS_OK;
-}
-
-void nsAbIPCCard::SplitAddresses(PRBool isUnicode, LPTSTR homeAddress, LPTSTR workAddress)
-{
-  PRInt32 idx;
-  nsAutoString homeAddressStr;
-  nsAutoString workAddressStr;
-  if (isUnicode)
-  {
-    homeAddressStr.Assign(homeAddress);
-    workAddressStr.Assign(workAddress);
-  }
-  else
-  {
-    CONVERT_ASSIGNTO_UNICODE(homeAddressStr, homeAddress, PR_FALSE);
-    CONVERT_ASSIGNTO_UNICODE(workAddressStr, workAddress, PR_FALSE);
-  }
-  nsAutoString addr1, addr2;
-  if ((idx = homeAddressStr.Find( "\x0D\x0A")) != kNotFound)
-  {
-    homeAddressStr.Left(addr1, idx);
-    homeAddressStr.Right( addr2, homeAddressStr.Length() - idx - 2);  // need to minus string lenght of CRLF.
-    addr2.ReplaceSubstring(NS_LITERAL_STRING("\x0D\x0A").get(),NS_LITERAL_STRING(", ").get());
-
-    SetPropertyAsAString(kHomeAddressProperty, addr1);
-    SetPropertyAsAString(kHomeAddress2Property, addr2);
-  }
-  else
-    SetPropertyAsAString(kHomeAddressProperty, homeAddressStr);
-
-  if ((idx = workAddressStr.Find( "\x0D\x0A")) != kNotFound)
-  {
-    workAddressStr.Left(addr1, idx);
-    workAddressStr.Right( addr2, workAddressStr.Length() - idx - 2);  // need to minus string lenght of CRLF.
-    addr2.ReplaceSubstring(NS_LITERAL_STRING("\x0D\x0A").get(),NS_LITERAL_STRING(", ").get());
-
-    SetPropertyAsAString(kWorkAddressProperty, addr1);
-    SetPropertyAsAString(kWorkAddress2Property, addr2);
-  }
-  else
-    SetPropertyAsAString(kWorkAddressProperty, workAddressStr);
-}
-
-void nsAbIPCCard::SplitHomeAndWorkAddresses(nsABCOMCardStruct * card, PRBool isUnicode)
-{
-  // If the address contains more than one line then split it into two 
-  // (since moz only allows two address lines) and make sure all CRLFs
-  // are converted to spaces in the 2nd address line. Lines are ended
-  // with CRLF (done by moz conduit). So card->homeAddress2 
-  // and card->workAddress2 are never used.
-  SplitAddresses(isUnicode, card->homeAddress, card->workAddress);
-}
-
-
-PRBool nsAbIPCCard::EqualsAfterUnicodeConversion(nsABCOMCardStruct * card, nsStringArray & differingAttrs)
-{
-    if(!card)
-        return PR_FALSE;
-
-    // convert to Unicode first
-    nsAbIPCCard card1(card, PR_FALSE);
-    card1.SplitAddresses(PR_FALSE, card->homeAddress, card->workAddress);
-    nsABCOMCardStruct * newCard = new nsABCOMCardStruct;
-    // get the unicode nsABCOMCardStruct and compare
-    card1.GetABCOMCardStruct(PR_TRUE, newCard);
-    // want to split newCard home and work address
-
-    // I think this leaks...need to free up the original values
-    card1.CopyValue(PR_TRUE, kHomeAddressProperty, &newCard->homeAddress);
-    card1.CopyValue(PR_TRUE, kHomeAddress2Property, &newCard->homeAddress2);
-    card1.CopyValue(PR_TRUE, kWorkAddressProperty, &newCard->workAddress);
-    card1.CopyValue(PR_TRUE, kWorkAddress2Property, &newCard->workAddress2);
-  
-    PRBool ret = Equals(newCard, differingAttrs);
-    delete newCard;
-    return ret;
-}
-
-
-PRBool nsAbIPCCard::Equals(nsABCOMCardStruct * card, nsStringArray & differingAttrs)
-{
-    if(!card)
-        return PR_FALSE;
-
-    differingAttrs.Clear();
-
-    if(card->firstName)
-        if (CompareValue(PR_TRUE, card->firstName, kFirstNameProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kFirstNameProperty));
-    if(card->lastName)
-        if (CompareValue(PR_TRUE, card->lastName, kLastNameProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kLastNameProperty));
-    if(card->displayName)
-        if (CompareValue(PR_TRUE, card->displayName, kDisplayNameProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kDisplayNameProperty));
-    if(card->nickName)
-        if (CompareValue(PR_TRUE, card->nickName, kNicknameProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kNicknameProperty));
-    if(card->primaryEmail)
-        if (CompareValue(PR_TRUE, card->primaryEmail, kPriEmailProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kPriEmailProperty));
-    if(card->secondEmail)
-        if (CompareValue(PR_TRUE, card->secondEmail, k2ndEmailProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(k2ndEmailProperty));
-    if(card->workPhone)
-        if (CompareValue(PR_TRUE, card->workPhone, kWorkPhoneProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkPhoneProperty));
-    if(card->homePhone)
-        if (CompareValue(PR_TRUE, card->homePhone, kHomePhoneProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kHomePhoneProperty));
-    if(card->faxNumber)
-        if (CompareValue(PR_TRUE, card->faxNumber, kFaxProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kFaxProperty));
-    if(card->pagerNumber)
-        if (CompareValue(PR_TRUE, card->pagerNumber, kPagerProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kPagerProperty));
-    if(card->cellularNumber)
-        if (CompareValue(PR_TRUE, card->cellularNumber, kCellularProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kCellularProperty));
-    // card  has home and work addresses joined, but "this" has them split
-    if(card->homeAddress)
-        if (CompareValue(PR_TRUE, card->homeAddress, kHomeAddressProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeAddressProperty));
-    if(card->homeAddress2)
-        if (CompareValue(PR_TRUE, card->homeAddress2, kHomeAddress2Property))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeAddress2Property));
-    if(card->homeCity)
-        if (CompareValue(PR_TRUE, card->homeCity, kHomeCityProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeCityProperty));
-    if(card->homeState)
-        if (CompareValue(PR_TRUE, card->homeState, kHomeStateProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeStateProperty));
-    if(card->homeZipCode)
-        if (CompareValue(PR_TRUE, card->homeZipCode, kHomeZipCodeProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeZipCodeProperty));
-    if(card->homeCountry)
-        if (CompareValue(PR_TRUE, card->homeCountry, kHomeCountryProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeCountryProperty));
-    // card->workAddress is Joined, WorkAddress and WorkAddress2 are split
-    if(card->workAddress)
-        if (CompareValue(PR_TRUE, card->workAddress, kWorkAddressProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkAddressProperty));
-    if(card->workAddress2)
-        if (CompareValue(PR_TRUE, card->workAddress2, kWorkAddress2Property))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkAddress2Property));
-    if(card->workCity)
-        if (CompareValue(PR_TRUE, card->workCity, kWorkCityProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkCityProperty));
-    if(card->workState)
-        if (CompareValue(PR_TRUE, card->workState, kWorkStateProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkStateProperty));
-    if(card->workZipCode)
-        if (CompareValue(PR_TRUE, card->workZipCode, kWorkZipCodeProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkZipCodeProperty));
-    if(card->workCountry)
-        if (CompareValue(PR_TRUE, card->workCountry, kWorkCountryProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkCountryProperty));
-    if(card->jobTitle)
-        if (CompareValue(PR_TRUE, card->jobTitle, kJobTitleProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kJobTitleProperty));
-    if(card->department)
-        if (CompareValue(PR_TRUE, card->department, kDepartmentProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kDepartmentProperty));
-    if(card->company)
-        if (CompareValue(PR_TRUE, card->company, kCompanyProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kCompanyProperty));
-    if(card->webPage1)
-        if (CompareValue(PR_TRUE, card->webPage1, kWorkWebPageProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kWorkWebPageProperty));
-    if(card->webPage2)
-        if (CompareValue(PR_TRUE, card->webPage2, kWorkWebPageProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kHomeWebPageProperty));
-    if(card->birthYear)
-        if (CompareValue(PR_TRUE, card->birthYear, kBirthYearProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kBirthYearProperty));
-    if(card->birthMonth)
-        if (CompareValue(PR_TRUE, card->birthMonth, kBirthMonthProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kBirthMonthProperty));
-    if(card->birthDay)
-        if (CompareValue(PR_TRUE, card->birthDay, kBirthDayProperty))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kBirthDayProperty));
-    if(card->custom1)
-        if (CompareValue(PR_TRUE, card->custom1, kCustom1Property))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kCustom1Property));
-    if(card->custom2)
-        if (CompareValue(PR_TRUE, card->custom2, kCustom2Property))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kCustom2Property));
-    if(card->custom3)
-        if (CompareValue(PR_TRUE, card->custom3, kCustom3Property))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kCustom3Property));
-    if(card->custom4)
-        if (CompareValue(PR_TRUE, card->custom4, kCustom4Property))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kCustom4Property));
-    if (card->isMailList != m_IsMailList)
-        differingAttrs.AppendString(NS_LITERAL_STRING(kMailListName));
-    if(card->mailListURI) {
-        nsCAutoString str(card->mailListURI);
-        if (str.Equals(m_MailListURI, nsCaseInsensitiveCStringComparator()))
-            differingAttrs.AppendString(NS_LITERAL_STRING(kMailListDescription));
-    }
-
-    return (differingAttrs.Count() == 0);
-}
-
-
-NS_IMETHODIMP nsAbIPCCard::Equals(nsIAbCard *card, PRBool *_retval)
-{
-    NS_ENSURE_ARG_POINTER(card);
-    NS_ENSURE_ARG_POINTER(_retval);
-
-    nsString str;
-    *_retval = PR_FALSE;
-
-    card->GetFirstName(str);
-    if (Compare(str, kFirstNameProperty))
-        return NS_OK;
-
-    card->GetLastName(str);
-    if (Compare(str, kLastNameProperty))
-        return NS_OK;
-
-    card->GetDisplayName(str);
-    if (Compare(str, kDisplayNameProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kNicknameProperty, str)))
-      str.Truncate();
-    if (Compare(str, kNicknameProperty))
-        return NS_OK;
-
-    card->GetPrimaryEmail(str);
-    if (Compare(str, kPriEmailProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(k2ndEmailProperty, str)))
-      str.Truncate();
-    if (Compare(str, k2ndEmailProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kWorkPhoneProperty, str)))
-      str.Truncate();
-    if (Compare(str, kWorkPhoneProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kHomePhoneProperty, str)))
-      str.Truncate();
-    if (Compare(str, kHomePhoneProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kFaxProperty, str)))
-      str.Truncate();
-    if (Compare(str, kFaxProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kPagerProperty, str)))
-      str.Truncate();
-    if (Compare(str, kPagerProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kCellularProperty, str)))
-      str.Truncate();
-    if (Compare(str, kCellularProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kHomeAddressProperty, str)))
-      str.Truncate();
-    if (Compare(str, kHomeAddressProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kHomeAddress2Property, str)))
-      str.Truncate();
-    if (Compare(str, kHomeAddress2Property))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kHomeCityProperty, str)))
-      str.Truncate();
-    if (Compare(str, kHomeCityProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kHomeStateProperty, str)))
-      str.Truncate();
-    if (Compare(str, kHomeStateProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kHomeZipCodeProperty, str)))
-      str.Truncate();
-    if (Compare(str, kHomeZipCodeProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kHomeCountryProperty, str)))
-      str.Truncate();
-    if (Compare(str, kHomeCountryProperty))
-        return NS_OK;
-
-    // both card and this have their addresses split, which is correct
-    if (NS_FAILED(card->GetPropertyAsAString(kWorkAddressProperty, str)))
-      str.Truncate();
-    if (Compare(str, kWorkAddressProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kWorkAddress2Property, str)))
-      str.Truncate();
-    if (Compare(str, kWorkAddress2Property))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kWorkCityProperty, str)))
-      str.Truncate();
-    if (Compare(str, kWorkCityProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kWorkStateProperty, str)))
-      str.Truncate();
-    if (Compare(str, kWorkStateProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kWorkZipCodeProperty, str)))
-      str.Truncate();
-    if (Compare(str, kWorkZipCodeProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kWorkCountryProperty, str)))
-      str.Truncate();
-    if (Compare(str, kWorkCountryProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kJobTitleProperty, str)))
-      str.Truncate();
-    if (Compare(str, kJobTitleProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kDepartmentProperty, str)))
-      str.Truncate();
-    if (Compare(str, kDepartmentProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kCompanyProperty, str)))
-      str.Truncate();
-    if (Compare(str, kCompanyProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kWorkWebPageProperty, str)))
-      str.Truncate();
-    if (Compare(str, kWorkWebPageProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kHomeWebPageProperty, str)))
-      str.Truncate();
-    if (Compare(str, kHomeWebPageProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kBirthYearProperty, str)))
-      str.Truncate();
-    if (Compare(str, kBirthYearProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kBirthMonthProperty, str)))
-      str.Truncate();
-    if (Compare(str, kBirthMonthProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kBirthDayProperty, str)))
-      str.Truncate();
-    if (Compare(str, kBirthDayProperty))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kCustom1Property, str)))
-      str.Truncate();
-    if (Compare(str, kCustom1Property))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kCustom2Property, str)))
-      str.Truncate();
-    if (Compare(str, kCustom2Property))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kCustom3Property, str)))
-      str.Truncate();
-    if (Compare(str, kCustom3Property))
-        return NS_OK;
-
-    if (NS_FAILED(card->GetPropertyAsAString(kCustom4Property, str)))
-      str.Truncate();
-    if (Compare(str, kCustom4Property))
-        return NS_OK;
-
-    PRBool isMailList=PR_FALSE;
-    card->GetIsMailList(&isMailList);
-    if (isMailList != m_IsMailList)
-        return NS_OK;
-
-    nsCString str2;
-    card->GetMailListURI(getter_Copies(str2));
-    if (m_MailListURI.Equals(str2, nsCaseInsensitiveCStringComparator()))
-        return NS_OK;
-
-    *_retval = PR_TRUE;
-    return NS_OK;
-}
-
-PRBool nsAbIPCCard::CompareValue(PRBool isUnicode, LPTSTR cardValue, const char *attribute)
-{
-    if(cardValue) {
-        if(isUnicode) {
-            if (Compare(nsDependentString(cardValue), attribute))
-                return PR_FALSE;
-        }
-        else {
-            nsAutoString str;
-            CONVERT_ASSIGNTO_UNICODE(str, cardValue, PR_TRUE);
-            if (Compare(str, attribute))
-                return PR_FALSE;
-        }
-    }
-
-    return PR_TRUE;
-}
-
-PRBool nsAbIPCCard::Compare(nsString &cardValue, const char *attribute)
-{
-  nsAutoString attribValue;
-  GetPropertyAsAString(attribute, attribValue);
-  return ::Compare(cardValue, attribValue, nsCaseInsensitiveStringComparator());
-}
-PRBool nsAbIPCCard::Same(nsABCOMCardStruct * card, PRBool isUnicode)
-{
-    if(!card)
-        return PR_FALSE;
-
-    if(mRecordId && card->dwRecordId) 
-        return (mRecordId == card->dwRecordId);
-
-    if(CompareValue(isUnicode, card->firstName, kFirstNameProperty))
-        if(CompareValue(isUnicode, card->lastName, kLastNameProperty))
-            if(CompareValue(isUnicode, card->displayName, kDisplayNameProperty))
-                if(CompareValue(isUnicode, card->nickName, kNicknameProperty))
-                    return PR_TRUE;
-
-    return PR_FALSE;
-}
-
-
-PRBool nsAbIPCCard::Same(nsIAbCard *card)
-{
-    if(!card)
-        return PR_FALSE;
-
-    nsresult rv;
-    // first check the palmID for the cards if they exist
-    nsString palmIDStr;
-    rv = card->GetPropertyAsAString(CARD_ATTRIB_PALMID, palmIDStr);
-    if (NS_SUCCEEDED(rv) && palmIDStr.get()) {
-      PRInt32 palmID=0;
-      PRFloat64 f = PR_strtod(NS_LossyConvertUTF16toASCII(palmIDStr).get(), nsnull);
-      PRInt64 l;
-      LL_D2L(l, f);
-      LL_L2UI(palmID, l);
-      if (palmID && mRecordId)
-        return mRecordId == palmID;
-    }
-
-    nsString str;
-    card->GetFirstName(str);
-    if (Compare(str, kFirstNameProperty))
-        return PR_FALSE;
-    card->GetLastName(str);
-    if (Compare(str, kLastNameProperty))
-        return PR_FALSE;
-    card->GetDisplayName(str);
-    if (Compare(str, kDisplayNameProperty))
-        return PR_FALSE;
-    if (NS_FAILED(card->GetPropertyAsAString(kNicknameProperty, str)))
-      str.Truncate();
-    if (Compare(str, kNicknameProperty))
-        return PR_FALSE;
-
-    return PR_TRUE;
-}
-
-
-void nsAbIPCCard::CopyValue(PRBool isUnicode, const char *attribute, LPTSTR * result)
-{
-    *result = NULL;
-    nsAutoString attribValue;
-    GetPropertyAsAString(attribute, attribValue);
-    if(attribValue.Length() && attribValue.get()) {
-        PRInt32 length;
-        if(isUnicode) {                                 
-            length = attribValue.Length()+1;
-            PRUnichar * Str = (PRUnichar *) CoTaskMemAlloc(sizeof(PRUnichar) * length);
-            wcsncpy(Str, attribValue.get(), length-1);
-            Str[length-1] = '\0';
-            *result = Str;
-        } 
-        else { 
-            NS_LossyConvertUTF16toASCII cStr(attribValue);
-            // These strings are defined as wide in the idl, so we need to add up to 3
-            // bytes of 0 byte padding at the end (if the string is an odd number of 
-            // bytes long, we need one null byte to pad out the last char to a wide char
-            // and then  two more nulls as a wide null terminator.
-            length = cStr.Length()+3;
-            char * str = (char *) CoTaskMemAlloc(length);
-            strncpy(str, cStr.get(), length-1);
-            str[length-1] = '\0';
-            *result = (LPTSTR) str;
-        } 
-    }
-}
-
-nsresult nsAbIPCCard::GetABCOMCardStruct(PRBool isUnicode, nsABCOMCardStruct * card)
-{
-    NS_ENSURE_ARG_POINTER(card);
-
-    // If memset() call is missing, callers of MS COM nsSynchronizeAB() will
-    // receive a different return code even if nsSynchronizeAB() return S_OK.
-    memset(card, 0, sizeof(nsABCOMCardStruct));
-    card->dwRecordId = mRecordId;
-    card->dwCategoryId = mCategoryId;
-    card->dwStatus = mStatus;
-    card->addressToUse = CPalmSyncImp::nsUseABHomeAddressForPalmAddress(); // 0 == home, 1 == work
-    PR_LOG(PALMSYNC, PR_LOG_DEBUG, ("nsAbIPCCard::GetABCOMCardStruct using %d\n", card->addressToUse));
-
-    CopyValue(isUnicode, kFirstNameProperty, &card->firstName);
-    CopyValue(isUnicode, kLastNameProperty, &card->lastName);
-    CopyValue(isUnicode, kDisplayNameProperty, &card->displayName);
-    CopyValue(isUnicode, kNicknameProperty, &card->nickName);
-    CopyValue(isUnicode, kPriEmailProperty, &card->primaryEmail);
-    CopyValue(isUnicode, k2ndEmailProperty, &card->secondEmail);
-    CopyValue(isUnicode, kWorkPhoneProperty, &card->workPhone);
-    CopyValue(isUnicode, kHomePhoneProperty, &card->homePhone);
-    CopyValue(isUnicode, kFaxProperty, &card->faxNumber);
-    CopyValue(isUnicode, kPagerProperty, &card->pagerNumber);
-    CopyValue(isUnicode, kCellularProperty, &card->cellularNumber);
-    // See if home address contains multiple lines.
-    JoinHomeAndWorkAddresses(isUnicode, card);
-    CopyValue(isUnicode, kHomeCityProperty, &card->homeCity);
-    CopyValue(isUnicode, kHomeStateProperty, &card->homeState);
-    CopyValue(isUnicode, kHomeZipCodeProperty, &card->homeZipCode);
-    CopyValue(isUnicode, kHomeCountryProperty, &card->homeCountry);
-    CopyValue(isUnicode, kWorkCityProperty, &card->workCity);
-    CopyValue(isUnicode, kWorkStateProperty, &card->workState);
-    CopyValue(isUnicode, kWorkZipCodeProperty, &card->workZipCode);
-    CopyValue(isUnicode, kWorkCountryProperty, &card->workCountry);
-    CopyValue(isUnicode, kJobTitleProperty, &card->jobTitle);
-    CopyValue(isUnicode, kDepartmentProperty, &card->department);
-    CopyValue(isUnicode, kCompanyProperty, &card->company);
-    CopyValue(isUnicode, kWorkWebPageProperty, &card->webPage1);
-    CopyValue(isUnicode, kHomeWebPageProperty, &card->webPage2);
-    CopyValue(isUnicode, kBirthYearProperty, &card->birthYear);
-    CopyValue(isUnicode, kBirthMonthProperty, &card->birthMonth);
-    CopyValue(isUnicode, kBirthDayProperty, &card->birthDay);
-    CopyValue(isUnicode, kCustom1Property, &card->custom1);
-    CopyValue(isUnicode, kCustom2Property, &card->custom2);
-    CopyValue(isUnicode, kCustom3Property, &card->custom3);
-    CopyValue(isUnicode, kCustom4Property, &card->custom4);
-    CopyValue(isUnicode, kNotesProperty, &card->notes);
-
-    GetPropertyAsUint32(kLastModifiedDateProperty,
-                        (PRUint32*)&card->lastModifiedDate);
-    GetPropertyAsUint32(kPreferMailFormatProperty,
-                        (PRUint32*)&card->preferMailFormat);
-    card->addressToUse = CPalmSyncImp::nsUseABHomeAddressForPalmAddress(); // 0 == home, 1 == work
-    nsAutoString homePhone, workPhone;
-    GetPropertyAsAString(kHomePhoneProperty, homePhone);
-    GetPropertyAsAString(kWorkPhoneProperty, workPhone);
-    if (CPalmSyncImp::nsPreferABHomePhoneForPalmPhone())
-      card->preferredPhoneNum = (homePhone.IsEmpty()) ? (workPhone.IsEmpty() ? 4 : 1) : 2;
-    else
-      card->preferredPhoneNum = (workPhone.IsEmpty()) ? 2 : (workPhone.IsEmpty() ? 4 : 1);
-    card->isMailList = m_IsMailList;
-    // Can't use ToNewCString() call here becasue MSCOM will complaint about
-    // memory deallocation (ie, NdrPointerFree()) use CoTaskMemAlloc() instead.
-    if (m_MailListURI.IsEmpty())
-      card->mailListURI = NULL;
-    else
-    {
-      PRInt32 length = m_MailListURI.Length()+1;
-      char * str = (char *) CoTaskMemAlloc(sizeof(char) * length);
-      strncpy(str, m_MailListURI.get(), length-1);
-      str[length-1] = '\0';
-      card->mailListURI = str;
-    }
-
-    return NS_OK;
-}
-
-void nsAbIPCCard::JoinAddress(PRBool isUnicode, LPTSTR *ptrAddress, nsString &address1, nsString &address2)
-{
-  // If the two address lines in a moz card are not empty
-  // then join the lines into a single line separated by
-  // '\x0A'. This is the format expected by Palm.
-  *ptrAddress = NULL;
-  PRUint32 strLength= address1.Length() + address2.Length();
-  if(!strLength)
-    return;
-
-  // Allocate space for 'strLength' plus three for nulls and one for "\x0A".
-  // These strings are defined as wide in the idl, so we need to add up to 3
-  // bytes of 0 byte padding at the end (if the string is an odd number of 
-  // bytes long, we need one null byte to pad out the last char to a wide char
-  // and then  two more nulls as a wide null terminator.
-  strLength += 4;
-  if(isUnicode)
-  { 
-    PRUnichar * uniStr = (PRUnichar *) CoTaskMemAlloc(sizeof(PRUnichar) * (strLength));
-    if(address1.Length())
-    {
-      wcsncpy(uniStr, address1.get(), strLength-1);
-      uniStr[strLength-1] = '\0';
-      if(address2.Length())
-      {
-        wcsncat(uniStr, (const wchar_t *)"\x0A", strLength-1);
-        wcsncat(uniStr, address2.get(), strLength-1);
-        uniStr[strLength-1] = '\0';
-      }
-    }
-    else
-    {
-      wcsncpy(uniStr, address2.get(), strLength-1);
-      uniStr[strLength-1] = '\0';
-    }
-
-    *ptrAddress = uniStr;
-  } 
-  else
-  { 
-    char * str = (char *) CoTaskMemAlloc(strLength);
-    if(address1.Length())
-    {
-      NS_LossyConvertUTF16toASCII cStr(address1);
-      strncpy(str, cStr.get(), strLength-1);
-      str[strLength-1] = '\0';
-      if(address2.Length())
-      {
-        LossyCopyUTF16toASCII(address2, cStr);
-        strncat(str, "\x0A", strLength-1);
-        strncat(str, cStr.get(), strLength-1);
-        str[strLength-1] = '\0';
-      }
-    }
-    else
-    {
-      NS_LossyConvertUTF16toASCII cStr(address2);
-      strncpy(str, cStr.get(), strLength-1);
-      str[strLength-1] = '\0';
-    }
-    *ptrAddress = (LPTSTR) str;
-  } 
-}
-void nsAbIPCCard::JoinHomeAndWorkAddresses(PRBool isUnicode, nsABCOMCardStruct * card)
-{
-  nsAutoString address, address2;
-  GetPropertyAsAString(kHomeAddressProperty, address);
-  GetPropertyAsAString(kHomeAddress2Property, address2);
-  JoinAddress(isUnicode, &card->homeAddress, address, address2);
-
-  address.Truncate();
-  address2.Truncate();
-  GetPropertyAsAString(kWorkAddressProperty, address);
-  GetPropertyAsAString(kWorkAddress2Property, address2);
-  JoinAddress(isUnicode, &card->workAddress, address, address2);
-}
-
-
deleted file mode 100644
--- a/mailnews/extensions/palmsync/src/nsAbIPCCard.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Created by: Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef nsAbIPCCard_h__
-#define nsAbIPCCard_h__
-
-#include "nsAbCardProperty.h"
-#include "nsISupportsArray.h"
-#include "nsVoidArray.h"
-#include "IPalmSync.h"
-
-// these are states of Palm record
-// as defined in the Palm CDK
-#define ATTR_DELETED        0x0001
-#define ATTR_ARCHIVED       0x0002
-#define ATTR_MODIFIED       0x0004
-#define ATTR_NEW            0x0008
-#define ATTR_NONE           0x0020
-#define ATTR_NO_REC         0x0040
-
-class nsAbIPCCard : public nsAbCardProperty
-{
-public:
-    NS_DECL_ISUPPORTS_INHERITED
-    
-    // this checks for all card data fields
-    NS_IMETHOD Equals(nsIAbCard *card, PRBool *_retval);
-    PRBool Equals(nsABCOMCardStruct * card, nsStringArray & differingAttrs);
-    PRBool EqualsAfterUnicodeConversion(nsABCOMCardStruct * card, nsStringArray & differingAttrs);
-    
-    // this check names attribs: first name + last name + display name + nickname
-    PRBool Same(nsABCOMCardStruct * card, PRBool isUnicode=PR_TRUE);
-    PRBool Same(nsIAbCard *card);
-
-    NS_IMETHOD Copy(nsIAbCard *srcCard);
-    nsresult Copy(nsABCOMCardStruct * srcCard);
-    nsresult ConvertToUnicodeAndCopy(nsABCOMCardStruct * srcCard);
-
-    // this function will allocate new memory for the passed in card struct data members
-    // the caller needs to CoTaskMemFree once it is done using the card struct
-    nsresult GetABCOMCardStruct(PRBool isUnicode, nsABCOMCardStruct * card);
-
-    nsAbIPCCard();
-    nsAbIPCCard(nsIAbCard *card);
-    nsAbIPCCard(nsABCOMCardStruct *card, PRBool isUnicode=PR_TRUE);
-    virtual ~nsAbIPCCard();
-
-    void SetStatus(PRUint32 status) { mStatus = status; }
-    PRUint32 GetStatus() { return mStatus; }
-    void SetRecordId(PRUint32 recID) { mRecordId = recID; }
-    PRUint32 GetRecordId() { return mRecordId; }
-    void SetCategoryId(PRUint32 catID) { mCategoryId = catID; }
-    PRUint32 GetCategoryId() { return mCategoryId; }
-
-private:
-    PRUint32 mRecordId;
-    PRUint32 mCategoryId;
-    PRUint32 mStatus;
-
-    void CopyValue(PRBool isUnicode, const char *attribute, LPTSTR * result);
-    PRBool CompareValue(PRBool isUnicode, LPTSTR cardValue, const char *attribute);
-    PRBool Compare(nsString &cardValue, const char *attribute);
-    void SplitHomeAndWorkAddresses(nsABCOMCardStruct * card, PRBool isUnicode);
-    void SplitAddresses(PRBool isUnicode, LPTSTR homeAddress, LPTSTR workAddress);
-    void JoinHomeAndWorkAddresses(PRBool isUnicode, nsABCOMCardStruct * card);
-    void JoinAddress(PRBool isUnicode, LPTSTR *ptrAddress, nsString &address1, nsString &address2);
-};
-
-#endif
deleted file mode 100644
--- a/mailnews/extensions/palmsync/src/nsAbPalmSync.cpp
+++ /dev/null
@@ -1,1028 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *       Rajiv Dayal <rdayal@netscape.com>
- *       Mark Banner <mark@standard8.demon.co.uk>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsRDFResource.h"
-#include "nsAbPalmSync.h"
-#include "nsAbBaseCID.h"
-#include "nsMsgI18N.h"
-#include "nsIRDFService.h"
-#include "nsRDFCID.h"
-#include "nsUnicharUtils.h"
-#include "nsIAbManager.h"
-#include "nsAbCardProperty.h"
-#include "prdtoa.h"
-#include "nsMsgUtils.h"
-#include "nsIArray.h"
-#include "nsArrayUtils.h"
-
-#define  PREVIOUS_EXTENSION ".prev"
-#define  kPABDirectory  2 // defined in nsDirPrefs.h
-#define  kMAPIDirectory 3 // defined in nsDirPrefs.h
-
-#define PERSONAL_ADDRBOOK_URL   "moz-abmdbdirectory://abook.mab" // defined in MozABConduitSync.h
-
-#ifdef DEBUG_bienvenu
-   PRBool PalmDataDisplayed = PR_FALSE;
-   void DisplayTestData(nsABCOMCardStruct * aIPCCard, PRBool IsUnicode)
-   {
-       if (IsUnicode) {
-           if(aIPCCard->displayName)
-               printf("\n Card Data For : %S:", aIPCCard->displayName);
-           if(aIPCCard->firstName)
-               printf("\n First Name : %S", aIPCCard->firstName);
-           if(aIPCCard->lastName)
-               printf("\n Last Name : %S", aIPCCard->lastName);
-           if(aIPCCard->primaryEmail)
-               printf("\n Email : %S", aIPCCard->primaryEmail);
-           if(aIPCCard->workPhone)
-               printf("\n Work Phone : %S", aIPCCard->workPhone);
-           if(aIPCCard->homePhone)
-               printf("\n Home Phone : %S", aIPCCard->homePhone);
-           if(aIPCCard->faxNumber)
-               printf("\n Fax Number : %S", aIPCCard->faxNumber);
-           if(aIPCCard->company)
-               printf("\n Company : %S", aIPCCard->company);
-           if(aIPCCard->jobTitle)
-               printf("\n Job Title : %S", aIPCCard->jobTitle);
-           if(aIPCCard->homeAddress)
-               printf("\n Home Address : %S", aIPCCard->homeAddress);
-           if(aIPCCard->homeCity)
-               printf("\n Home City : %S", aIPCCard->homeCity);
-           if(aIPCCard->homeState)
-               printf("\n Home State : %S", aIPCCard->homeState);
-           printf("\n");
-       }
-       else {
-           if(aIPCCard->displayName)
-               printf("\n Card Data For : %s:", (char *) aIPCCard->displayName);
-           if(aIPCCard->firstName)
-               printf("\n First Name : %s", (char *) aIPCCard->firstName);
-           if(aIPCCard->lastName)
-               printf("\n Last Name : %s", (char *) aIPCCard->lastName);
-           if(aIPCCard->primaryEmail)
-               printf("\n Email : %s", (char *) aIPCCard->primaryEmail);
-           if(aIPCCard->workPhone)
-               printf("\n Work Phone : %s", (char *) aIPCCard->workPhone);
-           if(aIPCCard->homePhone)
-               printf("\n Home Phone : %s", (char *) aIPCCard->homePhone);
-           if(aIPCCard->faxNumber)
-               printf("\n Fax Number : %s", (char *) aIPCCard->faxNumber);
-           if(aIPCCard->company)
-               printf("\n Company :   %s", (char *) aIPCCard->company);
-           if(aIPCCard->jobTitle)
-               printf("\n Job Title : %s", (char *) aIPCCard->jobTitle);
-           if(aIPCCard->homeAddress)
-               printf("\n Home Address : %s", (char *) aIPCCard->homeAddress);
-           if(aIPCCard->homeCity)
-               printf("\n Home City : %s", (char *) aIPCCard->homeCity);
-           if(aIPCCard->homeState)
-               printf("\n Home State : %s", (char *) aIPCCard->homeState);
-           printf("\n");
-       }
-   }
-#endif
-
-nsAbPalmHotSync::nsAbPalmHotSync(PRBool aIsUnicode, PRUnichar * aAbDescUnicode, const char * aAbDesc, PRInt32 aPalmCatIndex, PRInt32 aPalmCatId)
-{
-    mTotalCardCount=0;
-
-    mCardForPalmCount = 0;
-    mCardListForPalm = nsnull;
-    
-    mInitialized = PR_FALSE;
-    mDBOpen = PR_FALSE;
-    
-    if(aIsUnicode)
-        mAbName.Assign(aAbDescUnicode);
-    else
-        mAbName.AssignASCII(aAbDesc);
-    mAbName.Trim(" ");
-
-    mPalmCategoryIndex = aPalmCatIndex;
-    mPalmCategoryId    = aPalmCatId;
-
-    mIsPalmDataUnicode = aIsUnicode;
-
-    mNewCardCount = 0;
-    NS_NewISupportsArray(getter_AddRefs(mNewCardsArray));
-    mIsNewCardForPalm = PR_FALSE;
-}
-
-nsAbPalmHotSync::~nsAbPalmHotSync()
-{
-    // clear the nsVoidArray, don't free the stored pointers since they are freed by calling app (Conduit)
-    mPalmRecords.Clear();
-
-    if(mDBOpen && mABDB)
-        mABDB->Close(PR_FALSE);
-}
-
-// this is a utility function
-void nsAbPalmHotSync::ConvertAssignPalmIDAttrib(PRUint32 id, nsIAbCard * card)  
-{ 
-    PRInt64 l;
-    LL_UI2L(l, id);
-    PRFloat64 f;
-    LL_L2F(f, l);
-    char buf[128];
-    PR_cnvtf(buf, 128, 0, f);
-    mABDB->SetCardValue(card, CARD_ATTRIB_PALMID, NS_ConvertASCIItoUTF16(buf).get(), PR_TRUE);
-}
-
-nsresult nsAbPalmHotSync::GetABInterface()
-{
-  // Use GetChildNodes() call here.
-  nsresult rv;
-  nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID, &rv));
-  if (NS_FAILED(rv))
-    return E_FAIL;
-
-  nsString description;
-  nsCString fileName, uri, prefName;
-  PRUint32 palmSyncTimeStamp;
-  PRInt32 dirType, palmCategoryIndex;
-  nsCOMPtr<nsISimpleEnumerator> subDirectories;
-  if (NS_FAILED(abManager->GetDirectories(getter_AddRefs(subDirectories))) || !subDirectories)
-    return E_FAIL;
-
-  // Check each valid addrbook.
-  nsCOMPtr<nsISupports> item;
-  nsCOMPtr<nsIAbDirectory> directory;
-  PRBool hasMore;
-  while (NS_SUCCEEDED(rv = subDirectories->HasMoreElements(&hasMore)) && hasMore)
-  {
-    if (NS_SUCCEEDED(subDirectories->GetNext(getter_AddRefs(item))))
-    {
-      directory = do_QueryInterface(item, &rv);
-      if (NS_SUCCEEDED(rv))
-      {
-        // TODO: may need to skip mailing list?? but maybe not since there's no mailing list on the top level.
-
-        rv = directory->GetDescription(description);
-        if(NS_FAILED(rv)) return E_FAIL;
-        rv = directory->GetFileName(fileName);
-        if(NS_FAILED(rv)) return E_FAIL;
-        rv = directory->GetURI(uri);
-        if(NS_FAILED(rv)) return E_FAIL;
-        rv = directory->GetDirType(&dirType);
-        if(NS_FAILED(rv)) return E_FAIL;
-        rv = directory->GetDirPrefId(prefName);
-        if (NS_FAILED(rv)) return E_FAIL;
-        rv = directory->GetIntValue("PalmCategoryId", -1, &palmCategoryIndex);
-        if (NS_FAILED(rv)) return E_FAIL;
-        rv = directory->GetIntValue("PalmSyncTimeStamp", 0,
-                                    (PRInt32*)&palmSyncTimeStamp);
-        if (NS_FAILED(rv)) return E_FAIL;
-
-        // Skip/Ignore 4.X addrbooks (ie, with ".na2" extension).
-        if (((fileName.Length() > kABFileName_PreviousSuffixLen) && 
-            strcmp(fileName.get() + fileName.Length() - kABFileName_PreviousSuffixLen, kABFileName_PreviousSuffix) == 0) ||
-            (dirType != kPABDirectory && dirType != kMAPIDirectory))
-          continue;
-
-        // If Palm category is already assigned to AB then just check that (ie, was synced before).
-        if((palmCategoryIndex > -1) && (mPalmCategoryIndex == palmCategoryIndex))
-          break;
-
-        // If Palm category is not already assigned check the AB name (ie, never
-        // synced before). Note that Palm category name is only 15 chars max.
-        if (description.Length() > 15 && mAbName.Length() <= 15)
-          description.Cut(15, description.Length()-15);
-
-        // check for matching AB+Category, and special case personal address book
-        // to match "Personal" category.
-        if(description == mAbName || 
-            (prefName.Equals("ldap_2.servers.pab", nsCaseInsensitiveCStringComparator())
-             && mAbName.LowerCaseEqualsLiteral("personal")))
-          break;
-        directory = nsnull;
-      }
-    }
-  }
-
-  // If not found return error.
-  if(!directory)
-    return NS_ERROR_FILE_NOT_FOUND;
-
-  mDirectory = directory;
-  mFileName = fileName;
-  mUri = uri;
-  mDescription = description;
-  mDirType = dirType;
-  mPalmSyncTimeStamp = palmSyncTimeStamp;
-
-  return NS_OK;
-}
-
-nsresult nsAbPalmHotSync::Initialize()
-{
-  // Use GetChildNodes() call here.
-  if(mInitialized)
-      return NS_OK;
-
-  nsresult rv = GetABInterface();
-  NS_ENSURE_SUCCESS(rv, rv);
-  mInitialized = TRUE;
-    return NS_OK;
-}
-
-nsresult nsAbPalmHotSync::AddAllRecordsToAB(PRBool existingAB, PRInt32 aCount, lpnsABCOMCardStruct aPalmRecords)
-{
-    NS_ENSURE_ARG_POINTER(aPalmRecords);
-    nsresult rv;
-    // Create the new AB dir before adding cards/records.
-    if (existingAB)
-    {
-      rv = Initialize();  
-      NS_ENSURE_SUCCESS(rv, rv); 
-      rv = OpenABDBForHotSync(PR_FALSE);
-      NS_ENSURE_SUCCESS(rv, rv);
-      // lets try deleting the db out from under ourselves. 
-      nsCOMPtr<nsIFile> abFile;
-      rv = mABDB->GetDbPath(getter_AddRefs(abFile));
-      NS_ENSURE_SUCCESS(rv, rv);
-      mABDB->ForceClosed();
-      mDBOpen = PR_FALSE;
-      mABDB = nsnull;
-      abFile->Remove(PR_FALSE);
-    }
-    else
-    {
-      nsresult rv = NewAB(mAbName);
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      rv = Initialize(); // Find the new AB and and init some vars (set mDirectory etc).
-      NS_ENSURE_SUCCESS(rv, rv);
-    }
-
-    // open the Moz AB database
-    rv = OpenABDBForHotSync(PR_TRUE);
-    NS_ENSURE_SUCCESS(rv, rv);
-    // we are just storing the pointer array here not record arrays
-    for (PRInt32 i=0; i < aCount; i++)
-        mPalmRecords.AppendElement(&aPalmRecords[i]);
-
-    // new DB here so no need to backup
-    rv = UpdateMozABWithPalmRecords();
- 
-    rv = mABDB->Close(NS_SUCCEEDED(rv));
-
-    if(NS_SUCCEEDED(rv)) {
-        mDBOpen = PR_FALSE;
-        PRUint32 modTimeInSec;
-        PRTime2Seconds(PR_Now(), &modTimeInSec);
-        rv = UpdateABInfo(modTimeInSec, mPalmCategoryIndex);
-    }
-    else { // get back the previous file
-        rv = mABDB->ForceClosed();
-        if(NS_SUCCEEDED(rv)) {
-            nsCAutoString leafName;
-            mABFile->GetNativeLeafName(leafName);
-            PRBool bExists=PR_FALSE;
-            mPreviousABFile->Exists(&bExists);
-            if(bExists) {
-                nsCOMPtr<nsIFile> parent;
-                rv = mABFile->GetParent(getter_AddRefs(parent));
-                if (NS_SUCCEEDED(rv)) {
-                    mABFile->Remove(PR_FALSE);
-                    mPreviousABFile->CopyToNative(parent, leafName);
-                }
-            }
-            mDBOpen = PR_FALSE;
-        }
-    }
-
-    return rv;
-}
-
-nsresult nsAbPalmHotSync::GetAllCards(PRInt32 * aCount, lpnsABCOMCardStruct * aCardList)
-{
-    NS_ENSURE_ARG_POINTER(aCount);
-    NS_ENSURE_ARG_POINTER(aCardList);
-
-    if(!mInitialized) 
-        return NS_ERROR_NOT_INITIALIZED;
-
-    // open the Moz AB database
-    nsresult rv = OpenABDBForHotSync(PR_FALSE); 
-    if(NS_FAILED(rv))
-        return rv;
-
-    // create the list to be sent back to Palm
-    mABDB->GetCardCount(&mTotalCardCount);
-    *aCount = mTotalCardCount;
-    if(!mTotalCardCount) {
-        mABDB->Close(PR_FALSE);
-        return NS_OK;
-    }
-
-    mCardListForPalm = (lpnsABCOMCardStruct) CoTaskMemAlloc(sizeof(nsABCOMCardStruct) * mTotalCardCount);
-    if(!mCardListForPalm) {
-        mABDB->Close(PR_FALSE);
-        return NS_ERROR_OUT_OF_MEMORY;
-    }
-
-    nsCOMPtr<nsISimpleEnumerator> cardsEnumerator;
-    rv = mABDB->EnumerateCards(mDirectory, getter_AddRefs(cardsEnumerator));
-    if (NS_FAILED(rv) || !cardsEnumerator) {
-        mABDB->Close(PR_FALSE);
-        return rv;
-    }
-
-    nsCOMPtr<nsISupports> item;
-    nsCOMPtr<nsIAbCard> card;
-    PRBool more;
-    while (NS_SUCCEEDED(cardsEnumerator->HasMoreElements(&more)) && more) {
-        rv = cardsEnumerator->GetNext(getter_AddRefs(item));
-        if (NS_FAILED(rv)) 
-            continue;
-
-        card = do_QueryInterface(item, &rv);
-        if (NS_FAILED(rv)) // can this be anything but a card?
-            continue;
-
-        PRBool isMailingList=PR_FALSE;
-        rv = card->GetIsMailList(&isMailingList);
-        if (NS_FAILED(rv) || isMailingList) // if mailing list go to cards
-            continue;
-
-        nsAbIPCCard  ipcCard(card);
-        ipcCard.SetStatus(ATTR_NEW);
-
-        rv = AddToListForPalm(ipcCard);
-        if(NS_FAILED(rv))
-            break;
-
-        mNewCardsArray->AppendElement(card);
-        mNewCardCount++;
-    }
-
-
-    *aCount = mCardForPalmCount;
-    *aCardList = mCardListForPalm;
-
-    // Don't close the DB yet, it will be closed when Done is called
-
-    return NS_OK;
-}
-
-nsresult nsAbPalmHotSync::DoSyncAndGetUpdatedCards(PRInt32 aPalmCount, lpnsABCOMCardStruct aPalmRecords, 
-                                                    PRInt32 * aMozCount, lpnsABCOMCardStruct * aMozCards)
-{
-    NS_ENSURE_ARG_POINTER(aPalmRecords);
-    NS_ENSURE_ARG_POINTER(aMozCount);
-    NS_ENSURE_ARG_POINTER(aMozCards);
-
-    if(!mInitialized) 
-        return NS_ERROR_NOT_INITIALIZED;
-
-    // open the Moz AB database
-    nsresult rv = OpenABDBForHotSync(PR_FALSE); 
-    if(NS_FAILED(rv))
-        return rv;
-
-    // we are just storing the pointer array here, not record arrays
-    for (PRInt32 i=0; i < aPalmCount; i++) 
-    {
-        mPalmRecords.AppendElement(&aPalmRecords[i]);
-#ifdef DEBUG_bienvenu        
-        DisplayTestData(&aPalmRecords[i],PR_FALSE);
-#endif
-    }
-
-    // create the list to be sent back to Palm
-    mABDB->GetCardCount(&mTotalCardCount);
-    PRUint32  deletedCardCount=0;
-    mABDB->GetDeletedCardCount(&deletedCardCount);
-    mTotalCardCount += deletedCardCount;
-    if(mTotalCardCount) 
-    {
-        mCardListForPalm = (lpnsABCOMCardStruct) CoTaskMemAlloc(sizeof(nsABCOMCardStruct) * mTotalCardCount);
-        if(!mCardListForPalm) 
-        {
-            mABDB->Close(PR_FALSE);
-            return NS_ERROR_OUT_OF_MEMORY;
-        }
-    }
-
-    // initialize the flag for any new Moz cards to be added to Palm
-    mIsNewCardForPalm = PR_FALSE;
-
-    // deal with new / modified or first time sync
-    rv = LoadNewModifiedCardsSinceLastSync();
-    if(NS_SUCCEEDED(rv))
-        // deal with deleted
-        rv = LoadDeletedCardsSinceLastSync();
-    if(NS_SUCCEEDED(rv))
-        // first backup the existing DB as Previous
-        rv = KeepCurrentStateAsPrevious();
-    if(NS_SUCCEEDED(rv))
-        // update local DB for sync
-        rv = UpdateMozABWithPalmRecords();
-
-    // if there are no new cards to be added in Palm close DB
-    // else wait for Done to be called.
-    if(!mIsNewCardForPalm) 
-    {
-        rv = mABDB->Close(NS_SUCCEEDED(rv) && mPalmRecords.Count());
-
-        if(NS_SUCCEEDED(rv)) 
-        {
-            mDBOpen = PR_FALSE;
-            PRUint32 modTimeInSec;
-            PRTime2Seconds(PR_Now(), &modTimeInSec);
-            rv = UpdateABInfo(modTimeInSec, mPalmCategoryIndex);
-        }
-        else
-        { // get back the previous file
-            rv = mABDB->ForceClosed();
-            if(NS_SUCCEEDED(rv)) 
-            {
-                nsCAutoString leafName;
-                mABFile->GetNativeLeafName(leafName);
-                PRBool bExists=PR_FALSE;
-                mPreviousABFile->Exists(&bExists);
-                if(bExists) 
-                {
-                    nsCOMPtr<nsIFile> parent;
-                    rv = mABFile->GetParent(getter_AddRefs(parent));
-                    if (NS_SUCCEEDED(rv)) 
-                    {
-                        mABFile->Remove(PR_FALSE);
-                        mPreviousABFile->CopyToNative(parent, leafName);
-                    }
-                }
-                mDBOpen = PR_FALSE;
-            }
-        }
-    }
-
-    *aMozCount = mCardForPalmCount;
-    *aMozCards = mCardListForPalm;
-
-    return rv;
-}
-
-// this takes care of the cases when the state is deleted
-nsresult nsAbPalmHotSync::LoadDeletedCardsSinceLastSync()
-{
-    if (!mDBOpen || !mABDB || !mInitialized) 
-        return NS_ERROR_NOT_INITIALIZED;
-    
-    nsCOMPtr<nsIArray> deletedCardArray;
-    nsresult rv = mABDB->GetDeletedCardList(getter_AddRefs(deletedCardArray));
-    if (NS_FAILED(rv))
-        return rv;
-
-    PRUint32 deletedCardCount;
-    rv = deletedCardArray->GetLength(&deletedCardCount);
-    if (NS_FAILED(rv))
-        return rv;
-
-    for(PRUint32 i=0; i < deletedCardCount; i++) 
-    {
-        nsCOMPtr<nsIAbCard> card(do_QueryElementAt(deletedCardArray, i, &rv));
-        if (NS_FAILED(rv)) // can this be anything but a card?
-            continue;
-        
-        PRBool isMailingList=PR_FALSE;
-        rv = card->GetIsMailList(&isMailingList);
-        if (NS_FAILED(rv) || isMailingList)
-            continue;
-
-        PRUint32 lastModifiedDate = 0;
-        rv = card->GetPropertyAsUint32(kLastModifiedDateProperty, &lastModifiedDate);
-        if (NS_FAILED(rv) || !lastModifiedDate)
-            continue;
-
-        if(lastModifiedDate > mPalmSyncTimeStamp)
-        {
-            nsAbIPCCard  ipcCard(card);
-            // check in the list of Palm records
-            for(PRInt32 i=mPalmRecords.Count()-1; i >=0;  i--) 
-            {
-                nsABCOMCardStruct * palmRec = (nsABCOMCardStruct *) mPalmRecords.ElementAt(i);
-                // if same record exists in palm list, donot delete it from Palm
-                if(ipcCard.Same(palmRec, mIsPalmDataUnicode))
-                    continue;
-            }
-            ipcCard.SetStatus(ATTR_DELETED);
-
-            rv = AddToListForPalm(ipcCard);
-            if(NS_FAILED(rv))
-                break;
-        }
-    }
-    return rv;
-}
-
-
-nsresult nsAbPalmHotSync::LoadNewModifiedCardsSinceLastSync()
-{
-    if(!mDBOpen || !mABDB || !mInitialized) 
-        return NS_ERROR_NOT_INITIALIZED;
-
-    nsCOMPtr<nsISimpleEnumerator> cardsEnumerator;
-    nsresult rv = mABDB->EnumerateCards(mDirectory, getter_AddRefs(cardsEnumerator));
-    if (NS_FAILED(rv) || !cardsEnumerator) 
-        return NS_ERROR_NOT_AVAILABLE; // no cards available
-
-    // create the list of cards to be sent to Palm
-    nsCOMPtr<nsISupports> item;
-    nsCOMPtr<nsIAbCard> card;
-    PRBool more;
-    while (NS_SUCCEEDED(cardsEnumerator->HasMoreElements(&more)) && more) 
-    {
-        rv = cardsEnumerator->GetNext(getter_AddRefs(item));
-        if (NS_FAILED(rv)) 
-            return rv;
-
-        card = do_QueryInterface(item, &rv);
-        if (NS_FAILED(rv)) // can this be anything but a card?
-            continue;
-
-        PRBool isMailingList=PR_FALSE;
-        rv = card->GetIsMailList(&isMailingList);
-        if (NS_FAILED(rv) || isMailingList) // if mailing list go to cards
-            continue;
-
-        PRUint32 lastModifiedDate = 0;
-        rv = card->GetPropertyAsUint32(kLastModifiedDateProperty, &lastModifiedDate);
-        if (NS_FAILED(rv))
-            continue;
-
-        if(lastModifiedDate > mPalmSyncTimeStamp  // take care of modified
-            || !lastModifiedDate || !mPalmSyncTimeStamp) 
-        {  // take care of new or never before sync
-            
-            //create nsAbIPCCard and assign its status based on lastModifiedDate
-            nsAbIPCCard ipcCard(card);
-            ipcCard.AddRef(); // someone needs a reference to this, since we
-            // pass it around as an interface pointer
-            ipcCard.SetStatus((lastModifiedDate) ? ATTR_MODIFIED : ATTR_NEW);
-
-            // Check with the palm list (merging is done if required)
-            if (CardExistsInPalmList(&ipcCard)) 
-                continue;
-
-            rv = AddToListForPalm(ipcCard);
-            if(NS_FAILED(rv))
-                break;
-
-            if(ipcCard.GetStatus() == ATTR_NEW) 
-            {
-                mNewCardsArray->AppendElement(card);
-                mNewCardCount++;
-                mIsNewCardForPalm = PR_TRUE;
-            }
-        }
-    }
-
-    return NS_OK;
-}
-
-
-// this take care of the all cases when the state is either modified or new
-PRBool nsAbPalmHotSync::CardExistsInPalmList(nsAbIPCCard  * aIPCCard)
-{
-    NS_ENSURE_ARG_POINTER(aIPCCard);
-
-    if(!mInitialized) 
-        return PR_FALSE;
-
-    PRBool exists = PR_FALSE;
-
-    for(PRInt32 i=mPalmRecords.Count()-1; i >=0;  i--) 
-    {
-        nsABCOMCardStruct * palmRec = (nsABCOMCardStruct *) mPalmRecords.ElementAt(i);
-        
-        // if same record is in palm list also
-        if(aIPCCard->Same(palmRec, mIsPalmDataUnicode)) 
-        {
-            // if the state deleted on both sides no need to do anything
-            if ((palmRec->dwStatus & ATTR_DELETED || palmRec->dwStatus & ATTR_ARCHIVED) &&
-                (aIPCCard->GetStatus() == ATTR_DELETED)) 
-            {
-                mPalmRecords.RemoveElementAt(i);
-                return PR_TRUE;
-            }
-            // if deleted on Palm and added or modified on Moz, don't delete on Moz
-            if ( (palmRec->dwStatus & ATTR_DELETED || palmRec->dwStatus & ATTR_ARCHIVED) && 
-                 ((aIPCCard->GetStatus() == ATTR_NEW) || (aIPCCard->GetStatus() == ATTR_MODIFIED)) ) 
-            {
-                mPalmRecords.RemoveElementAt(i);
-                return PR_FALSE;
-            }
-
-            // set the palm record ID in the card if not already set
-            if(!aIPCCard->GetRecordId()) 
-            {
-                ConvertAssignPalmIDAttrib(palmRec->dwRecordId, aIPCCard);
-                mABDB->EditCard(aIPCCard, PR_FALSE, nsnull);
-                aIPCCard->SetRecordId(palmRec->dwRecordId);
-            }
-
-            // if deleted in Moz and added or modified on Palm, don't delete on Palm
-            if ( (aIPCCard->GetStatus() == ATTR_DELETED) && 
-                 ((palmRec->dwStatus == ATTR_NEW) 
-                   ||(palmRec->dwStatus == ATTR_MODIFIED)) ) 
-                return PR_TRUE;
-
-            // for rest of the cases with state as either mod or new:
-            nsStringArray diffAttrs;
-            PRBool fieldsMatch = PR_FALSE;
-            if(mIsPalmDataUnicode)
-                fieldsMatch = aIPCCard->Equals(palmRec, diffAttrs);
-            else
-                fieldsMatch = aIPCCard->EqualsAfterUnicodeConversion(palmRec, diffAttrs);
-
-            // if fields match, no need to keep it for sync
-            if(fieldsMatch) 
-            {
-                exists = PR_TRUE;
-                // since the fields match, no need to update Moz AB with palm record
-                mPalmRecords.RemoveElementAt(i); 
-            }
-            else 
-            {
-                // we add an additional record on both sides alike Palm Desktop sync
-                palmRec->dwStatus = ATTR_NONE;
-                aIPCCard->SetStatus(ATTR_NEW);
-                exists = PR_FALSE;
-            }
-            // since we found the same record in palm sync list
-            // no need to go thru the rest of the mPalmRecords list
-            break;
-        }
-    }
-
-    return exists;
-}
-
-// utility function
-nsresult nsAbPalmHotSync::AddToListForPalm(nsAbIPCCard & ipcCard)
-{
-    // this should never happen but check for crossing array index
-    if(mCardForPalmCount >= mTotalCardCount)
-        return NS_ERROR_UNEXPECTED;
-
-    nsresult rv = ipcCard.GetABCOMCardStruct(mIsPalmDataUnicode, &mCardListForPalm[mCardForPalmCount]);
-    if(NS_SUCCEEDED(rv)) 
-    {
-        mCardListForPalm[mCardForPalmCount].dwCategoryId = mPalmCategoryId;
-        mCardForPalmCount++;
-    }
-
-    return rv;
-}
-
-nsresult nsAbPalmHotSync::OpenABDBForHotSync(PRBool aCreate)
-{
-    if(!mInitialized) 
-        return NS_ERROR_NOT_INITIALIZED;
-
-    // if already open
-    if(mDBOpen && mABDB && mDirectory)
-        return NS_OK;
-
-    if(mFileName.IsEmpty())
-        return NS_ERROR_FILE_INVALID_PATH;
-
-    nsresult rv;
-    nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID, &rv));
-    if (NS_FAILED(rv))
-      return rv;
-
-    rv = abManager->GetUserProfileDirectory(getter_AddRefs(mABFile));
-    if (NS_FAILED(rv))
-      return rv;
-
-    mABFile->AppendNative(mFileName);
-
-    nsCOMPtr<nsIAddrDatabase> addrDBFactory = 
-             do_GetService(NS_ADDRDATABASE_CONTRACTID, &rv);
-    if(NS_FAILED(rv)) 
-    {
-        return rv;
-    }
-    
-    rv = addrDBFactory->Open(mABFile, aCreate, PR_TRUE, getter_AddRefs(mABDB));
-    NS_ENSURE_SUCCESS(rv, rv);
-    mDBOpen = PR_TRUE;  // Moz AB DB is now Open
-
-    return rv;
-}
-
-nsresult nsAbPalmHotSync::KeepCurrentStateAsPrevious()
-{
-    if(!mInitialized) 
-        return NS_ERROR_NOT_INITIALIZED;
-
-    nsresult rv = NS_OK;
-
-    nsCAutoString previousLeafName(mFileName);
-    previousLeafName += PREVIOUS_EXTENSION;
-
-    if(!mPreviousABFile) 
-    {
-      nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID, &rv));
-      if (NS_FAILED(rv))
-        return rv;
-
-      rv = abManager->GetUserProfileDirectory(getter_AddRefs(mPreviousABFile));
-      if (NS_SUCCEEDED(rv))
-      {
-        mPreviousABFile->AppendNative(previousLeafName);
-        if (NS_FAILED(rv))
-          return rv;
-      }
-    }
-
-    PRBool bExists=PR_FALSE;
-    mABFile->Exists(&bExists);
-    if(bExists) 
-    {
-        mPreviousABFile->Exists(&bExists);
-        if(bExists)
-            rv = mPreviousABFile->Remove(PR_FALSE);
-        nsCOMPtr<nsIFile> parent;
-        rv = mABFile->GetParent(getter_AddRefs(parent));
-        if (NS_SUCCEEDED(rv))
-            rv = mABFile->CopyToNative(parent, previousLeafName);
-    }        
-    return rv;
-}
-
-
-nsresult nsAbPalmHotSync::UpdateMozABWithPalmRecords()
-{
-    if(!mInitialized || !mABDB || !mDBOpen)
-        return NS_ERROR_NOT_INITIALIZED;
-
-    nsresult rv = NS_OK;
-
-    for(PRInt32 i=mPalmRecords.Count()-1; i >=0;  i--) 
-    {
-        nsABCOMCardStruct * palmRec = (nsABCOMCardStruct *)mPalmRecords.ElementAt(i);
-        nsAbIPCCard ipcCard(palmRec, PR_FALSE);
-
-        char recordIDBuf[128]; 
-        PRInt64 l;
-        LL_UI2L(l, palmRec->dwRecordId);
-        PRFloat64 f;
-        LL_L2F(f, l);
-        PR_cnvtf(recordIDBuf, 128, 0, f);
-
-        // if the card already exists
-        nsCOMPtr<nsIAbCard> existingCard;
-        rv = mABDB->GetCardFromAttribute(nsnull, CARD_ATTRIB_PALMID,
-					 nsDependentCString(recordIDBuf),
-					 PR_FALSE, getter_AddRefs(existingCard));
-        if (!existingCard)
-        {
-          rv = mABDB->GetCardFromAttribute(nsnull, CARD_ATTRIB_DISPLAY,
-					   nsDependentCString((const char *) palmRec->displayName),
-					   PR_FALSE, getter_AddRefs(existingCard));
-          // if card with this display name exists, just continue; But, we should make sure
-          // it's associated with the palm card going forward, so set the palmid.
-          if (NS_SUCCEEDED(rv) && existingCard)
-          {
-            existingCard->SetPropertyAsAUTF8String(CARD_ATTRIB_PALMID,
-                nsDependentCString(recordIDBuf));
-            continue;
-          }
-
-        }
-        if(NS_SUCCEEDED(rv) && existingCard) 
-        {
-            // Archived is the same as deleted in palm.
-            if(palmRec->dwStatus & ATTR_DELETED || palmRec->dwStatus & ATTR_ARCHIVED) 
-            {
-                mABDB->DeleteCard(existingCard, PR_FALSE, nsnull);
-                continue;
-            }
-            if(palmRec->dwStatus & ATTR_NEW)
-                continue;
-            if(palmRec->dwStatus & ATTR_MODIFIED) 
-            {
-                PRBool isEqual=PR_FALSE;
-                ipcCard.Equals(existingCard, &isEqual);
-                if(isEqual)
-                    continue;
-                else 
-                {
-                    existingCard->Copy(&ipcCard);
-                    rv = mABDB->EditCard(existingCard, PR_FALSE, nsnull);
-                    continue;
-                }
-            }
-        }
-
-        nsCOMPtr<nsIAbCard> newCard;
-        newCard = do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv);
-        if(NS_FAILED(rv))
-            continue;
-
-        rv = newCard->Copy(&ipcCard);
-        if(NS_FAILED(rv)) 
-            continue;
-
-        // if the card does not exist
-        if((ipcCard.GetStatus() == ATTR_NEW)
-            ||(ipcCard.GetStatus() == ATTR_MODIFIED)
-            || (ipcCard.GetStatus() == ATTR_NONE)) 
-        {
-            PRUint32 modTimeInSec;
-            PRTime2Seconds(PR_Now(), &modTimeInSec);
-            ipcCard.SetPropertyAsUint32(kLastModifiedDateProperty, modTimeInSec);
-            rv = mABDB->CreateNewCardAndAddToDB(newCard, PR_FALSE, nsnull);
-            if(NS_SUCCEEDED(rv)) 
-            {
-                // now set the attribute for the PalmRecID in the card in the DB
-                newCard->SetPropertyAsAUTF8String(CARD_ATTRIB_PALMID,
-                    nsDependentCString(recordIDBuf));
-                rv = mABDB->EditCard(newCard, PR_FALSE, nsnull);
-            }
-        }
-    }
-
-    return rv;
-}
-
-
-nsresult nsAbPalmHotSync::Done(PRBool aSuccess, PRInt32 aPalmCatIndex, PRUint32 aPalmRecIDListCount, unsigned long * aPalmRecordIDList)
-{
-    if(!mInitialized) 
-        return NS_ERROR_NOT_INITIALIZED;
-
-    nsresult rv=NS_ERROR_UNEXPECTED;
-
-    if(aPalmRecIDListCount == mNewCardCount) 
-    {
-        for(PRUint32 i=0; i<aPalmRecIDListCount; i++) 
-        {
-            nsCOMPtr<nsIAbCard> newCard;
-            rv = mNewCardsArray->QueryElementAt(i, NS_GET_IID(nsIAbCard), getter_AddRefs(newCard));
-            if (NS_SUCCEEDED(rv) && newCard) 
-            {
-                ConvertAssignPalmIDAttrib(aPalmRecordIDList[i], newCard);
-                mABDB->EditCard(newCard, PR_FALSE, nsnull);
-            }
-        }
-    }
-
-    if(mABDB && mDBOpen) 
-    {
-        if(aSuccess) 
-        {
-            rv = mABDB->Close(PR_TRUE);
-            if(NS_SUCCEEDED(rv)) 
-            {
-                mDBOpen = PR_FALSE;
-                PRUint32 modTimeInSec;
-                PRTime2Seconds(PR_Now(), &modTimeInSec);
-                rv = UpdateABInfo(modTimeInSec, aPalmCatIndex);
-            }
-        }
-        if(NS_FAILED(rv) || !aSuccess) 
-        { // get back the previous file
-            rv = mABDB->ForceClosed();
-            if(NS_SUCCEEDED(rv)) 
-            {
-                nsCAutoString leafName;
-                mABFile->GetNativeLeafName(leafName);
-                PRBool bExists=PR_FALSE;
-                mPreviousABFile->Exists(&bExists);
-                if(bExists) 
-                {
-                    nsCOMPtr<nsIFile> parent;
-                    rv = mABFile->GetParent(getter_AddRefs(parent));
-                    if (NS_SUCCEEDED(rv)) 
-                    {
-                        mABFile->Remove(PR_FALSE);
-                        mPreviousABFile->CopyToNative(parent, leafName);
-                    }
-                }
-                mDBOpen = PR_FALSE;
-            }
-        }
-    }
-    
-    return rv;
-}
-
-nsresult nsAbPalmHotSync::UpdateSyncInfo(long aCategoryIndex)
-{
-  // aCategoryIndex = -1 means that callers want to reset the mod time as well. 
-  mDBOpen = PR_FALSE;
-  PRUint32 modTimeInSec;
-  PRTime2Seconds(PR_Now(), &modTimeInSec);
-  if (aCategoryIndex >= 0)
-    return(UpdateABInfo(modTimeInSec, aCategoryIndex));
-  else
-    return(UpdateABInfo(0, aCategoryIndex)); // Reset mod time.
-}
-
-nsresult nsAbPalmHotSync::DeleteAB(const char* aABUrl)
-{
-  nsresult rv;
-  nsCOMPtr<nsIAbManager> ab(do_GetService(NS_ABMANAGER_CONTRACTID, &rv));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return ab->DeleteAddressBook(nsDependentCString(aABUrl));
-}
-
-nsresult nsAbPalmHotSync::RenameAB(long aCategoryIndex, const char * aABUrl)
-{
-  PRUint32 modTimeInSec;
-  PRTime2Seconds(PR_Now(), &modTimeInSec);
-
-  return ModifyAB(aABUrl, mAbName, modTimeInSec, aCategoryIndex);
-}
-
-nsresult nsAbPalmHotSync::NewAB(const nsString& aAbName)
-{
-  nsresult rv;
-  nsCOMPtr <nsIAbManager> ab(do_GetService(NS_ABMANAGER_CONTRACTID, &rv));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Don't actually need to keep the result
-  nsCString result;
-  return ab->NewAddressBook(aAbName, EmptyCString(), kPABDirectory, EmptyCString(), result);
-}
-
-nsresult nsAbPalmHotSync::UpdateABInfo(PRUint32 aModTime, PRInt32 aCategoryIndex)
-{
-  return(ModifyAB(mUri.get(), mDescription, aModTime, aCategoryIndex));
-}
-
-nsresult nsAbPalmHotSync::ModifyAB(const char * aABUrl,
-				   const nsString &aAbName,
-				   const PRUint32 aModTime,
-				   const PRInt32 aCategoryId)
-{
-  nsresult rv;
-
-  nsCOMPtr<nsIRDFService> rdfService = do_GetService (NS_RDF_CONTRACTID "/rdf-service;1", &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Parent nsIABDirectory: like "moz-abdirectory://".
-  nsCOMPtr <nsIRDFResource> resource;
-  rv = rdfService->GetResource(NS_LITERAL_CSTRING("moz-abdirectory://"), getter_AddRefs(resource));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr <nsIAbDirectory> parentDirectory = do_QueryInterface(resource, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Selected folder nsIABDirectory: like "moz-abmdbdirectory://abook-1.mab"
-  nsCOMPtr <nsIRDFResource> childResource;
-  rv = rdfService->GetResource(nsDependentCString(aABUrl), getter_AddRefs(childResource));
-  NS_ENSURE_SUCCESS(rv, rv);
-  nsCOMPtr <nsIAbDirectory> selectedDirectory = do_QueryInterface(childResource, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = selectedDirectory->SetDirName(aAbName);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Now set the mod time and category id directly via the selected directory.
-  rv = selectedDirectory->SetIntValue("PalmSyncTimeStamp", aModTime);
-  NS_ENSURE_SUCCESS(rv, rv);
-  
-  return selectedDirectory->SetIntValue("PalmSyncCategoryId", aCategoryId);
-}
deleted file mode 100644
--- a/mailnews/extensions/palmsync/src/nsAbPalmSync.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla 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/MPL/
- *
- * 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 the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Rajiv Dayal <rdayal@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL&