Compare commits

..

38 Commits

Author SHA1 Message Date
dkl%redhat.com
8c591d53e2 Removed some remaining SelectVisible calls in favor of CanSeeBug
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@121533 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-15 18:36:31 +00:00
dkl%redhat.com
c1aa983fd5 Update to HEAD 2002/05/13
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@121401 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-13 21:56:49 +00:00
dkl%redhat.com
3551227412 forgot one
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@121393 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-13 20:49:00 +00:00
dkl%redhat.com
d0cc91f285 Fixed some template inconsistencies with current 2.16 Stable Branch
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@121392 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-13 20:46:50 +00:00
(no author)
65ff7d56b3 This commit was manufactured by cvs2svn to create branch
'Bugzilla_PgSQL_branch'.

git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@121370 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-13 06:24:51 +00:00
dkl%redhat.com
800eccde9a Merge with HEAD 2002/04/26
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@119979 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-26 18:59:37 +00:00
(no author)
5360e5b008 This commit was manufactured by cvs2svn to create branch
'Bugzilla_PgSQL_branch'.

git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@119975 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-26 18:12:55 +00:00
dkl%redhat.com
da759055dd Sync to HEAD 2002/03/21
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@117156 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-22 05:16:48 +00:00
(no author)
1f960bb1bd This commit was manufactured by cvs2svn to create branch
'Bugzilla_PgSQL_branch'.

git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@116669 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-15 23:23:14 +00:00
dkl%redhat.com
e0f4b89db1 Update to HEAD 2002/02/26
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@115395 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-27 01:11:14 +00:00
(no author)
025b6e8e46 This commit was manufactured by cvs2svn to create branch
'Bugzilla_PgSQL_branch'.

git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@115298 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-24 09:28:23 +00:00
dkl%redhat.com
704f46aa53 Update to HEAD 2002/02/04
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@113607 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-04 15:56:15 +00:00
(no author)
f26338df7e This commit was manufactured by cvs2svn to create branch
'Bugzilla_PgSQL_branch'.

git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@113575 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-03 09:28:50 +00:00
dkl%redhat.com
58548c3f0d Update to HEAD 2002/01/30
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@113247 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-30 23:00:13 +00:00
(no author)
9a6b4393ad This commit was manufactured by cvs2svn to create branch
'Bugzilla_PgSQL_branch'.

git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@113166 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-29 23:26:38 +00:00
dkl%redhat.com
4316819604 Fix runtests.sh error on processmail
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@112507 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-21 23:27:24 +00:00
dkl%redhat.com
9d93dfabb8 Fix botched earlier sync with HEAD
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@112499 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-21 20:42:30 +00:00
dkl%redhat.com
d2ddb07675 Update to HEAD 01/18/2002
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@112473 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-18 23:06:43 +00:00
dkl%redhat.com
66d426dc97 Lost the pgsetup.pl file somewhere along the line. Adding back properly.
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@111575 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-08 16:13:05 +00:00
dkl%redhat.com
b7e91cb3b6 Changes to CanSeeBug to allow multiple checks in one call for buglist.cgi
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@111509 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-07 23:20:15 +00:00
dkl%redhat.com
5ac0899827 Update to HEAD 2002-01-07
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@111508 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-07 23:14:41 +00:00
dkl%redhat.com
4f49e57a3b Merge 3 with HEAD: 2001/12/26
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@111103 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-27 07:26:12 +00:00
dkl%redhat.com
38c27be28f Merge 2 with HEAD: 2001/12/26
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@111102 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-27 06:02:04 +00:00
dkl%redhat.com
d60d3d6121 Merge fix. This is frustrating.
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@111101 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-27 05:29:04 +00:00
dkl%redhat.com
db0b87fb6c Merge with HEAD on 2001/12/26
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@111100 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-27 05:09:43 +00:00
(no author)
6e2791a4b7 This commit was manufactured by cvs2svn to create branch
'Bugzilla_PgSQL_branch'.

git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@110404 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-12 22:41:21 +00:00
dkl%redhat.com
14542c62c7 Update to HEAD 2001-12-03
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@109510 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-03 04:06:19 +00:00
dkl%redhat.com
38ebcba576 Fixed error in AddFDef
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@108598 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 18:40:38 +00:00
dkl%redhat.com
a5502157a9 Update to HEAD - November 18, 2001
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@108470 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-19 05:57:30 +00:00
(no author)
ba69b37618 This commit was manufactured by cvs2svn to create branch
'Bugzilla_PgSQL_branch'.

git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@108456 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-18 22:20:21 +00:00
dkl%redhat.com
22b863a5e9 Synced up with CVS HEAD and created Bugzilla_PgSQL_branch_sync tag
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@107700 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 23:03:10 +00:00
dkl%redhat.com
3e54979994 Fixed conflict in Bug.pm, removal of tabs from lots of files.
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@107385 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:21:11 +00:00
dkl%redhat.com
d73ca44c76 Add new cpan module dependencies
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@107356 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-05 21:43:11 +00:00
dkl%redhat.com
a4fc52b12e Updates and bug fixes
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@107354 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-05 21:10:15 +00:00
dkl%redhat.com
353baca797 New SQL utility functions. Changes in buglist.cgi to improve queries.
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@106967 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-01 15:35:03 +00:00
dkl%redhat.com
4618ab6c36 Initial checkin of pgsetup.pl. Utility for setting up Bugzilla database in PostgreSQL.
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@106569 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-29 20:15:50 +00:00
justdave%syndicomm.com
faaed9c15f initial commit of PgSQL megapatch v0.2
git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@106532 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-29 07:49:05 +00:00
(no author)
675f64d0ae This commit was manufactured by cvs2svn to create branch
'Bugzilla_PgSQL_branch'.

git-svn-id: svn://10.0.0.236/branches/Bugzilla_PgSQL_branch@106501 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-28 03:41:01 +00:00
1886 changed files with 106012 additions and 479409 deletions

View File

@@ -1,36 +0,0 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public base db/msgdb news local mime compose imap addrbook import absync extensions
ifeq ($(OS_ARCH),WINNT)
DIRS += mapi
endif
include $(topsrcdir)/config/rules.mk

View File

@@ -1,32 +0,0 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src build
include $(topsrcdir)/config/rules.mk

View File

@@ -1,21 +0,0 @@
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
nsAbSyncCID.h

View File

@@ -1,69 +0,0 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = absyncsvc
LIBRARY_NAME = absyncsvc
META_COMPONENT = mail
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsAbSyncModule
SHORT_LIBNAME = absyncsv
REQUIRES = xpcom \
string \
necko \
docshell \
uriloader \
msgbase \
intl \
addrbook \
mork \
$(NULL)
ifeq ($(USE_SHORT_LIBNAME),1)
EXTRA_DSO_LIBS = msgbsutl
else
EXTRA_DSO_LIBS = msgbaseutil
endif
CPPSRCS = nsAbSyncFactory.cpp
EXPORTS = nsAbSyncCID.h
SHARED_LIBRARY_LIBS = \
$(DIST)/lib/$(LIB_PREFIX)absync_s.$(LIB_SUFFIX) \
$(NULL)
EXTRA_DSO_LDOPTS = \
$(LIBS_DIR) \
$(EXTRA_DSO_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_JS_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -1,101 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsAbSyncCID_h__
#define nsAbSyncCID_h__
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsIComponentManager.h"
//
// Ab Sync Service
//
#define NS_ABSYNC_SERVICE_CID \
{ /* {3C21BB39-0A87-11d4-8FD6-00A024A7D144} */ \
0x3c21bb39, 0xa87, 0x11d4, \
{ 0x8f, 0xd6, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } }
#define NS_ABSYNC_SERVICE_CONTRACTID \
"@mozilla.org/absync;1"
//
// Ab Sync Listener
//
#define NS_ABSYNC_LISTENER_CID \
{ /* {3C21BB44-0A87-11d4-8FD6-00A024A7D144} */ \
0x3c21bb44, 0xa87, 0x11d4, \
{ 0x8f, 0xd6, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } }
#define NS_ABSYNC_LISTENER_CONTRACTID \
"@mozilla.org/absync/listener;1"
//
// Ab Sync Post Engine
//
#define NS_ABSYNC_POST_ENGINE_CID \
{ /* {3C21BB9f-0A87-11d4-8FD6-00A024A7D144} */ \
0x3c21bb9f, 0xa87, 0x11d4, \
{ 0x8f, 0xd6, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } }
#define NS_ABSYNC_POST_ENGINE_CONTRACTID \
"@mozilla.org/absync/postengine;1"
//
// Ab Sync Post Listener
//
#define NS_ABSYNC_POST_LISTENER_CID \
{ /* {3C21BBcc-0A87-11d4-8FD6-00A024A7D144} */ \
0x3c21bbcc, 0xa87, 0x11d4, \
{ 0x8f, 0xd6, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } }
#define NS_ABSYNC_POST_LISTENER_CONTRACTID \
"@mozilla.org/absync/postlistener;1"
//
// Sync Driver
//
#define NS_ADDBOOK_SYNCDRIVER_CONTRACTID \
"@mozilla.org/addressbook/services/syncdriver;1"
#define NS_ADDBOOK_SYNCDRIVER_CID \
{ /* 40D1D3DA-1637-11d4-8FE1-00A024A7D144 */ \
0x40d1d3da, 0x1637, 0x11d4, \
{ 0x8f, 0xe1, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } \
}
#endif // nsAbSyncCID_h__

View File

@@ -1,79 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "msgCore.h"
#include "nsISupports.h"
#include "nsCOMPtr.h"
#include "nsIFactory.h"
#include "nsIGenericFactory.h"
#include "nsIServiceManager.h"
#include "nsIModule.h"
#include "pratom.h"
#include "nsAbSyncCID.h"
/* Include all of the interfaces our factory can generate components for */
#include "nsAbSync.h"
#include "nsAbSyncPostEngine.h"
#include "nsABSyncDriver.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbSync);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbSyncDriver)
////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////
static const nsModuleComponentInfo components[] =
{
{ "Addressbook Sync",
NS_ABSYNC_SERVICE_CID,
NS_ABSYNC_SERVICE_CONTRACTID,
nsAbSyncConstructor },
{ "Addressbook Sync Post Engine",
NS_ABSYNC_POST_ENGINE_CID,
NS_ABSYNC_POST_ENGINE_CONTRACTID,
nsAbSyncPostEngine::Create },
{ "The Address Book Sync Driver",
NS_ADDBOOK_SYNCDRIVER_CID,
NS_ADDBOOK_SYNCDRIVER_CONTRACTID,
nsAbSyncDriverConstructor }
};
NS_IMPL_NSGETMODULE(nsAbSyncModule, components)

View File

@@ -1 +0,0 @@
_NSGetModule ; 1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "MacPrefix.h"

View File

@@ -1,25 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "MacPrefix_debug.h"

View File

@@ -1,42 +0,0 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = absyncsvc
XPIDL_MODULE = absync
XPIDLSRCS = \
nsIAbSync.idl \
nsIAbSyncMojo.idl \
nsIAbSyncListener.idl \
nsIAbSyncPostEngine.idl \
nsIAbSyncPostListener.idl \
nsIAbSyncDriver.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -1,69 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsrootidl.idl"
#include "nsIAbSyncListener.idl"
#include "nsIMsgStatusFeedback.idl"
[uuid(3c9cbef8-070b-4123-98b2-9297443a8cd1)]
interface nsIAbSyncState
{
const long nsIAbSyncIdle = 0;
const long nsIAbSyncRunning = 1;
};
[scriptable, uuid(74872D27-0A4E-11d4-8FD6-00A024A7D144)]
interface nsIAbSync : nsISupports {
/*
* This is the primary interface for performing AB Sync operations
*/
/* Add or remove a listener for this particular sync operation */
void AddSyncListener(in nsIAbSyncListener aListener);
void RemoveSyncListener(in nsIAbSyncListener aListener);
/* Get the nsIAbSyncPostEngineState of the sync operation */
PRInt32 GetCurrentState();
/*
* Send the protocol request and get a transaction ID in return that
* will be sent along with all sync listener operations
*/
void PerformAbSync(in nsIDOMWindowInternal aDOMWindow, out PRInt32 aTransactionID);
void CancelAbSync();
void SetAbSyncUser(in string aUser);
};

View File

@@ -1,48 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsrootidl.idl"
#include "nsIAbSyncListener.idl"
#include "nsIMsgStatusFeedback.idl"
[scriptable, uuid(91FDFEE1-EFBC-11d3-8F97-000073757374)]
interface nsIAbSyncDriver : nsIAbSyncListener
{
void KickIt(in nsIMsgStatusFeedback aStatus, in nsIDOMWindowInternal aDOMWindow);
void CancelIt();
};

View File

@@ -1,96 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsrootidl.idl"
%{C++
%}
[scriptable, uuid(E0ED29E0-098A-11d4-8FD6-00A024A7D144)]
interface nsIAbSyncListener : nsISupports {
/**
* Notify the observer that the AB Sync Authorization operation has begun.
*
*/
void OnStartAuthOperation();
/**
* Notify the observer that the AB Sync operation has been completed.
*
* This method is called regardless of whether the the operation was
* successful.
*
* aTransactionID - the ID for this particular request
* aStatus - Status code for the sync request
* aMsg - A text string describing the error (if any).
* aCookie - hmmm...cooookies!
*/
void OnStopAuthOperation(in nsresult aStatus, in wstring aMsg, in string aCookie);
/**
* Notify the observer that the AB Sync operation has begun. This method is
* called only once, at the beginning of a sync transaction
*
*/
void OnStartOperation(in PRInt32 aTransactionID, in PRUint32 aMsgSize);
/**
* Notify the observer that progress as occurred for the AB Sync operation
*/
void OnProgress(in PRInt32 aTransactionID, in PRUint32 aProgress, in PRUint32 aProgressMax);
/**
* Notify the observer with a status message for sync operation
*/
void OnStatus(in PRInt32 aTransactionID, in wstring aMsg);
/**
* Notify the observer that the AB Sync operation has been completed.
*
* This method is called regardless of whether the the operation was
* successful.
*
* aTransactionID - the ID for this particular request
* aStatus - Status code for the sync request
* aMsg - A text string describing the error (if any).
*/
void OnStopOperation(in PRInt32 aTransactionID, in nsresult aStatus,
in wstring aMsg);
};

View File

@@ -1,62 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIStreamListener.idl"
#include "nsIDocShell.idl"
%{C++
#define NS_AB_SYNC_MOJO_CID \
{ 0x842cc263, 0x5255, 0x1144, \
{ 0xcc, 0xb8, 0x44, 0x45, 0x53, 0xff, 0x0, 0x2 } }
#define NS_AB_SYNC_MOJO_CONTRACTID \
"@mozilla.org/absync/absyncmojo;1"
%}
[scriptable, uuid(74872D27-0A4E-11d4-8FD6-BEEF24A7D144)]
interface nsIAbSyncMojo : nsISupports {
/*
* This is the primary interface for performing AB Sync mojo operations
*/
string BuildMojoString(in nsIDocShell aRootDocShell);
void StartAbSyncMojo(in nsIStreamListener aListener,
in nsIDocShell aRootDocShell,
in string aUser);
void GetAbSyncMojoResults(out string aMojoUser, out string aMojoString,
out string aMojoSpec, out long aMojoPort);
void CancelTheMojo();
};

View File

@@ -1,76 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIAbSyncPostListener.idl"
#include "nsIDocShell.idl"
[scriptable, uuid(E0ED29D3-BEEF-11d4-8FD6-00A024A7D144)]
interface nsIAbSyncPostEngineState
{
const long nsIAbSyncPostIdle = 0;
const long nsIAbSyncPostRunning = 1;
const long nsIAbSyncAuthenticationRunning = 2;
};
[scriptable, uuid(E0ED29D3-098A-11d4-8FD6-00A024A7D144)]
interface nsIAbSyncPostEngine : nsISupports {
/*
* This is the primary interface for posting operations to the
* Address Book server in the sky
*/
/* Add or remove a listener for this particular sync operation */
void AddPostListener(in nsIAbSyncPostListener aListener);
void RemovePostListener(in nsIAbSyncPostListener aListener);
/* Get the nsIAbSyncPostEngineState of the sync operation */
string BuildMojoString(in nsIDocShell aRootDocShell);
PRInt32 GetCurrentState();
void GetMojoUserAndSnack(out string aMojoUser, out string aMojoSnack);
/*
* Send the protocol request and get a transaction ID in return that
* will be sent along with all sync listener operations
*/
void SendAbRequest(in string aSpec, in PRInt32 aPort, in string aProtocolRequest, in PRInt32 aTransactionID,
in nsIDocShell aDocShell, in string aUser);
/*
* Cancel it!
*/
void CancelAbSync();
};

View File

@@ -1,99 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsrootidl.idl"
%{C++
%}
[scriptable, uuid(E0ED29E0-098A-11d4-8FD6-00A024A7BEEF)]
interface nsIAbSyncPostListener : nsISupports {
/**
* Notify the observer that the AB Sync Authorization operation has begun.
*
*/
void OnStartAuthOperation();
/**
* Notify the observer that the AB Sync operation has been completed.
*
* This method is called regardless of whether the the operation was
* successful.
*
* aTransactionID - the ID for this particular request
* aStatus - Status code for the sync request
* aMsg - A text string describing the error (if any).
* aCookie - hmmm...cooookies!
*/
void OnStopAuthOperation(in nsresult aStatus, in wstring aMsg, in string aCookie);
/**
* Notify the observer that the AB Sync operation has begun. This method is
* called only once, at the beginning of a sync transaction
*
*/
void OnStartOperation(in PRInt32 aTransactionID, in PRUint32 aMsgSize);
/**
* Notify the observer that progress as occurred for the AB Sync operation
*/
void OnProgress(in PRInt32 aTransactionID, in PRUint32 aProgress, in PRUint32 aProgressMax);
/**
* Notify the observer with a status message for sync operation
*/
void OnStatus(in PRInt32 aTransactionID, in wstring aMsg);
/**
* Notify the observer that the AB Sync operation has been sent. This
* method is called once when the networking library has finished processing
* the sync operation.
*
* This method is called regardless of whether the the operation was
* successful.
*
* aTransactionID - the ID for this particular request
* aStatus - Status code for the sync request
* aMsg - A text string describing the error (if any).
* aProtocolResponse - The protocol response sent by the AB server
*/
void OnStopOperation(in PRInt32 aTransactionID, in nsresult aStatus,
in wstring aMsg, in string aProtocolResponse);
};

View File

@@ -1 +0,0 @@
absync.properties

View File

@@ -1,40 +0,0 @@
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
#
# The following are used by the Mailing list dialog
#
syncDoneSuccess=Synchronization completed.
syncDoneFailed=Synchronization Failed.
syncDoneCancelled=Synchronization cancelled by user.
syncProgress=Synchronization received %d bytes...
syncStarting=Synchronization starting with %d byte request...
syncConnect=Synchronization connecting to server...
syncStartingAuth=Synchronization authentication started...
syncAuthSuccess=Synchronization authentication complete.
syncAuthFailed=Synchronization authentication failed.
syncInvalidResponse=The server returned invalid response!
syncServerError=The server returned the error: %s
syncNeedPrefs=You need to fill in your Address Book Synchronization preferences before attempting a synchronization operation.
passwordPrompt=Enter your Netscape.com User Name and Password for Address Book Synchronization
passwordTitle=Enter Password
passwordError=You must enter a valid screen name and password for Address Book Synchronization
syncInProgress=Address Book Synchronization in progress...please wait...
exceedMaxRecordError=Synchronization failed because your Personal Address Book has exceeded the maximum limit of 1500 entries. Remove some entries from your Personal Address Book, and then try again.

View File

@@ -1,77 +0,0 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = absyncsvc
XPIDL_MODULE = absync
LIBRARY_NAME = absync_s
META_COMPONENT = mail
REQUIRES = xpcom \
string \
necko \
mime \
docshell \
uriloader \
pref \
widget \
msgbase \
msgbaseutil \
dom \
rdf \
addrbook \
intl \
mork \
mimetype \
windowwatcher \
unicharutil \
$(NULL)
CPPSRCS = \
nsAbSyncPostEngine.cpp \
nsAbSync.cpp \
nsAbSyncCRCModel.cpp \
nsABSyncDriver.cpp \
nsSyncDecoderRing.cpp \
$(NULL)
EXPORTS = \
nsAbSyncPostEngine.h \
nsAbSync.h \
nsAbSyncCRCModel.h \
nsABSyncDriver.h \
nsSyncDecoderRing.h \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
include $(topsrcdir)/config/rules.mk
ifeq ($(OS_ARCH), Linux)
DEFINES += -D_BSD_SOURCE
endif

View File

@@ -1,285 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsABSyncDriver.h"
#include "nsIAbSync.h"
#include "nsAbSyncCID.h"
#include "nsIServiceManager.h"
#include "nsTextFormatter.h"
#include "nsIStringBundle.h"
#include "prmem.h"
#include "nsString.h"
#include "nsCRT.h"
NS_IMPL_THREADSAFE_ISUPPORTS1(nsAbSyncDriver, nsIAbSyncDriver)
//NS_IMPL_ISUPPORTS1(nsAbSyncDriver, nsIAbSyncDriver)
static NS_DEFINE_CID(kAbSync, NS_ABSYNC_SERVICE_CID);
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
nsAbSyncDriver::nsAbSyncDriver()
{
NS_INIT_ISUPPORTS();
/* member initializers and constructor code */
mTransactionID = -1;
mStatus = nsnull;
}
nsAbSyncDriver::~nsAbSyncDriver()
{
/* destructor code */
}
/**
* Notify the observer that the AB Sync Authorization operation has begun.
*
*/
NS_IMETHODIMP
nsAbSyncDriver::OnStartAuthOperation(void)
{
if (mStatus)
{
PRUnichar *outValue = nsnull;
// Tweak the button...
mStatus->StartMeteors();
mStatus->ShowProgress(0);
outValue = GetString(NS_LITERAL_STRING("syncStartingAuth").get());
mStatus->ShowStatusString(outValue);
PR_FREEIF(outValue);
}
return NS_OK;
}
/**
* Notify the observer that the AB Sync operation has been completed.
*
* This method is called regardless of whether the the operation was
* successful.
*
* aTransactionID - the ID for this particular request
* aStatus - Status code for the sync request
* aMsg - A text string describing the error (if any).
* aCookie - hmmm...cooookies!
*/
NS_IMETHODIMP
nsAbSyncDriver::OnStopAuthOperation(nsresult aStatus, const PRUnichar *aMsg, const char *aCookie)
{
if (mStatus)
{
PRUnichar *outValue = nsnull;
if (NS_SUCCEEDED(aStatus))
outValue = GetString(NS_LITERAL_STRING("syncAuthSuccess").get());
else
outValue = GetString(NS_LITERAL_STRING("syncAuthFailed").get());
mStatus->ShowStatusString(outValue);
PR_FREEIF(outValue);
}
return NS_OK;
}
/* void OnStartOperation (in PRInt32 aTransactionID, in PRUint32 aMsgSize); */
NS_IMETHODIMP nsAbSyncDriver::OnStartOperation(PRInt32 aTransactionID, PRUint32 aMsgSize)
{
if (mStatus)
{
PRUnichar *outValue = nsnull;
PRUnichar *msgValue = nsnull;
// Tweak the button...
mStatus->StartMeteors();
mStatus->ShowProgress(50);
outValue = GetString(NS_LITERAL_STRING("syncStarting").get());
msgValue = nsTextFormatter::smprintf(outValue, aMsgSize);
mStatus->ShowStatusString(msgValue);
PR_FREEIF(outValue);
PR_FREEIF(msgValue);
}
return NS_OK;
}
/* void OnProgress (in PRInt32 aTransactionID, in PRUint32 aProgress, in PRUint32 aProgressMax); */
NS_IMETHODIMP nsAbSyncDriver::OnProgress(PRInt32 aTransactionID, PRUint32 aProgress, PRUint32 aProgressMax)
{
if (mStatus)
{
PRUnichar *outValue = nsnull;
PRUnichar *msgValue = nsnull;
outValue = GetString(NS_LITERAL_STRING("syncProgress").get());
msgValue = nsTextFormatter::smprintf(outValue, aProgress);
mStatus->ShowStatusString(msgValue);
PR_FREEIF(outValue);
PR_FREEIF(msgValue);
}
return NS_OK;
}
/* void OnStatus (in PRInt32 aTransactionID, in wstring aMsg); */
NS_IMETHODIMP nsAbSyncDriver::OnStatus(PRInt32 aTransactionID, const PRUnichar *aMsg)
{
return mStatus->ShowStatusString(aMsg);
}
/* void OnStopOperation (in PRInt32 aTransactionID, in nsresult aStatus, in wstring aMsg); */
NS_IMETHODIMP nsAbSyncDriver::OnStopOperation(PRInt32 aTransactionID, nsresult aStatus, const PRUnichar *aMsg)
{
if (mStatus)
{
PRUnichar *outValue = nsnull;
// Tweak the button...
mStatus->StopMeteors();
mStatus->CloseWindow();
if (NS_SUCCEEDED(aStatus))
outValue = GetString(NS_LITERAL_STRING("syncDoneSuccess").get());
else
{
if (mCancelled)
outValue = GetString(NS_LITERAL_STRING("syncDoneCancelled").get());
else
outValue = GetString(NS_LITERAL_STRING("syncDoneFailed").get());
}
mStatus->ShowStatusString(outValue);
PR_FREEIF(outValue);
}
return NS_OK;
}
/* void KickIt (); */
NS_IMETHODIMP nsAbSyncDriver::KickIt(nsIMsgStatusFeedback *aStatus, nsIDOMWindowInternal *aDocShell)
{
nsresult rv = NS_OK;
PRInt32 stateVar;
nsCOMPtr<nsIAbSync> sync(do_GetService(kAbSync, &rv));
if (NS_FAILED(rv) || !sync)
return rv;
mCancelled = PR_FALSE;
sync->GetCurrentState(&stateVar);
if (stateVar != nsIAbSyncState::nsIAbSyncIdle)
return NS_ERROR_FAILURE;
mStatus = aStatus;
// Add ourselves to the party!
sync->AddSyncListener((nsIAbSyncListener *)this);
rv = sync->PerformAbSync(aDocShell, &mTransactionID);
if (NS_SUCCEEDED(rv))
{
if (mStatus)
{
PRUnichar *msgValue = nsnull;
msgValue = GetString(NS_LITERAL_STRING("syncStartingAuth").get());
mStatus->ShowStatusString(msgValue);
PR_FREEIF(msgValue);
}
}
else
{
// We failed, turn the button back on...
mStatus->StopMeteors();
mStatus->CloseWindow();
}
return rv;
}
#define AB_STRING_URL "chrome://messenger/locale/addressbook/absync.properties"
PRUnichar *
nsAbSyncDriver::GetString(const PRUnichar *aStringName)
{
nsresult res = NS_OK;
PRUnichar *ptrv = nsnull;
if (!mStringBundle)
{
static const char propertyURL[] = AB_STRING_URL;
nsCOMPtr<nsIStringBundleService> sBundleService =
do_GetService(kStringBundleServiceCID, &res);
if (NS_SUCCEEDED(res) && (nsnull != sBundleService))
{
res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(mStringBundle));
}
}
if (mStringBundle)
res = mStringBundle->GetStringFromName(aStringName, &ptrv);
if ( NS_SUCCEEDED(res) && (ptrv) )
return ptrv;
else
return nsCRT::strdup(aStringName);
}
//
// What if we want to stop the operation? Call this!
//
NS_IMETHODIMP nsAbSyncDriver::CancelIt()
{
nsresult rv = NS_OK;
PRInt32 stateVar;
mCancelled = PR_TRUE;
nsCOMPtr<nsIAbSync> sync(do_GetService(kAbSync, &rv));
if (NS_FAILED(rv) || !sync)
return rv;
sync->GetCurrentState(&stateVar);
if (stateVar == nsIAbSyncState::nsIAbSyncIdle)
return NS_ERROR_FAILURE;
// Cancel this mess...
return sync->CancelAbSync();
}

View File

@@ -1,66 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __nsAbSyncDriver_h__
#define __nsAbSyncDriver_h__
#include "nsIAbSyncDriver.h"
#include "nsIMsgStatusFeedback.h"
#include "nsIStringBundle.h"
#include "nsCOMPtr.h"
class nsAbSyncDriver : public nsIAbSyncDriver
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIABSYNCDRIVER
NS_DECL_NSIABSYNCLISTENER
nsAbSyncDriver();
virtual ~nsAbSyncDriver();
/* additional members */
PRUnichar *GetString(const PRUnichar *aStringName);
private:
nsCOMPtr<nsIStringBundle> mStringBundle;
PRInt32 mTransactionID;
nsCOMPtr<nsIMsgStatusFeedback> mStatus;
PRBool mCancelled;
};
#endif /* __nsAbSyncDriver_h__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,294 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __nsIAbSync_h__
#define __nsIAbSync_h__
#include "nsIAbSync.h"
#include "nsIAbSyncPostListener.h"
#include "nsIAbSyncPostEngine.h"
#include "nsCOMPtr.h"
#include "nsIAddrDatabase.h"
#include "nsIAbDirectory.h"
#include "nsIAbMDBCard.h"
#include "nsAbSyncCRCModel.h"
#include "nsVoidArray.h"
#include "nsIStringBundle.h"
#include "nsIDocShell.h"
#include "nsIFileSpec.h"
//
// Basic Sync Logic
// Keep a Sync mapping table like:
//
// ServerRecordID - Unique ID for a record provided by the
// UAB server.
// LocalRecordID - Local Unique ID, for mobile devices this
// is assigned by the mobile device.
// CRC - CRC of the record last time we synced.
// Flags - Operation to apply to this record. ADD
// if it's new, MOD if it's been modified,
// RET if it was already sent to the server
// but an error occured, etc.
//
// Step 1:
// When the user begins a sync, run through the local database and update the
// sync mapping table. If the CRC has changed, mark the entry modified, if
// it's a new record, add an entry and mark it new, if a record was deleted,
// mark the entry deleted, etc.
//
// Sync approach - server handles all conflict resolution:
//
// Step 2:
// Using the sync mapping table and the local records database, generate the change
// list to send to the server. Mark any modified or new record with the RET (retry)
// flag.
//
// Step 3:
// Get the response back from the server. Since the communication was successful,
// clear the RET (retry) flag on all records. Then apply the server changes back
// to the local database (updating the CRC's in the process). Save the changes to
// the local database, clear the sync mapping table flags and save the new sync
// mapping table.
//
typedef struct {
PRInt32 serverID;
PRInt32 localID;
ulong CRC;
PRUint32 flags;
} syncMappingRecord;
#define SYNC_MODIFIED 0x0001 // Must modify record on server
#define SYNC_ADD 0x0002 // Must add record to server
#define SYNC_DELETED 0x0004 // Must delete record from server
#define SYNC_RETRY 0x0008 // Sent to server but failed...must retry!
#define SYNC_RENUMBER 0x0010 // Renumber on the server
#define SYNC_PROCESSED 0x8000 // We processed the entry...nothing to do
#define SYNC_ALLTAGS 1000
#define SYNC_EMAILS 2000
#define ABSYNC_PROTOCOL "2.2.1.1.2.1.2.2.1.1.1.2"
#define ABSYNC_VERSION "Demo"
#define ABSYNC_HOME_PHONE_TYPE "Home"
#define ABSYNC_WORK_PHONE_TYPE "Work"
#define ABSYNC_FAX_PHONE_TYPE "Fax"
#define ABSYNC_PAGER_PHONE_TYPE "Pager"
#define ABSYNC_CELL_PHONE_TYPE "Cellular"
#define ABSYNC_HOME_PHONE_ID 1
#define ABSYNC_WORK_PHONE_ID 2
#define ABSYNC_FAX_PHONE_ID 3
#define ABSYNC_PAGER_PHONE_ID 4
#define ABSYNC_CELL_PHONE_ID 5
#define SYNC_ESCAPE_ADDUSER "op%3Dadd"
#define SYNC_ESCAPE_MOD "op%3Dmod"
#define SYNC_ESCAPE_DEL "op%3Ddel"
//mailing list
#define SYNC_ESCAPE_MAIL_ADD "op%3DmaillistCreate"
#define SYNC_ESCAPE_MAIL_MOD "op%3DmaillistRen"
#define SYNC_ESCAPE_MAIL_DEL "op%3DmaillistDel"
#define SYNC_ESCAPE_MAIL_EMAIL_MOD "op%3DemailstringUpdate"
#define SYNC_ESCAPE_MAIL_CONTACT_ADD "op%3DmaillistAdd"
#define SYNC_ESCAPE_MAIL_CONTACT_DEL "op%3DmaillistMemberDel"
// group
#define SYNC_ESCAPE_GROUP_DEL "op%3DgrpDel"
// Defines for what type of add this may be?
#define SYNC_SINGLE_USER_TYPE 1
#define SYNC_MAILLIST_TYPE 2
#define SYNC_GROUP_TYPE 3
#define SYNC_UNKNOWN_TYPE 0
// Server errors that need to be converted to more user-friendly ones.
#define SYNC_ERROR_EXCEED_MAX_RECORD "exceed max record"
// Generic name tag for AIM screen name
#define SYNC_PREF_PREFIX_CLIENT_MAP "mail.absync.client_map."
#define SYNC_PREF_PREFIX_SERVER_MAP "mail.absync.server_map."
//
// We need this structure for mapping our field names to the server
// field names
//
#define kMaxColumns 38
typedef struct {
const char *abField;
nsString serverField;
} schemaStruct;
class nsAbSync : public nsIAbSync, public nsIAbSyncPostListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIABSYNC
NS_DECL_NSIABSYNCPOSTLISTENER
nsAbSync();
virtual ~nsAbSync();
/* additional members */
private:
// Handy methods for listeners...
nsresult DeleteListeners();
nsresult NotifyListenersOnStartSync(PRInt32 aTransactionID, const PRUint32 aMsgSize);
nsresult NotifyListenersOnProgress(PRInt32 aTransactionID, PRUint32 aProgress, PRUint32 aProgressMax);
nsresult NotifyListenersOnStatus(PRInt32 aTransactionID, const PRUnichar *aMsg);
nsresult NotifyListenersOnStopSync(PRInt32 aTransactionID, nsresult aStatus, const PRUnichar *aMsg);
nsresult NotifyListenersOnStartAuthOperation(void);
nsresult NotifyListenersOnStopAuthOperation(nsresult aStatus, const PRUnichar *aMsg, const char *aCookie);
nsresult AnalyzeTheLocalAddressBook();
nsresult ProcessServerResponse(const char *aProtocolResponse);
NS_IMETHOD InitSchemaColumns();
NS_IMETHOD OpenAB(char *aAbName, nsIAddrDatabase **aDatabase);
NS_IMETHOD AnalyzeAllRecords(nsIAddrDatabase *aDatabase, nsIAbDirectory *directory);
NS_IMETHOD GenerateProtocolForCard(nsIAbCard *aCard, PRBool aAddId, nsString &protLine);
PRBool ThisCardHasChanged(nsIAbCard *aCard, syncMappingRecord *syncRecord, nsString &protLine);
void InternalInit();
nsresult InternalCleanup(nsresult aResult);
nsresult CleanServerTable(nsVoidArray *aArray);
PRUnichar *GetString(const PRUnichar *aStringName);
nsresult DisplayErrorMessage(const PRUnichar * msg);
nsresult SetDOMWindow(nsIDOMWindowInternal *aWindow);
nsCOMPtr<nsIAbSyncPostEngine> mPostEngine;
nsString mPostString;
nsIAbSyncListener **mListenerArray;
PRInt32 mListenerArrayCount;
PRInt32 mCurrentState;
PRInt32 mLastChangeNum;
char *mUserName;
nsCOMPtr<nsIStringBundle> mStringBundle;
// Setting for ABSync operations...
char *mAbSyncServer;
PRInt32 mAbSyncPort;
char *mAbSyncAddressBook;
char *mAbSyncAddressBookFileName;
PRInt32 mTransactionID;
PRInt32 mCurrentPostRecord;
nsCOMPtr<nsIFileSpec> mHistoryFile;
nsCOMPtr<nsIFileSpec> mLockFile;
PRBool mLastSyncFailed;
PRUint32 mOldTableSize;
syncMappingRecord *mOldSyncMapingTable; // Old history table...
PRUint32 mNewTableSize;
syncMappingRecord *mNewSyncMapingTable; // New table after reading address book
nsVoidArray *mNewServerTable; // New entries from the server
PRUint32 mCrashTableSize;
syncMappingRecord *mCrashTable; // Comparison table for crash recovery...
char *mProtocolResponse; // what the server said...
char *mProtocolOffset; // where in the buffer are we?
schemaStruct mSchemaMappingList[kMaxColumns];
///////////////////////////////////////////////
// The following is for protocol parsing
///////////////////////////////////////////////
PRBool EndOfStream(); // If this returns true, we are done with the data...
PRBool ParseNextSection(); // Deal with next section
nsresult AdvanceToNextLine();
nsresult AdvanceToNextSection();
char *ExtractCurrentLine();
nsresult ExtractInteger(char *aLine, char *aTag, char aDelim, PRInt32 *aRetVal);
char *ExtractCharacterString(char *aLine, char *aTag, char aDelim);
nsresult PatchHistoryTableWithNewID(PRInt32 clientID, PRInt32 serverID, PRInt32 aMultiplier, ulong crc);
nsresult DeleteRecord();
nsresult DeleteList();
nsresult DeleteGroup();
nsresult DeleteCardByServerID(PRInt32 aServerID);
nsresult LocateClientIDFromServerID(PRInt32 aServerID, PRInt32 *aClientID);
PRInt32 DetermineTagType(nsStringArray *aArray);
nsresult AddNewUsers();
nsresult AddValueToNewCard(nsIAbCard *aCard, nsString *aTagName, nsString *aTagValue);
PRBool TagHit(const char *aTag, PRBool advanceToNextLine); // See if we are sitting on a particular tag...and advance if asked
PRBool ErrorFromServer(char **errString); // Return true if the server returned an error...
nsresult ProcessOpReturn();
nsresult ProcessNewRecords();
nsresult ProcessDeletedRecords();
nsresult ProcessLastChange();
nsresult ProcessPhoneNumbersTheyAreSpecial(nsIAbCard *aCard);
PRInt32 GetTypeOfPhoneNumber(const nsAString& tagName);
nsresult AddValueToProtocolLine(const PRUnichar *value, nsString &protocolLine);
// For updating...
PRInt32 HuntForExistingABEntryInServerRecord(PRInt32 aPersonIndex,
nsIAddrDatabase *aDatabase,
nsIAbDirectory *directory,
PRInt32 *aServerID,
nsIAbCard **newCard);
nsresult FindCardByClientID(PRInt32 aClientID,
nsIAddrDatabase *aDatabase,
nsIAbDirectory *directory,
nsIAbCard **aReturnCard);
PRBool CardAlreadyInAddressBook(nsIAbCard *newCard,
PRInt32 *aClientID,
ulong *aRetCRC);
nsString mLocale; // Charset of returned data!
nsStringArray *mDeletedRecordTags; // The deleted record tags from the server...
nsStringArray *mDeletedRecordValues; // The deleted record values from the server...
nsStringArray *mNewRecordTags; // The new record tags from the server...
nsStringArray *mNewRecordValues; // The new record values from the server...
// Only support one column/value pair for now until #128567 is fixed to allow multiple pairs to be set.
nsCString mCurrentGenericColumn; // New generic column from server.
nsString mCurrentGenericValue; // New generic value from server.
nsStringArray *mPhoneTypes; // Phone number types...
nsStringArray *mPhoneValues; // Phone number values...
nsIDocShell *mRootDocShell; // For use in prompts
};
#endif /* __nsIAbSync_h__ */

View File

@@ -1,137 +0,0 @@
/******************************************************************************/
/* Start of crcmodel.c */
/******************************************************************************/
/* */
/* Author : Ross Williams (ross@guest.adelaide.edu.au.). */
/* Date : 3 June 1993. */
/* Status : Public domain. */
/* */
/* Description : This is the implementation (.c) file for the reference */
/* implementation of the Rocksoft^tm Model CRC Algorithm. For more */
/* information on the Rocksoft^tm Model CRC Algorithm, see the document */
/* titled "A Painless Guide to CRC Error Detection Algorithms" by Ross */
/* Williams (ross@guest.adelaide.edu.au.). This document is likely to be in */
/* "ftp.adelaide.edu.au/pub/rocksoft". */
/* */
/* Note: Rocksoft is a trademark of Rocksoft Pty Ltd, Adelaide, Australia. */
/* */
/******************************************************************************/
/* */
/* Implementation Notes */
/* -------------------- */
/* To avoid inconsistencies, the specification of each function is not echoed */
/* here. See the header file for a description of these functions. */
/* This package is light on checking because I want to keep it short and */
/* simple and portable (i.e. it would be too messy to distribute my entire */
/* C culture (e.g. assertions package) with this package. */
/* */
/******************************************************************************/
#include "nsAbSyncCRCModel.h"
/******************************************************************************/
/* The following definitions make the code more readable. */
#define BITMASK(X) (1L << (X))
#define MASK32 0xFFFFFFFFL
#define LOCAL static
/******************************************************************************/
LOCAL ulong reflect P_((ulong v,int b));
LOCAL ulong reflect (ulong v, int b)
/* Returns the value v with the bottom b [0,32] bits reflected. */
/* Example: reflect(0x3e23L,3) == 0x3e26 */
{
int i;
ulong t = v;
for (i=0; i<b; i++)
{
if (t & 1L)
v|= BITMASK((b-1)-i);
else
v&= ~BITMASK((b-1)-i);
t>>=1;
}
return v;
}
/******************************************************************************/
LOCAL ulong widmask P_((p_cm_t));
LOCAL ulong widmask (p_cm_t p_cm)
/* Returns a longword whose value is (2^p_cm->cm_width)-1. */
/* The trick is to do this portably (e.g. without doing <<32). */
{
return (((1L<<(p_cm->cm_width-1))-1L)<<1)|1L;
}
/******************************************************************************/
void cm_ini (p_cm_t p_cm)
{
p_cm->cm_reg = p_cm->cm_init;
}
/******************************************************************************/
void cm_nxt (p_cm_t p_cm, int ch)
{
int i;
ulong uch = (ulong) ch;
ulong topbit = BITMASK(p_cm->cm_width-1);
if (p_cm->cm_refin) uch = reflect(uch,8);
p_cm->cm_reg ^= (uch << (p_cm->cm_width-8));
for (i=0; i<8; i++)
{
if (p_cm->cm_reg & topbit)
p_cm->cm_reg = (p_cm->cm_reg << 1) ^ p_cm->cm_poly;
else
p_cm->cm_reg <<= 1;
p_cm->cm_reg &= widmask(p_cm);
}
}
/******************************************************************************/
void cm_blk (p_cm_t p_cm,p_ubyte_ blk_adr,ulong blk_len)
{
while (blk_len--) cm_nxt(p_cm,*blk_adr++);
}
/******************************************************************************/
ulong cm_crc (p_cm_t p_cm)
{
if (p_cm->cm_refot)
return p_cm->cm_xorot ^ reflect(p_cm->cm_reg,p_cm->cm_width);
else
return p_cm->cm_xorot ^ p_cm->cm_reg;
}
/******************************************************************************/
ulong cm_tab (p_cm_t p_cm,int index)
{
int i;
ulong r;
ulong topbit = BITMASK(p_cm->cm_width-1);
ulong inbyte = (ulong) index;
if (p_cm->cm_refin) inbyte = reflect(inbyte,8);
r = inbyte << (p_cm->cm_width-8);
for (i=0; i<8; i++)
if (r & topbit)
r = (r << 1) ^ p_cm->cm_poly;
else
r<<=1;
if (p_cm->cm_refin) r = reflect(r,p_cm->cm_width);
return r & widmask(p_cm);
}
/******************************************************************************/
/* End of crcmodel.c */
/******************************************************************************/

View File

@@ -1,149 +0,0 @@
/******************************************************************************/
/* Start of crcmodel.h */
/******************************************************************************/
/* */
/* Author : Ross Williams (ross@guest.adelaide.edu.au.). */
/* Date : 3 June 1993. */
/* Status : Public domain. */
/* */
/* Description : This is the header (.h) file for the reference */
/* implementation of the Rocksoft^tm Model CRC Algorithm. For more */
/* information on the Rocksoft^tm Model CRC Algorithm, see the document */
/* titled "A Painless Guide to CRC Error Detection Algorithms" by Ross */
/* Williams (ross@guest.adelaide.edu.au.). This document is likely to be in */
/* "ftp.adelaide.edu.au/pub/rocksoft". */
/* */
/* Note: Rocksoft is a trademark of Rocksoft Pty Ltd, Adelaide, Australia. */
/* */
/******************************************************************************/
/* */
/* How to Use This Package */
/* ----------------------- */
/* Step 1: Declare a variable of type cm_t. Declare another variable */
/* (p_cm say) of type p_cm_t and initialize it to point to the first */
/* variable (e.g. p_cm_t p_cm = &cm_t). */
/* */
/* Step 2: Assign values to the parameter fields of the structure. */
/* If you don't know what to assign, see the document cited earlier. */
/* For example: */
/* p_cm->cm_width = 16; */
/* p_cm->cm_poly = 0x8005L; */
/* p_cm->cm_init = 0L; */
/* p_cm->cm_refin = TRUE; */
/* p_cm->cm_refot = TRUE; */
/* p_cm->cm_xorot = 0L; */
/* Note: Poly is specified without its top bit (18005 becomes 8005). */
/* Note: Width is one bit less than the raw poly width. */
/* */
/* Step 3: Initialize the instance with a call cm_ini(p_cm); */
/* */
/* Step 4: Process zero or more message bytes by placing zero or more */
/* successive calls to cm_nxt. Example: cm_nxt(p_cm,ch); */
/* */
/* Step 5: Extract the CRC value at any time by calling crc = cm_crc(p_cm); */
/* If the CRC is a 16-bit value, it will be in the bottom 16 bits. */
/* */
/******************************************************************************/
/* */
/* Design Notes */
/* ------------ */
/* PORTABILITY: This package has been coded very conservatively so that */
/* it will run on as many machines as possible. For example, all external */
/* identifiers have been restricted to 6 characters and all internal ones to */
/* 8 characters. The prefix cm (for Crc Model) is used as an attempt to avoid */
/* namespace collisions. This package is endian independent. */
/* */
/* EFFICIENCY: This package (and its interface) is not designed for */
/* speed. The purpose of this package is to act as a well-defined reference */
/* model for the specification of CRC algorithms. If you want speed, cook up */
/* a specific table-driven implementation as described in the document cited */
/* above. This package is designed for validation only; if you have found or */
/* implemented a CRC algorithm and wish to describe it as a set of parameters */
/* to the Rocksoft^tm Model CRC Algorithm, your CRC algorithm implementation */
/* should behave identically to this package under those parameters. */
/* */
/******************************************************************************/
/* The following #ifndef encloses this entire */
/* header file, rendering it indempotent. */
#ifndef CM_DONE
#define CM_DONE
#include "prtypes.h"
/******************************************************************************/
/* The following definitions are extracted from my style header file which */
/* would be cumbersome to distribute with this package. The DONE_STYLE is the */
/* idempotence symbol used in my style header file. */
typedef unsigned long ulong;
typedef unsigned char * p_ubyte_;
/* Change to the second definition if you don't have prototypes. */
#define P_(A) A
/* #define P_(A) () */
/* Uncomment this definition if you don't have void. */
/* typedef int void; */
/******************************************************************************/
/* CRC Model Abstract Type */
/* ----------------------- */
/* The following type stores the context of an executing instance of the */
/* model algorithm. Most of the fields are model parameters which must be */
/* set before the first initializing call to cm_ini. */
typedef struct
{
int cm_width; /* Parameter: Width in bits [8,32]. */
ulong cm_poly; /* Parameter: The algorithm's polynomial. */
ulong cm_init; /* Parameter: Initial register value. */
PRBool cm_refin; /* Parameter: Reflect input bytes? */
PRBool cm_refot; /* Parameter: Reflect output CRC? */
ulong cm_xorot; /* Parameter: XOR this to output CRC. */
ulong cm_reg; /* Context: Context during execution. */
} cm_t;
typedef cm_t *p_cm_t;
/******************************************************************************/
/* Functions That Implement The Model */
/* ---------------------------------- */
/* The following functions animate the cm_t abstraction. */
void cm_ini P_((p_cm_t p_cm));
/* Initializes the argument CRC model instance. */
/* All parameter fields must be set before calling this. */
void cm_nxt P_((p_cm_t p_cm,int ch));
/* Processes a single message byte [0,255]. */
void cm_blk P_((p_cm_t p_cm,p_ubyte_ blk_adr,ulong blk_len));
/* Processes a block of message bytes. */
ulong cm_crc P_((p_cm_t p_cm));
/* Returns the CRC value for the message bytes processed so far. */
/******************************************************************************/
/* Functions For Table Calculation */
/* ------------------------------- */
/* The following function can be used to calculate a CRC lookup table. */
/* It can also be used at run-time to create or check static tables. */
ulong cm_tab P_((p_cm_t p_cm,int index));
/* Returns the i'th entry for the lookup table for the specified algorithm. */
/* The function examines the fields cm_width, cm_poly, cm_refin, and the */
/* argument table index in the range [0,255] and returns the table entry in */
/* the bottom cm_width bytes of the return value. */
/******************************************************************************/
/* End of the header file idempotence #ifndef */
#endif
/******************************************************************************/
/* End of crcmodel.h */
/******************************************************************************/

View File

@@ -1,864 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "msgCore.h" // for pre-compiled headers
#include "nsCOMPtr.h"
#include <stdio.h>
#include "nscore.h"
#include "prprf.h"
#include "nsEscape.h"
#include "nsIFactory.h"
#include "nsISupports.h"
#include "comi18n.h"
#include "prmem.h"
#include "plstr.h"
#include "nsIPref.h"
#include "nsIComponentManager.h"
#include "nsIURI.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsAbSyncPostEngine.h"
#include "nsIIOService.h"
#include "nsIChannel.h"
#include "nsNetUtil.h"
#include "nsMimeTypes.h"
#include "nsIHttpChannel.h"
#include "nsIUploadChannel.h"
#include "nsTextFormatter.h"
#include "nsICookieService.h"
#include "nsIAbSync.h"
#include "nsAbSyncCID.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
static NS_DEFINE_CID(kCookieServiceCID, NS_COOKIESERVICE_CID);
static NS_DEFINE_CID(kCAbSyncMojoCID, NS_AB_SYNC_MOJO_CID);
static NS_DEFINE_CID(kAbSync, NS_ABSYNC_SERVICE_CID);
/*
* This function will be used by the factory to generate an
* object class object....
*/
NS_METHOD
nsAbSyncPostEngine::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
nsAbSyncPostEngine *ph = new nsAbSyncPostEngine();
if (ph == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
return ph->QueryInterface(aIID, aResult);
}
NS_IMPL_ADDREF(nsAbSyncPostEngine)
NS_IMPL_RELEASE(nsAbSyncPostEngine)
NS_INTERFACE_MAP_BEGIN(nsAbSyncPostEngine)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIURIContentListener)
NS_INTERFACE_MAP_ENTRY(nsIStreamListener)
NS_INTERFACE_MAP_ENTRY(nsIRequestObserver)
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
NS_INTERFACE_MAP_ENTRY(nsIURIContentListener)
NS_INTERFACE_MAP_ENTRY(nsIAbSyncPostEngine)
NS_INTERFACE_MAP_END
/*
* Inherited methods for nsMimeConverter
*/
nsAbSyncPostEngine::nsAbSyncPostEngine()
{
/* the following macro is used to initialize the ref counting data */
NS_INIT_ISUPPORTS();
// Init member variables...
mTotalWritten = 0;
mStillRunning = PR_TRUE;
mListenerArray = nsnull;
mListenerArrayCount = 0;
mPostEngineState = nsIAbSyncPostEngineState::nsIAbSyncPostIdle;
mTransactionID = 0;
mMessageSize = 0;
mAuthenticationRunning = PR_TRUE;
mCookie = nsnull;
mUser = nsnull;
mSyncProtocolRequest = nsnull;
mSyncProtocolRequestPrefix = nsnull;
mChannel = nsnull;
mMojoSyncSpec = nsnull;
}
nsAbSyncPostEngine::~nsAbSyncPostEngine()
{
mStillRunning = PR_FALSE;
PR_FREEIF(mSyncProtocolRequest);
PR_FREEIF(mSyncProtocolRequestPrefix);
PR_FREEIF(mCookie);
PR_FREEIF(mUser);
PR_FREEIF(mMojoSyncSpec);
DeleteListeners();
}
PRInt32 Base64Decode_int(const char *in_str, unsigned char *out_str,
PRUint32& decoded_len);
/* ==================================================================
* Base64Encode
*
* Returns number of bytes that were encoded.
*
* >0 -> OK
* -1 -> BAD (output buffer not big enough).
*
* ==================================================================
*/
PRInt32 Base64Encode(const unsigned char *in_str, PRInt32 in_len, char *out_str,
PRInt32 out_len)
{
static unsigned char base64[] =
{
/* 0 1 2 3 4 5 6 7 */
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', /* 0 */
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', /* 1 */
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', /* 2 */
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', /* 3 */
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', /* 4 */
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', /* 5 */
'w', 'x', 'y', 'z', '0', '1', '2', '3', /* 6 */
'4', '5', '6', '7', '8', '9', '+', '/' /* 7 */
};
PRInt32 curr_out_len = 0;
PRInt32 i = 0;
unsigned char a, b, c;
out_str[0] = '\0';
if (in_len > 0)
{
while (i < in_len)
{
a = in_str[i];
b = (i + 1 >= in_len) ? 0 : in_str[i + 1];
c = (i + 2 >= in_len) ? 0 : in_str[i + 2];
if (i + 2 < in_len)
{
out_str[curr_out_len++] = (base64[(a >> 2) & 0x3F]);
out_str[curr_out_len++] = (base64[((a << 4) & 0x30)
+ ((b >> 4) & 0xf)]);
out_str[curr_out_len++] = (base64[((b << 2) & 0x3c)
+ ((c >> 6) & 0x3)]);
out_str[curr_out_len++] = (base64[c & 0x3F]);
}
else if (i + 1 < in_len)
{
out_str[curr_out_len++] = (base64[(a >> 2) & 0x3F]);
out_str[curr_out_len++] = (base64[((a << 4) & 0x30)
+ ((b >> 4) & 0xf)]);
out_str[curr_out_len++] = (base64[((b << 2) & 0x3c)
+ ((c >> 6) & 0x3)]);
out_str[curr_out_len++] = '=';
}
else
{
out_str[curr_out_len++] = (base64[(a >> 2) & 0x3F]);
out_str[curr_out_len++] = (base64[((a << 4) & 0x30)
+ ((b >> 4) & 0xf)]);
out_str[curr_out_len++] = '=';
out_str[curr_out_len++] = '=';
}
i += 3;
if((curr_out_len + 4) > out_len)
{
return(-1);
}
}
out_str[curr_out_len] = '\0';
}
return curr_out_len;
}
/*
* This routine decodes base64 string to a buffer.
* Populates 'out_str' with b64 decoded data.
*
* Returns number of bytes that were decoded.
* >0 -> OK
* -1 -> BAD (output buffer not big enough).
*/
PRInt32 Base64Decode(const char *in_str, unsigned char *out_str,
PRUint32* decoded_len)
{
return Base64Decode_int(in_str, out_str, *decoded_len);
}
PRInt32 Base64Decode_int(const char *in_str, unsigned char *out_str,
PRUint32& decoded_len)
{
PRInt32 in_len = strlen (/*(char *)*/ in_str);
PRInt32 ii = 0;
PRInt32 a = 0;
char ch;
PRInt32 b1 = 0;
long b4 = 0;
PRInt32 nn = 0;
/* Decode remainder of base 64 string */
while (ii < in_len)
{
ch = in_str[ii++];
if (ch >= 'A' && ch <= 'Z') b1 = (ch - 'A');
else if (ch >= 'a' && ch <= 'z') b1 = 26 + (ch - 'a');
else if (ch >= '0' && ch <= '9') b1 = 52 + (ch - '0');
else if (ch == '+') b1 = 62;
else if (ch == '/') b1 = 63;
else if (ch == '\r' || ch == '\n') continue;
else
{
if (ch == '=')
{
if (nn == 3)
{
if ((a + 2) > (PRInt32) decoded_len)
return (-1); /* Bail. Buffer overflow */
b4 = (b4 << 6);
out_str[a++] = (char) (0xff & (b4 >> 16));
out_str[a++] = (char) (0xff & (b4 >> 8));
}
else if (nn == 2)
{
if ((a + 1) > (PRInt32) decoded_len)
{
return (-1); /* Bail. Buffer overflow */
}
b4 = (b4 << 12);
out_str[a++] = (char) (0xff & (b4 >> 16));
}
}
break;
}
b4 = (b4 << 6) | (long) b1;
nn++;
if (nn == 4)
{
if ((a + 3) > (PRInt32) decoded_len)
{
return (-1); /* Bail. Buffer overflow */
}
out_str[a++] = (char) (0xff & (b4 >> 16));
out_str[a++] = (char) (0xff & (b4 >> 8));
out_str[a++] = (char) (0xff & (b4));
nn = 0;
}
}
out_str[a] = '\0';
decoded_len = a;
return (a);
}
NS_IMETHODIMP nsAbSyncPostEngine::GetInterface(const nsIID & aIID, void * *aInstancePtr)
{
NS_ENSURE_ARG_POINTER(aInstancePtr);
return QueryInterface(aIID, aInstancePtr);
}
// nsIURIContentListener support
NS_IMETHODIMP
nsAbSyncPostEngine::OnStartURIOpen(nsIURI* aURI, PRBool* aAbortOpen)
{
return NS_OK;
}
NS_IMETHODIMP
nsAbSyncPostEngine::IsPreferred(const char * aContentType,
char ** aDesiredContentType,
PRBool * aCanHandleContent)
{
return CanHandleContent(aContentType, PR_TRUE, aDesiredContentType,
aCanHandleContent);
}
NS_IMETHODIMP
nsAbSyncPostEngine::CanHandleContent(const char * aContentType,
PRBool aIsContentPreferred,
char ** aDesiredContentType,
PRBool * aCanHandleContent)
{
if (nsCRT::strcasecmp(aContentType, MESSAGE_RFC822) == 0)
*aDesiredContentType = nsCRT::strdup("text/html");
// since we explicilty loaded the url, we always want to handle it!
*aCanHandleContent = PR_TRUE;
return NS_OK;
}
NS_IMETHODIMP
nsAbSyncPostEngine::DoContent(const char * aContentType,
PRBool aIsContentPreferred,
nsIRequest *request,
nsIStreamListener ** aContentHandler,
PRBool * aAbortProcess)
{
nsresult rv = NS_OK;
if (aAbortProcess)
*aAbortProcess = PR_FALSE;
QueryInterface(NS_GET_IID(nsIStreamListener), (void **) aContentHandler);
return rv;
}
NS_IMETHODIMP
nsAbSyncPostEngine::GetParentContentListener(nsIURIContentListener** aParent)
{
*aParent = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsAbSyncPostEngine::SetParentContentListener(nsIURIContentListener* aParent)
{
return NS_OK;
}
NS_IMETHODIMP
nsAbSyncPostEngine::GetLoadCookie(nsISupports ** aLoadCookie)
{
*aLoadCookie = mLoadCookie;
NS_IF_ADDREF(*aLoadCookie);
return NS_OK;
}
NS_IMETHODIMP
nsAbSyncPostEngine::SetLoadCookie(nsISupports * aLoadCookie)
{
mLoadCookie = aLoadCookie;
return NS_OK;
}
nsresult
nsAbSyncPostEngine::StillRunning(PRBool *running)
{
*running = mStillRunning;
return NS_OK;
}
// Methods for nsIStreamListener...
nsresult
nsAbSyncPostEngine::OnDataAvailable(nsIRequest *request, nsISupports * ctxt, nsIInputStream *aIStream,
PRUint32 sourceOffset, PRUint32 aLength)
{
PRUint32 readLen = aLength;
char *buf = (char *)PR_Malloc(aLength);
if (!buf)
return NS_ERROR_OUT_OF_MEMORY; /* we couldn't allocate the object */
// read the data from the input stram...
nsresult rv = aIStream->Read(buf, aLength, &readLen);
if (NS_FAILED(rv)) return rv;
// write to the protocol response buffer...
mProtocolResponse.Append(NS_ConvertASCIItoUCS2(buf, readLen));
PR_FREEIF(buf);
mTotalWritten += readLen;
if (!mAuthenticationRunning)
NotifyListenersOnProgress(mTransactionID, mTotalWritten, 0);
return NS_OK;
}
// Methods for nsIRequestObserver
nsresult
nsAbSyncPostEngine::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
{
if (mAuthenticationRunning)
NotifyListenersOnStartAuthOperation();
else
NotifyListenersOnStartSending(mTransactionID, mMessageSize);
return NS_OK;
}
nsresult
nsAbSyncPostEngine::OnStopRequest(nsIRequest *request, nsISupports * /* ctxt */, nsresult aStatus)
{
#ifdef NS_DEBUG_rhp
printf("nsAbSyncPostEngine::OnStopRequest()\n");
#endif
char *tProtResponse = nsnull;
//
// Now complete the stream!
//
mStillRunning = PR_FALSE;
// Check the content type!
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
if (channel)
{
nsCAutoString contentType;
nsCAutoString charset;
if (NS_SUCCEEDED(channel->GetContentType(contentType)) &&
!contentType.Equals(NS_LITERAL_CSTRING(UNKNOWN_CONTENT_TYPE)))
{
mContentType = contentType;
}
if (NS_SUCCEEDED(channel->GetContentCharset(charset)) && !charset.IsEmpty())
{
mCharset = charset;
}
}
// set the state...
mPostEngineState = nsIAbSyncPostEngineState::nsIAbSyncPostIdle;
if (mAuthenticationRunning)
{
nsresult rv;
if (mSyncMojo)
rv = mSyncMojo->GetAbSyncMojoResults(&mUser, &mCookie, &mMojoSyncSpec, &mMojoSyncPort);
if (NS_SUCCEEDED(rv))
{
// Before we really get started...lets let sync know who is doing this...
nsCOMPtr<nsIAbSync> sync(do_GetService(kAbSync, &rv));
if (NS_SUCCEEDED(rv) || sync)
sync->SetAbSyncUser(mUser);
// Base64 encode then url encode it...
//
char tUser[256] = "";
if (Base64Encode((unsigned char *)mUser, strlen(mUser), tUser, sizeof(tUser)) < 0)
{
rv = NS_ERROR_FAILURE;
NotifyListenersOnStopAuthOperation(rv, tProtResponse);
NotifyListenersOnStopSending(mTransactionID, rv, nsnull);
}
else
{
char *tUser2 = nsEscape(tUser, url_Path);
if (!tUser2)
{
rv = NS_ERROR_FAILURE;
NotifyListenersOnStopAuthOperation(rv, tProtResponse);
NotifyListenersOnStopSending(mTransactionID, rv, nsnull);
}
else
{
mSyncProtocolRequestPrefix = PR_smprintf("cn=%s&cc=%s&", tUser2, mCookie);
PR_FREEIF(tUser2);
NotifyListenersOnStopAuthOperation(aStatus, tProtResponse);
KickTheSyncOperation();
}
}
// RICHIE - Special here to show the server we are hitting!
// RICHIE - REMOVE THIS BEFORE SHIPPING!!!!
#ifdef DEBUG
PRUnichar *msgValue = nsnull;
msgValue = nsTextFormatter::smprintf(nsString(NS_LITERAL_STRING("Server: %s - port %d")).get(),
mMojoSyncSpec, mMojoSyncPort);
NotifyListenersOnStatus(mTransactionID, msgValue);
PR_FREEIF(msgValue);
// RICHIE
#endif
}
else
{
NotifyListenersOnStopAuthOperation(rv, tProtResponse);
NotifyListenersOnStopSending(mTransactionID, rv, nsnull);
}
mSyncMojo = nsnull;
}
else
{
tProtResponse = ToNewCString(mProtocolResponse);
NotifyListenersOnStopSending(mTransactionID, aStatus, tProtResponse);
}
PR_FREEIF(tProtResponse);
// Time to return...
return NS_OK;
}
/* void AddSyncListener (in nsIAbSyncPostListener aListener); */
NS_IMETHODIMP nsAbSyncPostEngine::AddPostListener(nsIAbSyncPostListener *aListener)
{
if ( (mListenerArrayCount > 0) || mListenerArray )
{
++mListenerArrayCount;
mListenerArray = (nsIAbSyncPostListener **)
PR_Realloc(*mListenerArray, sizeof(nsIAbSyncPostListener *) * mListenerArrayCount);
if (!mListenerArray)
return NS_ERROR_OUT_OF_MEMORY;
else
{
mListenerArray[mListenerArrayCount - 1] = aListener;
return NS_OK;
}
}
else
{
mListenerArrayCount = 1;
mListenerArray = (nsIAbSyncPostListener **) PR_Malloc(sizeof(nsIAbSyncPostListener *) * mListenerArrayCount);
if (!mListenerArray)
return NS_ERROR_OUT_OF_MEMORY;
memset(mListenerArray, 0, (sizeof(nsIAbSyncPostListener *) * mListenerArrayCount));
mListenerArray[0] = aListener;
NS_ADDREF(mListenerArray[0]);
return NS_OK;
}
}
/* void RemoveSyncListener (in nsIAbSyncPostListener aListener); */
NS_IMETHODIMP nsAbSyncPostEngine::RemovePostListener(nsIAbSyncPostListener *aListener)
{
PRInt32 i;
for (i=0; i<mListenerArrayCount; i++)
if (mListenerArray[i] == aListener)
{
NS_RELEASE(mListenerArray[i]);
mListenerArray[i] = nsnull;
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
nsresult
nsAbSyncPostEngine::DeleteListeners()
{
if ( (mListenerArray) && (*mListenerArray) )
{
PRInt32 i;
for (i=0; i<mListenerArrayCount; i++)
{
NS_RELEASE(mListenerArray[i]);
}
PR_FREEIF(mListenerArray);
}
mListenerArrayCount = 0;
return NS_OK;
}
nsresult
nsAbSyncPostEngine::NotifyListenersOnStartAuthOperation(void)
{
PRInt32 i;
for (i=0; i<mListenerArrayCount; i++)
if (mListenerArray[i] != nsnull)
mListenerArray[i]->OnStartAuthOperation();
return NS_OK;
}
nsresult
nsAbSyncPostEngine::NotifyListenersOnStopAuthOperation(nsresult aStatus, const char *aCookie)
{
PRInt32 i;
for (i=0; i<mListenerArrayCount; i++)
if (mListenerArray[i] != nsnull)
mListenerArray[i]->OnStopAuthOperation(aStatus, nsnull, aCookie);
return NS_OK;
}
nsresult
nsAbSyncPostEngine::NotifyListenersOnStartSending(PRInt32 aTransactionID, PRUint32 aMsgSize)
{
PRInt32 i;
for (i=0; i<mListenerArrayCount; i++)
if (mListenerArray[i] != nsnull)
mListenerArray[i]->OnStartOperation(aTransactionID, aMsgSize);
return NS_OK;
}
nsresult
nsAbSyncPostEngine::NotifyListenersOnProgress(PRInt32 aTransactionID, PRUint32 aProgress, PRUint32 aProgressMax)
{
PRInt32 i;
for (i=0; i<mListenerArrayCount; i++)
if (mListenerArray[i] != nsnull)
mListenerArray[i]->OnProgress(aTransactionID, aProgress, aProgressMax);
return NS_OK;
}
nsresult
nsAbSyncPostEngine::NotifyListenersOnStatus(PRInt32 aTransactionID, PRUnichar *aMsg)
{
PRInt32 i;
for (i=0; i<mListenerArrayCount; i++)
if (mListenerArray[i] != nsnull)
mListenerArray[i]->OnStatus(aTransactionID, aMsg);
return NS_OK;
}
nsresult
nsAbSyncPostEngine::NotifyListenersOnStopSending(PRInt32 aTransactionID, nsresult aStatus,
char *aProtocolResponse)
{
PRInt32 i;
for (i=0; i<mListenerArrayCount; i++)
if (mListenerArray[i] != nsnull)
mListenerArray[i]->OnStopOperation(aTransactionID, aStatus, nsnull, aProtocolResponse);
return NS_OK;
}
// Utility to create a nsIURI object...
extern "C" nsresult
nsEngineNewURI(nsIURI** aInstancePtrResult, const char *aSpec, nsIURI *aBase)
{
nsresult res;
if (nsnull == aInstancePtrResult)
return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsIIOService> pService(do_GetService(kIOServiceCID, &res));
if (NS_FAILED(res))
return NS_ERROR_FACTORY_NOT_REGISTERED;
return pService->NewURI(nsDependentCString(aSpec), nsnull, aBase, aInstancePtrResult);
}
nsresult
nsAbSyncPostEngine::FireURLRequest(nsIURI *aURL, const char *postData)
{
nsresult rv;
nsCOMPtr<nsIInputStream> postStream;
if (!postData)
return NS_ERROR_INVALID_ARG;
NS_ENSURE_SUCCESS(NS_NewChannel(getter_AddRefs(mChannel), aURL, nsnull), NS_ERROR_FAILURE);
// Tag the post stream onto the channel...but never seemed to work...so putting it
// directly on the URL spec
//
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel);
if (!httpChannel)
return NS_ERROR_FAILURE;
if (NS_SUCCEEDED(rv = NS_NewPostDataStream(getter_AddRefs(postStream), PR_FALSE, nsDependentCString(postData), 0))){
nsCOMPtr<nsIUploadChannel> uploadChannel(do_QueryInterface(httpChannel));
NS_ASSERTION(uploadChannel, "http must support nsIUploadChannel");
uploadChannel->SetUploadStream(postStream, nsnull, -1);
}
httpChannel->AsyncOpen(this, nsnull);
return NS_OK;
}
/* PRInt32 GetCurrentState (); */
NS_IMETHODIMP nsAbSyncPostEngine::GetCurrentState(PRInt32 *_retval)
{
*_retval = mPostEngineState;
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////////////
//
// This is the implementation of the actual post driver.
//
////////////////////////////////////////////////////////////////////////////////////////
NS_IMETHODIMP nsAbSyncPostEngine::BuildMojoString(nsIDocShell *aRootDocShell, char **aID)
{
nsresult rv;
if (!aID)
return NS_ERROR_FAILURE;
// Now, get the COMPtr to the Mojo!
if (!mSyncMojo)
{
rv = nsComponentManager::CreateInstance(kCAbSyncMojoCID, NULL, NS_GET_IID(nsIAbSyncMojo), getter_AddRefs(mSyncMojo));
if ( NS_FAILED(rv) || (!mSyncMojo) )
return NS_ERROR_FAILURE;
}
rv = mSyncMojo->BuildMojoString(aRootDocShell, aID);
return rv;
}
NS_IMETHODIMP nsAbSyncPostEngine::SendAbRequest(const char *aSpec, PRInt32 aPort, const char *aProtocolRequest, PRInt32 aTransactionID,
nsIDocShell *aDocShell, const char *aUser)
{
nsresult rv;
char *mojoUser = nsnull;
char *mojoSnack = nsnull;
// Only try if we are not currently busy!
if (mPostEngineState != nsIAbSyncPostEngineState::nsIAbSyncPostIdle)
return NS_ERROR_FAILURE;
// Now, get the COMPtr to the Mojo!
if (!mSyncMojo)
{
rv = nsComponentManager::CreateInstance(kCAbSyncMojoCID, NULL, NS_GET_IID(nsIAbSyncMojo), getter_AddRefs(mSyncMojo));
if ( NS_FAILED(rv) || (!mSyncMojo) )
return NS_ERROR_FAILURE;
}
if (aUser)
mUser = nsCRT::strdup(aUser);
if (NS_FAILED(mSyncMojo->StartAbSyncMojo(this, aDocShell, mUser)))
return NS_ERROR_FAILURE;
// Set transaction ID and save/init Sync info...
mTransactionID = aTransactionID;
// Init stuff we need....
mSyncProtocolRequest = nsCRT::strdup(aProtocolRequest);
mProtocolResponse.Truncate();
mTotalWritten = 0;
// The first thing we need to do is authentication so do it!
mAuthenticationRunning = PR_TRUE;
mPostEngineState = nsIAbSyncPostEngineState::nsIAbSyncAuthenticationRunning;
return NS_OK;
}
NS_IMETHODIMP
nsAbSyncPostEngine::KickTheSyncOperation(void)
{
nsresult rv;
nsIURI *workURI = nsnull;
char *protString = nsnull;
// The first thing we need to do is authentication so do it!
mAuthenticationRunning = PR_FALSE;
mProtocolResponse.Truncate();
mPostEngineState = nsIAbSyncPostEngineState::nsIAbSyncPostRunning;
const char postHeader[] = "Content-Type: application/x-www-form-urlencoded\r\nContent-Length: %d\r\nCookie: %s\r\n\r\n%s";
protString = PR_smprintf("%s%s", mSyncProtocolRequestPrefix, mSyncProtocolRequest);
if (protString)
mMessageSize = strlen(protString);
else
mMessageSize = 0;
char *tCommand = PR_smprintf(postHeader, mMessageSize, mCookie, protString);
PR_FREEIF(protString);
#ifdef DEBUG_rhp
printf("COMMAND = %s\n", tCommand);
#endif
if (!tCommand)
{
rv = NS_ERROR_OUT_OF_MEMORY; // we couldn't allocate the string
goto GetOuttaHere;
}
rv = nsEngineNewURI(&workURI, mMojoSyncSpec, nsnull);
if (NS_FAILED(rv) || (!workURI))
{
rv = NS_ERROR_FAILURE; // we couldn't allocate the string
goto GetOuttaHere;
}
if (mMojoSyncPort > 0)
workURI->SetPort(mMojoSyncPort);
rv = FireURLRequest(workURI, tCommand);
if (NS_SUCCEEDED(rv))
NotifyListenersOnStartSending(mTransactionID, mMessageSize);
GetOuttaHere:
NS_IF_RELEASE(workURI);
PR_FREEIF(tCommand);
mPostEngineState = nsIAbSyncPostEngineState::nsIAbSyncPostRunning;
return rv;
}
NS_IMETHODIMP
nsAbSyncPostEngine::CancelAbSync()
{
nsresult rv = NS_ERROR_FAILURE;
if (mSyncMojo)
{
rv = mSyncMojo->CancelTheMojo();
}
else if (mChannel)
{
rv = mChannel->Cancel(NS_BINDING_ABORTED);
}
return rv;
}
NS_IMETHODIMP
nsAbSyncPostEngine::GetMojoUserAndSnack(char **aMojoUser, char **aMojoSnack)
{
if ( (!mUser) || (!mCookie) )
return NS_ERROR_FAILURE;
*aMojoUser = nsCRT::strdup(mUser);
*aMojoSnack = nsCRT::strdup(mCookie);
if ( (!*aMojoUser) || (!*aMojoSnack) )
return NS_ERROR_FAILURE;
else
return NS_OK;
}

View File

@@ -1,135 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsAbSyncPostEngine_h_
#define nsAbSyncPostEngine_h_
#include "nsCOMPtr.h"
#include "nsIInputStream.h"
#include "nsIStreamListener.h"
#include "nsFileStream.h"
#include "nsIAbSyncPostEngine.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsCURILoader.h"
#include "nsIURIContentListener.h"
#include "nsIURI.h"
#include "nsIAbSyncMojo.h"
#include "nsIChannel.h"
//
// Callback declarations for URL completion
//
// For completion of send/message creation operations...
//
typedef nsresult (*nsPostCompletionCallback ) (nsresult aStatus,
const char *aContentType,
const char *aCharset,
PRInt32 totalSize, const PRUnichar* aMsg,
void *tagData);
class nsAbSyncPostEngine : public nsIAbSyncPostEngine, public nsIStreamListener, public nsIURIContentListener, public nsIInterfaceRequestor {
public:
nsAbSyncPostEngine();
virtual ~nsAbSyncPostEngine();
/* this macro defines QueryInterface, AddRef and Release for this class */
NS_DECL_ISUPPORTS
NS_DECL_NSIABSYNCPOSTENGINE
//
// This is the output stream where the stream converter will write processed data after
// conversion.
//
NS_IMETHOD StillRunning(PRBool *running);
NS_IMETHOD FireURLRequest(nsIURI *aURL, const char *postData);
NS_IMETHOD KickTheSyncOperation();
static NS_METHOD Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
// Methods for nsIStreamListener
NS_DECL_NSISTREAMLISTENER
// Methods for nsIStreamObserver
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSIURICONTENTLISTENER
NS_DECL_NSIINTERFACEREQUESTOR
PRInt32 mPostEngineState;
PRInt32 mTransactionID;
private:
// Handy methods for listeners...
nsresult DeleteListeners();
nsresult NotifyListenersOnStartAuthOperation(void);
nsresult NotifyListenersOnStopAuthOperation(nsresult aStatus, const char *aCookie);
nsresult NotifyListenersOnStartSending(PRInt32 aTransactionID, PRUint32 aMsgSize);
nsresult NotifyListenersOnProgress(PRInt32 aTransactionID, PRUint32 aProgress, PRUint32 aProgressMax);
nsresult NotifyListenersOnStatus(PRInt32 aTransactionID, PRUnichar *aMsg);
nsresult NotifyListenersOnStopSending(PRInt32 aTransactionID, nsresult aStatus,
char *aProtocolResponse);
PRBool mStillRunning; // Are we still running?
PRInt32 mTotalWritten; // Size counter variable
nsString mProtocolResponse; // Protocol response
nsCString mContentType; // The content type retrieved from the server
nsCString mCharset; // The charset retrieved from the server
nsCOMPtr<nsISupports> mLoadCookie; // load cookie used by the uri loader when we post the url
char *mCookie;
char *mUser;
char *mAuthSpec;
PRInt32 mMessageSize; // Size of POST request...
nsIAbSyncPostListener **mListenerArray;
PRInt32 mListenerArrayCount;
// Since we need to do authentication a bit differently, do it here!
PRBool mAuthenticationRunning;
nsCOMPtr<nsIAbSyncMojo> mSyncMojo;
nsCOMPtr<nsIChannel> mChannel;
char *mSyncProtocolRequest;
char *mSyncProtocolRequestPrefix;
char *mMojoSyncSpec;
PRInt32 mMojoSyncPort;
};
#endif /* nsAbSyncPostEngine_h_ */

View File

@@ -1,54 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsAbSync.h"
#include "prmem.h"
#include "nsAbSyncCID.h"
#include "nsIPref.h"
#include "nsIServiceManager.h"
#include "nsEscape.h"
#include "nsSyncDecoderRing.h"
nsSyncDecoderRing::nsSyncDecoderRing()
{
}
nsSyncDecoderRing::~nsSyncDecoderRing()
{
}

View File

@@ -1,98 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __nsSyncDecoderRing_h__
#define __nsSyncDecoderRing_h__
#include "nsIAbSync.h"
#include "nsIAbSyncPostListener.h"
#include "nsIAbSyncPostEngine.h"
#include "nsCOMPtr.h"
#include "nsIAddrDatabase.h"
#include "nsIAbDirectory.h"
#include "nsAbSyncCRCModel.h"
// Server record fields!
#define kServerFirstNameColumn NS_LITERAL_STRING("fname")
#define kServerLastNameColumn NS_LITERAL_STRING("lname")
#define kServerDisplayNameColumn NS_LITERAL_STRING("Display_name")
#define kServerNicknameColumn NS_LITERAL_STRING("nick_name")
#define kServerPriEmailColumn NS_LITERAL_STRING("email1")
#define kServer2ndEmailColumn NS_LITERAL_STRING("email2")
#define kServerPlainTextColumn NS_LITERAL_STRING("Pref_rich_email")
#define kServerWorkPhoneColumn NS_LITERAL_STRING("work_phone")
#define kServerHomePhoneColumn NS_LITERAL_STRING("home_phone")
#define kServerFaxColumn NS_LITERAL_STRING("fax")
#define kServerPagerColumn NS_LITERAL_STRING("pager")
#define kServerCellularColumn NS_LITERAL_STRING("cell_phone")
#define kServerHomeAddressColumn NS_LITERAL_STRING("home_add1")
#define kServerHomeAddress2Column NS_LITERAL_STRING("home_add2")
#define kServerHomeCityColumn NS_LITERAL_STRING("home_city")
#define kServerHomeStateColumn NS_LITERAL_STRING("home_state")
#define kServerHomeZipCodeColumn NS_LITERAL_STRING("home_zip")
#define kServerHomeCountryColumn NS_LITERAL_STRING("home_country")
#define kServerWorkAddressColumn NS_LITERAL_STRING("work_add1")
#define kServerWorkAddress2Column NS_LITERAL_STRING("work_add2")
#define kServerWorkCityColumn NS_LITERAL_STRING("work_city")
#define kServerWorkStateColumn NS_LITERAL_STRING("work_state")
#define kServerWorkZipCodeColumn NS_LITERAL_STRING("work_zip")
#define kServerWorkCountryColumn NS_LITERAL_STRING("work_country")
#define kServerJobTitleColumn NS_LITERAL_STRING("job_title")
#define kServerDepartmentColumn NS_LITERAL_STRING("department")
#define kServerCompanyColumn NS_LITERAL_STRING("company")
#define kServerWebPage1Column NS_LITERAL_STRING("Work_web_page")
#define kServerWebPage2Column NS_LITERAL_STRING("web_page")
#define kServerBirthYearColumn NS_LITERAL_STRING("OMIT:BirthYear")
#define kServerBirthMonthColumn NS_LITERAL_STRING("OMIT:BirthMonth")
#define kServerBirthDayColumn NS_LITERAL_STRING("OMIT:BirthDay")
#define kServerCustom1Column NS_LITERAL_STRING("Custom_1")
#define kServerCustom2Column NS_LITERAL_STRING("Custom_2")
#define kServerCustom3Column NS_LITERAL_STRING("Custom_3")
#define kServerCustom4Column NS_LITERAL_STRING("Custom_4")
#define kServerNotesColumn NS_LITERAL_STRING("addl_info")
#define kServerLastModifiedDateColumn NS_LITERAL_STRING("OMIT:LastModifiedDate")
class nsSyncDecoderRing
{
public:
nsSyncDecoderRing();
virtual ~nsSyncDecoderRing();
};
#endif /* __nsSyncDecoderRing_h__ */

View File

@@ -1,37 +0,0 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifdef MOZ_LDAP_XPCOM
REQUIRES += mozldap necko
EXTRA_COMPONENTS += src/nsLDAPPrefsService.js
endif
DIRS = public src build
include $(topsrcdir)/config/rules.mk

View File

@@ -1,21 +0,0 @@
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
nsAbBaseCID.h

View File

@@ -1,84 +0,0 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = addrbook
LIBRARY_NAME = addrbook
META_COMPONENT = mail
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = nsAbModule
REQUIRES = xpcom \
string \
necko \
mime \
rdf \
msgbase \
msgbaseutil \
rdfutil \
docshell \
appshell \
dom \
widget \
locale \
mork \
appcomps \
layout \
intl \
$(NULL)
CPPSRCS = nsAbFactory.cpp
EXPORTS = nsAbBaseCID.h
ifdef MOZ_LDAP_XPCOM
REQUIRES += mozldap \
uriloader \
$(NULL)
DEFINES += -DMOZ_LDAP_XPCOM
endif
SHARED_LIBRARY_LIBS = \
$(DIST)/lib/$(LIB_PREFIX)addrbook_s.$(LIB_SUFFIX) \
$(NULL)
EXTRA_DSO_LIBS = rdfutil_s
ifeq ($(USE_SHORT_LIBNAME),1)
EXTRA_DSO_LIBS += msgbsutl
else
EXTRA_DSO_LIBS += msgbaseutil
endif
EXTRA_DSO_LDOPTS = \
$(LIBS_DIR) \
$(EXTRA_DSO_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -1,447 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsAbBaseCID_h__
#define nsAbBaseCID_h__
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsIComponentManager.h"
#include "nsAbDirFactoryService.h"
//
// nsAddressBook
//
#define NS_ADDRESSBOOK_CONTRACTID \
"@mozilla.org/addressbook;1"
#define NS_ADDRESSBOOKSTARTUPHANDLER_CONTRACTID \
"@mozilla.org/commandlinehandler/general-startup;1?type=addressbook"
#define NS_ADDRESSBOOK_CID \
{ /* {D60B84F2-2A8C-11d3-9E07-00A0C92B5F0D} */ \
0xd60b84f2, 0x2a8c, 0x11d3, \
{ 0x9e, 0x7, 0x0, 0xa0, 0xc9, 0x2b, 0x5f, 0xd } \
}
//
// nsAbDirectoryDataSource
//
#define NS_ABDIRECTORYDATASOURCE_CONTRACTID \
NS_RDF_DATASOURCE_CONTRACTID_PREFIX "addressdirectory"
#define NS_ABDIRECTORYDATASOURCE_CID \
{ /* 0A79186D-F754-11d2-A2DA-001083003D0C */ \
0xa79186d, 0xf754, 0x11d2, \
{0xa2, 0xda, 0x0, 0x10, 0x83, 0x0, 0x3d, 0xc} \
}
//
// nsAbBSDirectory
//
#define NS_ABDIRECTORY_CONTRACTID \
NS_RDF_RESOURCE_FACTORY_CONTRACTID_PREFIX "moz-abdirectory"
#define NS_ABDIRECTORY_CID \
{ /* {012D3C24-1DD2-11B2-BA79-B4AD359FC461}*/ \
0x012D3C24, 0x1DD2, 0x11B2, \
{0xBA, 0x79, 0xB4, 0xAD, 0x35, 0x9F, 0xC4, 0x61} \
}
//
// nsAbMDBDirectory
//
#define NS_ABMDBDIRECTORY_CONTRACTID \
NS_RDF_RESOURCE_FACTORY_CONTRACTID_PREFIX "moz-abmdbdirectory"
#define NS_ABMDBDIRECTORY_CID \
{ /* {e618f894-1dd1-11b2-889c-9aaefaa90dde}*/ \
0xe618f894, 0x1dd1, 0x11b2, \
{0x88, 0x9c, 0x9a, 0xae, 0xfa, 0xa9, 0x0d, 0xde} \
}
//
// nsAbMDBCard
//
#define NS_ABMDBCARD_CONTRACTID \
"@mozilla.org/addressbook/moz-abmdbcard;1"
#define NS_ABMDBCARD_CID \
{ /* {f578a5d2-1dd1-11b2-8841-f45cc5e765f8} */ \
0xf578a5d2, 0x1dd1, 0x11b2, \
{0x88, 0x41, 0xf4, 0x5c, 0xc5, 0xe7, 0x65, 0xf8} \
}
//
// nsAddressBookDB
//
#define NS_ADDRDATABASE_CONTRACTID \
"@mozilla.org/addressbook/carddatabase;1"
#define NS_ADDRDATABASE_CID \
{ /* 63187917-1D19-11d3-A302-001083003D0C */ \
0x63187917, 0x1d19, 0x11d3, \
{0xa3, 0x2, 0x0, 0x10, 0x83, 0x0, 0x3d, 0xc} \
}
//
// nsAbCardProperty
//
#define NS_ABCARDPROPERTY_CONTRACTID \
"@mozilla.org/addressbook/cardproperty;1"
#define NS_ABCARDPROPERTY_CID \
{ /* 2B722171-2CEA-11d3-9E0B-00A0C92B5F0D */ \
0x2b722171, 0x2cea, 0x11d3, \
{0x9e, 0xb, 0x0, 0xa0, 0xc9, 0x2b, 0x5f, 0xd} \
}
//
// nsAddrBookSession
//
#define NS_ADDRBOOKSESSION_CONTRACTID \
"@mozilla.org/addressbook/services/session;1"
#define NS_ADDRBOOKSESSION_CID \
{ /* C5339442-303F-11d3-9E13-00A0C92B5F0D */ \
0xc5339442, 0x303f, 0x11d3, \
{0x9e, 0x13, 0x0, 0xa0, 0xc9, 0x2b, 0x5f, 0xd} \
}
//
// nsAbDirProperty
//
#define NS_ABDIRPROPERTY_CONTRACTID \
"@mozilla.org/addressbook/directoryproperty;1"
#define NS_ABDIRPROPERTY_CID \
{ /* 6FD8EC67-3965-11d3-A316-001083003D0C */ \
0x6fd8ec67, 0x3965, 0x11d3, \
{0xa3, 0x16, 0x0, 0x10, 0x83, 0x0, 0x3d, 0xc} \
}
//
// nsAbDirectoryProperties
//
#define NS_ABDIRECTORYPROPERTIES_CONTRACTID \
"@mozilla.org/addressbook/properties;1"
#define NS_ABDIRECTORYPROPERTIES_CID \
{ /* 8b00a972-1dd2-11b2-9d9c-9c377a9c3dba */ \
0x8b00a972, 0x1dd2, 0x11b2, \
{0x9d, 0x9c, 0x9c, 0x37, 0x7a, 0x9c, 0x3d, 0xba} \
}
//
// nsAbAutoCompleteSession
//
#define NS_ABAUTOCOMPLETESESSION_CONTRACTID \
"@mozilla.org/autocompleteSession;1?type=addrbook"
#define NS_ABAUTOCOMPLETESESSION_CID \
{ /* 138DE9BD-362B-11d3-988E-001083010E9B */ \
0x138de9bd, 0x362b, 0x11d3, \
{0x98, 0x8e, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b} \
}
//
// nsAbAddressCollecter
//
#define NS_ABADDRESSCOLLECTER_CONTRACTID \
"@mozilla.org/addressbook/services/addressCollecter;1"
#define NS_ABADDRESSCOLLECTER_CID \
{ /* fe04c8e6-501e-11d3-a527-0060b0fc04b7 */ \
0xfe04c8e6, 0x501e, 0x11d3, \
{0xa5, 0x27, 0x0, 0x60, 0xb0, 0xfc, 0x4, 0xb7} \
}
#define NS_AB4xUPGRADER_CONTRACTID \
"@mozilla.org/addressbook/services/4xUpgrader;1"
#define NS_AB4xUPGRADER_CID \
{ /* 0a6ae8e6-f550-11d3-a563-0060b0fc04b7 */ \
0x0a6ae8e6, 0xf550, 0x11d3, \
{0xa5, 0x63, 0x00, 0x60, 0xb0, 0xfc, 0x4, 0xb7} \
}
//
// addbook URL
//
#define NS_ADDBOOKURL_CONTRACTID \
"@mozilla.org/addressbook/services/url;1?type=addbook"
#define NS_ADDBOOKURL_CID \
{ /* ff04c8e6-501e-11d3-a527-0060b0fc0444 */ \
0xff04c8e6, 0x501e, 0x11d3, \
{0xa5, 0x27, 0x0, 0x60, 0xb0, 0xfc, 0x4, 0x44} \
}
//
// addbook Protocol Handler
//
#define NS_ADDBOOK_HANDLER_CONTRACTID \
"@mozilla.org/addressbook/services/addbook;1"
#define NS_ADDBOOK_HANDLER_CID \
{ /* ff04c8e6-501e-11d3-ffcc-0060b0fc0444 */ \
0xff04c8e6, 0x501e, 0x11d3, \
{0xff, 0xcc, 0x0, 0x60, 0xb0, 0xfc, 0x4, 0x44} \
}
//
// directory factory service
//
#define NS_ABDIRFACTORYSERVICE_CONTRACTID \
"@mozilla.org/addressbook/directory-factory-service;1"
#define NS_ABDIRFACTORYSERVICE_CID \
{ /* {F8B212F2-742B-4A48-B7A0-4C44D4DDB121}*/ \
0xF8B212F2, 0x742B, 0x4A48, \
{0xB7, 0xA0, 0x4C, 0x44, 0xD4, 0xDD, 0xB1, 0x21} \
}
//
// mdb directory factory
//
#define NS_ABMDBDIRFACTORY_CONTRACTID \
NS_AB_DIRECTORY_FACTORY_CONTRACTID_PREFIX "moz-abmdbdirectory"
#define NS_ABMDBDIRFACTORY_CID \
{ /* {E1CB9C8A-722D-43E4-9D7B-7CCAE4B0338A}*/ \
0xE1CB9C8A, 0x722D, 0x43E4, \
{0x9D, 0x7B, 0x7C, 0xCA, 0xE4, 0xB0, 0x33, 0x8A} \
}
#ifdef XP_WIN
//
// nsAbOutlookDirectory
//
#define NS_ABOUTLOOKDIRECTORY_CONTRACTID \
NS_RDF_RESOURCE_FACTORY_CONTRACTID_PREFIX "moz-aboutlookdirectory"
#define NS_ABOUTLOOKDIRECTORY_CID \
{ /* {9cc57822-0599-4c47-a399-1c6fa185a05c}*/ \
0x9cc57822, 0x0599, 0x4c47, \
{0xa3, 0x99, 0x1c, 0x6f, 0xa1, 0x85, 0xa0, 0x5c} \
}
//
// nsAbOutlookCard
//
#define NS_ABOUTLOOKCARD_CONTRACTID \
"@mozilla.org/addressbook/moz-aboutlookcard"
#define NS_ABOUTLOOKCARD_CID \
{ /* {32cf9734-4ee8-4f5d-acfc-71b75eee1819}*/ \
0x32cf9734, 0x4ee8, 0x4f5d, \
{0xac, 0xfc, 0x71, 0xb7, 0x5e, 0xee, 0x18, 0x19} \
}
//
// Outlook directory factory
//
#define NS_ABOUTLOOKDIRFACTORY_CONTRACTID \
NS_AB_DIRECTORY_FACTORY_CONTRACTID_PREFIX "moz-aboutlookdirectory"
#define NS_ABOUTLOOKDIRFACTORY_CID \
{ /* {558ccc0f-2681-4dac-a066-debd8d26faf6}*/ \
0x558ccc0f, 0x2681, 0x4dac, \
{0xa0, 0x66, 0xde, 0xbd, 0x8d, 0x26, 0xfa, 0xf6} \
}
#endif
//
// Addressbook Query support
//
#define NS_ABDIRECTORYQUERYARGUMENTS_CONTRACTID \
"@mozilla.org/addressbook/directory/query-arguments;1"
#define NS_ABDIRECTORYQUERYARGUMENTS_CID \
{ /* {f7dc2aeb-8e62-4750-965c-24b9e09ed8d2} */ \
0xf7dc2aeb, 0x8e62, 0x4750, \
{ 0x96, 0x5c, 0x24, 0xb9, 0xe0, 0x9e, 0xd8, 0xd2 } \
}
#define NS_BOOLEANCONDITIONSTRING_CONTRACTID \
"@mozilla.org/boolean-expression/condition-string;1"
#define NS_BOOLEANCONDITIONSTRING_CID \
{ /* {ca1944a9-527e-4c77-895d-d0466dd41cf5} */ \
0xca1944a9, 0x527e, 0x4c77, \
{ 0x89, 0x5d, 0xd0, 0x46, 0x6d, 0xd4, 0x1c, 0xf5 } \
}
#define NS_BOOLEANEXPRESSION_CONTRACTID \
"@mozilla.org/boolean-expression/n-peer;1"
#define NS_BOOLEANEXPRESSION_CID \
{ /* {2c2e75c8-6f56-4a50-af1c-72af5d0e8d41} */ \
0x2c2e75c8, 0x6f56, 0x4a50, \
{ 0xaf, 0x1c, 0x72, 0xaf, 0x5d, 0x0e, 0x8d, 0x41 } \
}
#define NS_ABDIRECTORYQUERYPROXY_CONTRACTID \
"@mozilla.org/addressbook/directory-query/proxy;1"
#define NS_ABDIRECTORYQUERYPROXY_CID \
{ /* {E162E335-541B-43B4-AAEA-FE591E240CAF}*/ \
0xE162E335, 0x541B, 0x43B4, \
{0xAA, 0xEA, 0xFE, 0x59, 0x1E, 0x24, 0x0C, 0xAF} \
}
// nsAbLDAPDirectory
//
#define NS_ABLDAPDIRECTORY_CONTRACTID \
NS_RDF_RESOURCE_FACTORY_CONTRACTID_PREFIX "moz-abldapdirectory"
#define NS_ABLDAPDIRECTORY_CID \
{ /* {783E2777-66D7-4826-9E4B-8AB58C228A52}*/ \
0x783E2777, 0x66D7, 0x4826, \
{0x9E, 0x4B, 0x8A, 0xB5, 0x8C, 0x22, 0x8A, 0x52} \
}
//
// nsAbLDAPCard
//
#define NS_ABLDAPCARD_CONTRACTID \
"@mozilla.org/addressbook/moz-abldapcard"
#define NS_ABLDAPCARD_CID \
{ /* {10307B01-EBD6-465F-B972-1630410F70E6}*/ \
0x10307B01, 0xEBD6, 0x465F, \
{0xB9, 0x72, 0x16, 0x30, 0x41, 0x0F, 0x70, 0xE6} \
}
//
// LDAP directory factory
//
#define NS_ABLDAPDIRFACTORY_CONTRACTID \
NS_AB_DIRECTORY_FACTORY_CONTRACTID_PREFIX "moz-abldapdirectory"
#define NS_ABLDAPDIRFACTORY_CID \
{ /* {8e3701af-8828-426c-84ac-124825c778f8} */ \
0x8e3701af, 0x8828, 0x426c, \
{0x84, 0xac, 0x12, 0x48, 0x25, 0xc7, 0x78, 0xf8} \
}
//
// LDAP autcomplete directory factory
//
#define NS_ABLDAPACDIRFACTORY_CONTRACTID \
NS_AB_DIRECTORY_FACTORY_CONTRACTID_PREFIX "ldap"
#define NS_ABLDAPSACDIRFACTORY_CONTRACTID \
NS_AB_DIRECTORY_FACTORY_CONTRACTID_PREFIX "ldaps"
// nsAbLDAPAutoCompFormatter
// 4e276d6d-9981-46b4-9070-92f344ac5f5a
//
#define NS_ABLDAPAUTOCOMPFORMATTER_CID \
{ 0x4e276d6d, 0x9981, 0x46b4, \
{ 0x90, 0x70, 0x92, 0xf3, 0x44, 0xac, 0x5f, 0x5a }}
#define NS_ABLDAPAUTOCOMPFORMATTER_CONTRACTID \
"@mozilla.org/ldap-autocomplete-formatter;1?type=addrbook"
// nsAbLDAPReplicationService
//
// {ece81280-2639-11d6-b791-00b0d06e5f27}
//
#define NS_ABLDAP_REPLICATIONSERVICE_CID \
{0xece81280, 0x2639, 0x11d6, \
{ 0xb7, 0x91, 0x00, 0xb0, 0xd0, 0x6e, 0x5f, 0x27 }}
#define NS_ABLDAP_REPLICATIONSERVICE_CONTRACTID \
"@mozilla.org/addressbook/ldap-replication-service;1"
// nsAbLDAPReplicationQuery
//
// {5414fff0-263b-11d6-b791-00b0d06e5f27}
//
#define NS_ABLDAP_REPLICATIONQUERY_CID \
{0x5414fff0, 0x263b, 0x11d6, \
{ 0xb7, 0x91, 0x00, 0xb0, 0xd0, 0x6e, 0x5f, 0x27 }}
#define NS_ABLDAP_REPLICATIONQUERY_CONTRACTID \
"@mozilla.org/addressbook/ldap-replication-query;1"
// nsAbLDAPChangeLogQuery
//
// {63E11D51-3C9B-11d6-B7B9-00B0D06E5F27}
#define NS_ABLDAP_CHANGELOGQUERY_CID \
{0x63e11d51, 0x3c9b, 0x11d6, \
{ 0xb7, 0xb9, 0x0, 0xb0, 0xd0, 0x6e, 0x5f, 0x27 }}
#define NS_ABLDAP_CHANGELOGQUERY_CONTRACTID \
"@mozilla.org/addressbook/ldap-changelog-query;1"
// nsAbLDAPProcessReplicationData
//
// {5414fff1-263b-11d6-b791-00b0d06e5f27}
//
#define NS_ABLDAP_PROCESSREPLICATIONDATA_CID \
{0x5414fff1, 0x263b, 0x11d6, \
{ 0xb7, 0x91, 0x00, 0xb0, 0xd0, 0x6e, 0x5f, 0x27 }}
#define NS_ABLDAP_PROCESSREPLICATIONDATA_CONTRACTID \
"@mozilla.org/addressbook/ldap-process-replication-data;1"
// nsAbLDAPProcessChangeLogData
//
// {63E11D52-3C9B-11d6-B7B9-00B0D06E5F27}
#define NS_ABLDAP_PROCESSCHANGELOGDATA_CID \
{0x63e11d52, 0x3c9b, 0x11d6, \
{0xb7, 0xb9, 0x0, 0xb0, 0xd0, 0x6e, 0x5f, 0x27 }}
#define NS_ABLDAP_PROCESSCHANGELOGDATA_CONTRACTID \
"@mozilla.org/addressbook/ldap-process-changelog-data;1"
// nsABView
#define NS_ABVIEW_CID \
{ 0xc5eb5d6a, 0x1dd1, 0x11b2, \
{ 0xa0, 0x25, 0x94, 0xd1, 0x18, 0x1f, 0xc5, 0x9c }}
#define NS_ABVIEW_CONTRACTID \
"@mozilla.org/addressbook/abview;1"
#endif // nsAbBaseCID_h__

View File

@@ -1,325 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998,1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIFactory.h"
#include "nsISupports.h"
#include "nsIGenericFactory.h"
#include "nsIModule.h"
#include "nsAbBaseCID.h"
#include "pratom.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "rdf.h"
#include "nsCRT.h"
#include "nsCOMPtr.h"
#include "nsDirectoryDataSource.h"
#include "nsAbBSDirectory.h"
#include "nsAbMDBDirectory.h"
#include "nsAbMDBCard.h"
#include "nsAbDirFactoryService.h"
#include "nsAbMDBDirFactory.h"
#include "nsAddrDatabase.h"
#include "nsAddressBook.h"
#include "nsAddrBookSession.h"
#include "nsAbDirProperty.h"
#include "nsAbAutoCompleteSession.h"
#include "nsAbAddressCollecter.h"
#include "nsAddbookProtocolHandler.h"
#include "nsAddbookUrl.h"
#ifdef XP_WIN
#include "nsAbOutlookDirectory.h"
#include "nsAbOutlookCard.h"
#include "nsAbOutlookDirFactory.h"
#endif
#include "nsAbDirectoryQuery.h"
#include "nsAbBooleanExpression.h"
#include "nsAbDirectoryQueryProxy.h"
#include "nsAbView.h"
#if defined(MOZ_LDAP_XPCOM)
#include "nsAbLDAPDirectory.h"
#include "nsAbLDAPCard.h"
#include "nsAbLDAPDirFactory.h"
#include "nsAbLDAPAutoCompFormatter.h"
#include "nsAbLDAPReplicationService.h"
#include "nsAbLDAPReplicationQuery.h"
#include "nsAbLDAPReplicationData.h"
#include "nsAbLDAPChangeLogQuery.h"
#include "nsAbLDAPChangeLogData.h"
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddressBook)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAbDirectoryDataSource,Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbDirProperty)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbDirectoryProperties)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbCardProperty)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbBSDirectory)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbMDBDirectory)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbMDBCard)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddrDatabase)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddrBookSession)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbAutoCompleteSession)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAbAddressCollecter,Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddbookUrl)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbDirFactoryService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbMDBDirFactory)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAddbookProtocolHandler)
#ifdef XP_WIN
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbOutlookDirectory)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbOutlookCard)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbOutlookDirFactory)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbDirectoryQueryArguments)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbBooleanConditionString)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbBooleanExpression)
#if defined(MOZ_LDAP_XPCOM)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPDirectory)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPCard)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPDirFactory)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPAutoCompFormatter)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPReplicationService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPReplicationQuery)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPProcessReplicationData)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPChangeLogQuery)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbLDAPProcessChangeLogData)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbDirectoryQueryProxy)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAbView);
static const nsModuleComponentInfo components[] =
{
{ "Address Book",
NS_ADDRESSBOOK_CID,
NS_ADDRESSBOOK_CONTRACTID,
nsAddressBookConstructor },
{ "Address Book Startup Handler",
NS_ADDRESSBOOK_CID,
NS_ADDRESSBOOKSTARTUPHANDLER_CONTRACTID,
nsAddressBookConstructor,
nsAddressBook::RegisterProc,
nsAddressBook::UnregisterProc },
{ "Address Book Directory Datasource",
NS_ABDIRECTORYDATASOURCE_CID,
NS_ABDIRECTORYDATASOURCE_CONTRACTID,
nsAbDirectoryDataSourceConstructor },
{ "Address Boot Strap Directory",
NS_ABDIRECTORY_CID,
NS_ABDIRECTORY_CONTRACTID,
nsAbBSDirectoryConstructor },
{ "Address MDB Book Directory",
NS_ABMDBDIRECTORY_CID,
NS_ABMDBDIRECTORY_CONTRACTID,
nsAbMDBDirectoryConstructor },
{ "Address MDB Book Card",
NS_ABMDBCARD_CID,
NS_ABMDBCARD_CONTRACTID,
nsAbMDBCardConstructor },
{ "Address Database",
NS_ADDRDATABASE_CID,
NS_ADDRDATABASE_CONTRACTID,
nsAddrDatabaseConstructor },
{ "Address Book Card Property",
NS_ABCARDPROPERTY_CID,
NS_ABCARDPROPERTY_CONTRACTID,
nsAbCardPropertyConstructor },
{ "Address Book Directory Property",
NS_ABDIRPROPERTY_CID,
NS_ABDIRPROPERTY_CONTRACTID,
nsAbDirPropertyConstructor },
{ "AB Directory Properties",
NS_ABDIRECTORYPROPERTIES_CID,
NS_ABDIRECTORYPROPERTIES_CONTRACTID,
nsAbDirectoryPropertiesConstructor },
{ "Address Book Session",
NS_ADDRBOOKSESSION_CID,
NS_ADDRBOOKSESSION_CONTRACTID,
nsAddrBookSessionConstructor },
{ "Address Book Auto Complete Session",
NS_ABAUTOCOMPLETESESSION_CID,
NS_ABAUTOCOMPLETESESSION_CONTRACTID,
nsAbAutoCompleteSessionConstructor },
{ "Address Book Address Collector",
NS_ABADDRESSCOLLECTER_CID,
NS_ABADDRESSCOLLECTER_CONTRACTID,
nsAbAddressCollecterConstructor },
{ "The addbook URL Interface",
NS_ADDBOOKURL_CID,
NS_ADDBOOKURL_CONTRACTID,
nsAddbookUrlConstructor },
{ "The addbook Protocol Handler",
NS_ADDBOOK_HANDLER_CID,
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "addbook",
nsAddbookProtocolHandlerConstructor },
{ "The directory factory service interface",
NS_ABDIRFACTORYSERVICE_CID,
NS_ABDIRFACTORYSERVICE_CONTRACTID,
nsAbDirFactoryServiceConstructor },
{ "The MDB directory factory interface",
NS_ABMDBDIRFACTORY_CID,
NS_ABMDBDIRFACTORY_CONTRACTID,
nsAbMDBDirFactoryConstructor },
#ifdef XP_WIN
{ "Address OUTLOOK Book Directory",
NS_ABOUTLOOKDIRECTORY_CID,
NS_ABOUTLOOKDIRECTORY_CONTRACTID,
nsAbOutlookDirectoryConstructor },
{ "Address OUTLOOK Book Card",
NS_ABOUTLOOKCARD_CID,
NS_ABOUTLOOKCARD_CONTRACTID,
nsAbOutlookCardConstructor },
{ "The outlook factory Interface",
NS_ABOUTLOOKDIRFACTORY_CID,
NS_ABOUTLOOKDIRFACTORY_CONTRACTID,
nsAbOutlookDirFactoryConstructor },
#endif
{ "The addbook query arguments",
NS_ABDIRECTORYQUERYARGUMENTS_CID,
NS_ABDIRECTORYQUERYARGUMENTS_CONTRACTID,
nsAbDirectoryQueryArgumentsConstructor },
{ "The query boolean condition string",
NS_BOOLEANCONDITIONSTRING_CID,
NS_BOOLEANCONDITIONSTRING_CONTRACTID,
nsAbBooleanConditionStringConstructor },
{ "The query n-peer expression",
NS_BOOLEANEXPRESSION_CID,
NS_BOOLEANEXPRESSION_CONTRACTID,
nsAbBooleanExpressionConstructor },
#if defined(MOZ_LDAP_XPCOM)
{ "Address LDAP Book Directory",
NS_ABLDAPDIRECTORY_CID,
NS_ABLDAPDIRECTORY_CONTRACTID,
nsAbLDAPDirectoryConstructor },
{ "Address LDAP Book Card",
NS_ABLDAPCARD_CID,
NS_ABLDAPCARD_CONTRACTID,
nsAbLDAPCardConstructor },
{ "Address LDAP factory Interface",
NS_ABLDAPDIRFACTORY_CID,
NS_ABLDAPDIRFACTORY_CONTRACTID,
nsAbLDAPDirFactoryConstructor },
{"Address LDAP Replication Service Interface",
NS_ABLDAP_REPLICATIONSERVICE_CID,
NS_ABLDAP_REPLICATIONSERVICE_CONTRACTID,
nsAbLDAPReplicationServiceConstructor },
{"Address LDAP Replication Query Interface",
NS_ABLDAP_REPLICATIONQUERY_CID,
NS_ABLDAP_REPLICATIONQUERY_CONTRACTID,
nsAbLDAPReplicationQueryConstructor },
{"Address LDAP Replication Processor Interface",
NS_ABLDAP_PROCESSREPLICATIONDATA_CID,
NS_ABLDAP_PROCESSREPLICATIONDATA_CONTRACTID,
nsAbLDAPProcessReplicationDataConstructor },
{"Address LDAP ChangeLog Query Interface",
NS_ABLDAP_CHANGELOGQUERY_CID,
NS_ABLDAP_CHANGELOGQUERY_CONTRACTID,
nsAbLDAPChangeLogQueryConstructor },
{"Address LDAP ChangeLog Processor Interface",
NS_ABLDAP_PROCESSCHANGELOGDATA_CID,
NS_ABLDAP_PROCESSCHANGELOGDATA_CONTRACTID,
nsAbLDAPProcessChangeLogDataConstructor },
{ "Address LDAP autocomplete factory Interface",
NS_ABLDAPDIRFACTORY_CID,
NS_ABLDAPACDIRFACTORY_CONTRACTID,
nsAbLDAPDirFactoryConstructor },
{ "Address LDAP over SSL autocomplete factory Interface",
NS_ABLDAPDIRFACTORY_CID,
NS_ABLDAPSACDIRFACTORY_CONTRACTID,
nsAbLDAPDirFactoryConstructor },
{ "Address book LDAP autocomplete formatter",
NS_ABLDAPAUTOCOMPFORMATTER_CID,
NS_ABLDAPAUTOCOMPFORMATTER_CONTRACTID,
nsAbLDAPAutoCompFormatterConstructor },
#endif
{ "The directory query proxy interface",
NS_ABDIRECTORYQUERYPROXY_CID,
NS_ABDIRECTORYQUERYPROXY_CONTRACTID,
nsAbDirectoryQueryProxyConstructor },
{ "addressbook view",
NS_ABVIEW_CID,
NS_ABVIEW_CONTRACTID,
nsAbViewConstructor }
};
PR_STATIC_CALLBACK(void)
msgAbModuleDtor(nsIModule* self)
{
nsAddrDatabase::CleanupCache();
}
NS_IMPL_NSGETMODULE_WITH_DTOR(nsAbModule, components, msgAbModuleDtor)

View File

@@ -1,249 +0,0 @@
?GetStringColumn@nsAddrDatabase@@IAEIPAVnsIMdbRow@@IAAVnsString@@@Z ; 75645
?AddRef@nsAddrDatabase@@UAGKXZ ; 19143
?Release@nsRDFResource@@UAGKXZ ; 16961
?Release@nsAbDirectory@@UAGKXZ ; 16929
?AddRef@nsAbRDFResource@@UAGKXZ ; 16929
?AddRef@nsAbDirectory@@UAGKXZ ; 16929
?Release@nsAbRDFResource@@UAGKXZ ; 16929
?GetAttributeName@nsAbCardProperty@@IAEIPAPAGAAVnsString@@@Z ; 10557
?QueryInterface@nsAbCard@@UAGIABUnsID@@PAPAX@Z ; 8402
?SetAttributeName@nsAbCardProperty@@IAEIPBGAAVnsString@@@Z ; 6694
?assign_assuming_AddRef@nsCOMPtr_base@@IAEXPAVnsISupports@@@Z ; 4248
?GetValueConst@nsRDFResource@@UAGIPAPBD@Z ; 4232
?GetIntColumn@nsAddrDatabase@@IAEIPAVnsIMdbRow@@IPAII@Z ; 4223
?QueryInterface@nsAbRDFResource@@UAGIABUnsID@@PAPAX@Z ; 4219
?Release@nsAddrDatabase@@UAGKXZ ; 2182
?YarnToUInt32@nsAddrDatabase@@IAEXPAUmdbYarn@@PAI@Z ; 2139
?RemoveListener@nsAddrDatabase@@UAGIPAVnsIAddrDBListener@@@Z ; 2118
?Init@nsRDFResource@@UAGIPBD@Z ; 2116
??1nsRDFResource@@UAE@XZ ; 2116
?QueryInterface@nsRDFResource@@UAGIABUnsID@@PAPAX@Z ; 2116
??0nsRDFResource@@QAE@XZ ; 2116
??0nsAbRDFResource@@QAE@XZ ; 2116
??1nsAbRDFResource@@UAE@XZ ; 2116
?Next@nsAddrDBEnumerator@@UAGIXZ ; 2109
?AddListener@nsAddrDatabase@@UAGIPAVnsIAddrDBListener@@@Z ; 2107
?SetDbRowID@nsAbCardProperty@@UAGII@Z ; 2103
?SetDbTableID@nsAbCardProperty@@UAGII@Z ; 2103
?SetAbDatabase@nsAbCardProperty@@UAGIPAVnsIAddrDatabase@@@Z ; 2101
?AddChildCards@nsAbDirectory@@UAGIPBDPAPAVnsIAbCard@@@Z ; 2101
??0nsAbCardProperty@@QAE@XZ ; 2101
??1nsAbCard@@UAE@XZ ; 2101
?SetPrimaryEmail@nsAbCardProperty@@UAGIPBG@Z ; 2101
?GetCardFromDB@nsAddrDatabase@@IAEIPAVnsIAbCard@@PAVnsIMdbRow@@@Z ; 2101
?SetRecordKey@nsAbCardProperty@@UAGII@Z ; 2101
??1nsAbCardProperty@@UAE@XZ ; 2101
??0nsAbCard@@QAE@XZ ; 2101
??_EnsAbCard@@UAEPAXI@Z ; 2101
?CreateABCard@nsAddrDatabase@@QAEIPAVnsIMdbRow@@PAPAVnsIAbCard@@@Z ; 2101
?CreateCard@nsAddrDatabase@@IAEIPAVnsIMdbRow@@IPAPAVnsIAbCard@@@Z ; 2101
?GetFirstName@nsAbCardProperty@@UAGIPAPAG@Z ; 2099
?GetDisplayName@nsAbCardProperty@@UAGIPAPAG@Z ; 2099
?GetNickName@nsAbCardProperty@@UAGIPAPAG@Z ; 2099
?GetLastName@nsAbCardProperty@@UAGIPAPAG@Z ; 2099
?GetIsMailList@nsAbCardProperty@@UAGIPAH@Z ; 2099
?GetPrimaryEmail@nsAbCardProperty@@UAGIPAPAG@Z ; 2099
?CurrentItem@nsAddrDBEnumerator@@UAGIPAPAVnsISupports@@@Z ; 2097
?CheckEntry@nsAbAutoCompleteSession@@IAEHPAVnsAbAutoCompleteSearchString@@PBG1111PAW4MatchType@1@@Z ; 2097
?SetDisplayName@nsAbCardProperty@@UAGIPBG@Z ; 1891
?SetFirstName@nsAbCardProperty@@UAGIPBG@Z ; 1456
?SetLastName@nsAbCardProperty@@UAGIPBG@Z ; 1246
?do_GetService@@YA?BVnsGetServiceByCID@@ABUnsID@@PAI@Z ; 371
?GetDBCache@nsAddrDatabase@@KAPAVnsVoidArray@@XZ ; 198
?GetCharStringYarn@nsAddrDatabase@@IAEXPADPAUmdbYarn@@@Z ; 74
?AddCharStringColumn@nsAddrDatabase@@IAEIPAVnsIMdbRow@@IPBD@Z ; 74
?INTL_ConvertFromUnicode@@YAHPBGHPAPAD@Z ; 72
?QueryInterface@nsAbDirectory@@UAGIABUnsID@@PAPAX@Z ; 59
?DIR_ForceFlag@@YAXPAUDIR_Server@@IH@Z ; 54
?FindInCache@nsAddrDatabase@@KAHPAV1@@Z ; 44
?RemoveFromCache@nsAddrDatabase@@KAXPAV1@@Z ; 44
?AddRef@nsAddbookProtocolHandler@@UAGKXZ ; 42
?DIR_GetDirectories@@YAPAVnsVoidArray@@XZ ; 35
?CloseMDB@nsAddrDatabase@@UAGIH@Z ; 33
?Close@nsAddrDatabase@@UAGIH@Z ; 33
?DIR_TestFlag@@YAHPAUDIR_Server@@I@Z ; 32
?NS_GetSpecialDirectory@@YAIPBDPAPAVnsIFile@@@Z ; 30
?QueryInterface@nsAddrBookSession@@UAGIABUnsID@@PAPAX@Z ; 30
?Open@nsAddrDatabase@@UAGIPAVnsFileSpec@@HPAPAVnsIAddrDatabase@@H@Z ; 30
?QueryInterface@nsAddrDatabase@@UAGIABUnsID@@PAPAX@Z ; 30
?GetUserProfileDirectory@nsAddrBookSession@@UAGIPAPAVnsFileSpec@@@Z ; 30
?FindInCache@nsAddrDatabase@@SAPAV1@PAVnsFileSpec@@@Z ; 30
?RemoveElementsFromAddressList@nsAbDirProperty@@UAGIXZ ; 29
?INTL_ConvertToUnicode@@YAHPBDHPAPAX@Z ; 27
?GetDataRow@nsAddrDatabase@@IAEIPAPAVnsIMdbRow@@@Z ; 23
??0nsAddrDatabase@@QAE@XZ ; 22
??_EnsAddrDatabase@@UAEPAXI@Z ; 22
??1nsAddrDatabase@@UAE@XZ ; 22
?SetDbPath@nsAddrDatabase@@UAGIPAVnsFileSpec@@@Z ; 21
?GetMDBFactory@nsAddrDatabase@@QAEPAVnsIMdbFactory@@XZ ; 21
?OpenMDB@nsAddrDatabase@@UAGIPAVnsFileSpec@@H@Z ; 21
?UpdateLowercaseEmailListName@nsAddrDatabase@@IAEIXZ ; 21
?GetLastRecorKey@nsAddrDatabase@@IAEIXZ ; 21
?UnixToNative@nsAddrDatabase@@KAXAAPAD@Z ; 21
?InitMDBInfo@nsAddrDatabase@@IAEIXZ ; 21
?Commit@nsAddrDatabase@@UAGII@Z ; 21
?InitExistingDB@nsAddrDatabase@@IAEIXZ ; 21
?GetChildNodes@nsAbDirectory@@UAGIPAPAVnsIEnumerator@@@Z ; 19
?MatchDbName@nsAddrDatabase@@IAEHPAVnsFileSpec@@@Z ; 19
?SetPreferMailFormat@nsAbCardProperty@@UAGII@Z ; 17
?Release@nsAbAutoCompleteParam@@UAGKXZ ; 16
??0nsAbDirectory@@QAE@XZ ; 15
??_GnsAbDirectory@@UAEPAXI@Z ; 15
??0nsAbDirProperty@@QAE@XZ ; 15
??1nsAbDirProperty@@UAE@XZ ; 15
?AddRef@nsAddressBook@@UAGKXZ ; 15
??1nsAbDirectory@@UAE@XZ ; 15
?Release@nsAddressBook@@UAGKXZ ; 15
?GetAbDatabaseFromURI@nsAddressBook@@UAGIPBDPAPAVnsIAddrDatabase@@@Z ; 13
?QueryInterface@nsAddressBook@@UAGIABUnsID@@PAPAX@Z ; 13
?Release@nsAbAutoCompleteSession@@UAGKXZ ; 12
?QueryInterface@nsAbAutoCompleteSession@@UAGIABUnsID@@PAPAX@Z ; 12
?GetMailingListsFromDB@nsAddrDatabase@@UAGIPAVnsIAbDirectory@@@Z ; 10
?SetDirName@nsAbDirProperty@@UAGIPBG@Z ; 10
?AddDirectory@nsAbDirectory@@UAGIPBDPAPAVnsIAbDirectory@@@Z ; 10
?SetServer@nsAbDirProperty@@UAGIPAUDIR_Server@@@Z ; 10
?DIR_InitServer@@YAIPAUDIR_Server@@@Z ; 9
?DIR_GetPrefsForOneServer@@YAXPAUDIR_Server@@HH@Z ; 9
?SearchDirectory@nsAbAutoCompleteSession@@IAEIAAVnsString@@PAVnsAbAutoCompleteSearchString@@PAVnsIAutoCompleteResults@@H@Z ; 9
??_GnsVoidArray@@UAEPAXI@Z ; 9
?Release@nsAbAddressCollecter@@UAGKXZ ; 8
?AddToResult@nsAbAutoCompleteSession@@IAEXPBG00000HW4MatchType@1@PAVnsIAutoCompleteResults@@@Z ; 8
?GetDirUri@nsAbDirectory@@UAGIPAPAD@Z ; 8
??1nsAbAutoCompleteParam@@UAE@XZ ; 8
?ItsADuplicate@nsAbAutoCompleteSession@@IAEHPAGPAVnsIAutoCompleteResults@@@Z ; 8
??0nsAbAutoCompleteParam@@QAE@PBG00000HW4MatchType@nsAbAutoCompleteSession@@@Z ; 8
??_GnsAbAutoCompleteParam@@UAEPAXI@Z ; 8
?QueryInterface@nsAbAddressCollecter@@UAGIABUnsID@@PAPAX@Z ; 7
?OnStartLookup@nsAbAutoCompleteSession@@UAGIPBGPAVnsIAutoCompleteResults@@PAVnsIAutoCompleteListener@@@Z ; 7
?GetServer@nsAbDirProperty@@UAGIPAPAUDIR_Server@@@Z ; 6
?GetIntYarn@nsAddrDatabase@@IAEXIPAUmdbYarn@@@Z ; 6
??_EnsAddrDBEnumerator@@UAEPAXI@Z ; 6
??0nsAddrDBEnumerator@@QAE@PAVnsAddrDatabase@@@Z ; 6
?SearchCards@nsAbAutoCompleteSession@@IAEIPAVnsIAbDirectory@@PAVnsAbAutoCompleteSearchString@@PAVnsIAutoCompleteResults@@@Z ; 6
?GetCardForEmailAddress@nsAddrDatabase@@UAGIPAVnsIAbDirectory@@PBDPAPAVnsIAbCard@@@Z ; 6
?Release@nsListAddressEnumerator@@UAGKXZ ; 6
?First@nsAddrDBEnumerator@@UAGIXZ ; 6
?AddIntColumn@nsAddrDatabase@@IAEIPAVnsIMdbRow@@II@Z ; 6
?GetChildCards@nsAbDirectory@@UAGIPAPAVnsIEnumerator@@@Z ; 6
??1nsAddrDBEnumerator@@UAE@XZ ; 6
?GetAbDatabase@nsAbRDFResource@@IAEIXZ ; 6
?GetRowForEmailAddress@nsAddrDatabase@@IAEIPBDPAPAVnsIMdbRow@@@Z ; 6
?EnumerateCards@nsAddrDatabase@@UAGIPAVnsIAbDirectory@@PAPAVnsIEnumerator@@@Z ; 6
?GetRowForCharColumn@nsAddrDatabase@@IAEIPBDIHPAPAVnsIMdbRow@@@Z ; 6
?DIR_SetFlag@@YAXPAUDIR_Server@@I@Z ; 5
?DIR_SavePrefsForOneServer@@YAXPAUDIR_Server@@@Z ; 5
?DIR_ClearFlag@@YAXPAUDIR_Server@@I@Z ; 5
?DIR_ClearPrefBranch@@YAXPBD@Z ; 5
?NotifyCardEntryChange@nsAddrDatabase@@UAGIIPAVnsIAbCard@@PAVnsIAddrDBListener@@@Z ; 4
?GetIsMailList@nsAbDirProperty@@UAGIPAH@Z ; 4
?GetPreferMailFormat@nsAbCardProperty@@UAGIPAI@Z ; 4
?DIR_SetServerFileName@@YAXPAUDIR_Server@@PBD@Z ; 4
??0nsAbAutoCompleteSearchString@@QAE@PBG@Z ; 3
??1nsAbAutoCompleteSearchString@@UAE@XZ ; 3
?ResetMatchTypeConters@nsAbAutoCompleteSession@@IAEXXZ ; 3
?SearchPreviousResults@nsAbAutoCompleteSession@@IAEIPAVnsAbAutoCompleteSearchString@@PAVnsIAutoCompleteResults@@1@Z ; 3
?AddUnicodeToColumn@nsAddrDatabase@@IAEIPAVnsIMdbRow@@IPAG@Z ; 2
?IsDomainExcluded@nsAbAddressCollecter@@QAEIPBDPAVnsIPref@@PAH@Z ; 2
?AddDepartment@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddCustom2@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddHomeCountry@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddWebPage2@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetWorkCountry@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddCompany@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetCellularNumber@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddWorkPhone@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetWebPage2@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?GetCustom3@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddAttributeColumnsToRow@nsAddrDatabase@@IAEIPAVnsIAbCard@@PAVnsIMdbRow@@@Z ; 2
?GetCardCount@nsAddrDatabase@@UAGIPAI@Z ; 2
?GetCustom2@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddCustom1@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?DeleteCardFromAllMailLists@nsAddrDatabase@@IAEXI@Z ; 2
?GetHomeCity@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?GetDepartment@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?GetBirthDay@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?GetWorkState@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddWebPage1@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddCardToDatabase@nsAbCardProperty@@UAGIPBD@Z ; 2
?UpdateLastRecordKey@nsAddrDatabase@@IAEIXZ ; 2
?GetWorkPhone@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddHomeAddress@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetBirthMonth@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?GetHomeState@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?GetFaxNumber@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddDisplayName@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetCustom4@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddNotes@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetNewRow@nsAddrDatabase@@UAGIPAPAVnsIMdbRow@@@Z ; 2
?AddFirstName@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddRecordKeyColumnToRow@nsAddrDatabase@@IAEIPAVnsIMdbRow@@@Z ; 2
?CreateNewCardAndAddToDB@nsAddrDatabase@@UAGIPAVnsIAbCard@@H@Z ; 2
?GetHomePhone@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?GetWebPage1@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddHomeState@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?DeleteCard@nsAddrDatabase@@UAGIPAVnsIAbCard@@H@Z ; 2
?GetHomeZipCode@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddHomeAddress2@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddWorkCity@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetPagerNumber@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?GetDbRowID@nsAbCardProperty@@UAGIPAI@Z ; 2
?AddLastName@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetWorkZipCode@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddBirthDay@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddCustom3@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetSecondEmail@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddCellularNumber@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddPreferMailFormat@nsAddrDatabase@@UAGIPAVnsIMdbRow@@I@Z ; 2
?DeleteRow@nsAddrDatabase@@IAEIPAVnsIMdbTable@@PAVnsIMdbRow@@@Z ; 2
?GetJobTitle@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddHomeCity@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetNotes@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddHomePhone@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?SplitFullName@nsAbAddressCollecter@@QAEIPBDPAPAD1@Z ; 2
?SetNamesForCard@nsAbAddressCollecter@@QAEIPAVnsIAbCard@@PBD@Z ; 2
?AddWorkAddress2@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddWorkState@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetBirthYear@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?GetCompany@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddCustom4@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?CollectAddress@nsAbAddressCollecter@@UAGIPBD@Z ; 2
?AddWorkZipCode@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetWorkCity@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddBirthMonth@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetHomeAddress2@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddBirthYear@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetWorkAddress2@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddLowercaseColumn@nsAddrDatabase@@IAEIPAVnsIMdbRow@@IPBD@Z ; 2
?GetCustom1@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?GetWorkAddress@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddWorkCountry@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddJobTitle@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetHomeCountry@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddHomeZipCode@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddPagerNumber@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddWorkAddress@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?AddFaxNumber@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?Add2ndEmail@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?GetHomeAddress@nsAbCardProperty@@UAGIPAPAG@Z ; 2
?AddNickName@nsAddrDatabase@@UAGIPAVnsIMdbRow@@PBD@Z ; 2
?SetDefaultDomain@nsAbAutoCompleteSession@@UAGIPBG@Z ; 1
??1nsAddrBookSession@@UAE@XZ ; 1
_NSGetModule ; 1
?DIR_GetDirServers@@YAIXZ ; 1
??_EnsAddressBook@@UAEPAXI@Z ; 1
??1nsAddressBook@@UAE@XZ ; 1
??0nsAddressBook@@QAE@XZ ; 1
??0nsAbAutoCompleteSession@@QAE@XZ ; 1
?DIR_GetServerPreferences@@YAIPAPAVnsVoidArray@@@Z ; 1
??0nsAddrBookSession@@QAE@XZ ; 1
??_EnsAddrBookSession@@UAEPAXI@Z ; 1
?OpenHistoryAB@nsAbAddressCollecter@@QAEIPAPAVnsIAddrDatabase@@@Z ; 1
?setupPrefs@nsAbAddressCollecter@@AAEXXZ ; 1
??0nsAbAddressCollecter@@QAE@XZ ; 1
??1nsAbAddressCollecter@@UAE@XZ ; 1
??_GnsFileSpec@@UAEPAXI@Z ; 1
?DIR_SendNotification@@YAHPAUDIR_Server@@IW4DIR_PrefId@@@Z ; 1
?DIR_SortServersByPosition@@YAHPAVnsVoidArray@@@Z ; 1
??_EnsAbAddressCollecter@@UAEPAXI@Z ; 1
??_GnsAbAutoCompleteSession@@UAEPAXI@Z ; 1
??1nsAbAutoCompleteSession@@UAE@XZ ; 1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "MacPrefix.h"

View File

@@ -1,25 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "MacPrefix_debug.h"

View File

@@ -1,24 +0,0 @@
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
# This is a list of local files which get copied to the res\mailnews\messenger directory
#
pref-addressing.xul
pref-addressbookOverlay.xul

View File

@@ -1,14 +0,0 @@
<?xml version="1.0"?>
<overlay id="addressbookPrefOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<treechildren id="messengerChildren">
<treeitem open="true" position="3">
<treerow>
<treecell indent="true" url="chrome://messenger/content/addressbook/pref-addressing.xul" label="&address.label;"/>
</treerow>
</treeitem>
</treechildren>
</overlay>

View File

@@ -1,90 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/pref-addressing.dtd">
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();"
headertitle="&pane.title;">
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/pref-directory.js"/>
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["emailCollectionIncoming", "emailCollectionOutgoing",
"emailCollectionNewsgroup", "addressingAutocomplete",
"enableCABsizeLimit", "CABsizeLimit", "autocompleteLDAP",
"directoriesList"];
function onLoad(){
createDirectoriesList(true);
parent.initPanel('chrome://messenger/content/addressbook/pref-addressing.xul');
}
function Startup(){
enableAutocomplete();
}
]]>
</script>
<groupbox>
<caption label="&emailCollectiontitle.label;"/>
<description>&emailCollectiontext.label;</description>
<vbox align="start" class="indent">
<checkbox id="emailCollectionIncoming" label="&emailCollectionIncomingEnable.label;"
prefstring="mail.collect_email_address_incoming"
accesskey="&emailCollectionIncomingEnable.accesskey;"/>
<checkbox id="emailCollectionOutgoing" label="&emailCollectionOutgoingEnable.label;"
prefstring="mail.collect_email_address_outgoing"
accesskey="&emailCollectionOutgoingEnable.accesskey;"/>
<checkbox id="emailCollectionNewsgroup" label="&emailCollectionNewsgroupEnable.label;"
prefstring="mail.collect_email_address_newsgroup"
accesskey="&emailCollectionNewsgroupEnable.accesskey;"/>
</vbox>
<hbox align="center">
<checkbox id="enableCABsizeLimit" label="&useCABSizelimitPart1.label;"
prefstring="mail.collect_email_address_enable_size_limit"
accesskey="&useCABSizelimitPart1.accesskey;"/>
<textbox id="CABsizeLimit" size="6" preftype="int"
prefstring="mail.collect_email_address_size_limit"/>
<label id="useCABSizelimitPart2" class="small-margin" value="&useCABSizelimitPart2.label;"
accesskey="&useCABSizelimitPart2.accesskey;"
control="CABsizeLimit"/>
</hbox>
</groupbox>
<groupbox id="addressAutocompletion">
<caption label="&addressingTitle.label;"/>
<description>&autocompleteText.label;</description>
<hbox align="center">
<checkbox id="addressingAutocomplete" label="&addressingEnable.label;"
prefstring="mail.enable_autocomplete"
accesskey="&addressingEnable.accesskey;"/>
</hbox>
<hbox align="center">
<checkbox id="autocompleteLDAP" label="&directories.label;"
prefstring="ldap_2.autoComplete.useDirectory"
oncommand="enableAutocomplete();"
accesskey="&directories.accesskey;"/>
<menulist id="directoriesList" flex="1"
preftype="string"
prefstring="ldap_2.autoComplete.directoryServer">
<menupopup id="directoriesListPopup"
onpopupshowing="createDirectoriesList(true);">
</menupopup>
</menulist>
<button id="editButton" label="&editDirectories.label;"
prefstring="pref.ldap.disable_button.edit_directories"
oncommand="onEditDirectories();"
accesskey="&editDirectories.accesskey;"/>
</hbox>
<!--
<description>&matchText.label;</description>
<hbox align="center">
<checkbox id="autocompleteSkipDirectory"
label="&skipDirectory.label;"
prefstring="ldap_2.autoComplete.skipDirectoryIfLocalMatchFound"/>
</hbox>
-->
</groupbox>
</page>

View File

@@ -1,349 +0,0 @@
/* -*- Mode: Java; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
var gPrefstring = "ldap_2.servers.";
var gPref_string_desc = "";
var gPrefInt = null;
var gCurrentDirectory = null;
var gCurrentDirectoryString = null;
var gLdapService = Components.classes["@mozilla.org/network/ldap-service;1"].
getService(Components.interfaces.nsILDAPService);
const kDefaultMaxHits = 100;
const kDefaultLDAPPort = 389;
const kDefaultSecureLDAPPort = 636;
function Startup()
{
if ( "arguments" in window && window.arguments[0] ) {
gCurrentDirectory = window.arguments[0].selectedDirectory;
gCurrentDirectoryString = window.arguments[0].selectedDirectoryString;
try {
fillSettings();
} catch (ex) {
dump("pref-directory-add.js:Startup(): fillSettings() exception: "
+ ex + "\n");
}
} else {
fillDefaultSettings();
}
}
function DownloadNow()
{
var args = {dirName: gCurrentDirectory, prefName: gCurrentDirectoryString};
window.opener.openDialog("chrome://messenger/content/addressbook/replicationProgress.xul", "", "chrome,resizable,status,centerscreen,dialog=no", args);
}
// fill the settings panel with the data from the preferences.
//
function fillSettings()
{
gPrefInt = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"];
ldapUrl = ldapUrl.createInstance().
QueryInterface(Components.interfaces.nsILDAPURL);
try {
var prefValue =
gPrefInt.getComplexValue(gCurrentDirectoryString + ".description",
Components.interfaces.nsISupportsString).data;
} catch(ex) {
prefValue="";
}
document.getElementById("description").value = prefValue;
ldapUrl.spec = gPrefInt.getComplexValue(gCurrentDirectoryString +".uri",
Components.interfaces.
nsISupportsString).data;
document.getElementById("hostname").value = ldapUrl.host;
document.getElementById("port").value = ldapUrl.port;
document.getElementById("basedn").value =
gLdapService.UTF8toUCS2(ldapUrl.dn);
document.getElementById("search").value =
gLdapService.UTF8toUCS2(ldapUrl.filter);
var sub = document.getElementById("sub");
switch(ldapUrl.scope) {
case Components.interfaces.nsILDAPURL.SCOPE_ONELEVEL:
sub.radioGroup.selectedItem = document.getElementById("one");
break;
default:
sub.radioGroup.selectedItem = sub;
break;
}
if (ldapUrl.options & ldapUrl.OPT_SECURE) {
document.getElementById("secure").setAttribute("checked", "true");
}
try {
prefValue = gPrefInt.getIntPref(gCurrentDirectoryString + ".maxHits");
} catch(ex) {
prefValue = kDefaultMaxHits;
}
document.getElementById("results").value = prefValue;
try {
prefValue =
gPrefInt.getComplexValue(gCurrentDirectoryString + ".auth.dn",
Components.interfaces.nsISupportsString).data;
} catch(ex) {
prefValue="";
}
document.getElementById("login").value = prefValue;
// check if any of the preferences for this server are locked.
//If they are locked disable them
DisableUriFields(gCurrentDirectoryString + ".uri");
DisableElementIfPrefIsLocked(gCurrentDirectoryString + ".description", "description");
DisableElementIfPrefIsLocked(gCurrentDirectoryString + ".disable_button_download", "download");
DisableElementIfPrefIsLocked(gCurrentDirectoryString + ".maxHits", "results");
DisableElementIfPrefIsLocked(gCurrentDirectoryString + ".auth.dn", "login");
}
function DisableElementIfPrefIsLocked(aPrefName, aElementId)
{
if (gPrefInt.prefIsLocked(aPrefName))
document.getElementById(aElementId).setAttribute('disabled', true);
}
// disables all the text fields corresponding to the .uri pref.
function DisableUriFields(aPrefName)
{
if (gPrefInt.prefIsLocked(aPrefName)) {
var lockedElements = document.getElementsByAttribute("disableiflocked", "true");
for (var i=0; i<lockedElements.length; i++)
lockedElements[i].setAttribute('disabled', 'true');
}
}
function onSecure()
{
var port = document.getElementById("port");
if (document.getElementById("secure").checked)
port.value = kDefaultSecureLDAPPort;
else
port.value = kDefaultLDAPPort;
}
function fillDefaultSettings()
{
document.getElementById("port").value = kDefaultLDAPPort;
document.getElementById("results").value = kDefaultMaxHits;
var sub = document.getElementById("sub");
sub.radioGroup.selectedItem = sub;
}
// find a unique server-name for the new directory server
// from the description entered by the user.
function createUniqueServername()
{
// gPref_string_desc is the description entered by the user.
// Just get the alphabets and digits from the description.
// remove spaces and special characters from description.
var user_Id = 0;
var re = /[A-Za-z0-9]/g;
var str = gPref_string_desc.match(re);
var temp = "";
if (!str) {
try {
user_Id = gPrefInt.getIntPref("ldap_2.user_id");
}
catch(ex){
user_Id = 0;
}
++user_Id;
temp = "user_directory_" + user_Id;
str = temp;
try {
gPrefInt.setIntPref("ldap_2.user_id", user_Id);
}
catch(ex) {}
}
else {
var len = str.length;
if (len > 20) len = 20;
for (var count = 0; count < len; count++)
{
temp += str[count];
}
}
gPref_string_desc = temp;
while (temp) {
temp = "";
try{
temp = gPrefInt.getComplexValue(gPrefstring+gPref_string_desc+".description",
Components.interfaces.nsISupportsString).data;
} catch(e){}
if (temp)
gPref_string_desc += str[0];
}
}
function hasOnlyWhitespaces(string)
{
// get all the whitespace characters of string and assign them to str.
// string is not modified in this function
// returns true if string contains only whitespaces and/or tabs
var re = /[ \s]/g;
var str = string.match(re);
if (str && (str.length == string.length))
return true;
else
return false;
}
function hasCharacters(number)
{
var re = /[0-9]/g;
var num = number.match(re);
if(num && (num.length == number.length))
return false;
else
return true;
}
function onAccept()
{
try {
var pref_string_content = "";
var pref_string_title = "";
if (!gPrefInt) {
gPrefInt = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
}
var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"];
ldapUrl = ldapUrl.createInstance().
QueryInterface(Components.interfaces.nsILDAPURL);
var description = document.getElementById("description").value;
var hostname = document.getElementById("hostname").value;
var port = document.getElementById("port").value;
var secure = document.getElementById("secure");
var dn = document.getElementById("login").value;
var results = document.getElementById("results").value;
var errorValue = null;
gPref_string_desc = description;
if ((!gPref_string_desc) || hasOnlyWhitespaces(gPref_string_desc))
errorValue = "invalidName";
else if ((!hostname) || hasOnlyWhitespaces(hostname))
errorValue = "invalidHostname";
// XXX write isValidDn and call it on the dn string here?
else if (port && hasCharacters(port))
errorValue = "invalidPortNumber";
else if (results && hasCharacters(results))
errorValue = "invalidResults";
if (!errorValue) {
pref_string_content = gPref_string_desc;
if (gCurrentDirectory && gCurrentDirectoryString) {
gPref_string_desc = gCurrentDirectoryString;
} else {
createUniqueServername();
gPref_string_desc = gPrefstring + gPref_string_desc;
}
pref_string_title = gPref_string_desc + "." + "description";
var str = Components.classes["@mozilla.org/supports-string;1"]
.createInstance(Components.interfaces.nsISupportsString);
str.data = pref_string_content;
gPrefInt.setComplexValue(pref_string_title,
Components.interfaces.nsISupportsString, str);
ldapUrl.host = hostname;
pref_string_content = gLdapService.
UCS2toUTF8(document.getElementById("basedn").value);
ldapUrl.dn = pref_string_content;
pref_string_content = gLdapService.
UCS2toUTF8(document.getElementById("search").value);
ldapUrl.filter = pref_string_content;
if (!port) {
if (secure.checked)
ldapUrl.port = kDefaultSecureLDAPPort;
else
ldapUrl.port = kDefaultLDAPPort;
} else {
ldapUrl.port = port;
}
if (document.getElementById("one").selected) {
ldapUrl.scope = Components.interfaces.nsILDAPURL.SCOPE_ONELEVEL;
} else {
ldapUrl.scope = Components.interfaces.nsILDAPURL.SCOPE_SUBTREE;
}
if (secure.checked)
ldapUrl.options |= ldapUrl.OPT_SECURE;
pref_string_title = gPref_string_desc + ".uri";
var uri = Components.classes["@mozilla.org/supports-string;1"]
.createInstance(Components.interfaces.nsISupportsString);
uri.data = ldapUrl.spec;
gPrefInt.setComplexValue(pref_string_title,
Components.interfaces.nsISupportsString, uri);
pref_string_content = results;
pref_string_title = gPref_string_desc + ".maxHits";
if (pref_string_content != kDefaultMaxHits) {
gPrefInt.setIntPref(pref_string_title, pref_string_content);
} else {
try {
gPrefInt.clearUserPref(pref_string_title);
} catch (ex) {
}
}
pref_string_title = gPref_string_desc + ".auth.dn";
var dnWString = Components.classes["@mozilla.org/supports-string;1"]
.createInstance(Components.interfaces.nsISupportsString);
dnWString.data = dn;
gPrefInt.setComplexValue(pref_string_title,
Components.interfaces.nsISupportsString,
dnWString);
// We don't actually allow the password to be saved in the preferences;
// this preference is (effectively) ignored by the current code base.
// It's here because versions of Mozilla 1.0 and earlier (maybe 1.1alpha
// too?) would blow away the .auth.dn preference if .auth.savePassword
// is not set. To avoid trashing things for users who switch between
// versions, we'll set it. Once the versions in question become
// obsolete enough, this workaround can be gotten rid of.
//
try {
gPrefInt.setBoolPref(gPref_string_desc + ".auth.savePassword", true);
} catch (ex) {
// if this fails, we can live with that; keep going
}
window.opener.gNewServer = description;
window.opener.gNewServerString = gPref_string_desc;
// set window.opener.gUpdate to true so that LDAP Directory Servers
// dialog gets updated
window.opener.gUpdate = true;
} else {
var addressBookBundle = document.getElementById("bundle_addressBook");
var errorMsg = addressBookBundle.getString(errorValue);
alert(errorMsg);
}
} catch (outer) {
dump("Internal error in pref-directory-add.js:onAccept() " + outer + "\n");
}
}
function onCancel()
{
window.opener.gUpdate = false;
}
// called by Help button in platform overlay
function doHelpButton()
{
openHelp("mail-ldap-properties");
}

View File

@@ -1,156 +0,0 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
Srilatha Moturi <srilatha@netscape.com>, original implementor
Hkan Waara <hwaara@chello.se>
Dan Mosedale <dmose@netscape.com>
-->
<?xml-stylesheet href="chrome://messenger/skin/prefPanels.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/pref-directory-add.dtd">
<dialog id="addDirectory"
style="width: &newDirectoryWidth;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&newDirectoryTitle.label;"
onload="Startup();"
buttons="accept,cancel,help"
ondialogaccept="return onAccept();"
ondialogcancel="return onCancel();"
ondialoghelp="return doHelpButton();">
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/pref-directory-add.js"/>
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
<stringbundle id="bundle_addressBook" src="chrome://messenger/locale/addressbook/addressBook.properties"/>
<keyset id="keyset"/>
<vbox id="editDirectory">
<tabbox style="margin:5px">
<tabs id="directoryTabBox">
<tab label="&General.tab;"/>
<tab label="&Offline.tab;"/>
<tab label="&Advanced.tab;"/>
</tabs>
<tabpanels id="directoryTabPanels" flex="1">
<vbox>
<grid flex="1">
<columns>
<column/>
<column flex="1"/>
<column/>
</columns>
<rows>
<row align="center">
<label value="&directoryName.label;" accesskey="&directoryName.accesskey;"
control="description"/>
<textbox id="description" flex="1"/>
<spacer flex="1"/>
</row>
<row align="center">
<label value="&directoryHostname.label;" accesskey="&directoryHostname.accesskey;"
control="hostname"/>
<textbox id="hostname" flex="1" disableiflocked="true"/>
<spacer flex="1"/>
</row>
<row align="center">
<label value="&directoryBaseDN.label;"
accesskey="&directoryBaseDN.accesskey;"
control="basedn"/>
<vbox>
<textbox id="basedn" disableiflocked="true"/>
</vbox>
<button label="&findButton.label;"
accesskey="&findButton.accesskey;" disabled="true"/>
</row>
<row align="center">
<label value="&portNumber.label;"
accesskey="&portNumber.accesskey;"
control="port"/>
<hbox>
<textbox id="port" size="6" disableiflocked="true"/>
</hbox>
</row>
<row align="center">
<label value="&directoryLogin.label;"
accesskey="&directoryLogin.accesskey;"
control="login"/>
<textbox id="login" flex="1"/>
</row>
</rows>
</grid>
<separator/>
<checkbox id="secure" label="&directorySecure.label;"
accesskey="&directorySecure.accesskey;"
oncommand="onSecure();" disableiflocked="true"/>
</vbox>
<vbox>
<description>&offlineText.label;</description>
<separator/>
<hbox>
<button id="download" label="&downloadNowButton.label;"
accesskey="&downloadNowButton.accesskey;"
oncommand="DownloadNow();"/>
<spacer flex="1"/>
</hbox>
</vbox>
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&return.label;"
accesskey="&return.accesskey;"
control="results"/>
<hbox align="center">
<textbox id="results" size="6"/>
<label value="&results.label;"/>
</hbox>
</row>
<row align="center">
<label value="&scope.label;" control="scope" accesskey="&scope.accesskey;"/>
<radiogroup id="scope" orient="horizontal">
<radio id="one" value="1" label="&scopeOneLevel.label;"
disableiflocked="true" accesskey="&scopeOneLevel.accesskey;"/>
<radio id="sub" value="2" label="&scopeSubtree.label;"
disableiflocked="true" accesskey="&scopeSubtree.accesskey;"/>
</radiogroup>
</row>
<row>
<label value="&searchFilter.label;"
accesskey="&searchFilter.accesskey;"
control="search"/>
<textbox id="search" multiline="true" flex="1" disableiflocked="true"/>
</row>
</rows>
</grid>
</tabpanels>
</tabbox>
</vbox>
</dialog>

View File

@@ -1,512 +0,0 @@
var gPrefInt = null;
var gAvailDirectories = null;
var gCurrentDirectoryServer = null;
var gCurrentDirectoryServerId = null;
var gRefresh = false;
var gNewServer = null;
var gNewServerString = null;
var gFromGlobalPref = false;
var gUpdate = false;
var gDeletedDirectories = new Array();
var gLDAPPrefsService = Components.classes[
"@mozilla.org/ldapprefs-service;1"].getService();
gLDAPPrefsService = gLDAPPrefsService.QueryInterface(
Components.interfaces.nsILDAPPrefsService);
function onEditDirectories()
{
var args = {fromGlobalPref: gFromGlobalPref};
window.openDialog("chrome://messenger/content/addressbook/pref-editdirectories.xul",
"editDirectories", "chrome,modal=yes,resizable=no", args);
if (gRefresh)
{
var popup = document.getElementById("directoriesListPopup");
if (popup)
{
while (popup.childNodes.length)
popup.removeChild(popup.childNodes[0]);
}
gAvailDirectories = null;
LoadDirectories(popup);
gRefresh = false;
}
}
function enableAutocomplete()
{
var autocompleteLDAP = document.getElementById("autocompleteLDAP");
var directoriesList = document.getElementById("directoriesList");
var directoriesListPopup = document.getElementById("directoriesListPopup");
var editButton = document.getElementById("editButton");
// var autocompleteSkipDirectory = document.getElementById("autocompleteSkipDirectory");
if (autocompleteLDAP.checked) {
// If the default directory preference is locked
// disable the list popup
if (gPrefInt.prefIsLocked("ldap_2.autoComplete.directoryServer")) {
directoriesList.setAttribute("disabled", true);
directoriesListPopup.setAttribute("disabled", true);
}
else {
directoriesList.removeAttribute("disabled");
directoriesListPopup.removeAttribute("disabled");
}
editButton.removeAttribute("disabled");
// autocompleteSkipDirectory.removeAttribute("disabled");
}
else {
directoriesList.setAttribute("disabled", true);
directoriesListPopup.setAttribute("disabled", true);
editButton.setAttribute("disabled", true);
// autocompleteSkipDirectory.setAttribute("disabled", true);
}
// if we do not have any directories disable the dropdown list box
if (gAvailDirectories.length < 1)
directoriesList.setAttribute("disabled", true);
gFromGlobalPref = true;
LoadDirectories(directoriesListPopup);
}
function setupDirectoriesList()
{
var override = document.getElementById("identity.overrideGlobalPref").getAttribute("value");
var autocomplete = document.getElementById("ldapAutocomplete");
// useGlobalFlag is set when user changes the selectedItem on the radio button and switches
// to a different pane and switches back in Mail/news AccountSettings
var useGlobalFlag = document.getElementById("overrideGlobalPref").getAttribute("value");
// directoryServerFlag is set when user changes the server to None and switches
// to a different pane and switches back in Mail/news AccountSettings
var directoryServerFlag = document.getElementById("directoryServer").getAttribute("value");
if(override == "true" && !useGlobalFlag)
autocomplete.selectedItem = document.getElementById("directories");
else
autocomplete.selectedItem = document.getElementById("useGlobalPref");
var directoriesList = document.getElementById("directoriesList");
var directoryServer =
document.getElementById("identity.directoryServer").getAttribute('value');
try {
var directoryServerString = gPrefInt.getComplexValue(directoryServer + ".description",
Components.interfaces.nsISupportsString).data;
}
catch(ex) {}
if (directoryServerFlag || !directoryServerString) {
document.getElementById("identity.directoryServer").setAttribute("value", "");
directoryServer = "";
var addressBookBundle = document.getElementById("bundle_addressBook");
directoryServerString = addressBookBundle.getString("directoriesListItemNone");
}
directoriesList.value = directoryServer;
directoriesList.label = directoryServerString;
gFromGlobalPref = false;
}
function createDirectoriesList(flag)
{
gFromGlobalPref = flag;
var directoriesListPopup = document.getElementById("directoriesListPopup");
if (directoriesListPopup) {
LoadDirectories(directoriesListPopup);
}
}
function LoadDirectories(popup)
{
var prefCount = {value:0};
var enabled = false;
var description = "";
var item;
var formElement;
var j=0;
var arrayOfDirectories;
var position = 0;
var dirType = 1;
var directoriesList;
var directoryDescription;
if (!gPrefInt) {
try {
gPrefInt = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
}
catch (ex) {
gPrefInt = null;
}
}
if (!gAvailDirectories) {
try {
arrayOfDirectories = gLDAPPrefsService.getServerList(gPrefInt, prefCount);
}
catch (ex) {
arrayOfDirectories = null;
}
if (arrayOfDirectories) {
gAvailDirectories = new Array();
for (var i = 0; i < prefCount.value; i++)
{
if ((arrayOfDirectories[i] != "ldap_2.servers.pab") &&
(arrayOfDirectories[i] != "ldap_2.servers.history")) {
try{
position = gPrefInt.getIntPref(arrayOfDirectories[i]+".position");
}
catch(ex){
position = 1;
}
try{
dirType = gPrefInt.getIntPref(arrayOfDirectories[i]+".dirType");
}
catch(ex){
dirType = 1;
}
if ((position != 0) && (dirType == 1)) {
try{
description = gPrefInt.getComplexValue(arrayOfDirectories[i]+".description",
Components.interfaces.nsISupportsString).data;
}
catch(ex){
description="";
}
if (description != "") {
if (popup) {
item=document.createElement("menuitem");
item.setAttribute("label", description);
item.setAttribute("value", arrayOfDirectories[i]);
popup.appendChild(item);
}
gAvailDirectories[j] = {value:arrayOfDirectories[i], label:description};
j++;
}
}
}
}
if (popup && !gFromGlobalPref)
{
// we are in mail/news Account settings
item=document.createElement("menuitem");
var addressBookBundle = document.getElementById("bundle_addressBook");
var directoryName = addressBookBundle.getString("directoriesListItemNone");
item.setAttribute("label", directoryName);
item.setAttribute("value", "");
popup.appendChild(item);
if (gRefresh) {
// gRefresh is true if user edits, removes or adds a directory.
directoriesList = document.getElementById("directoriesList");
directoryDescription = null;
if(directoriesList.value != "") {
// make sure the selected directory still exists
try {
directoryDescription = gPrefInt.
getComplexValue(directoriesList.value + ".description",
Components.interfaces.nsISupportsString).data;
}
catch (ex) {}
}
if(!directoryDescription) {
// if selected directory doesn't exist, set it to none
directoriesList.value = "";
addressBookBundle = document.getElementById("bundle_addressBook");
directoriesList.label = addressBookBundle.
getString("directoriesListItemNone");
}
else {
directoriesList.label = directoryDescription;
directoriesList.value = directoriesList.value;
}
}
}
if (popup && gFromGlobalPref) {
// we are in global preferences-> Addressing pane.
directoriesList = document.getElementById("directoriesList");
if (gRefresh) {
// gRefresh is true if user edits, removes or adds a directory.
directoryDescription = null;
if(directoriesList.label != "") {
// make sure the selected directory still exists
try {
directoryDescription = gPrefInt.
getComplexValue(directoriesList.value + ".description",
Components.interfaces.nsISupportsString).data;
}
catch (ex) {}
}
if(!directoryDescription) {
// if selected directory doesn't exist,
// set it the first one in the list of directories
// if we have atleast one directory.
// or else set it to ""
if (gAvailDirectories.length) {
directoriesList.label = gAvailDirectories[0].label;
directoriesList.value = gAvailDirectories[0].value;
directoriesList.removeAttribute("disabled");
}
else {
directoriesList.label = "";
directoriesList.value = null;
directoriesList.setAttribute("disabled", true);
}
}
else {
directoriesList.label = directoryDescription;
directoriesList.value = directoriesList.value;
}
return;
}
var pref_string_title = "ldap_2.autoComplete.directoryServer";
try {
var directoryServer = gPrefInt.getCharPref(pref_string_title);
}
catch (ex)
{
directoryServer = "";
}
if (directoryServer != "")
{
pref_string_title = directoryServer + ".description";
try {
description = gPrefInt.getComplexValue(pref_string_title,
Components.interfaces.nsISupportsString).data;
}
catch (ex) {
description = "";
}
}
if ((directoryServer != "") && (description != ""))
{
directoriesList.label = description;
directoriesList.value = directoryServer;
}
else if(gAvailDirectories.length) {
directoriesList.label = gAvailDirectories[0].label;
directoriesList.value = gAvailDirectories[0].value;
gPrefInt.setCharPref("ldap_2.autoComplete.directoryServer",
gAvailDirectories[0].value);
}
else {
directoriesList.label = "";
directoriesList.value = null;
gPrefInt.setCharPref("ldap_2.autoComplete.directoryServer", "");
}
}
}
}
}
function onInitEditDirectories()
{
var listbox = document.getElementById("directoriesList");
gFromGlobalPref = window.arguments[0].fromGlobalPref;
LoadDirectoriesList(listbox);
// If the pref is locked disable the "Add" button
if (gPrefInt.prefIsLocked("ldap_2.disable_button_add"))
document.getElementById("addButton").setAttribute('disabled', true);
}
function LoadDirectoriesList(listbox)
{
LoadDirectories();
if (listbox && gAvailDirectories)
{
for (var i=0; i<gAvailDirectories.length; i++)
{
var item = document.createElement('listitem');
item.setAttribute('label', gAvailDirectories[i].label);
item.setAttribute('string', gAvailDirectories[i].value);
listbox.appendChild(item);
}
}
}
function selectDirectory()
{
var directoriesList = document.getElementById("directoriesList");
if(directoriesList && directoriesList.selectedItems
&& directoriesList.selectedItems.length)
{
gCurrentDirectoryServer =
directoriesList.selectedItems[0].getAttribute('label');
gCurrentDirectoryServerId =
directoriesList.selectedItems[0].getAttribute('string');
}
else
{
gCurrentDirectoryServer = null;
gCurrentDirectoryServerId = null;
}
var editButton = document.getElementById("editButton");
var removeButton = document.getElementById("removeButton");
if(gCurrentDirectoryServer && gCurrentDirectoryServerId) {
editButton.removeAttribute("disabled");
// If the disable delete button pref for the selected directory is set
// disable the delete button for that directory.
var disable = false;
try {
disable = gPrefInt.getBoolPref(gCurrentDirectoryServerId + ".disable_delete");
}
catch(ex){
// if this preference is not set its ok.
}
if (disable)
removeButton.setAttribute("disabled", true);
else
removeButton.removeAttribute("disabled");
}
else {
editButton.setAttribute("disabled", true);
removeButton.setAttribute("disabled", true);
}
}
function newDirectory()
{
window.openDialog("chrome://messenger/content/addressbook/pref-directory-add.xul",
"addDirectory", "chrome,modal=yes,resizable=no,centerscreen");
if(gUpdate && gNewServer && gNewServerString) {
var listbox = document.getElementById("directoriesList");
var item = document.createElement('listitem');
item.setAttribute('label', gNewServer);
item.setAttribute('string', gNewServerString);
listbox.appendChild(item);
gNewServer = null;
gNewServerString = null;
window.opener.gRefresh = true;
}
}
function editDirectory()
{
var args = { selectedDirectory: null,
selectedDirectoryString: null,
result: false};
if(gCurrentDirectoryServer && gCurrentDirectoryServerId) {
args.selectedDirectory = gCurrentDirectoryServer;
args.selectedDirectoryString = gCurrentDirectoryServerId;
window.openDialog("chrome://messenger/content/addressbook/pref-directory-add.xul",
"editDirectory", "chrome,modal=yes,resizable=no,centerscreen", args);
}
if(gUpdate)
{
// directory server properties have changed. So, update the
// LDAP Directory Servers dialog.
var directoriesList = document.getElementById("directoriesList");
var selectedNode = directoriesList.selectedItems[0];
selectedNode.setAttribute('label', gNewServer);
selectedNode.setAttribute('string', gNewServerString);
// window.opener is either global pref window or
// mail/news account settings window.
// set window.opener.gRefresh to true such that the
// dropdown list box gets updated
window.opener.gRefresh = true;
}
}
function removeDirectory()
{
var directoriesList = document.getElementById("directoriesList");
var selectedNode = directoriesList.selectedItems[0];
var nextNode = selectedNode.nextSibling;
if (!nextNode)
if (selectedNode.previousSibling)
nextNode = selectedNode.previousSibling;
if(gCurrentDirectoryServer && gCurrentDirectoryServerId) {
var len= gDeletedDirectories.length;
gDeletedDirectories[len] = gCurrentDirectoryServerId;
}
directoriesList.removeChild(selectedNode);
if (nextNode)
directoriesList.selectItem(nextNode)
}
// remove all the directories that are selected for deletion from preferences
// check if the deleted directory is selected for autocompletion in global
// or identity prefs. If so change the pref to ""
function onAccept()
{
var len = gDeletedDirectories.length;
if (len) {
try {
var directoryServer = gPrefInt.getCharPref("ldap_2.autoComplete.directoryServer");
}
catch(ex) {
directoryServer = null;
}
var am = Components.classes["@mozilla.org/messenger/account-manager;1"]
.getService(Components.interfaces.nsIMsgAccountManager);
if (am) {
var RDF, addressbook, addressbookDS;
try {
// the rdf service
RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].
getService(Components.interfaces.nsIRDFService);
// get the datasource for the addressdirectory
addressbookDS = RDF.GetDataSource("rdf:addressdirectory");
addressbook = Components.classes["@mozilla.org/addressbook;1"].
createInstance(Components.interfaces.nsIAddressBook);
}
catch(ex){
dump("Failed to get RDF Service or addressbook " + ex + "\n");
}
var allIdentities = am.allIdentities;
var identitiesCount = allIdentities.Count();
var identityServer = new Array();
var currentIdentity = null;
var j=0;
for (j=0; j< identitiesCount; j++) {
currentIdentity = allIdentities.QueryElementAt(j, Components.interfaces.nsIMsgIdentity);
identityServer[j] = {server:currentIdentity.directoryServer, deleted:false};
}
var deletedGlobal = false;
for (var i=0; i< len; i++){
if (!deletedGlobal && directoryServer && (gDeletedDirectories[i] == directoryServer)) {
gPrefInt.setCharPref("ldap_2.autoComplete.directoryServer", "");
deletedGlobal = true;
}
for (j=0; j<identitiesCount; j++){
if (identityServer[j].server && !identityServer[j].deleted && (gDeletedDirectories[i] == identityServer[j].server)) {
identityServer[j].server = "";
identityServer[j].deleted = true;
}
}
try {
// delete the directory
var parentArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
// moz-abdirectory:// is the RDF root to get all types of addressbooks.
var parentDir = RDF.GetResource("moz-abdirectory://").QueryInterface(Components.interfaces.nsIAbDirectory);
parentArray.AppendElement(parentDir);
var resourceArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
// the RDF resource URI for LDAPDirectory will be moz-abldapdirectory://<prefName>
var selectedABURI = "moz-abldapdirectory://" + gDeletedDirectories[i];
var selectedABDirectory = RDF.GetResource(selectedABURI).QueryInterface(Components.interfaces.nsIAbDirectory);
var selectedABResource = selectedABDirectory.QueryInterface(Components.interfaces.nsIRDFResource);
resourceArray.AppendElement(selectedABResource);
addressbook.deleteAddressBooks(addressbookDS, parentArray, resourceArray);
}
catch(ex){
dump("Failed to delete the addressbook " + ex + "\n");
}
}
var svc = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
svc.savePrefFile(null);
}
}
window.opener.gRefresh = true;
return true;
}
function doHelpButton()
{
openHelp("mail-ldap-properties");
}

View File

@@ -1,47 +0,0 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<?xml-stylesheet href="chrome://messenger/skin/prefPanels.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/pref-directory.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
title="&window.title;"
buttons="accept,cancel,help"
onload="onInitEditDirectories();"
ondialogaccept="return onAccept();"
ondialoghelp="return doHelpButton();">
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/pref-directory.js"/>
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
<label value="&directoriesText.label;" accesskey="&directoriesText.accesskey;" control="directoriesList"/>
<hbox flex="1">
<listbox id="directoriesList" flex="1" onselect="selectDirectory();"/>
<vbox>
<button id="addButton" label="&addDirectory.label;" oncommand="newDirectory();" accesskey="&addDirectory.accesskey;"/>
<button id="editButton" label="&editDirectory.label;" oncommand="editDirectory();" disabled="true" accesskey="&editDirectory.accesskey;"/>
<button id="removeButton" label="&deleteDirectory.label;" oncommand="removeDirectory();" disabled="true" accesskey="&deleteDirectory.accesskey;"/>
</vbox>
</hbox>
</dialog>

View File

@@ -1,147 +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
* Srilatha Moturi <srilatha@netscape.com>.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Rajiv Dayal <rdayal@netscape.com>
* Seth Spitzer <sspitzer@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 ***** */
var gCurrentDirectoryPrefName;
var gReplicationService = Components.classes["@mozilla.org/addressbook/ldap-replication-service;1"].getService(Components.interfaces.nsIAbLDAPReplicationService);
var gProgressText;
var gProgressMeter;
var gReplicationBundle;
function onLoad()
{
var dirName;
if (window.arguments[0]) {
dirName = window.arguments[0].dirName;
gCurrentDirectoryPrefName = window.arguments[0].prefName;
}
gProgressText = document.getElementById("replication.status");
gProgressMeter = document.getElementById("replication.progress");
gReplicationBundle = document.getElementById("bundle_replication");
window.title = gReplicationBundle.getFormattedString("replicatingTitle", [dirName])
Replicate();
}
function DoReplicationClose()
{
// XXX todo, confirm the cancel
onCancelReplication(false);
return true;
}
var progressListener = {
onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus)
{
if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_START) {
// start the spinning
gProgressMeter.setAttribute("mode","undetermined");
if (aStatus)
SetProgressText(gReplicationBundle.getString("replicationStarted"));
else
SetProgressText(gReplicationBundle.getString("changesStarted"));
}
if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) {
// stop the spinning
gProgressMeter.setAttribute("mode","normal");
gProgressMeter.setAttribute("value", "100");
if (aStatus) {
SetProgressText(gReplicationBundle.getString("replicationSucceeded"));
}
else {
SetProgressText(gReplicationBundle.getString("replicationFailed"));
}
window.close();
}
},
onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
{
SetProgressText(gReplicationBundle.getFormattedString("currentCount", [aCurSelfProgress]));
},
onLocationChange: function(aWebProgress, aRequest, aLocation)
{
},
onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage)
{
},
onSecurityChange: function(aWebProgress, aRequest, state)
{
},
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIWebProgressListener) ||
iid.equals(Components.interfaces.nsISupportsWeakReference))
return this;
throw Components.results.NS_NOINTERFACE;
}
};
function Replicate()
{
try {
gReplicationService.startReplication(gCurrentDirectoryPrefName, progressListener);
}
catch (ex) {
// XXX todo
// are you offline? If so, you need to go offline to use this
dump("replication failed. ex=" + ex + "\n");
}
}
function onCancelReplication(closeWindow)
{
try {
gReplicationService.cancelReplication(gCurrentDirectoryPrefName);
}
catch (ex) {
// XXX todo
// perhaps replication hasn't started yet? This can happen if you hit cancel after attempting to replication when offline
dump("unexpected failure while cancelling. ex=" + ex + "\n");
if (closeWindow)
window.close();
}
}
function SetProgressText(textStr)
{
gProgressText.value = textStr;
}

View File

@@ -1,82 +0,0 @@
<?xml version="1.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
- Srilatha Moturi <srilatha@netscape.com>
- Portions created by the Initial Developer are Copyright (C) 2002
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Rajiv Dayal <rdayal@netscape.com>
- Seth Spitzer <sspitzer@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 LGPL or the GPL. 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 ***** -->
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/replicationProgress.dtd">
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="replicationProgress"
style="width: 36em;"
class="dialog"
onload="onLoad()"
onclose="return DoReplicationClose()">
<stringbundle id="bundle_replication" src="chrome://messenger/locale/addressbook/replicationProgress.properties"/>
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/replicationProgress.js"/>
<separator/>
<grid flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row>
<hbox pack="end">
<label value="&status.label;"/>
</hbox>
<label id="replication.status"/>
</row>
<row class="thin-separator">
<hbox pack="end">
<label value="&progress.label;"/>
</hbox>
<progressmeter id="replication.progress" mode="normal" value="0"/>
</row>
</rows>
</grid>
<separator/>
<hbox id="CancelButton" pack="end">
<button id="cancel" label="&replicationCancel.label;" accesskey="&replicationCancel.accesskey;" oncommand="onCancelReplication(true);"/>
</hbox>
</window>

View File

@@ -1 +0,0 @@
pref-addressing.dtd

View File

@@ -1,64 +0,0 @@
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<!ENTITY window.title "Addressing">
<!ENTITY pane.title "Addressing">
<!ENTITY pane.description "Settings for addressing messages">
<!ENTITY pinpoint.label "Pinpoint Addressing">
<!ENTITY lookFor.label "Look for addresses in the following:">
<!ENTITY padCheck.label "Address Books">
<!ENTITY padCheck.accesskey "a">
<!ENTITY dirCheck.label "Directory Server">
<!ENTITY dirCheck.accesskey "d">
<!ENTITY mulFound.label "When there are multiple addresses found:">
<!ENTITY showList.label "Show me a list of choices">
<!ENTITY showList.accesskey "s">
<!ENTITY acceptList.label "Accept what I have typed">
<!ENTITY acceptList.accesskey "c">
<!ENTITY oneMatch.label "If there is one match in your personal address books:">
<!ENTITY useAddress.label "Use the address and do not search in the directory">
<!ENTITY useAddress.accesskey "u">
<!ENTITY emailCollectionEnable.label "Enable Email Address Collection">
<!ENTITY emailCollectionIncomingEnable.label "Incoming Mail Messages">
<!ENTITY emailCollectionIncomingEnable.accesskey "I">
<!ENTITY emailCollectionOutgoingEnable.label "Outgoing Mail Messages">
<!ENTITY emailCollectionOutgoingEnable.accesskey "O">
<!ENTITY emailCollectionNewsgroupEnable.label "Outgoing Newsgroup Messages">
<!ENTITY emailCollectionNewsgroupEnable.accesskey "u">
<!ENTITY emailCollectionTypeText.label "Save email addresses from:">
<!ENTITY emailCollectiontitle.label "Email Address Collection">
<!ENTITY emailCollectiontext.label "Email addresses from messages can be added to a local address book, 'Collected Addresses'. Add email addresses from:">
<!ENTITY useCABSizelimitPart1.label "Limit the Collected Address book to">
<!ENTITY useCABSizelimitPart1.accesskey "L">
<!ENTITY useCABSizelimitPart2.label "cards">
<!ENTITY useCABSizelimitPart2.accesskey "c">
<!-- Autocompletion -->
<!ENTITY addressingTitle.label "Address Autocompletion">
<!-- LOCALIZATION NOTE (addressingText.label) : do not translate "LDAP" in below line -->
<!ENTITY addressingEnable.label "Local Address Books">
<!ENTITY addressingEnable.accesskey "A">
<!ENTITY autocompleteText.label "When addressing messages, look for matching entries in:">
<!ENTITY directories.label "Directory Server:">
<!ENTITY directories.accesskey "D">
<!ENTITY editDirectories.label "Edit Directories...">
<!ENTITY editDirectories.accesskey "E">
<!ENTITY matchText.label "If there is a match in your local address books:">
<!ENTITY skipDirectory.label "Do not search in the directory">

View File

@@ -1,60 +0,0 @@
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-2002 Netscape Communications Corporation. All
Rights Reserved.
-->
<!ENTITY newDirectoryTitle.label "Directory Server Properties">
<!ENTITY directoryName.label "Name: ">
<!ENTITY directoryName.accesskey "n">
<!ENTITY directoryHostname.label "Hostname: ">
<!ENTITY directoryHostname.accesskey "o">
<!ENTITY directoryBaseDN.label "Base DN: ">
<!ENTITY directoryBaseDN.accesskey "b">
<!ENTITY findButton.label "Find">
<!ENTITY findButton.accesskey "f">
<!ENTITY directorySecure.label "Use secure connection (SSL)">
<!ENTITY directorySecure.accesskey "U">
<!ENTITY directoryLogin.label "Bind DN: ">
<!ENTITY directoryLogin.accesskey "i">
<!ENTITY advancedOptionsButton.label "Advanced Options">
<!ENTITY advancedOptionsButton.accesskey "a">
<!ENTITY General.tab "General">
<!ENTITY Offline.tab "Offline">
<!ENTITY Advanced.tab "Advanced">
<!ENTITY advancedOptionsTitle.label "Advanced Options">
<!ENTITY portNumber.label "Port number: ">
<!ENTITY portNumber.accesskey "p">
<!ENTITY searchFilter.label "Search filter: ">
<!ENTITY searchFilter.accesskey "f">
<!ENTITY scope.label "Scope: ">
<!ENTITY scope.accesskey "c">
<!ENTITY scopeOneLevel.label "One Level">
<!ENTITY scopeOneLevel.accesskey "L">
<!ENTITY scopeSubtree.label "Subtree">
<!ENTITY scopeSubtree.accesskey "S">
<!ENTITY return.label "Don't return more than">
<!ENTITY return.accesskey "r">
<!ENTITY results.label "results">
<!ENTITY offlineText.label "You can download a local copy of this directory so that it is available for use when you are working offline.">
<!ENTITY downloadNowButton.label "Download Now">
<!ENTITY downloadNowButton.accesskey "D">
<!-- Localization note: this is here because the width of the dialog
is determined by the width of the base DN box; and that is likely
to vary somewhat with the language.
-->
<!ENTITY newDirectoryWidth "36em">

View File

@@ -1,37 +0,0 @@
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<!-- LOCALIZATION NOTE (window.title) : do not translate "LDAP" in below line -->
<!ENTITY window.title "LDAP Directory Servers">
<!ENTITY pane.title "Directory">
<!ENTITY directory.label "Add a directory">
<!-- LOCALIZATION NOTE (directories.label) : do not translate "LDAP" in below line -->
<!ENTITY directories.label "LDAP Directory Server:">
<!-- LOCALIZATION NOTE (directoriesText.label) : do not translate "LDAP" in below line -->
<!ENTITY directoriesText.label "Select an LDAP Directory Server:">
<!ENTITY directoriesText.accesskey "S">
<!-- LOCALIZATION NOTE (autocomplete.title) : do not translate "LDAP" in below line -->
<!ENTITY autocomplete.title "LDAP Directory Server">
<!ENTITY addDirectory.label "Add">
<!ENTITY addDirectory.accesskey "a">
<!ENTITY editDirectory.label "Edit">
<!ENTITY editDirectory.accesskey "e">
<!ENTITY deleteDirectory.label "Delete">
<!ENTITY deleteDirectory.accesskey "d">

View File

@@ -1,41 +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
- Srilatha Moturi <srilatha@netscape.com>
- Portions created by the Initial Developer are Copyright (C) 2002
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Rajiv Dayal <rdayal@netscape.com>
- Seth Spitzer <sspitzer@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 LGPL or the GPL. 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 ***** -->
<!ENTITY status.label "Status:">
<!ENTITY progress.label "Progress:">
<!ENTITY replicationCancel.label "Cancel">
<!ENTITY replicationCancel.accesskey "C">

View File

@@ -1,55 +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
# Srilatha Moturi <srilatha@netscape.com>.
#Portions created by the Initial Developer are Copyright (C) 2002
#the Initial Developer. All Rights Reserved.
#
#Contributor(s):
# Rajiv Dayal <rdayal@netscape.com>
# Seth Spitzer <sspitzer@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 *****
replicationStarted=Replication started...
changesStarted=Started finding changes to replicate...
replicationSucceeded=Replication succeeded
replicationFailed=Replication failed
# LOCALIZATION NOTE
# do not localize %S. %S is the current entry number (an integer)
currentCount=Replicating directory entry: %S
# LOCALIZATION NOTE
# do not localize %S. %S is the current address book name
replicatingTitle=Replicating %S
replicationOfSameInProgress=A replication of this directory is already in progress.
replicationOfOtherInProgress=A replication of another directory is already in progress. You can only replicate one directory at a time.
mustBeOnlineToReplicate=You must be online to replicate a directory.
# LOCALIZATION NOTE
# do not localize %S. %S is the product name.
replicationInProgress=%S is currently in the process of replicating an address book. Would you like to wait until the process has completed before quitting or quit now?
waitButton=Wait
quitButton=Quit

View File

@@ -1,22 +0,0 @@
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
# This is a list of local files which get copied to the mozilla:dist:mailnews directory
#

View File

@@ -1,7 +0,0 @@
#
# This is a list of local files which get copied to the mozilla:dist:idl directory
#
nsIAbAddressCollecter.idl
nsIAbUpgrader.idl

View File

@@ -1,66 +0,0 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = addrbook
XPIDLSRCS = \
nsIAbListener.idl \
nsIAbDirectory.idl \
nsIAbCard.idl \
nsIAbMDBDirectory.idl \
nsIAbMDBCard.idl \
nsIAddrDBAnnouncer.idl \
nsIAddrDBListener.idl \
nsIAddrDatabase.idl \
nsIAddressBook.idl \
nsIAbBase.idl \
nsIAddrBookSession.idl \
nsIAbAutoCompleteSession.idl \
nsIAbAddressCollecter.idl \
nsIAbUpgrader.idl \
nsIAddbookUrl.idl \
nsIAbDirFactory.idl \
nsIAbDirFactoryService.idl \
nsIAbDirectoryQueryProxy.idl \
nsIAbDirectoryQuery.idl \
nsIAbBooleanExpression.idl \
nsIAbDirectorySearch.idl \
nsIAbView.idl \
$(NULL)
ifdef MOZ_LDAP_XPCOM
XPIDLSRCS += \
nsILDAPPrefsService.idl \
nsIAbLDAPAutoCompFormatter.idl \
nsIAbLDAPReplicationService.idl \
nsIAbLDAPReplicationQuery.idl \
nsIAbLDAPReplicationData.idl \
$(NULL)
endif
include $(topsrcdir)/config/rules.mk

View File

@@ -1,53 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
[scriptable, uuid(fe04c8e6-501e-11d3-a527-0060b0fc04b7)]
interface nsIAbAddressCollecter : nsISupports {
void collectAddress(in string address);
/* CollectUnicodeAddress is the most I18N friendly
of the two methods to call. If you just take a char * address
as used by CollectAddress then you don't know what char set
the address is in (UTF-8??).
*/
void collectUnicodeAddress(in wstring address);
};

View File

@@ -1,45 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsrootidl.idl"
[scriptable, uuid(CA2A6B08-3625-11d3-988E-001083010E9B)]
interface nsIAbAutoCompleteListener : nsISupports {
void onAutoCompleteResult(in nsISupports aParam, in wstring aOriginalString, in wstring aMatch);
};

View File

@@ -1,45 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIAutoCompleteSession.idl"
#include "nsIMsgIdentity.idl"
[scriptable, uuid(CA2A6B07-3625-11d3-988E-001083010E9B)]
interface nsIAbAutoCompleteSession : nsIAutoCompleteSession {
attribute wstring defaultDomain;
};

View File

@@ -1,54 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsICollection.idl"
[scriptable, uuid(013DD009-F73B-11d2-A2DA-001083003D0C)]
interface nsIAbBase : nsICollection {
readonly attribute string URI;
attribute string name;
nsISupports GetChildNamed(in string name);
attribute nsIAbBase parent;
nsIEnumerator GetChildNodes();
void AddUnique(in nsISupports element);
void ReplaceElement(in nsISupports element, in nsISupports newElement);
};

View File

@@ -1,168 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Sun Microsystems, Inc.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Created by: Paul Sandoz <paul.sandoz@sun.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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsISupportsArray.idl"
typedef long nsAbBooleanConditionType;
/**
* Condition types
*
* Constants defining the types of condition
* to obtain a boolean result of TRUE or FALSE
*
*/
[scriptable, uuid(F51387B1-5AEF-4A1C-830E-7CD3B02366CE)]
interface nsIAbBooleanConditionTypes
{
const long Exists = 0;
const long DoesNotExist = 1;
const long Contains = 2;
const long DoesNotContain = 3;
const long Is = 4;
const long IsNot = 5;
const long BeginsWith = 6;
const long EndsWith = 7;
const long LessThan = 8;
const long GreaterThan = 9;
const long SoundsLike = 10;
const long RegExp = 11;
};
typedef long nsAbBooleanOperationType;
/*
* Operation types
*
* Constants defining the boolean operation that
* should be performed between two boolean expressions
*
*/
[uuid(9bdd2e51-2be4-49a4-a558-36d1a812231a)]
interface nsIAbBooleanOperationTypes
{
const long AND = 0;
const long OR = 1;
const long NOT = 2;
};
/**
* String condition
*
* A string condition represents a leaf node in a
* boolean expression tree and represents
* test which will return TRUE or FALSE
*
* Condition is an expression which is a
* leaf node in a boolean expression tree
*
*/
[scriptable, uuid(C3869D72-CFD0-45F0-A0EC-3F67D83C7110)]
interface nsIAbBooleanConditionString : nsISupports
{
/**
* The condition for how the a value
* should be compared
*
*/
attribute nsAbBooleanConditionType condition;
/**
* The lhs of the condition
*
* Represents a property name which
* should be evaluated to obtain the
* lhs.
*
*/
attribute string name;
/**
* The rhs of the condition
*
* <name> [condition] value
*
*/
attribute wstring value;
};
/**
* N Boolean expression type
*
* Supports Unary Binary and N boolean expressions
*
* An operation represents a node in a boolean
* expression tree which may contain one or more
* child conditions or expressions
*
*/
[scriptable, uuid(67F87C44-2C63-41A2-9545-AFF1D9F09623)]
interface nsIAbBooleanExpression: nsISupports
{
/**
* The boolean operation to be applied to
* results of all evaluated expressions
*
*/
attribute nsAbBooleanOperationType operation;
/**
* List of peer expressions
*
* e1 [op] e2 [op] .... en
*
*/
attribute nsISupportsArray expressions;
/**
* expressions attribute defined explicitly as an
* array of nsISupports
*
*/
void asetExpressions (in unsigned long aExpressionsSize,
[array, size_is(aExpressionsSize)]
in nsISupports aExpressionsArray);
void agetExpressions (out unsigned long aExpressionsSize,
[retval, array, size_is(aExpressionsSize)]
out nsISupports aExpressionsArray);
};

View File

@@ -1,122 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
[scriptable, uuid(97448252-F189-11d4-A422-001083003D0C)]
interface nsIAbPreferMailFormat {
const unsigned long unknown = 0;
const unsigned long plaintext = 1;
const unsigned long html = 2;
};
[scriptable, uuid(FA5C977F-04C8-11d3-A2EB-001083003D0C)]
interface nsIAbCard : nsISupports {
// Card properties
attribute wstring firstName;
attribute wstring lastName;
attribute wstring displayName;
attribute wstring nickName;
attribute wstring primaryEmail;
attribute wstring secondEmail;
attribute wstring workPhone;
attribute wstring homePhone;
attribute wstring faxNumber;
attribute wstring pagerNumber;
attribute wstring cellularNumber;
attribute wstring homeAddress;
attribute wstring homeAddress2;
attribute wstring homeCity;
attribute wstring homeState;
attribute wstring homeZipCode;
attribute wstring homeCountry;
attribute wstring workAddress;
attribute wstring workAddress2;
attribute wstring workCity;
attribute wstring workState;
attribute wstring workZipCode;
attribute wstring workCountry;
attribute wstring jobTitle;
attribute wstring department;
attribute wstring company;
/**
* webPage1 is work web page
*/
attribute wstring webPage1;
/**
* webPage2 is home web page
*/
attribute wstring webPage2;
attribute wstring birthYear;
attribute wstring birthMonth;
attribute wstring birthDay;
attribute wstring custom1;
attribute wstring custom2;
attribute wstring custom3;
attribute wstring custom4;
attribute wstring notes;
attribute unsigned long lastModifiedDate;
attribute unsigned long preferMailFormat;
attribute boolean isMailList;
/**
* If isMailList is true then mailListURI
* will contain the URI of the associated
* mail list
*/
attribute string mailListURI;
wstring getCardValue(in string name);
void setCardValue(in string attrname, in wstring value);
// Copies the card attributes from srcCard
void copy(in nsIAbCard srcCard);
// Edits an existing card in the directory defined by 'uri'
// Rename to editCardInDirectory
// Component will be an RDF card, since it has already
// been created
//
// XXX FIX ME, this should not be a the card, it should be on the addressbook.
void editCardToDatabase(in string uri);
boolean equals(in nsIAbCard card);
string convertToBase64EncodedXML();
wstring convertToXMLPrintData();
};

View File

@@ -1,72 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Paul Sandoz <paul.sandoz@sun.com>
* Sun Microsystems, Inc.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Csaba Borbola <csaba.borbola@sun.com>
* Seth Spitzer <sspitzer@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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsISimpleEnumerator.idl"
interface nsIAbDirectory;
interface nsIAbDirectoryProperties;
[scriptable, uuid(C2308606-1DD1-11B2-87D4-85FCA9B1DC08)]
interface nsIAbDirFactory : nsISupports
{
/**
* Instantiate new top level address book
* directories given some properties.
* More than one directory may be
* returned depending on the implementation
* and integration with the associated address book
* sources
*
* @param aProperties
* nsIAbDirectoryProperties with the properties
* @return
* Enumeration of nsIAbDirectory
* interfaces
*/
nsISimpleEnumerator createDirectory(in nsIAbDirectoryProperties aProperties);
/**
* Delete a top level address book directory
*
*/
void deleteDirectory (in nsIAbDirectory directory);
};

View File

@@ -1,67 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Sun Microsystems, Inc.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Created by: Paul Sandoz <paul.sandoz@sun.com>
* Csaba Borbola <csaba.borbola@sun.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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
interface nsIAbDirFactory;
[scriptable, uuid(BE2075A8-1DD1-11B2-99BA-BCB9DB1D77CC)]
interface nsIAbDirFactoryService : nsISupports
{
/**
* Obtain a directory factory component
* given a uri representing an address book
*
* The scheme is extracted from the uri and
* contract id is generated of the form:
* @mozilla.org/addressbook/directory-factory;1?type=<scheme>
*
* This id is used to instantiate a registered
* component which implemented the nsIAbDirFactory
* interface
*
* @param uri
* The uri which contains the scheme that
* defines what directory factory instance
* is returned
*/
nsIAbDirFactory getDirFactory (in string uri);
};

View File

@@ -1,186 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Seth Spitzer <sspitzer@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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIAbCard.idl"
#include "nsISupportsArray.idl"
[ptr] native nsFileSpec(nsFileSpec);
%{C++
#include "nsFileSpec.h"
#include "nsDirPrefs.h"
%}
// used for when creating new directories
// either from user input, or during bootstrapping
[scriptable, uuid(f94812de-1dd1-11b2-b0ab-9eb5e055f712)]
interface nsIAbDirectoryProperties : nsISupports {
attribute AString description;
attribute string URI;
attribute string prefName;
attribute string fileName;
};
[scriptable, uuid(AA920C90-1DD1-11B2-96D3-AA81268ADAFC)]
interface nsIAbDirectory : nsISupports {
// Types of operation
// Perform linear reading of directory card
// content
const long opRead = 0x1;
// Perform modification and deletion on a
// directories content
const long opWrite = 0x2;
// Perform searching on a directory card
// content via the uri format:
// scheme://path?query
const long opSearch = 0x4;
// The supported operations
readonly attribute long operations;
// The name of the directory
attribute wstring dirName;
// will be used for LDAP replication
attribute unsigned long lastModifiedDate;
// Defines whether this directory is a mail
// list or not
attribute PRBool isMailList;
// Get the children directories
readonly attribute nsIEnumerator childNodes;
// Get the cards associated with the directory
// This will return the cards associated with
// the mailing lists too
readonly attribute nsIEnumerator childCards;
// Deletes either a mailing list or a top
// level directory, which also updates the
// preferences
void deleteDirectory(in nsIAbDirectory dierctory);
// Delete the array of cards
void deleteCards(in nsISupportsArray cards);
// Check if directory contains card
// If the implementation is asynchronous the card
// may not yet have arrived. If it is in the process
// of obtaining cards the method will throw an
// NS_ERROR_NOT_AVAILABLE exception if the card
// cannot be found.
boolean hasCard(in nsIAbCard cards);
// Check if directory contains directory
boolean hasDirectory(in nsIAbDirectory dir);
/**
* return value is the card that got added
* we need to do this, as the card we pass in might
* be an abstract nsIAbCard, and the caller might need
* the "real" card (the mdbcard) to get / set
* non-standard card values
*/
nsIAbCard addCard(in nsIAbCard card);
void dropCard(in nsIAbCard card, in boolean needToCopyCard);
/**
* directory is local (example, mork based) or remote (example, LDAP)
*/
readonly attribute boolean isRemote;
/**
* directory should be searched when doing local autocomplete
*/
readonly attribute boolean searchDuringLocalAutocomplete;
// Mail list specific
readonly attribute boolean supportsMailingLists;
// XXX todo
// fix this, ugh
// This attribute servers two purposes
// depending if the directory is a mail list.
// If not mail list directories are stored here
// If so mail list card entries are stored here
attribute nsISupportsArray addressLists;
// Specific to a directory which stores mail lists
// Creates a new mailing list in the directory
// with the properties defined by list
void addMailList (in nsIAbDirectory list);
// Specific to a directory which is a mail list
attribute wstring listNickName;
attribute wstring description;
/**
* Edits an existing mailing list (specified as listCard)
* into the directory specified by the uri
* XXX javadoc me
*/
void editMailListToDatabase(in string uri, in nsIAbCard listCard);
// Copies mail list properties from the srcList
void copyMailList(in nsIAbDirectory srcList);
/*
Only creates a top level address book
which is stored in the preferences
Need to change to factory based approach
to create new address books
This method should become redundant or
be only associated with card folders
*/
void createNewDirectory(in nsIAbDirectoryProperties aProperties);
/* create a directory by passing the display name and address book uri */
void createDirectoryByURI(in wstring displayName, in string uri, in boolean migrating);
wstring getValueForCard(in nsIAbCard card, in string name);
void setValueForCard(in nsIAbCard card, in string name, in wstring value);
};

View File

@@ -1,238 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Sun Microsystems, Inc.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Created by: Paul Sandoz <paul.sandoz@sun.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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsISupportsArray.idl"
#include "nsIAbBooleanExpression.idl"
/**
* The arguments for a query.
*
* Contains an expression for perform matches
* and an array of properties which should be
* returned if a match is found from the expression
*
*/
[scriptable, uuid(41EC291E-1DD2-11B2-B583-C44757081F64)]
interface nsIAbDirectoryQueryArguments : nsISupports
{
/**
* Defines the boolean expression for
* the matching of cards
*
*/
attribute nsISupports expression;
/**
* Defines if sub directories should be
* queried
*
*/
attribute boolean querySubDirectories;
/**
* The list of properties which should
* be returned if a match occurs on a card
*
*/
void setReturnProperties (in unsigned long returnPropertiesSize,
[array, size_is(returnPropertiesSize)]
in string returnPropertiesArray);
void getReturnProperties (out unsigned long returnPropertiesSize,
[retval, array, size_is(returnPropertiesSize)]
out string returnPropertiesArray);
};
[scriptable, uuid(3A6E0C0C-1DD2-11B2-B23D-EA3A8CCB333C)]
interface nsIAbDirectoryQueryPropertyValue : nsISupports
{
/**
* The property which should be matched
*
* For example 'primaryEmail' or 'homePhone'
* for card properties.
*
* Two further properties are defined that
* do not exist as properties on a card.
*
* 'card:nsIAbCard' which represents the interface
* of a card component
*
*/
readonly attribute string name;
/**
* The value of the property
*
*/
readonly attribute wstring value;
/**
* The value of the property
* as an interface
*
* Only valid if the corresponding
* property name is related to an
* interface instead of a wstring
*
*/
readonly attribute nsISupports valueISupports;
};
[scriptable, uuid(42E600BA-1DD2-11B2-BC39-C363AC0C93E3)]
interface nsIAbDirectoryQueryResult : nsISupports
{
/**
* The context ID of the query
*
*/
readonly attribute long contextID;
/**
* The context of the query which
* corresponds to the arguments that
* define the query
*
*/
readonly attribute nsIAbDirectoryQueryArguments contextArgs;
/**
* List of defined query results
*
*/
const long queryResultMatch = 0;
const long queryResultComplete = 1;
const long queryResultStopped = 2;
const long queryResultError = 3;
/**
* The type of result
*
* Identifies a query entry, the query has finished
* or that an error has occured
*/
readonly attribute long type;
/**
* The result of a singular match for a card
*
* Only valid when the attribute type is
* of 'query match'
*
* nsISupportsArray<nsIAbDirectoryQueryPropertyValue>
* Multiple entries corresponding to card
* properties
* nsISupportsArray<nsIAbCard>
* Only one entry makese sense
*
*/
readonly attribute nsISupportsArray result;
/**
* result attribute defined explicitly as an
* array of nsISupport interfaces
*
*/
void agetResult (out unsigned long aResultSize,
[retval, array, size_is(aResultSize)]
out nsISupports aResultArray);
};
[scriptable, uuid(4290E508-1DD2-11B2-AC3E-9597BBCB25D7)]
interface nsIAbDirectoryQueryResultListener : nsISupports
{
/**
* Called when a match is found. May be
* called from a different thread to the
* one that initiates the query
*
* @param result
* A individual result associated returned
* from a query
*/
void onQueryItem (in nsIAbDirectoryQueryResult result);
};
[scriptable, uuid(4241C46E-1DD2-11B2-978D-A2FBD0A72AC2)]
interface nsIAbDirectoryQuery : nsISupports
{
/**
* Initiates a query on a directory and
* sub-directories for properties on cards
*
* @param arguments
* The properties and values to match
* Value could of type nsIAbDirectoryQueryMatchItem
* for matches other than ?contains?
* @param listener
* The listener which will obtain individual
* query results
* @param resultLimit
* Limits the results returned to a specifed
* maximum value
* @return
* Unique number representing the context ID of
* the query
*
*/
long doQuery (in nsIAbDirectoryQueryArguments arguments,
in nsIAbDirectoryQueryResultListener listener,
in long resultLimit,
in long timeOut);
/**
* Stops an existing query operation if
* query operation is asynchronous
*
* The nsIAbDirectoryQueryResultListener will
* be notified when query has stopped
*
* It is implementation specific if notification
* synchronous or asynchronous
*
* @param contextID
* The unique number returned from
* the doQuery methods
*
*/
void stopQuery (in long contextID);
};

View File

@@ -1,48 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Sun Microsystems, Inc.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Created by: Paul Sandoz <paul.sandoz@sun.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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIAbDirectoryQuery.idl"
#include "nsIAbDirectory.idl"
[scriptable, uuid(CFA60E0C-94D5-4292-A675-28C737950B3B)]
interface nsIAbDirectoryQueryProxy : nsIAbDirectoryQuery
{
void initiate (in nsIAbDirectory directory);
};

View File

@@ -1,86 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Sun Microsystems, Inc.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Created by: Paul Sandoz <paul.sandoz@sun.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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
/**
* Searching of cards on a directory.
*
* The search data is defined in the query
* section of the directory URI, for example
*
* moz-abldapdirectory://ldap1.holland/dc=sun,dc=com?<query>
*
* If no search data is defined then the methods
* will return immediately with no error.
*/
[scriptable, uuid(ABF26047-37E3-44FD-A28A-6D37A1B9CCB3)]
interface nsIAbDirectorySearch : nsISupports
{
/**
* Starts a search on the directory.
*
* If a search is already being performed
* it is stopped.
*
* The results from a search, cards, will
* returned by informing the address book
* session that a new card has been added
* to the directory.
*
* The nsIAbDirectoryQuery implementation
* of the directory component (or a proxy)
* may be used as an implementation for
* this specialization of query.
*
* This method is semantically equivalent
* to the nsIAbDirectory.getChildCards
* method when there is search criteria
* defined in the directory uri.
*
*/
void startSearch ();
/**
* Stops a search on the directory.
*
*/
void stopSearch ();
};

View File

@@ -1,71 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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 Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s): Dan Mosedale <dmose@netscape.com> (Original Author)
*
*/
#include "nsILDAPAutoCompFormatter.idl"
/**
* An interface for formatter LDAP messages to be used as nsAutoCompleteItems
* for use in RFC 2822 message headers.
*/
[scriptable, uuid(cde8836e-1dd1-11b2-baff-a6d918243e80)]
interface nsIAbLDAPAutoCompFormatter: nsILDAPAutoCompFormatter {
/**
* All three Format attributes are templates, which work as follows:
*
* Required LDAP attributes are delimited by curly braces, and
* optional LDAP attributes are determined by brackets. Backslash
* escapes any character, including itself. Someday perhaps we'll rev
* this interface and change these to a more flexible format; perhaps
* something regexp based.
*
* If any of these are unset, components implementing this interface
* are free to choose reasonable defaults. As an example, the
*"@mozilla.org/ldap-autocomplete-formatter;1?type=addrbook"
* implementation currently happens to use the following default
* strings:
*
* nameFormat: "[cn]"
* addressFormat: "{mail}"
* commentFormat: ""
*
* and generates autocomplete items like this:
*
* value: John Doe <john.doe@foo.org>
* comment: Foo Organization
*
* Note that nsILDAPAutoCompFormatter::getAttributes() is only
* required to be called by the nsILDAPAutoCompleteSession
* implementation when the nsILDAPAutoCompleteSession::formatter
* IDL attribute is set. So if for some reason the format
* attributes exposed through this interface get changed (eg a
* user changes their prefs), it is the changing code's
* responsibly to re-set the nsILDAPAutoCompleteSession::formatter
* IDL attribute to the same object to force a new getAttributes()
* call.
*/
attribute AString nameFormat;
attribute AString addressFormat;
attribute AString commentFormat;
};

View File

@@ -1,82 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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 Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Rajiv Dayal <rdayal@netscape.com>
*
* nsIAbLDAPProcessReplicationData.idl
*/
#include "nsISupports.idl"
#include "nsILDAPMessageListener.idl"
interface nsIAbLDAPReplicationQuery;
interface nsIWebProgressListener;
/**
* this service does replication of an LDAP directory to a local Mork AB Database.
*/
[scriptable, uuid(00D568A2-3C3B-11d6-B7B9-00B0D06E5F27)]
interface nsIAbLDAPProcessReplicationData : nsILDAPMessageListener {
/**
* readonly attribute giving the current replication state
*/
readonly attribute PRInt32 replicationState;
/**
* replication states
*/
const long kQueryNotStarted = 0;
const long kAnonymousBinding = 1;
const long kAuthenticatedBinding = 2;
const long kSearchingAuthDN = 3;
const long kDecidingProtocol = 4;
const long kAuthenticating = 5;
const long kReplicatingAll = 6;
const long kSearchingRootDSE = 7;
const long kFindingChanges = 8;
const long kReplicatingChanges = 9;
const long kReplicationDone = 10;
/**
* readonly attribute giving the current protocol used
*/
readonly attribute PRInt32 protocolUsed ;
/**
* replication protocols
*/
const long kDefaultDownloadAll = 0;
const long kChangeLogProtocol = 1;
const long kLCUPProtocol = 2;
const long kLastUpdatedTimeStampMethod = 3;
/**
* this method initializes the implementation
*/
void init (in nsIAbLDAPReplicationQuery query, in nsIWebProgressListener progressListener);
/**
* this method a aborts the ongoing processing
*/
void abort();
};

View File

@@ -1,99 +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
* <rdayal@netscape.com>
*
* 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 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"
#include "nsILDAPMessageListener.idl"
interface nsIAbLDAPReplicationQuery;
interface nsIWebProgressListener;
/**
* this service does replication of an LDAP directory to a local Mork AB Database.
*/
[scriptable, uuid(00D568A2-3C3B-11d6-B7B9-00B0D06E5F27)]
interface nsIAbLDAPProcessReplicationData : nsILDAPMessageListener {
/**
* readonly attribute giving the current replication state
*/
readonly attribute PRInt32 replicationState;
/**
* replication states
*/
const long kIdle = 0;
const long kAnonymousBinding = 1;
const long kAuthenticatedBinding = 2;
const long kSyncServerBinding = 3;
const long kSearchingAuthDN = 4;
const long kDecidingProtocol = 5;
const long kAuthenticating = 6;
const long kReplicatingAll = 7;
const long kSearchingRootDSE = 8;
const long kFindingChanges = 9;
const long kReplicatingChanges = 10;
const long kReplicationDone = 11;
/**
* readonly attribute giving the current protocol used
*/
readonly attribute PRInt32 protocolUsed ;
/**
* replication protocols
*/
const long kDefaultDownloadAll = 0;
const long kChangeLogProtocol = 1;
const long kLCUPProtocol = 2;
const long kLastUpdatedTimeStampMethod = 3;
/**
* this method initializes the implementation
*/
void init (in nsIAbLDAPReplicationQuery query, in nsIWebProgressListener progressListener);
/**
* this method a aborts the ongoing processing
*/
void abort();
/**
* this utility method populates authentication data from Dir Server
*/
void populateAuthData();
};

View File

@@ -1,116 +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
* <rdayal@netscape.com>
*
* 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 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"
%{ C++
#include "nsDirPrefs.h"
%}
[ptr] native DIR_Server(DIR_Server);
interface nsIWebProgressListener;
interface nsILDAPURL;
interface nsILDAPConnection;
interface nsILDAPOperation;
/**
* this interface provides methods to perform LDAP Replication Queries
*/
[scriptable, uuid(00D568A1-3C3B-11d6-B7B9-00B0D06E5F27)]
interface nsIAbLDAPReplicationQuery : nsISupports {
readonly attribute nsILDAPURL replicationURL;
readonly attribute nsILDAPConnection connection;
readonly attribute nsILDAPOperation operation;
[noscript] readonly attribute DIR_Server replicationServerInfo;
/**
* initialize for the query
*/
void init (in ACString aPrefName, in nsIWebProgressListener aProgressListener);
/**
* Starts an LDAP query to do replication as needed
*/
void doReplicationQuery();
/**
* connects to an LDAP Server using a DN
*/
void connectToLDAPServer(in nsILDAPURL aURL, in AUTF8String aAuthDN);
/**
* Starts an LDAP query to replicate all entries
*/
void queryAllEntries();
/**
* Cancels the currently executing query
*/
void cancelQuery();
/**
* this method is the callback when query is done, failed or successful
*/
void done(in boolean aSuccess);
};
[scriptable, uuid(126202D1-4460-11d6-B7C2-00B0D06E5F27)]
interface nsIAbLDAPChangeLogQuery : nsISupports {
/**
* Starts an LDAP query to find auth DN
*/
void queryAuthDN(in AUTF8String aValueUsedToFindDn);
/**
* Starts an LDAP query to search server's Root DSE
*/
void queryRootDSE();
/**
* Starts an LDAP ChangeLog query to find changelog entries
*/
void queryChangeLog(in AUTF8String aChangeLogDN, in PRInt32 aLastChangeNo);
/**
* Starts an LDAP query to find changed entries
*/
void queryChangedEntries(in AUTF8String aChangedEntryDN);
};

View File

@@ -1,63 +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
* <rdayal@netscape.com>
*
* 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 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"
interface nsIWebProgressListener;
/**
* this service does replication of an LDAP directory to a local Mork AB Database.
*/
[scriptable, uuid(00D568A0-3C3B-11d6-B7B9-00B0D06E5F27)]
interface nsIAbLDAPReplicationService: nsISupports {
/**
* Start Replication of given LDAP directory represented by the URI
*/
void startReplication(in ACString aPrefName, in nsIWebProgressListener progressListener);
/**
* Cancel Replication of given LDAP directory represented by the URI
*/
void cancelReplication(in ACString aPrefName);
/**
* callback when replication is done, failure or success
*/
void done(in boolean aSuccess);
};

View File

@@ -1,57 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Seth Spitzer <sspitzer@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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIEnumerator.idl"
typedef unsigned long abListenerNotifyFlagValue;
[scriptable, uuid(1920E484-0709-11d3-A2EC-001083003D0C)]
interface nsIAbListener : nsISupports {
const abListenerNotifyFlagValue added = 0x1;
void onItemAdded(in nsISupports parentDir, in nsISupports item);
const abListenerNotifyFlagValue directoryItemRemoved = 0x2;
const abListenerNotifyFlagValue directoryRemoved = 0x4;
void onItemRemoved(in nsISupports parentDir, in nsISupports item);
const abListenerNotifyFlagValue changed = 0x8;
void onItemPropertyChanged(in nsISupports item, in string property, in wstring oldValue, in wstring newValue);
const abListenerNotifyFlagValue all = 0xFFFFFFFF;
};

View File

@@ -1,69 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Paul Sandoz <paul.sandoz@sun.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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
interface nsIAddrDatabase;
[ptr] native nsVoidArray(nsVoidArray);
%{C++
#include "nsVoidArray.h"
%}
[scriptable, uuid(5F414A80-1DD2-11B2-AAD0-AA4A15D5A1E8)]
interface nsIAbMDBCard : nsISupports {
// used by the absync code
attribute unsigned long key;
// DB specific methods
attribute unsigned long dbTableID;
attribute unsigned long dbRowID;
void setAbDatabase(in nsIAddrDatabase database);
// Copies attributes from the srcCard
// Only used when the address database notifies
// a directory listener of an inserted event
void copyCard(in nsIAbMDBCard srcCardDB);
wstring getStringAttribute(in string name);
void setStringAttribute(in string name, in wstring value);
};

View File

@@ -1,87 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Paul Sandoz <paul.sandoz@sun.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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIAbCard.idl"
#include "nsIAbDirectory.idl"
[scriptable, uuid(C6BCF232-1DD1-11B2-A108-B41BFECED134)]
interface nsIAbMDBDirectory : nsISupports {
// Creates an RDF directory component from the
// uriName, adds it to its children and returns
// the component
nsIAbDirectory addDirectory(in string uriName);
// This just returns the uri on the RDF resource
string getDirUri();
// Mail list specific
//
// Removes all elements from the addressLists
// property
[noscript] void removeElementsFromAddressList();
// Specific to a directory which stores mail lists
//
// Adds a directory to the addressLists attribute
void addMailListToDirectory(in nsIAbDirectory mailList);
// Specific to a directory which is a mail list
//
// Copies mail list properties from the srcList
void copyDBMailList(in nsIAbMDBDirectory srcListDB);
// Adds a card to the addressList attribute
void addAddressToList(in nsIAbCard card);
// Removes items from the addressLists member
void removeEmailAddressAt(in unsigned long aIndex);
attribute unsigned long dbRowID;
// Empty implementation, called by the data base
[noscript] void notifyDirItemAdded(in nsISupports item);
[noscript] void clearDatabase();
};

View File

@@ -1,46 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsrootidl.idl"
#include "nsIAbSyncListener.idl"
[scriptable, uuid(91FDFEE1-EFBC-11d3-8F97-000073757374)]
interface nsIAbSyncDriver : nsIAbSyncListener
{
void KickIt();
};

View File

@@ -1,47 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIFileSpec.idl"
[scriptable, uuid(abd6c760-f396-11d3-b9fa-00108335942a)]
interface nsIAbUpgrader : nsISupports {
void StartUpgrade4xAddrBook(in nsIFileSpec sourceAddrBook, in nsIFileSpec destAddrBook);
void ContinueExport(out boolean done);
attribute string currentCharset;
};

View File

@@ -1,73 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Original Author:
* Seth Spitzer <sspitzer@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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsISupportsArray.idl"
interface nsIAbCard;
interface nsIAbDirectory;
[scriptable, uuid(79ad5d6e-1dd2-11b2-addd-f547dab50d75)]
interface nsIAbViewListener : nsISupports
{
void onSelectionChanged();
void onCountChanged(in long total);
};
[scriptable, uuid(e35c015c-1dd1-11b2-9494-f88326252aae)]
interface nsIAbView : nsISupports
{
/**
* returns the actual sortColumn. migration, switching from mozilla
* to netscape 6.x, etc, could cause
* the "persisted" sortColumn to be bogus.
*/
wstring init(in string URI, in nsIAbViewListener abViewListener, in wstring sortColumn, in wstring sortDirection);
void close();
void sortBy(in wstring sortColumn, in wstring sortDirection);
readonly attribute string URI;
readonly attribute AString sortColumn;
readonly attribute AString sortDirection;
readonly attribute nsIAbDirectory directory;
nsIAbCard getCardFromRow(in long row);
void selectAll();
void deleteSelectedCards();
readonly attribute nsISupportsArray selectedAddresses;
};

View File

@@ -1,50 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIURI.idl"
[scriptable, uuid(6EB9D874-01AA-11d4-8FBE-000064657374)]
interface nsIAddbookUrlOperation
{
const long InvalidUrl = 0;
const long PrintAddressBook = 1;
};
[uuid(ee1d5cc3-5f8c-43f3-b1b8-8d2ea67ce2d8)]
interface nsIAddbookUrl : nsIURI {
readonly attribute long addbookOperation;
};

View File

@@ -1,90 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
/*
* The mail session is a replacement for the old 4.x MSG_Master object. It
* contains mail session generic information such as the account manager, etc
* I'm starting this off as an empty interface and as people feel they need to
* add more information to it, they can. I think this is a better approach
* than trying to port over the old MSG_Master in its entirety as that had a
* lot of cruft in it....
*/
#include "nsISupports.idl"
#include "nsIAbListener.idl"
#include "nsIAbDirectory.idl"
#include "nsIAbCard.idl"
[scriptable, uuid(C5339441-303F-11d3-9E13-00A0C92B5F0D)]
interface nsIAddrBookSession : nsISupports {
void addAddressBookListener(in nsIAbListener listener, in abListenerNotifyFlagValue notifyFlags);
void removeAddressBookListener(in nsIAbListener listener);
void notifyItemPropertyChanged(in nsISupports item,
in string property,
in wstring oldValue,
in wstring newValue);
void notifyDirectoryItemAdded(in nsIAbDirectory directory, in nsISupports item);
/**
* when a card is deleted
*/
void notifyDirectoryItemDeleted(in nsIAbDirectory directory, in nsISupports item);
/**
* when a directory is deleted
*/
void notifyDirectoryDeleted(in nsIAbDirectory directory, in nsISupports item);
[noscript] readonly attribute nsFileSpec userProfileDirectory;
/**
* generate the name from the card, using the firstName and lastName and the displayName
*
* format follows the "mail.addr_book.lastnamefirst" pref values
*
* 0 = generated name is displayName
* 1 = lastFirst, formatted following lastFirstFormat (see addressBook.properties)
* 2 = firstLast, formatted following firstLastFormat (see addressBook.properties)
*
* we allow the caller to cache the pref value, so we don't have to go to prefs every time.
*/
wstring generateNameFromCard(in nsIAbCard card, in long generateFormat);
};

View File

@@ -1,56 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIAbCard.idl"
interface nsIAddrDBListener;
[scriptable, uuid(A4186D8A-1DD0-11d3-A303-001083003D0C)]
interface nsIAddrDBAnnouncer : nsISupports {
void addListener(in nsIAddrDBListener listener);
void removeListener(in nsIAddrDBListener listener);
void notifyCardAttribChange(in unsigned long abCode,
in nsIAddrDBListener instigator);
void notifyCardEntryChange (in unsigned long abCode,
in nsIAbCard card,
in nsIAddrDBListener instigator);
void notifyAnnouncerGoingAway();
};

View File

@@ -1,56 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIAbCard.idl"
#include "nsIAbDirectory.idl"
interface nsIAddrDBAnnouncer;
[scriptable, uuid(A4186D89-1DD0-11d3-A303-001083003D0C)]
interface nsIAddrDBListener : nsISupports {
void onCardAttribChange(in unsigned long abCode,
in nsIAddrDBListener instigator);
void onCardEntryChange (in unsigned long abCode,
in nsIAbCard card,
in nsIAddrDBListener instigator);
void onListEntryChange (in unsigned long abCode,
in nsIAbDirectory list,
in nsIAddrDBListener instigator);
void onAnnouncerGoingAway(in nsIAddrDBAnnouncer instigator);
};

View File

@@ -1,225 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Seth Spitzer <sspitzer@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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* nsFileSpec is declared in nsIAbDirectory.idl */
#include "nsIAddrDBAnnouncer.idl"
#include "nsIAbCard.idl"
#include "nsIAbDirectory.idl"
%{C++
#include "mdb.h"
%}
[ptr] native nsIMdbTableRowCursor(nsIMdbTableRowCursor);
[ptr] native nsIMdbEnv(nsIMdbEnv);
[ptr] native nsIMdbRow(nsIMdbRow);
%{C++
// this is the prefix we for attributes that are specific
// to the mozilla addressbook, and weren't in 4.x and aren't specified in
// RFC 2789. used when exporting and import LDIF
// see nsTextAddress.cpp, nsAddressBook.cpp
#define MOZ_AB_LDIF_PREFIX "mozilla"
// note, GeneratedName is not a real column
// if you change any of this, make sure to change
// Get / Set CardValue in nsAbCardProperty.cpp
#define kFirstNameColumn "FirstName"
#define kLastNameColumn "LastName"
#define kDisplayNameColumn "DisplayName"
#define kNicknameColumn "NickName"
#define kPriEmailColumn "PrimaryEmail"
#define k2ndEmailColumn "SecondEmail"
#define kPreferMailFormatColumn "PreferMailFormat"
#define kWorkPhoneColumn "WorkPhone"
#define kHomePhoneColumn "HomePhone"
#define kFaxColumn "FaxNumber"
#define kPagerColumn "PagerNumber"
#define kCellularColumn "CellularNumber"
#define kHomeAddressColumn "HomeAddress"
#define kHomeAddress2Column "HomeAddress2"
#define kHomeCityColumn "HomeCity"
#define kHomeStateColumn "HomeState"
#define kHomeZipCodeColumn "HomeZipCode"
#define kHomeCountryColumn "HomeCountry"
#define kWorkAddressColumn "WorkAddress"
#define kWorkAddress2Column "WorkAddress2"
#define kWorkCityColumn "WorkCity"
#define kWorkStateColumn "WorkState"
#define kWorkZipCodeColumn "WorkZipCode"
#define kWorkCountryColumn "WorkCountry"
#define kJobTitleColumn "JobTitle"
#define kDepartmentColumn "Department"
#define kCompanyColumn "Company"
// webPage1 is work web page
#define kWebPage1Column "WebPage1"
// webPage2 is home web page
#define kWebPage2Column "WebPage2"
#define kBirthYearColumn "BirthYear"
#define kBirthMonthColumn "BirthMonth"
#define kBirthDayColumn "BirthDay"
#define kCustom1Column "Custom1"
#define kCustom2Column "Custom2"
#define kCustom3Column "Custom3"
#define kCustom4Column "Custom4"
#define kNotesColumn "Notes"
#define kLastModifiedDateColumn "LastModifiedDate"
#define kAddressCharSetColumn "AddrCharSet"
#define kMailListName "ListName"
#define kMailListNickName "ListNickName"
#define kMailListDescription "ListDescription"
#define kMailListTotalAddresses "ListTotalAddresses"
%}
[scriptable, uuid(ca536e0e-1dd1-11b2-951a-e02b86e4f60e)]
interface nsAddrDBCommitType
{
const long kSmallCommit = 0;
const long kLargeCommit = 1;
const long kSessionCommit = 2;
const long kCompressCommit = 3;
};
[scriptable, uuid(A4186D8B-1DD0-11d3-A303-001083003D0C)]
interface nsIAddrDatabase : nsIAddrDBAnnouncer {
[noscript] attribute nsFileSpec dbPath;
[noscript] void open(in nsFileSpec folderName, in boolean create,
out nsIAddrDatabase pCardDB, in boolean upgrading);
void close(in boolean forceCommit);
[noscript] void openMDB(in nsFileSpec dbName, in boolean create);
void closeMDB(in boolean commit);
void commit(in unsigned long commitType);
void forceClosed();
void createNewCardAndAddToDB(in nsIAbCard newCard, in boolean aNotify);
void createNewCardAndAddToDBWithKey(in nsIAbCard newCard, in boolean aNotify, out unsigned long key);
void createNewListCardAndAddToDB(in nsIAbDirectory list, in unsigned long listRowID, in nsIAbCard newCard, in boolean aNotify);
void createMailListAndAddToDB(in nsIAbDirectory newList, in boolean aNotify);
nsIEnumerator enumerateCards(in nsIAbDirectory directory);
nsIEnumerator enumerateListAddresses(in nsIAbDirectory directory);
void getMailingListsFromDB(in nsIAbDirectory parentDir);
void deleteCard(in nsIAbCard card, in boolean aNotify);
void editCard(in nsIAbCard card, in boolean aNotify);
boolean containsCard(in nsIAbCard card);
void deleteMailList(in nsIAbDirectory mailList, in boolean aNotify);
void editMailList(in nsIAbDirectory mailList, in nsIAbCard listCard, in boolean aNotify);
boolean containsMailList(in nsIAbDirectory mailList);
void deleteCardFromMailList(in nsIAbDirectory mailList, in nsIAbCard card, in boolean aNotify);
readonly attribute wstring directoryName;
/**
* aUTF8Value needs to be in UTF-8
*/
nsIAbCard getCardFromAttribute(in nsIAbDirectory directory, in string aName, in string aUTF8Value, in boolean caseInsensitive);
PRBool findMailListbyUnicodeName(in wstring listName);
void getCardCount(out PRUint32 count);
void removeExtraCardsInCab(in PRUint32 cardTotal, in PRUint32 cabMax);
[noscript] readonly attribute nsIMdbRow newRow;
[noscript] readonly attribute nsIMdbRow newListRow;
[noscript] void addCardRowToDB(in nsIMdbRow newRow);
[noscript] void addLdifListMember(in nsIMdbRow row, in string value);
[noscript] void addFirstName(in nsIMdbRow row, in string value);
[noscript] void addLastName(in nsIMdbRow row, in string value);
[noscript] void addDisplayName(in nsIMdbRow row, in string value);
[noscript] void addNickName(in nsIMdbRow row, in string value);
[noscript] void addPrimaryEmail(in nsIMdbRow row, in string value);
[noscript] void add2ndEmail(in nsIMdbRow row, in string value);
[noscript] void addWorkPhone(in nsIMdbRow row, in string value);
[noscript] void addHomePhone(in nsIMdbRow row, in string value);
[noscript] void addFaxNumber(in nsIMdbRow row, in string value);
[noscript] void addPagerNumber(in nsIMdbRow row, in string value);
[noscript] void addCellularNumber(in nsIMdbRow row, in string value);
[noscript] void addHomeAddress(in nsIMdbRow row, in string value);
[noscript] void addHomeAddress2(in nsIMdbRow row, in string value);
[noscript] void addHomeCity(in nsIMdbRow row, in string value);
[noscript] void addHomeState(in nsIMdbRow row, in string value);
[noscript] void addHomeZipCode(in nsIMdbRow row, in string value);
[noscript] void addHomeCountry(in nsIMdbRow row, in string value);
[noscript] void addWorkAddress(in nsIMdbRow row, in string value);
[noscript] void addWorkAddress2(in nsIMdbRow row, in string value);
[noscript] void addWorkCity(in nsIMdbRow row, in string value);
[noscript] void addWorkState(in nsIMdbRow row, in string value);
[noscript] void addWorkZipCode(in nsIMdbRow row, in string value);
[noscript] void addWorkCountry(in nsIMdbRow row, in string value);
[noscript] void addJobTitle(in nsIMdbRow row, in string value);
[noscript] void addDepartment(in nsIMdbRow row, in string value);
[noscript] void addCompany(in nsIMdbRow row, in string value);
[noscript] void addWebPage1(in nsIMdbRow row, in string value);
[noscript] void addWebPage2(in nsIMdbRow row, in string value);
[noscript] void addBirthYear(in nsIMdbRow row, in string value);
[noscript] void addBirthMonth(in nsIMdbRow row, in string value);
[noscript] void addBirthDay(in nsIMdbRow row, in string value);
[noscript] void addCustom1(in nsIMdbRow row, in string value);
[noscript] void addCustom2(in nsIMdbRow row, in string value);
[noscript] void addCustom3(in nsIMdbRow row, in string value);
[noscript] void addCustom4(in nsIMdbRow row, in string value);
[noscript] void addNotes(in nsIMdbRow row, in string value);
[noscript] void addPreferMailFormat(in nsIMdbRow row, in unsigned long value);
[noscript] void addListName(in nsIMdbRow row, in string value);
[noscript] void addListNickName(in nsIMdbRow row, in string value);
[noscript] void addListDescription(in nsIMdbRow row, in string value);
[noscript] void addListDirNode(in nsIMdbRow listRow);
/**
* use for getting and setting generic string attributes
* like _AimScreenName
*/
void setCardValue(in nsIAbCard card, in string name, in wstring value, in boolean notify);
wstring getCardValue(in nsIAbCard card, in string name);
/**
* used for adding a string attributes to a row.
* the string attribute does not have to be a generic attribute
* (ex: _AimScreenName). used during LDIF and addressbook import.
*
* @param aRow
* The row we're adding the column to
* @param aColName
* The column name (example: _AimScreenName)
* @param aColValue
* The column value (example: jabroni316)
*/
[noscript] void addRowValue(in nsIMdbRow aRow, in ACString aColName, in AString aColValue);
};

View File

@@ -1,60 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIRDFCompositeDataSource.idl"
#include "nsIAddrDatabase.idl"
#include "nsISupportsArray.idl"
interface nsIDOMWindowInternal;
interface nsIFileSpec;
interface nsIAbDirectory;
[scriptable, uuid(D60B84F1-2A8C-11d3-9E07-00A0C92B5F0D)]
interface nsIAddressBook : nsISupports
{
void newAddressBook(in nsIAbDirectoryProperties aProperties);
void deleteAddressBooks(in nsIRDFDataSource aDS, in nsISupportsArray aParentDir, in nsISupportsArray aResourceArray);
void setDocShellWindow(in nsIDOMWindowInternal win);
void exportAddressBook(in nsIAbDirectory aDirectory);
void convertLDIFtoMAB(in nsIFileSpec fileSpec, in boolean migrating, in nsIAddrDatabase db, in boolean bStoreLocAsHome, in boolean bImportingComm4x);
void convertNA2toLDIF(in nsIFileSpec srcFileSpec, in nsIFileSpec dstFileSpec);
nsIAddrDatabase getAbDatabaseFromURI(in string URI);
boolean mailListNameExistsInDB(in wstring name, in string URI);
boolean mailListNameExists(in wstring name);
};

View File

@@ -1,62 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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 Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Srilatha Moturi <srilatha@netscape.com>
*
* nsILDAPPrefsService.idl
*/
#include "nsISupports.idl"
#include "nsILDAPURL.idl"
#include "nsILDAPService.idl"
#include "nsIPrefBranch.idl"
/**
* this service implements migrating ldap prefs from 4.x format
* to mozilla format.
*/
[scriptable, uuid(5a4911e0-44cd-11d5-9074-0010a4b26cda)]
interface nsILDAPPrefsService: nsISupports {
/**
* Convert 4.x ldap prefs to mozilla format
* hostname, dn, scope, port are converted to uri
* Also converts the autocompletion preference from 4.x format
* (ldap_2.servers.<server-name>.autocomplete.enabled)
* to mozilla format (ldap_2.servers.directoryServer)
*/
void migrate();
/**
* This will create an array with entries
* "ldap_2.servers.<server-name>"
* Each entry in the array is unique.
*
* @param aPrefBranch prefBranch object.
* @param aCount Receives the number of elements in the array.
* @param aChildArray Receives the array with "ldap_2.servers.<server-name>".
*
* @return NS_OK The preference list was successfully retrieved.
* @return Other The preference(s) do not exist or an error occurred.
*/
void getServerList(in nsIPrefBranch aPrefBranch,
out unsigned long aCount,
[array, size_is(aCount), retval] out string aChildArray);
};

View File

@@ -1,41 +0,0 @@
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
# This is a list of local files which get copied to the res\mailnews\messenger directory
#
abAddressBookNameDialog.js
abAddressBookNameDialog.xul
abCardOverlay.js
abCardOverlay.xul
abCardViewOverlay.js
abCardViewOverlay.xul
abCommon.js
abDirTreeOverlay.xul
abEditCardDialog.xul
abNewCardDialog.xul
abSelectAddressesDialog.js
abSelectAddressesDialog.xul
addressbook.js
addressbook.xul
abDragDrop.js
abMailListDialog.js
abMailListDialog.xul
abListOverlay.xul
abEditListDialog.xul

View File

@@ -1,37 +0,0 @@
var okCallback = 0;
function abNameOnLoad()
{
doSetOKCancel(abNameOKButton, 0);
// look in arguments[0] for parameters
if ("arguments" in window && window.arguments[0])
{
if ("title" in window.arguments[0])
{
var title = window.arguments[0].title;
top.window.title = title;
}
if ("okCallback" in window.arguments[0])
top.okCallback = window.arguments[0].okCallback;
}
// focus on input
var name = document.getElementById('name');
if ( name )
name.focus();
moveToAlertPosition();
}
function abNameOKButton()
{
if ( top.okCallback )
{
var name = document.getElementById('name').value;
top.okCallback(name);
}
return true;
}

View File

@@ -1,53 +0,0 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/abAddressBookNameDialog.dtd">
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&title.label;"
class="dialog"
onload="abNameOnLoad()"
style="padding:10px">
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/abAddressBookNameDialog.js"/>
<keyset id="dialogKeys"/>
<vbox style="width:36em; min-height:12em">
<spacer flex="1"/>
<label control="name" style="margin-bottom:.3em" value="&name.label;"/>
<textbox tabindex="0" id="name" style="width: 100%"/>
<spacer flex="1"/>
<hbox id="okCancelButtons"/>
</vbox>
</window>

View File

@@ -1,501 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Seth Spitzer <sspitzer@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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var editCard;
var gOnSaveListeners = new Array;
var gOkCallback = null;
var gAddressBookBundle;
function OnLoadNewCard()
{
InitEditCard();
doSetOKCancel(NewCardOKButton, 0);
var cardproperty = Components.classes["@mozilla.org/addressbook/cardproperty;1"].createInstance(Components.interfaces.nsIAbCard);
editCard.card = cardproperty;
editCard.titleProperty = "newCardTitle";
editCard.selectedAB = "";
if ("arguments" in window && window.arguments[0])
{
if ("selectedAB" in window.arguments[0]) {
// check if selected ab is a mailing list
var abURI = window.arguments[0].selectedAB;
var directory = GetDirectoryFromURI(abURI);
if (directory.isMailList) {
var parentURI = GetParentDirectoryFromMailingListURI(abURI);
if (parentURI) {
editCard.selectedAB = parentURI;
}
else {
// it's a mailing list, but we failed to determine the parent directory
// use the personal addressbook
editCard.selectedAB = kPersonalAddressbookURI;
}
}
else if (!(directory.operations & directory.opWrite)) {
editCard.selectedAB = kPersonalAddressbookURI;
}
else {
editCard.selectedAB = window.arguments[0].selectedAB;
}
}
else {
editCard.selectedAB = kPersonalAddressbookURI;
}
// we may have been given properties to pre-initialize the window with....
// we'll fill these in here...
if ("primaryEmail" in window.arguments[0])
editCard.card.primaryEmail = window.arguments[0].primaryEmail;
if ("displayName" in window.arguments[0]) {
editCard.card.displayName = window.arguments[0].displayName;
// if we've got a display name, don't generate
// a display name (and stomp on the existing display name)
// when the user types a first or last name
if (editCard.card.displayName.length)
editCard.generateDisplayName = false;
}
}
// set popup with address book names
var abPopup = document.getElementById('abPopup');
if ( abPopup )
{
var menupopup = document.getElementById('abPopup-menupopup');
if ( editCard.selectedAB && menupopup && menupopup.childNodes )
{
for ( var index = menupopup.childNodes.length - 1; index >= 0; index-- )
{
if ( menupopup.childNodes[index].getAttribute('value') == editCard.selectedAB )
{
abPopup.label = menupopup.childNodes[index].getAttribute('label');
abPopup.value = menupopup.childNodes[index].getAttribute('value');
break;
}
}
}
else {
// Default to the first valid addressbook when none is
// selected. (the 0th is an empty/invalid entry)
abPopup.label = menupopup.childNodes[1].getAttribute('label');
abPopup.value = menupopup.childNodes[1].getAttribute('value');
}
}
GetCardValues(editCard.card, document);
// FIX ME - looks like we need to focus on both the text field and the tab widget
// probably need to do the same in the addressing widget
// focus on first name
var firstName = document.getElementById('FirstName');
if ( firstName ) {
// XXX Using the setTimeout hack until bug 103197 is fixed
setTimeout( function(firstTextBox) { firstTextBox.focus(); }, 0, firstName );
}
moveToAlertPosition();
}
// find the index in addressLists for the card that is being saved.
function findCardIndex(directory)
{
var index = -1;
var listCardsCount = directory.addressLists.Count();
for ( var i = 0; i < listCardsCount; i++ ) {
var card = directory.addressLists.QueryElementAt(i, Components.interfaces.nsIAbCard);
if (editCard.card.equals(card)) {
index = i;
break;
}
}
return index;
}
function EditCardOKButton()
{
// See if this card is in any mailing list
// if so then we need to update the addresslists of those mailing lists
var index = -1;
var directory = GetDirectoryFromURI(editCard.abURI);
// if the directory is a mailing list we need to search all the mailing lists
// in the parent directory if the card exists.
if (directory.isMailList) {
var parentURI = GetParentDirectoryFromMailingListURI(editCard.abURI);
directory = GetDirectoryFromURI(parentURI);
}
var listDirectoriesCount = directory.addressLists.Count();
var foundDirectories = new Array();
var foundDirectoriesCount = 0;
var i;
// create a list of mailing lists and the index where the card is at.
for ( i=0; i < listDirectoriesCount; i++ ) {
var subdirectory = directory.addressLists.QueryElementAt(i, Components.interfaces.nsIAbDirectory);
index = findCardIndex(subdirectory);
if (index > -1)
{
foundDirectories[foundDirectoriesCount] = {directory:subdirectory, index:index};
foundDirectoriesCount++;
}
}
SetCardValues(editCard.card, document);
editCard.card.editCardToDatabase(editCard.abURI);
for (i=0; i<foundDirectoriesCount; i++) {
// Update the addressLists item for this card
foundDirectories[i].directory.addressLists.
SetElementAt(foundDirectories[i].index, editCard.card);
}
NotifySaveListeners();
// callback to allow caller to update
if (gOkCallback)
gOkCallback();
return true; // close the window
}
function OnNewCardEnter()
{
if (NewCardOKButton())
window.close();
}
function OnEditCardEnter()
{
if (EditCardOKButton())
window.close();
}
function OnLoadEditCard()
{
InitEditCard();
doSetOKCancel(EditCardOKButton, 0);
editCard.titleProperty = "editCardTitle";
if (window.arguments && window.arguments[0])
{
if ( window.arguments[0].card )
editCard.card = window.arguments[0].card;
if ( window.arguments[0].okCallback )
gOkCallback = window.arguments[0].okCallback;
if ( window.arguments[0].abURI )
editCard.abURI = window.arguments[0].abURI;
}
// set global state variables
// if first or last name entered, disable generateDisplayName
if ( editCard.generateDisplayName && (editCard.card.firstName.length +
editCard.card.lastName.length +
editCard.card.displayName.length > 0) )
{
editCard.generateDisplayName = false;
}
GetCardValues(editCard.card, document);
var displayName = editCard.card.displayName;
top.window.title = gAddressBookBundle.getFormattedString(editCard.titleProperty,
[ displayName ]);
// check if selectedAB is a writeable
// if not disable all the fields
if ("arguments" in window && window.arguments[0])
{
if ("abURI" in window.arguments[0]) {
var abURI = window.arguments[0].abURI;
var directory = GetDirectoryFromURI(abURI);
if (!(directory.operations & directory.opWrite))
{
var disableElements = document.getElementsByAttribute("disableforreadonly", "true");
for (var i=0; i<disableElements.length; i++)
disableElements[i].setAttribute('disabled', 'true');
}
}
}
}
// this is used by people who extend the ab card dialog
// like Netscape does for screenname
function RegisterSaveListener(func)
{
var length = gOnSaveListeners.length;
gOnSaveListeners[length] = func;
}
// this is used by people who extend the ab card dialog
// like Netscape does for screenname
function NotifySaveListeners()
{
for ( var i = 0; i < gOnSaveListeners.length; i++ )
gOnSaveListeners[i]();
if (gOnSaveListeners.length) {
// the save listeners might have tweaked the card
// in which case we need to commit it.
editCard.card.editCardToDatabase(editCard.abURI);
}
}
function InitEditCard()
{
gAddressBookBundle = document.getElementById("bundle_addressBook");
// create editCard object that contains global variables for editCard.js
editCard = new Object;
editCard.prefs = gPrefs;
// get specific prefs that editCard will need
try {
editCard.displayLastNameFirst = gPrefs.getBoolPref("mail.addr_book.displayName.lastnamefirst");
editCard.generateDisplayName = gPrefs.getBoolPref("mail.addr_book.displayName.autoGeneration");
}
catch (ex) {
dump("ex: failed to get pref" + ex + "\n");
}
}
function NewCardOKButton()
{
var popup = document.getElementById('abPopup');
if ( popup )
{
var uri = popup.getAttribute('value');
// FIX ME - hack to avoid crashing if no ab selected because of blank option bug from template
// should be able to just remove this if we are not seeing blank lines in the ab popup
if ( !uri )
return false; // don't close window
// -----
if ( editCard.card )
{
SetCardValues(editCard.card, document);
var directory = GetDirectoryFromURI(uri);
// replace editCard.card with the card we added
// so that save listeners can get / set attributes on
// the card that got created.
var addedCard = directory.addCard(editCard.card);
editCard.card = addedCard;
NotifySaveListeners();
}
}
return true; // close the window
}
// Move the data from the cardproperty to the dialog
function GetCardValues(cardproperty, doc)
{
if ( cardproperty )
{
doc.getElementById('FirstName').value = cardproperty.firstName;
doc.getElementById('LastName').value = cardproperty.lastName;
doc.getElementById('DisplayName').value = cardproperty.displayName;
doc.getElementById('NickName').value = cardproperty.nickName;
doc.getElementById('PrimaryEmail').value = cardproperty.primaryEmail;
doc.getElementById('SecondEmail').value = cardproperty.secondEmail;
var popup = document.getElementById('PreferMailFormatPopup');
if ( popup )
popup.value = cardproperty.preferMailFormat;
doc.getElementById('WorkPhone').value = cardproperty.workPhone;
doc.getElementById('HomePhone').value = cardproperty.homePhone;
doc.getElementById('FaxNumber').value = cardproperty.faxNumber;
doc.getElementById('PagerNumber').value = cardproperty.pagerNumber;
doc.getElementById('CellularNumber').value = cardproperty.cellularNumber;
doc.getElementById('HomeAddress').value = cardproperty.homeAddress;
doc.getElementById('HomeAddress2').value = cardproperty.homeAddress2;
doc.getElementById('HomeCity').value = cardproperty.homeCity;
doc.getElementById('HomeState').value = cardproperty.homeState;
doc.getElementById('HomeZipCode').value = cardproperty.homeZipCode;
doc.getElementById('HomeCountry').value = cardproperty.homeCountry;
doc.getElementById('WebPage2').value = cardproperty.webPage2;
doc.getElementById('JobTitle').value = cardproperty.jobTitle;
doc.getElementById('Department').value = cardproperty.department;
doc.getElementById('Company').value = cardproperty.company;
doc.getElementById('WorkAddress').value = cardproperty.workAddress;
doc.getElementById('WorkAddress2').value = cardproperty.workAddress2;
doc.getElementById('WorkCity').value = cardproperty.workCity;
doc.getElementById('WorkState').value = cardproperty.workState;
doc.getElementById('WorkZipCode').value = cardproperty.workZipCode;
doc.getElementById('WorkCountry').value = cardproperty.workCountry;
doc.getElementById('WebPage1').value = cardproperty.webPage1;
doc.getElementById('Custom1').value = cardproperty.custom1;
doc.getElementById('Custom2').value = cardproperty.custom2;
doc.getElementById('Custom3').value = cardproperty.custom3;
doc.getElementById('Custom4').value = cardproperty.custom4;
doc.getElementById('Notes').value = cardproperty.notes;
}
}
// Move the data from the dialog to the cardproperty to be stored in the database
function SetCardValues(cardproperty, doc)
{
if (cardproperty)
{
cardproperty.firstName = doc.getElementById('FirstName').value;
cardproperty.lastName = doc.getElementById('LastName').value;
cardproperty.displayName = doc.getElementById('DisplayName').value;
cardproperty.nickName = doc.getElementById('NickName').value;
cardproperty.primaryEmail = doc.getElementById('PrimaryEmail').value;
cardproperty.secondEmail = doc.getElementById('SecondEmail').value;
var popup = document.getElementById('PreferMailFormatPopup');
if ( popup )
cardproperty.preferMailFormat = popup.value;
cardproperty.workPhone = doc.getElementById('WorkPhone').value;
cardproperty.homePhone = doc.getElementById('HomePhone').value;
cardproperty.faxNumber = doc.getElementById('FaxNumber').value;
cardproperty.pagerNumber = doc.getElementById('PagerNumber').value;
cardproperty.cellularNumber = doc.getElementById('CellularNumber').value;
cardproperty.homeAddress = doc.getElementById('HomeAddress').value;
cardproperty.homeAddress2 = doc.getElementById('HomeAddress2').value;
cardproperty.homeCity = doc.getElementById('HomeCity').value;
cardproperty.homeState = doc.getElementById('HomeState').value;
cardproperty.homeZipCode = doc.getElementById('HomeZipCode').value;
cardproperty.homeCountry = doc.getElementById('HomeCountry').value;
cardproperty.webPage2 = CleanUpWebPage(doc.getElementById('WebPage2').value);
cardproperty.jobTitle = doc.getElementById('JobTitle').value;
cardproperty.department = doc.getElementById('Department').value;
cardproperty.company = doc.getElementById('Company').value;
cardproperty.workAddress = doc.getElementById('WorkAddress').value;
cardproperty.workAddress2 = doc.getElementById('WorkAddress2').value;
cardproperty.workCity = doc.getElementById('WorkCity').value;
cardproperty.workState = doc.getElementById('WorkState').value;
cardproperty.workZipCode = doc.getElementById('WorkZipCode').value;
cardproperty.workCountry = doc.getElementById('WorkCountry').value;
cardproperty.webPage1 = CleanUpWebPage(doc.getElementById('WebPage1').value);
cardproperty.custom1 = doc.getElementById('Custom1').value;
cardproperty.custom2 = doc.getElementById('Custom2').value;
cardproperty.custom3 = doc.getElementById('Custom3').value;
cardproperty.custom4 = doc.getElementById('Custom4').value;
cardproperty.notes = doc.getElementById('Notes').value;
}
}
function CleanUpWebPage(webPage)
{
// no :// yet so we should add something
if ( webPage.length && webPage.search("://") == -1 )
{
// check for missing / on http://
if ( webPage.substr(0, 6) == "http:/" )
return( "http://" + webPage.substr(6) );
else
return( "http://" + webPage );
}
else
return(webPage);
}
function NewCardCancelButton()
{
top.window.close();
}
function EditCardCancelButton()
{
top.window.close();
}
function GenerateDisplayName()
{
if ( editCard.generateDisplayName )
{
var displayName;
var firstNameField = document.getElementById('FirstName');
var lastNameField = document.getElementById('LastName');
var displayNameField = document.getElementById('DisplayName');
if (lastNameField.value && firstNameField.value) {
if ( editCard.displayLastNameFirst )
displayName = gAddressBookBundle.getFormattedString("lastFirstFormat",[ lastNameField.value, firstNameField.value ]);
else
displayName = gAddressBookBundle.getFormattedString("firstLastFormat",[ firstNameField.value, lastNameField.value ]);
}
else {
// one (or both) of these is empty, so this works.
displayName = firstNameField.value + lastNameField.value;
}
displayNameField.value = displayName;
top.window.title = gAddressBookBundle.getFormattedString(editCard.titleProperty,
[ displayName ]);
}
}
function DisplayNameChanged()
{
// turn off generateDisplayName if the user changes the display name
editCard.generateDisplayName = false;
var displayName = document.getElementById('DisplayName').value;
var title = gAddressBookBundle.getFormattedString(editCard.titleProperty,
[ displayName ]);
if ( top.window.title != title )
top.window.title = title;
}

View File

@@ -1,331 +0,0 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<?xml-stylesheet href="chrome://messenger/skin/addressbook/cardDialog.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/abCardOverlay.dtd">
<overlay id="editcardOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_addressBook" src="chrome://messenger/locale/addressbook/addressBook.properties"/>
</stringbundleset>
<script type="application/x-javascript" src="chrome://global/content/dialogOverlay.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/abCommon.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/abCardOverlay.js"/>
<vbox id="editcard">
<tabbox style="margin:5px">
<tabs id="abTabs">
<tab label="&Name.tab;"/>
<tab label="&Address.tab;"/>
<tab label="&Other.tab;"/>
</tabs>
<tabpanels id="abTabPanels" flex="1">
<!-- ** Name Tab ** -->
<vbox index="name" flex="1">
<groupbox flex="1">
<caption label="&Name.box;"/>
<vbox style="width:100%">
<hbox>
<spacer flex="1"/>
<label control="FirstName" value="&FirstName.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="FirstName" flex="1" oninput="GenerateDisplayName()" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="LastName" value="&LastName.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="LastName" flex="1" oninput="GenerateDisplayName()" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="DisplayName" value="&DisplayName.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="DisplayName" flex="1" oninput="DisplayNameChanged()" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="NickName" value="&NickName.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="NickName" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
</vbox>
</groupbox>
<groupbox flex="1">
<caption label="&Internet.box;"/>
<vbox style="width:100%">
<hbox>
<spacer flex="1"/>
<label control="PrimaryEmail" value="&PrimaryEmail.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="PrimaryEmail" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="SecondEmail" value="&SecondEmail.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="SecondEmail" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<vbox valign="middle">
<label control="PreferMailFormatPopup" value="&PreferMailFormat.label;"/>
</vbox>
<menulist id="PreferMailFormatPopup" disableforreadonly="true">
<menupopup>
<menuitem value="0" label="&Unknown.label;"/>
<menuitem value="1" label="&PlainText.label;"/>
<menuitem value="2" label="&HTML.label;"/>
</menupopup>
</menulist>
</hbox>
</vbox>
</groupbox>
<groupbox flex="1">
<caption label="&Phones.box;"/>
<vbox style="width:100%">
<hbox>
<spacer flex="1"/>
<label control="WorkPhone" value="&WorkPhone.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="WorkPhone" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="HomePhone" value="&HomePhone.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="HomePhone" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="FaxNumber" value="&FaxNumber.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="FaxNumber" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="PagerNumber" value="&PagerNumber.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="PagerNumber" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="CellularNumber" value="&CellularNumber.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="CellularNumber" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
</vbox>
</groupbox>
</vbox>
<!-- ** Address Tab ** -->
<vbox index="address" flex="1">
<groupbox flex="1">
<caption label="&Home.box;"/>
<vbox style="width:100%">
<hbox>
<spacer flex="1"/>
<label control="HomeAddress" value="&HomeAddress.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="HomeAddress" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="HomeAddress2" value="&HomeAddress2.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="HomeAddress2" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="HomeCity" value="&HomeCity.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="HomeCity" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="HomeState" value="&HomeState.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="HomeState" flex="1" disableforreadonly="true"/>
<spacer class="stateZipSpacer"/>
<label control="HomeZipCode" value="&HomeZipCode.label;" class="CardEditLabel"/>
<textbox id="HomeZipCode" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="HomeCountry" value="&HomeCountry.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="HomeCountry" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="WebPage2" value="&HomeWebPage.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="WebPage2" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
</vbox>
</groupbox>
<groupbox style="width:100%">
<caption label="&Work.box;"/>
<vbox style="width:100%">
<hbox>
<spacer flex="1"/>
<label control="JobTitle" value="&JobTitle.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="JobTitle" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="Department" value="&Department.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="Department" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="Company" value="&Company.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="Company" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="WorkAddress" value="&WorkAddress.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="WorkAddress" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="WorkAddress2" value="&WorkAddress2.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="WorkAddress2" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="WorkCity" value="&WorkCity.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="WorkCity" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="WorkState" value="&WorkState.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="WorkState" flex="1" disableforreadonly="true"/>
<spacer class="stateZipSpacer"/>
<label control="WorkZipCode" value="&WorkZipCode.label;" class="CardEditLabel"/>
<textbox id="WorkZipCode" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="WorkCountry" value="&WorkCountry.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="WorkCountry" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
<hbox>
<spacer flex="1"/>
<label control="WebPage1" value="&WorkWebPage.label;" class="CardEditLabel"/>
<hbox class="CardEditWidth">
<textbox id="WebPage1" flex="1" disableforreadonly="true"/>
</hbox>
</hbox>
</vbox>
</groupbox>
</vbox>
<!-- ** Other Tab ** -->
<vbox index="other" flex="1">
<vbox class="alignBoxWithFieldset">
<hbox flex="1">
<label control="Custom1" value="&Custom1.label;" class="CardEditLabel"/>
<textbox id="Custom1" flex="1" disableforreadonly="true"/>
</hbox>
<hbox flex="1">
<label control="Custom2" value="&Custom2.label;" class="CardEditLabel"/>
<textbox id="Custom2" flex="1" disableforreadonly="true"/>
</hbox>
<hbox flex="1">
<label control="Custom3" value="&Custom3.label;" class="CardEditLabel"/>
<textbox id="Custom3" flex="1" disableforreadonly="true"/>
</hbox>
<hbox flex="1">
<label control="Custom4" value="&Custom4.label;" class="CardEditLabel"/>
<textbox id="Custom4" flex="1" disableforreadonly="true"/>
</hbox>
</vbox>
<groupbox style="width:100%">
<caption label="&Notes.box;"/>
<vbox style="width:100%">
<textbox id="Notes" multiline="true" rows="15" wrap="virtual" disableforreadonly="true"/>
</vbox>
</groupbox>
</vbox>
</tabpanels>
</tabbox>
</vbox>
</overlay>

View File

@@ -1,436 +0,0 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Original Author:
* Paul Hangas <hangas@netscape.com>
*
* Contributor(s):
* Alec Flett <alecf@netscape.com>
* Seth Spitzer <sspitzer@netscape.com>
*/
//NOTE: gAddressBookBundle must be defined and set or this Overlay won't work
var gPrefs = Components.classes["@mozilla.org/preferences-service;1"];
gPrefs = gPrefs.getService();
gPrefs = gPrefs.QueryInterface(Components.interfaces.nsIPrefBranch);
var gMapItURLFormat = gPrefs.getComplexValue("mail.addr_book.mapit_url.format",
Components.interfaces.nsIPrefLocalizedString).data;
var gAddrbookSession = Components.classes["@mozilla.org/addressbook/services/session;1"].getService().QueryInterface(Components.interfaces.nsIAddrBookSession);
var zName;
var zNickname;
var zDisplayName;
var zWork;
var zHome;
var zFax;
var zCellular;
var zPager;
var zCustom1;
var zCustom2;
var zCustom3;
var zCustom4;
var cvData;
function OnLoadCardView()
{
zName = gAddressBookBundle.getString("propertyName") + ": ";
zNickname = gAddressBookBundle.getString("propertyNickname") + ": ";
zDisplayName = gAddressBookBundle.getString("propertyDisplayName") + ": ";
zWork = gAddressBookBundle.getString("propertyWork") + ": ";
zHome = gAddressBookBundle.getString("propertyHome") + ": ";
zFax = gAddressBookBundle.getString("propertyFax") + ": ";
zCellular = gAddressBookBundle.getString("propertyCellular") + ": ";
zPager = gAddressBookBundle.getString("propertyPager") + ": ";
zCustom1 = gAddressBookBundle.getString("propertyCustom1") + ": ";
zCustom2 = gAddressBookBundle.getString("propertyCustom2") + ": ";
zCustom3 = gAddressBookBundle.getString("propertyCustom3") + ": ";
zCustom4 = gAddressBookBundle.getString("propertyCustom4") + ": ";
var doc = document;
/* data for address book, prefixes: "cvb" = card view box
"cvh" = crad view header
"cv" = card view (normal fields) */
cvData = new Object;
// Card View Box
cvData.CardViewBox = doc.getElementById("CardViewInnerBox");
// Title
cvData.CardTitle = doc.getElementById("CardTitle");
// Name section
cvData.cvbName = doc.getElementById("cvbName");
cvData.cvhName = doc.getElementById("cvhName");
cvData.cvNickname = doc.getElementById("cvNickname");
cvData.cvDisplayName = doc.getElementById("cvDisplayName");
cvData.cvEmail1Box = doc.getElementById("cvEmail1Box");
cvData.cvEmail1 = doc.getElementById("cvEmail1");
cvData.cvListNameBox = doc.getElementById("cvListNameBox");
cvData.cvListName = doc.getElementById("cvListName");
cvData.cvEmail2Box = doc.getElementById("cvEmail2Box");
cvData.cvEmail2 = doc.getElementById("cvEmail2");
// Home section
cvData.cvbHome = doc.getElementById("cvbHome");
cvData.cvhHome = doc.getElementById("cvhHome");
cvData.cvHomeAddress = doc.getElementById("cvHomeAddress");
cvData.cvHomeAddress2 = doc.getElementById("cvHomeAddress2");
cvData.cvHomeCityStZip = doc.getElementById("cvHomeCityStZip");
cvData.cvHomeCountry = doc.getElementById("cvHomeCountry");
cvData.cvbHomeMapItBox = doc.getElementById("cvbHomeMapItBox");
cvData.cvHomeMapIt = doc.getElementById("cvHomeMapIt");
cvData.cvHomeWebPageBox = doc.getElementById("cvHomeWebPageBox");
cvData.cvHomeWebPage = doc.getElementById("cvHomeWebPage");
// Other section
cvData.cvbOther = doc.getElementById("cvbOther");
cvData.cvhOther = doc.getElementById("cvhOther");
cvData.cvCustom1 = doc.getElementById("cvCustom1");
cvData.cvCustom2 = doc.getElementById("cvCustom2");
cvData.cvCustom3 = doc.getElementById("cvCustom3");
cvData.cvCustom4 = doc.getElementById("cvCustom4");
cvData.cvNotes = doc.getElementById("cvNotes");
// Description section (mailing lists only)
cvData.cvbDescription = doc.getElementById("cvbDescription");
cvData.cvhDescription = doc.getElementById("cvhDescription");
cvData.cvDescription = doc.getElementById("cvDescription");
// Addresses section (mailing lists only)
cvData.cvbAddresses = doc.getElementById("cvbAddresses");
cvData.cvhAddresses = doc.getElementById("cvhAddresses");
cvData.cvAddresses = doc.getElementById("cvAddresses");
// Phone section
cvData.cvbPhone = doc.getElementById("cvbPhone");
cvData.cvhPhone = doc.getElementById("cvhPhone");
cvData.cvPhWork = doc.getElementById("cvPhWork");
cvData.cvPhHome = doc.getElementById("cvPhHome");
cvData.cvPhFax = doc.getElementById("cvPhFax");
cvData.cvPhCellular = doc.getElementById("cvPhCellular");
cvData.cvPhPager = doc.getElementById("cvPhPager");
// Work section
cvData.cvbWork = doc.getElementById("cvbWork");
cvData.cvhWork = doc.getElementById("cvhWork");
cvData.cvJobTitle = doc.getElementById("cvJobTitle");
cvData.cvDepartment = doc.getElementById("cvDepartment");
cvData.cvCompany = doc.getElementById("cvCompany");
cvData.cvWorkAddress = doc.getElementById("cvWorkAddress");
cvData.cvWorkAddress2 = doc.getElementById("cvWorkAddress2");
cvData.cvWorkCityStZip = doc.getElementById("cvWorkCityStZip");
cvData.cvWorkCountry = doc.getElementById("cvWorkCountry");
cvData.cvbWorkMapItBox = doc.getElementById("cvbWorkMapItBox");
cvData.cvWorkMapIt = doc.getElementById("cvWorkMapIt");
cvData.cvWorkWebPageBox = doc.getElementById("cvWorkWebPageBox");
cvData.cvWorkWebPage = doc.getElementById("cvWorkWebPage");
}
// XXX todo
// some similar code (in spirit) already exists, see OnLoadEditList()
// perhaps we could combine and put in abCommon.js?
function GetAddressesFromURI(uri)
{
var addresses = "";
var editList = GetDirectoryFromURI(uri);
var addressList = editList.addressLists;
if (addressList) {
var total = addressList.Count();
if (total > 0)
addresses = addressList.GetElementAt(0).QueryInterface(Components.interfaces.nsIAbCard).primaryEmail;
for (var i = 1; i < total; i++ ) {
addresses += ", " + addressList.GetElementAt(i).QueryInterface(Components.interfaces.nsIAbCard).primaryEmail;
}
}
return addresses;
}
function DisplayCardViewPane(card)
{
var generatedName = gAddrbookSession.generateNameFromCard(card, gPrefs.getIntPref("mail.addr_book.lastnamefirst"));
var data = top.cvData;
var visible;
var titleString;
if (generatedName == "")
titleString = card.primaryEmail; // if no generatedName, use email
else
titleString = generatedName;
// set fields in card view pane
if (card.isMailList)
cvSetNode(data.CardTitle, gAddressBookBundle.getFormattedString("viewListTitle", [generatedName]));
else
cvSetNode(data.CardTitle, gAddressBookBundle.getFormattedString("viewCardTitle", [titleString]));
// Name section
cvSetNode(data.cvhName, titleString);
cvSetNodeWithLabel(data.cvNickname, zNickname, card.nickName);
if (card.isMailList) {
// email1 and display name always hidden when a mailing list.
cvSetVisible(data.cvEmail1Box, false);
cvSetVisible(data.cvDisplayName, false);
visible = HandleLink(data.cvListName, card.displayName, data.cvListNameBox, "mailto:" + escape(GenerateAddressFromCard(card))) || visible;
}
else {
// listname always hidden if not a mailing list
cvSetVisible(data.cvListNameBox, false);
cvSetNodeWithLabel(data.cvDisplayName, zDisplayName, card.displayName);
visible = HandleLink(data.cvEmail1, card.primaryEmail, data.cvEmail1Box, "mailto:" + card.primaryEmail) || visible;
}
visible = HandleLink(data.cvEmail2, card.secondEmail, data.cvEmail2Box, "mailto:" + card.secondEmail) || visible;
// Home section
visible = cvSetNode(data.cvHomeAddress, card.homeAddress);
visible = cvSetNode(data.cvHomeAddress2, card.homeAddress2) || visible;
visible = cvSetCityStateZip(data.cvHomeCityStZip, card.homeCity, card.homeState, card.homeZipCode) || visible;
visible = cvSetNode(data.cvHomeCountry, card.homeCountry) || visible;
if (visible) {
var homeMapItUrl = CreateMapItURL(card.homeAddress, card.homeAddress2, card.homeCity, card.homeState, card.homeZipCode, card.homeCountry);
if (homeMapItUrl) {
cvSetVisible(data.cvbHomeMapItBox, true);
data.cvHomeMapIt.setAttribute('url', homeMapItUrl);
}
else {
cvSetVisible(data.cvbHomeMapItBox, false);
}
}
else {
cvSetVisible(data.cvbHomeMapItBox, false);
}
visible = HandleLink(data.cvHomeWebPage, card.webPage2, data.cvHomeWebPageBox, card.webPage2) || visible;
cvSetVisible(data.cvhHome, visible);
cvSetVisible(data.cvbHome, visible);
if (card.isMailList) {
// Description section
visible = cvSetNode(data.cvDescription, card.notes)
cvSetVisible(data.cvbDescription, visible);
// Addresses section
visible = cvAddAddressNodes(data.cvAddresses, card.mailListURI);
cvSetVisible(data.cvbAddresses, visible);
// Other section, not shown for mailing lists.
cvSetVisible(data.cvbOther, false);
}
else {
// Other section
visible = cvSetNodeWithLabel(data.cvCustom1, zCustom1, card.custom1);
visible = cvSetNodeWithLabel(data.cvCustom2, zCustom2, card.custom2) || visible;
visible = cvSetNodeWithLabel(data.cvCustom3, zCustom3, card.custom3) || visible;
visible = cvSetNodeWithLabel(data.cvCustom4, zCustom4, card.custom4) || visible;
visible = cvSetNode(data.cvNotes, card.notes) || visible;
cvSetVisible(data.cvhOther, visible);
cvSetVisible(data.cvbOther, visible);
// hide description section, not show for non-mailing lists
cvSetVisible(data.cvbDescription, false);
// hide addresses section, not show for non-mailing lists
cvSetVisible(data.cvbAddresses, false);
}
// Phone section
visible = cvSetNodeWithLabel(data.cvPhWork, zWork, card.workPhone);
visible = cvSetNodeWithLabel(data.cvPhHome, zHome, card.homePhone) || visible;
visible = cvSetNodeWithLabel(data.cvPhFax, zFax, card.faxNumber) || visible;
visible = cvSetNodeWithLabel(data.cvPhCellular, zCellular, card.cellularNumber) || visible;
visible = cvSetNodeWithLabel(data.cvPhPager, zPager, card.pagerNumber) || visible;
cvSetVisible(data.cvhPhone, visible);
cvSetVisible(data.cvbPhone, visible);
// Work section
visible = cvSetNode(data.cvJobTitle, card.jobTitle);
visible = cvSetNode(data.cvDepartment, card.department) || visible;
visible = cvSetNode(data.cvCompany, card.company) || visible;
var addressVisible = cvSetNode(data.cvWorkAddress, card.workAddress);
addressVisible = cvSetNode(data.cvWorkAddress2, card.workAddress2) || addressVisible;
addressVisible = cvSetCityStateZip(data.cvWorkCityStZip, card.workCity, card.workState, card.workZipCode) || addressVisible;
addressVisible = cvSetNode(data.cvWorkCountry, card.workCountry) || addressVisible;
if (addressVisible) {
var workMapItUrl = CreateMapItURL(card.workAddress, card.workAddress2, card.workCity, card.workState, card.workZipCode, card.workCountry);
data.cvWorkMapIt.setAttribute('url', workMapItUrl);
if (workMapItUrl) {
cvSetVisible(data.cvbWorkMapItBox, true);
data.cvWorkMapIt.setAttribute('url', workMapItUrl);
}
else {
cvSetVisible(data.cvbWorkMapItBox, false);
}
}
else {
cvSetVisible(data.cvbWorkMapItBox, false);
}
visible = HandleLink(data.cvWorkWebPage, card.webPage1, data.cvWorkWebPageBox, card.webPage1) || addressVisible || visible;
cvSetVisible(data.cvhWork, visible);
cvSetVisible(data.cvbWork, visible);
// make the card view box visible
cvSetVisible(top.cvData.CardViewBox, true);
}
function ClearCardViewPane()
{
cvSetVisible(top.cvData.CardViewBox, false);
}
function cvSetNodeWithLabel(node, label, text)
{
if ( text )
return cvSetNode(node, label + text);
else
return cvSetNode(node, "");
}
function cvSetCityStateZip(node, city, state, zip)
{
var text = "";
if ( city )
{
text = city;
if ( state || zip )
text += ", ";
}
if ( state )
text += state + " ";
if ( zip )
text += zip;
return cvSetNode(node, text);
}
function cvSetNode(node, text)
{
if ( node )
{
if ( node.childNodes.length == 0 )
{
var textNode = document.createTextNode(text);
node.appendChild(textNode);
}
else if ( node.childNodes.length == 1 )
node.childNodes[0].nodeValue = text;
var visible;
if ( text )
visible = true;
else
visible = false;
cvSetVisible(node, visible);
}
return visible;
}
function cvAddAddressNodes(node, uri)
{
var visible = false;
if ( node )
{
var displayName = "";
var address = "";
var editList = GetDirectoryFromURI(uri);
var addressList = editList.addressLists;
if (addressList) {
var total = addressList.Count();
if (total > 0) {
for (var i = node.childNodes.length - 1; i >= 0; i--) {
node.removeChild(node.childNodes[i]);
}
for (i = 0; i < total; i++ ) {
var descNode = document.createElement("description");
address = addressList.GetElementAt(i).QueryInterface(Components.interfaces.nsIAbCard).primaryEmail;
displayName = addressList.GetElementAt(i).QueryInterface(Components.interfaces.nsIAbCard).displayName;
descNode.setAttribute("class", "CardViewLink");
node.appendChild(descNode);
var linkNode = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
linkNode.setAttribute("id", "addr#" + i);
linkNode.setAttribute("href", "mailto:" + address);
descNode.appendChild(linkNode);
var textNode = document.createTextNode(displayName + " <" + address + ">");
linkNode.appendChild(textNode);
}
visible = true;
}
}
cvSetVisible(node, visible);
}
return visible;
}
function cvSetVisible(node, visible)
{
if ( visible )
node.removeAttribute("collapsed");
else
node.setAttribute("collapsed", "true");
}
function HandleLink(node, value, box, link)
{
var visible = cvSetNode(node, value);
if (visible)
node.setAttribute('href', link);
cvSetVisible(box, visible);
return visible;
}
function MapIt(id)
{
var button = document.getElementById(id);
openTopWin(button.getAttribute('url'));
}
function CreateMapItURL(address1, address2, city, state, zip, country)
{
if (!gMapItURLFormat)
return null;
var urlFormat = gMapItURLFormat.replace("@A1", escape(address1));
urlFormat = urlFormat.replace("@A2", escape(address2));
urlFormat = urlFormat.replace("@CO", escape(country));
urlFormat = urlFormat.replace("@CI", escape(city));
urlFormat = urlFormat.replace("@ST", escape(state));
urlFormat = urlFormat.replace("@ZI", escape(zip));
return urlFormat;
}
function openLink(id)
{
openTopWin(document.getElementById(id).getAttribute("href"));
// return false, so we don't load the href in the addressbook window
return false;
}

View File

@@ -1,132 +0,0 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/abCardViewOverlay.dtd">
<overlay xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/abCardViewOverlay.js"/>
<vbox id="CardViewBox" flex="1">
<vbox id="CardViewInnerBox" collapsed="true" flex="1">
<description id="CardTitle"/>
<hbox style="width:100%" flex="1">
<vbox flex="1">
<vbox id="cvbName" class="cardViewGroup">
<description class="CardViewHeading" id="cvhName"/>
<description class="CardViewLink" id="cvListNameBox">
<html:p><html:a href="" id="cvListName"/></html:p>
</description>
<description class="CardViewText" id="cvDisplayName"/>
<description class="CardViewText" id="cvNickname"/>
<description class="CardViewLink" id="cvEmail1Box">
<html:a href="" id="cvEmail1"/>
</description>
<description class="CardViewLink" id="cvEmail2Box">
<html:a href="" id="cvEmail2"/>
</description>
</vbox>
<vbox id="cvbHome" class="cardViewGroup">
<description class="CardViewHeading" id="cvhHome">&home.heading;</description>
<hbox>
<vbox flex="1">
<description class="CardViewText" id="cvHomeAddress"/>
<description class="CardViewText" id="cvHomeAddress2"/>
<description class="CardViewText" id="cvHomeCityStZip"/>
<description class="CardViewText" id="cvHomeCountry"/>
</vbox>
<vbox id="cvbHomeMapItBox" pack="end">
<button id="cvHomeMapIt" url="" label="&mapItButton.label;" oncommand="MapIt('cvHomeMapIt');" tooltiptext="&mapIt.tooltip;"/>
</vbox>
</hbox>
<description class="CardViewLink" id="cvHomeWebPageBox">
<html:a onclick="return openLink('cvHomeWebPage');" href="" id="cvHomeWebPage"/>
</description>
</vbox>
<vbox id="cvbOther" class="cardViewGroup">
<description class="CardViewHeading" id="cvhOther">&other.heading;</description>
<description class="CardViewText" id="cvCustom1"/>
<description class="CardViewText" id="cvCustom2"/>
<description class="CardViewText" id="cvCustom3"/>
<description class="CardViewText" id="cvCustom4"/>
<description class="CardViewText" id="cvNotes"/>
</vbox>
<vbox id="cvbDescription" class="cardViewGroup">
<description class="CardViewHeading" id="cvhDescription">&description.heading;</description>
<description class="CardViewText" id="cvDescription"/>
</vbox>
<vbox id="cvbAddresses" class="cardViewGroup">
<description class="CardViewHeading" id="cvhAddresses">&addresses.heading;</description>
<vbox id="cvAddresses"/>
</vbox>
</vbox>
<spacer style="width:20px"/>
<vbox flex="1">
<vbox id="cvbPhone" class="cardViewGroup">
<description class="CardViewHeading" id="cvhPhone">&phone.heading;</description>
<description class="CardViewText" id="cvPhWork"/>
<description class="CardViewText" id="cvPhHome"/>
<description class="CardViewText" id="cvPhFax"/>
<description class="CardViewText" id="cvPhCellular"/>
<description class="CardViewText" id="cvPhPager"/>
</vbox>
<vbox id="cvbWork" class="cardViewGroup">
<description class="CardViewHeading" id="cvhWork">&work.heading;</description>
<description class="CardViewText" id="cvJobTitle"/>
<description class="CardViewText" id="cvDepartment"/>
<description class="CardViewText" id="cvCompany"/>
<hbox>
<vbox flex="1">
<description class="CardViewText" id="cvWorkAddress"/>
<description class="CardViewText" id="cvWorkAddress2"/>
<description class="CardViewText" id="cvWorkCityStZip"/>
<description class="CardViewText" id="cvWorkCountry"/>
</vbox>
<vbox id="cvbWorkMapItBox" pack="end">
<button id="cvWorkMapIt" url="" label="&mapItButton.label;" oncommand="MapIt('cvWorkMapIt');" tooltiptext="&mapIt.tooltip;"/>
</vbox>
</hbox>
<description class="CardViewLink" id="cvWorkWebPageBox">
<html:a onclick="return openLink('cvWorkWebPage');" href="" id="cvWorkWebPage"/>
</description>
</vbox>
</vbox>
</hbox>
</vbox>
</vbox>
</overlay>

View File

@@ -1,961 +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 Addressbook.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corp.
* Portions created by the Initial Developer are Copyright (C) 1999-2001
* the Initial Developer. All Rights Reserved.
*
* Original Author:
* Paul Hangas <hangas@netscape.com>
*
* Contributor(s):
* Seth Spitzer <sspitzer@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 ***** */
var gResultsTree = 0;
var dirTree = 0;
var abList = 0;
var gAbView = null;
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
var gPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var gHeaderParser = Components.classes["@mozilla.org/messenger/headerparser;1"].getService(Components.interfaces.nsIMsgHeaderParser);
const kDefaultSortColumn = "GeneratedName";
const kDefaultAscending = "ascending";
const kDefaultDescending = "descending";
const kPersonalAddressbookURI = "moz-abmdbdirectory://abook.mab";
const kCollectedAddressbookURI = "moz-abmdbdirectory://history.mab";
// Controller object for Results Pane
var ResultsPaneController =
{
supportsCommand: function(command)
{
switch (command) {
case "cmd_selectAll":
case "cmd_delete":
case "button_delete":
case "button_edit":
return true;
default:
return false;
}
},
isCommandEnabled: function(command)
{
switch (command) {
case "cmd_selectAll":
return true;
case "cmd_delete":
case "button_delete":
var numSelected;
var enabled = false;
if (gAbView && gAbView.selection) {
if (gAbView.directory)
enabled = gAbView.directory.operations & gAbView.directory.opWrite;
numSelected = gAbView.selection.count;
}
else
numSelected = 0;
// fix me, don't update on isCommandEnabled
if (command == "cmd_delete") {
if (numSelected < 2)
goSetMenuValue(command, "valueCard");
else
goSetMenuValue(command, "valueCards");
}
return (enabled && (numSelected > 0));
case "button_edit":
return (GetSelectedCardIndex() != -1);
default:
return false;
}
},
doCommand: function(command)
{
switch (command) {
case "cmd_selectAll":
if (gAbView)
gAbView.selectAll();
break;
case "cmd_delete":
case "button_delete":
AbDelete();
break;
case "button_edit":
AbEditSelectedCard();
break;
}
},
onEvent: function(event)
{
// on blur events set the menu item texts back to the normal values
if (event == "blur")
goSetMenuValue("cmd_delete", "valueDefault");
}
};
// Controller object for Dir Pane
var DirPaneController =
{
supportsCommand: function(command)
{
switch (command) {
case "cmd_selectAll":
case "cmd_delete":
case "button_delete":
case "button_edit":
return true;
default:
return false;
}
},
isCommandEnabled: function(command)
{
switch (command) {
case "cmd_selectAll":
return true;
case "cmd_delete":
case "button_delete":
if (command == "cmd_delete")
goSetMenuValue(command, "valueAddressBook");
var selectedDir = GetSelectedDirectory();
if (selectedDir) {
// If the selected directory is an ldap directory
// and if the prefs for this directory are locked
// disable the delete button.
var ldapUrlPrefix = "moz-abldapdirectory://";
if ((selectedDir.indexOf(ldapUrlPrefix, 0)) == 0)
{
var prefName = selectedDir.substr(ldapUrlPrefix.length, selectedDir.length);
var disable = false;
try {
disable = gPrefs.getBoolPref(prefName + ".disable_delete");
}
catch(ex){
// if this preference is not set its ok.
}
if (disable)
return false;
}
return true;
}
else
return false;
case "button_edit":
var selectedDir = GetSelectedDirectory();
if (selectedDir) {
var directory = GetDirectoryFromURI(selectedDir);
if ((directory.isMailList) ||
(!(directory.operations & directory.opWrite)))
return true;
}
return false;
default:
return false;
}
},
doCommand: function(command)
{
switch (command) {
case "cmd_selectAll":
if (dirTree)
dirTree.treeBoxObject.selection.selectAll();
break;
case "cmd_delete":
case "button_delete":
if (dirTree)
AbDeleteDirectory();
break;
case "button_edit":
AbEditSelectedDirectory();
break;
}
},
onEvent: function(event)
{
// on blur events set the menu item texts back to the normal values
if (event == "blur")
goSetMenuValue("cmd_delete", "valueDefault");
}
};
function AbEditSelectedDirectory()
{
if (dirTree.treeBoxObject.selection.count == 1) {
var mailingListUri = GetSelectedDirectory();
var directory = GetDirectoryFromURI(mailingListUri);
if (directory.isMailList) {
var dirUri = GetParentDirectoryFromMailingListURI(mailingListUri);
goEditListDialog(dirUri, null, mailingListUri, UpdateCardView);
}
else if (!(directory.operations & directory.opWrite))
{
var ldapUrlPrefix = "moz-abldapdirectory://";
if ((mailingListUri.indexOf(ldapUrlPrefix, 0)) == 0)
{
var args = { selectedDirectory: directory.dirName,
selectedDirectoryString: null};
args.selectedDirectoryString = mailingListUri.substr(ldapUrlPrefix.length, mailingListUri.length);
window.openDialog("chrome://messenger/content/addressbook/pref-directory-add.xul",
"editDirectory", "chrome,modal=yes,resizable=no,centerscreen", args);
}
}
}
}
function GetParentRow(aTree, aRow)
{
var row = aRow;
var level = aTree.view.getLevel(row);
var parentLevel = level;
while (parentLevel >= level) {
row--;
if (row == -1)
return row;
parentLevel = aTree.view.getLevel(row);
}
return row;
}
function InitCommonJS()
{
dirTree = document.getElementById("dirTree");
abList = document.getElementById("addressbookList");
gResultsTree = document.getElementById("abResultsTree");
}
// builds prior to 12-08-2001 did not use an tree for
// the results pane. so for any existing profiles will
// get all columns, whereas new profile only get a select few
// because we hide them by default in localStore.rdf
// to work around this, we hide the non-default columns once.
// there is more than one results pane (addressbook, select addresses,
// addressbook sidebar channel, etc) so we'll pass in the
// the pref so that we'll migrate each of them once.
function UpgradeAddressBookResultsPaneUI(prefName)
{
var resultsPaneUIVersion;
try {
resultsPaneUIVersion = gPrefs.getIntPref(prefName);
if (resultsPaneUIVersion == 1) {
// hide all columns with hiddenbydefault="true"
var elements = document.getElementsByAttribute("hiddenbydefault","true");
for (var i=0; i<elements.length; i++) {
elements[i].setAttribute("hidden","true");
}
gPrefs.setIntPref(prefName, 2);
}
}
catch (ex) {
dump("UpgradeAddressBookResultsPaneUI " + prefName + " ex = " + ex + "\n");
}
}
function SetupAbCommandUpdateHandlers()
{
// dir pane
if (dirTree)
dirTree.controllers.appendController(DirPaneController);
// results pane
if (gResultsTree)
gResultsTree.controllers.appendController(ResultsPaneController);
}
function AbDelete()
{
if (gAbView)
gAbView.deleteSelectedCards();
}
function AbNewCard(abListItem)
{
var selectedAB = GetSelectedAddressBookDirID(abListItem);
goNewCardDialog(selectedAB);
}
// NOTE, will return -1 if more than one card selected, or no cards selected.
function GetSelectedCardIndex()
{
if (!gAbView)
return -1;
var treeSelection = gAbView.selection;
if (treeSelection.getRangeCount() == 1) {
var start = new Object;
var end = new Object;
treeSelection.getRangeAt(0,start,end);
if (start.value == end.value)
return start.value;
}
return -1;
}
// NOTE, returns the card if exactly one card is selected, null otherwise
function GetSelectedCard()
{
var index = GetSelectedCardIndex();
if (index == -1)
return null;
else
return gAbView.getCardFromRow(index);
}
function AbEditSelectedCard()
{
AbEditCard(GetSelectedCard());
}
function AbEditCard(card)
{
if (!card)
return;
if (card.isMailList) {
goEditListDialog(gAbView.URI, card, card.mailListURI, UpdateCardView);
}
else {
goEditCardDialog(gAbView.URI, card, UpdateCardView);
}
}
function AbNewMessage()
{
var msgComposeType = Components.interfaces.nsIMsgCompType;
var msgComposFormat = Components.interfaces.nsIMsgCompFormat;
var msgComposeService = Components.classes["@mozilla.org/messengercompose;1"].getService();
msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMsgComposeService);
var params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams);
if (params)
{
params.type = msgComposeType.New;
params.format = msgComposFormat.Default;
var composeFields = Components.classes["@mozilla.org/messengercompose/composefields;1"].createInstance(Components.interfaces.nsIMsgCompFields);
if (composeFields)
{
if (DirPaneHasFocus())
composeFields.to = GetSelectedAddressesFromDirTree();
else
composeFields.to = GetSelectedAddresses();
params.composeFields = composeFields;
msgComposeService.OpenComposeWindowWithParams(null, params);
}
}
}
function GetOneOrMoreCardsSelected()
{
if (!gAbView)
return false;
return (gAbView.selection.getRangeCount() > 0);
}
// XXX todo
// could this be moved into utilityOverlay.js?
function goToggleSplitter( id, elementID )
{
var splitter = document.getElementById( id );
var element = document.getElementById( elementID );
if ( splitter )
{
var attribValue = splitter.getAttribute("state") ;
if ( attribValue == "collapsed" )
{
splitter.setAttribute("state", "open" );
if ( element )
element.setAttribute("checked","true")
}
else
{
splitter.setAttribute("state", "collapsed");
if ( element )
element.setAttribute("checked","false")
}
document.persist(id, 'state');
document.persist(elementID, 'checked');
}
}
// Generate a list of cards from the selected mailing list
// and get a comma separated list of card addresses. If the
// item selected in the directory pane is not a mailing list,
// an empty string is returned.
function GetSelectedAddressesFromDirTree()
{
var addresses = "";
if (dirTree.currentIndex >= 0) {
var selected = dirTree.contentView.getItemAtIndex(dirTree.currentIndex);
var mailingListUri = selected.id;
var directory = GetDirectoryFromURI(mailingListUri);
if (directory.isMailList) {
var listCardsCount = directory.addressLists.Count();
var cards = new Array(listCardsCount);
for ( var i = 0; i < listCardsCount; i++ ) {
var card = directory.addressLists.GetElementAt(i);
card = card.QueryInterface(Components.interfaces.nsIAbCard);
cards[i] = card;
}
addresses = GetAddressesForCards(cards);
}
}
return addresses;
}
function GetSelectedAddresses()
{
var selectedCards = GetSelectedAbCards();
return GetAddressesForCards(selectedCards);
}
// Generate a comma seperate list of addresses from a given
// set of cards.
function GetAddressesForCards(cards)
{
var addresses = "";
if (!cards)
return addresses;
var count = cards.length;
if (count > 0)
addresses += GenerateAddressFromCard(cards[0]);
for (var i = 1; i < count; i++) {
var generatedAddress = GenerateAddressFromCard(cards[i]);
if (generatedAddress)
addresses += "," + generatedAddress;
}
return addresses;
}
function GetNumSelectedCards()
{
try {
var treeSelection = gAbView.selection;
return treeSelection.count;
}
catch (ex) {
}
// if something went wrong, return 0 for the count.
return 0;
}
// XXX todo
// an optimization might be to make this return
// the selected ranges, which would be faster
// when the user does large selections, but for now, let's keep it simple.
function GetSelectedRows()
{
var selectedRows = "";
if (!gAbView)
return selectedRows;
var i,j;
var rangeCount = gAbView.selection.getRangeCount();
var current = 0;
for (i=0; i < rangeCount; i++) {
var start = new Object;
var end = new Object;
gAbView.selection.getRangeAt(i,start,end);
for (j=start.value;j<=end.value;j++) {
if (selectedRows)
selectedRows += ",";
selectedRows += j;
}
}
return selectedRows;
}
function GetSelectedAbCards()
{
var abView = gAbView;
// if sidebar is open, and addressbook panel is open and focused,
// then use the ab view from sidebar (gCurFrame is from sidebarOverlay.js)
const abPanelUrl = "chrome://messenger/content/addressbook/addressbook-panel.xul";
if (document.getElementById("sidebar-box")) {
if (gCurFrame &&
gCurFrame.getAttribute("src") == abPanelUrl &&
document.commandDispatcher.focusedWindow == gCurFrame.contentDocument.defaultView)
{
abView = gCurFrame.contentDocument.defaultView.gAbView;
}
}
if (!abView)
return null;
var cards = new Array(abView.selection.count);
var i,j;
var count = abView.selection.getRangeCount();
var current = 0;
for (i=0; i < count; i++) {
var start = new Object;
var end = new Object;
abView.selection.getRangeAt(i,start,end);
for (j=start.value;j<=end.value;j++) {
cards[current] = abView.getCardFromRow(j);
current++;
}
}
return cards;
}
function SelectFirstAddressBook()
{
dirTree.treeBoxObject.selection.select(0);
ChangeDirectoryByURI(GetSelectedDirectory());
}
function SelectFirstCard()
{
if (gAbView && gAbView.selection) {
gAbView.selection.select(0);
}
}
function DirPaneClick(event)
{
// we only care about left button events
if (event.button != 0)
return;
var searchInput = document.getElementById("searchInput");
// if there is a searchInput element, and it's not blank
// then we need to act like the user cleared the
// search text
if (searchInput && searchInput.value) {
searchInput.value = "";
onEnterInSearchBar();
}
}
function DirPaneDoubleClick()
{
if (dirTree && dirTree.treeBoxObject.selection && dirTree.treeBoxObject.selection.count == 1)
AbEditSelectedDirectory();
}
function DirPaneSelectionChange()
{
if (dirTree && dirTree.treeBoxObject.selection && dirTree.treeBoxObject.selection.count == 1)
ChangeDirectoryByURI(GetSelectedDirectory());
}
function GetAbResultsBoxObject()
{
return GetAbResultsTree().treeBoxObject;
}
var gAbResultsTree = null;
function GetAbResultsTree()
{
if (gAbResultsTree)
return gAbResultsTree;
gAbResultsTree = document.getElementById('abResultsTree');
return gAbResultsTree;
}
function CloseAbView()
{
var boxObject = GetAbResultsBoxObject();
boxObject.view = null;
if (gAbView) {
gAbView.close();
gAbView = null;
}
}
function SetAbView(uri, sortColumn, sortDirection)
{
CloseAbView();
if (!sortColumn)
sortColumn = kDefaultSortColumn;
if (!sortDirection)
sortDirection = kDefaultAscending;
gAbView = Components.classes["@mozilla.org/addressbook/abview;1"].createInstance(Components.interfaces.nsIAbView);
var actualSortColumn = gAbView.init(uri, GetAbViewListener(), sortColumn, sortDirection);
var boxObject = GetAbResultsBoxObject();
boxObject.view = gAbView.QueryInterface(Components.interfaces.nsITreeView);
return actualSortColumn;
}
function GetAbView()
{
return gAbView;
}
function GetAbViewURI()
{
if (gAbView)
return gAbView.URI;
else
return null;
}
function ChangeDirectoryByURI(uri)
{
if (!uri)
uri = kPersonalAddressbookURI;
if (gAbView && gAbView.URI == uri)
return;
var dataNode = document.getElementById(uri);
var sortColumn = dataNode ? dataNode.getAttribute("sortColumn") : kDefaultSortColumn;
var sortDirection = dataNode ? dataNode.getAttribute("sortDirection") : kDefaultAscending;
var actualSortColumn = SetAbView(uri, sortColumn, sortDirection);
UpdateSortIndicators(actualSortColumn, sortDirection);
// only select the first card if there is a first card
if (gAbView && gAbView.getCardFromRow(0)) {
SelectFirstCard();
}
else {
// the selection changes if we were switching directories.
ResultsPaneSelectionChanged()
}
return;
}
function AbSortAscending()
{
var sortColumn = kDefaultSortColumn;
if (gAbView) {
var node = document.getElementById(gAbView.URI);
sortColumn = node.getAttribute("sortColumn");
}
SortAndUpdateIndicators(sortColumn, kDefaultAscending);
}
function AbSortDescending()
{
var sortColumn = kDefaultSortColumn;
if (gAbView) {
var node = document.getElementById(gAbView.URI);
sortColumn = node.getAttribute("sortColumn");
}
SortAndUpdateIndicators(sortColumn, kDefaultDescending);
}
function SortResultPane(sortColumn)
{
var sortDirection = kDefaultAscending;
if (gAbView) {
sortDirection = gAbView.sortDirection;
}
SortAndUpdateIndicators(sortColumn, sortDirection);
}
function SortAndUpdateIndicators(sortColumn, sortDirection)
{
// XXX todo remove once #116341 is fixed
if (!sortColumn)
return;
UpdateSortIndicators(sortColumn, sortDirection);
if (gAbView)
gAbView.sortBy(sortColumn, sortDirection);
SaveSortSetting(sortColumn, sortDirection);
}
function SaveSortSetting(column, direction)
{
if (dirTree && gAbView) {
var node = document.getElementById(gAbView.URI);
if (node) {
node.setAttribute("sortColumn", column);
node.setAttribute("sortDirection", direction);
}
}
}
function UpdateSortIndicators(colID, sortDirection)
{
var sortedColumn;
// set the sort indicator on the column we are sorted by
if (colID) {
sortedColumn = document.getElementById(colID);
if (sortedColumn) {
sortedColumn.setAttribute("sortDirection",sortDirection);
}
}
// remove the sort indicator from all the columns
// except the one we are sorted by
var currCol = GetAbResultsTree().firstChild.firstChild;
while (currCol) {
if (currCol != sortedColumn && currCol.localName == "treecol")
currCol.removeAttribute("sortDirection");
currCol = currCol.nextSibling;
}
}
function InvalidateResultsPane()
{
var tree = GetAbResultsTree();
if (tree) {
tree.treeBoxObject.invalidate();
}
}
function AbNewList(abListItem)
{
var selectedAB = GetSelectedAddressBookDirID(abListItem);
goNewListDialog(selectedAB);
}
function GetSelectedAddressBookDirID(abListItem)
{
var selectedAB = 0;
var abDirEntries = document.getElementById(abListItem);
if (abDirEntries && abDirEntries.localName == "tree" && abDirEntries.currentIndex >= 0) {
var selected = abDirEntries.contentView.getItemAtIndex(abDirEntries.currentIndex);
selectedAB = selected.id;
}
// request could be coming from the context menu of addressbook panel in sidebar
// addressbook dirs are listed as menu item. So, get the selected item id.
if (!selectedAB && abDirEntries && abDirEntries.localName == "menulist" && abDirEntries.selectedItem)
selectedAB = abDirEntries.selectedItem.getAttribute("id");
// if we do not have a selected ab still, use personal addressbook
if (!selectedAB)
selectedAB = kPersonalAddressbookURI;
return selectedAB;
}
function goNewListDialog(selectedAB)
{
window.openDialog("chrome://messenger/content/addressbook/abMailListDialog.xul",
"",
"chrome,resizable=no,titlebar,modal,centerscreen",
{selectedAB:selectedAB});
}
function goEditListDialog(abURI, abCard, listURI, okCallback)
{
window.openDialog("chrome://messenger/content/addressbook/abEditListDialog.xul",
"",
"chrome,resizable=no,titlebar,modal,centerscreen",
{abURI:abURI, abCard:abCard, listURI:listURI, okCallback:okCallback});
}
function goNewCardDialog(selectedAB)
{
window.openDialog("chrome://messenger/content/addressbook/abNewCardDialog.xul",
"",
"chrome,resizable=no,titlebar,modal,centerscreen",
{selectedAB:selectedAB});
}
function goEditCardDialog(abURI, card, okCallback)
{
window.openDialog("chrome://messenger/content/addressbook/abEditCardDialog.xul",
"",
"chrome,resizable=no,modal,titlebar,centerscreen",
{abURI:abURI, card:card, okCallback:okCallback});
}
function setSortByMenuItemCheckState(id, value)
{
var menuitem = document.getElementById(id);
if (menuitem) {
menuitem.setAttribute("checked", value);
}
}
function InitViewSortByMenu()
{
var sortColumn = kDefaultSortColumn;
var sortDirection = kDefaultAscending;
if (gAbView) {
sortColumn = gAbView.sortColumn;
sortDirection = gAbView.sortDirection;
}
// this approach is necessary to support generic columns that get overlayed.
var elements = document.getElementsByAttribute("name","sortas");
for (var i=0; i<elements.length; i++) {
var cmd = elements[i].getAttribute("id");
var columnForCmd = cmd.split("cmd_SortBy")[1];
setSortByMenuItemCheckState(cmd, (sortColumn == columnForCmd));
}
setSortByMenuItemCheckState("sortAscending", (sortDirection == kDefaultAscending));
setSortByMenuItemCheckState("sortDescending", (sortDirection == kDefaultDescending));
}
function GenerateAddressFromCard(card)
{
if (!card)
return "";
var email;
if (card.isMailList)
{
var directory = GetDirectoryFromURI(card.mailListURI);
if(directory.description)
email = directory.description;
else
email = card.displayName;
}
else
email = card.primaryEmail;
return gHeaderParser.makeFullAddressWString(card.displayName, email);
}
function GetDirectoryFromURI(uri)
{
var directory = rdf.GetResource(uri).QueryInterface(Components.interfaces.nsIAbDirectory);
return directory;
}
// returns null if abURI is not a mailing list URI
function GetParentDirectoryFromMailingListURI(abURI)
{
var abURIArr = abURI.split("/");
/*
turn turn "moz-abmdbdirectory://abook.mab/MailList6"
into ["moz-abmdbdirectory:","","abook.mab","MailList6"]
then, turn ["moz-abmdbdirectory:","","abook.mab","MailList6"]
into "moz-abmdbdirectory://abook.mab"
*/
if (abURIArr.length == 4 && abURIArr[0] == "moz-abmdbdirectory:" && abURIArr[3] != "") {
return abURIArr[0] + "/" + abURIArr[1] + "/" + abURIArr[2];
}
return null;
}
function DirPaneHasFocus()
{
// returns true if diectory pane has the focus. Returns false, otherwise.
return (top.document.commandDispatcher.focusedElement == dirTree)
}
function GetSelectedDirectory()
{
if (dirTree.currentIndex < 0)
return null;
var selected = dirTree.contentView.getItemAtIndex(dirTree.currentIndex);
return selected.id;
}
function onAbSearchKeyPress(event)
{
// 13 == return
if (event && event.keyCode == 13)
onAbSearchInput(true);
}
function onAbSearchInput(returnKeyHit)
{
SearchInputChanged();
if (gSearchTimer) {
clearTimeout(gSearchTimer);
gSearchTimer = null;
}
if (returnKeyHit) {
onEnterInSearchBar();
}
else {
gSearchTimer = setTimeout("onEnterInSearchBar();", 800);
}
}
function SearchInputChanged()
{
var clearButton = document.getElementById("clear");
if (clearButton) {
if (gSearchInput.value && (gSearchInput.value != ""))
clearButton.removeAttribute("disabled");
else
clearButton.setAttribute("disabled", "true");
}
}
function onAbClearSearch()
{
if (gSearchInput)
gSearchInput.value =""; //on input does not get fired for some reason
onAbSearchInput(true);
}

View File

@@ -1,82 +0,0 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributors:
Seth Spitzer <sspitzer@netscape.com>
-->
<?xml-stylesheet href="chrome://messenger/skin/addressbook/addressPanes.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/abDirTreeOverlay.dtd">
<overlay xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/abDragDrop.js"/>
<!-- FIX ME - remove document.commandDispatcher.updateCommands() when tree selection calls this automatically -->
<tree id="dirTree" class="abDirectory plain" seltype="single"
datasources="rdf:addressdirectory" ref="moz-abdirectory://"
hidecolumnpicker="true"
onselect="DirPaneSelectionChange(); document.commandDispatcher.updateCommands('addrbook-select');"
onclick="DirPaneClick(event);"
ondblclick="DirPaneDoubleClick();"
onblur="goOnEvent(this,'blur')"
ondragover="nsDragAndDrop.dragOver(event, abDirTreeObserver);"
ondragdrop="nsDragAndDrop.drop(event, abDirTreeObserver);">
<treecols>
<treecol id="DirCol" flex="1" primary="true" hideheader="true"/>
</treecols>
<template>
<rule>
<conditions>
<content uri="?container"/>
<member container="?container" child="?member"/>
</conditions>
<bindings>
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#DirName"
object="?DirName"/>
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#IsMailList"
object="?IsMailList"/>
<binding subject="?member"
predicate="http://home.netscape.com/NC-rdf#IsRemote"
object="?IsRemote"/>
</bindings>
<action>
<treechildren>
<treeitem uri="?member" persist="sortDirection sortColumn open">
<treerow>
<treecell label="?DirName" properties="IsMailList-?IsMailList IsRemote-?IsRemote"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
</template>
</tree>
</overlay>

View File

@@ -1,173 +0,0 @@
/* -*- Mode: Java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Seth Spitzer <sspitzer@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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var abResultsPaneObserver = {
onDragStart: function (aEvent, aXferData, aDragAction)
{
aXferData.data = new TransferData();
var selectedRows = GetSelectedRows();
var selectedAddresses = GetSelectedAddresses();
aXferData.data.addDataForFlavour("moz/abcard", selectedRows);
aXferData.data.addDataForFlavour("text/x-moz-address", selectedAddresses);
},
onDrop: function (aEvent, aXferData, aDragSession)
{
},
onDragExit: function (aEvent, aDragSession)
{
},
onDragOver: function (aEvent, aFlavour, aDragSession)
{
},
getSupportedFlavours: function ()
{
return null;
}
};
var abDirTreeObserver = {
onDragStart: function (aEvent, aXferData, aDragAction)
{
},
onDrop: function (aEvent, aXferData, aDragSession)
{
var xferData = aXferData.data.split("\n");
var row = {}, col = {}, obj = {};
dirTree.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY, row, col, obj);
if (row.value >= dirTree.view.rowCount || row.value < 0) return;
var item = dirTree.contentView.getItemAtIndex(row.value);
var targetURI = item.id;
var directory = GetDirectoryFromURI(targetURI);
var abView = GetAbView();
var rows = xferData[0].split(",");
var numrows = rows.length;
var srcURI = GetAbViewURI();
if (srcURI == targetURI) {
// should not be here
return;
}
var result;
var needToCopyCard = true;
if (srcURI.length > targetURI.length) {
result = srcURI.split(targetURI);
if (result[0] != srcURI) {
// src directory is a mailing list on target directory, no need to copy card
needToCopyCard = false;
}
}
else {
result = targetURI.split(srcURI);
if (result[0] != targetURI) {
// target directory is a mailing list on src directory, no need to copy card
needToCopyCard = false;
}
}
// if we still think we have to copy the card,
// check if srcURI and targetURI are mailing lists on same directory
// if so, we don't have to copy the card
if (needToCopyCard) {
var targetParentURI = GetParentDirectoryFromMailingListURI(targetURI);
if (targetParentURI && (targetParentURI == GetParentDirectoryFromMailingListURI(srcURI)))
needToCopyCard = false;
}
for (var i=0;i<numrows;i++) {
var card = abView.getCardFromRow(rows[i]);
directory.dropCard(card, needToCopyCard);
}
var statusText = document.getElementById("statusText");
// XXX get this approved, move it to a string bundle
statusText.setAttribute("label", i + " Card(s) Copied");
},
onDragExit: function (aEvent, aDragSession)
{
},
onDragOver: function (aEvent, aFlavour, aDragSession)
{
if (aEvent.target.localName != "treechildren") {
aDragSession.canDrop = false;
return false;
}
var row = {}, col = {}, obj = {};
dirTree.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY, row, col, obj);
if (row.value >= dirTree.view.rowCount || row.value < 0) return;
var item = dirTree.contentView.getItemAtIndex(row.value);
var targetURI = item.id;
var srcURI = GetAbViewURI();
// you can't drop a card onto the directory it comes from
if (targetURI == srcURI) {
aDragSession.canDrop = false;
return false;
}
// determine if we dragging from a mailing list on a directory x to the parent (directory x).
// if so, don't allow the drop
var result = srcURI.split(targetURI);
if (result != srcURI) {
aDragSession.canDrop = false;
return false;
}
return true;
},
getSupportedFlavours: function ()
{
var flavourSet = new FlavourSet();
flavourSet.appendFlavour("moz/abcard");
return flavourSet;
}
};

View File

@@ -1,43 +0,0 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
-->
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://messenger/content/addressbook/abCardOverlay.xul"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="abcardWindow"
onload="OnLoadEditCard()"
class="dialog">
<keyset id="editCardDialogKeys">
<key keycode="VK_ENTER" oncommand="OnEditCardEnter();"/>
<key keycode="VK_RETURN" oncommand="OnEditCardEnter();"/>
<key keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<stringbundleset id="stringbundleset"/>
<vbox id="editcard"/>
<hbox id="okCancelButtons"/>
</window>

Some files were not shown because too many files have changed in this diff Show More