Compare commits

...

13 Commits

Author SHA1 Message Date
ltabb
afabb8c095 move forward in time
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@793 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-28 21:39:40 +00:00
ltabb
c75fa194f3 akanas change
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@782 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-28 19:08:40 +00:00
ltabb
090c9d45ba move changes to new branch
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@772 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-28 17:54:08 +00:00
(no author)
a5b2cc606f This commit was manufactured by cvs2svn to create branch 'MAILTO_BRANCH'.
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@761 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-28 09:09:55 +00:00
brade
e2ce3d1da5 add missing include for Macintosh
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@688 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-26 22:41:24 +00:00
akkana
9a3f31e3b5 Fix 'send page' and undefined symbols on Unix
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@47 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-06 20:41:52 +00:00
akkana
b247fe5236 Fix 'send page'; fix undefined symbols
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@46 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-06 20:32:54 +00:00
akkana
7da1bac960 tweaks that didn't get in in the previous checkin
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@40 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-02 03:18:21 +00:00
akkana
9996b626ff tweaks that didn't get in in the last checkin
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@39 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-02 03:16:19 +00:00
akkana
438f5025e5 Make free mail compose work on Unix
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@38 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-01 21:34:38 +00:00
akkana
6206795eab Make free mail compose work on Unix.
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@37 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-01 21:34:08 +00:00
akkana
851c8f28c0 Changes to free mail compose.
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@36 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-01 21:31:05 +00:00
(no author)
c412958d43 This commit was manufactured by cvs2svn to create branch 'MAILTO_BRANCH'.
git-svn-id: svn://10.0.0.236/branches/MAILTO_BRANCH@35 18797224-902f-48f8-a5cc-f745e15eee43
1998-03-31 19:19:57 +00:00
65 changed files with 44263 additions and 541 deletions

View File

@@ -1,248 +0,0 @@
# Three different line formats are valid:
# key -a aliases...
# key [options] directory
# key [options] directory files...
#
# Where "options" are composed of:
# -i prog Run "prog" on "cvs commit" from top-level of module.
# -o prog Run "prog" on "cvs checkout" of module.
# -e prog Run "prog" on "cvs export" of module.
# -t prog Run "prog" on "cvs rtag" of module.
# -u prog Run "prog" on "cvs update" of module.
# -d dir Place module in directory "dir" instead of module name.
# -l Top-level directory only -- do not recurse.
#
# NOTE: If you change any of the "Run" options above, you'll have to
# release and re-checkout any working directories of these modules.
#
# And "directory" is a path to a directory relative to $CVSROOT.
#
# The "-a" option specifies an alias. An alias is interpreted as if
# everything on the right of the "-a" had been typed on the command line.
#
# You can encode a module within a module by using the special '&'
# character to interpose another module into the current module. This
# can be useful for creating a module that consists of many directories
# spread out over the entire source repository.
ClientSourceProduct -a \
ClientSourceProductWin \
ClientSourceProductMac \
ClientSourceProductUnix \
ClientSourceProductWin -a MozillaCommon MozillaWinOnly
ClientSourceProductMac -a MozillaCommon MozillaMacOnly
ClientSourceProductUnix -a MozillaCommon MozillaUnixOnly
MozillaCommon -a \
ns/LEGAL \
ns/LICENSE \
ns/build \
ns/include \
ns/jpeg \
ns/js \
ns/lib/htmldlgs \
ns/lib/layout \
ns/lib/libcnv \
ns/lib/libi18n \
ns/lib/liblayer \
ns/lib/libmisc \
ns/lib/libmime \
ns/lib/libmocha \
ns/lib/libnet \
ns/lib/libparse \
ns/lib/libpics \
ns/lib/libpwcac \
ns/lib/libstyle \
ns/lib/plugin \
ns/lib/xlate \
ns/lib/xp \
ns/modules/edtplug/src \
ns/modules/edtplug/include \
ns/modules/libfont/classes \
ns/modules/libfont/public \
ns/modules/libfont/src \
ns/modules/libhook \
ns/modules/libimg \
ns/modules/libpref \
ns/modules/libreg \
ns/modules/libutil \
ns/modules/progress/src \
ns/modules/rdf \
ns/modules/schedulr \
ns/modules/security/freenav \
ns/modules/zlib/src \
ns/nav-java/stubs \
ns/nsprpub \
ns/xpcom \
ns/l10n \
ns/nsprpub \
ns/dbm \
ns/modules/schedulr
MozillaWinOnly -a \
ns/client.mak \
ns/cmd/makefile.win \
ns/cmd/wincom \
ns/cmd/winfe \
ns/config \
ns/lib/makefile.win \
ns/modules/coreincl \
ns/modules/edtplug/makefile.win \
ns/makefile.win \
ns/modules/libfont/jmcgen \
ns/modules/libfont/makefile.win \
ns/modules/libfont/producers/makefile.win \
ns/modules/libfont/producers/win \
ns/modules/libfont/producers/win/classes \
ns/modules/libfont/producers/win/classes/netscape \
ns/modules/libfont/producers/win/classes/netscape/fonts \
ns/modules/libfont/producers/win/src \
ns/modules/makefile.win \
ns/modules/progress/makefile.win \
ns/modules/progress/public \
ns/modules/security/makefile.win \
ns/modules/zlib/makefile.win \
ns/nav-java/makefile.win \
JavaStubWin
MozillaUnixOnly -a \
ns/cmd/Makefile \
ns/cmd/stubfe \
ns/cmd/xfe \
ns/config/.cvsignore \
ns/config/AIX.mk \
ns/config/BSD_OS.mk \
ns/config/bsdecho.c \
ns/config/bsdecho.c \
ns/config/clobber_miss.pl \
ns/config/clobber_miss.pl \
ns/config/common.mk \
ns/config/common.mk \
ns/config/config.guess \
ns/config/config.mk \
ns/config/coreconf.mk \
ns/config/coreconf.mk \
ns/config/cvsco.pl \
ns/config/cvsco.pl \
ns/config/fastcwd.pl \
ns/config/fastcwd.pl \
ns/config/FreeBSD.mk \
ns/config/gtscc.c \
ns/config/HP-UX.mk \
ns/config/IRIX.mk \
ns/config/Linux.mk \
ns/config/makecopy.c \
ns/config/makecopy.c \
ns/config/Makefile \
ns/config/Makefile \
ns/config/mangle.c \
ns/config/mangle.c \
ns/config/mantomak.c \
ns/config/mantomak.c \
ns/config/mkdepend \
ns/config/NCR.mk \
ns/config/NEC.mk \
ns/config/NEWS-OS.mk \
ns/config/NEXTSTEP.mk \
ns/config/nfspwd.pl \
ns/config/nfspwd.pl \
ns/config/nodl.pl \
ns/config/nodl.pl \
ns/config/nsinstall.c \
ns/config/nsinstall.c \
ns/config/OSF1.mk \
ns/config/outofdate.pl \
ns/config/outofdate.pl \
ns/config/pathsub.c \
ns/config/pathsub.c \
ns/config/pathsub.h \
ns/config/pathsub.h \
ns/config/pkg2dpth.pl \
ns/config/pkg2dpth.pl \
ns/config/ports \
ns/config/revdepth.pl \
ns/config/revdepth.pl \
ns/config/Rhapsody.mk \
ns/config/rules.mk \
ns/config/SCOOS.mk \
ns/config/SINIX.mk \
ns/config/sj.pl \
ns/config/sj.pl \
ns/config/SunOS.mk \
ns/config/SunOS4.mk \
ns/config/SunOS5.mk \
ns/config/UNIXWARE.mk \
ns/config/xmversion.sh \
ns/lib/Makefile \
ns/Makefile \
ns/modules/edtplug/Makefile \
ns/modules/libfont/jmcgen \
ns/modules/libfont/Makefile \
ns/modules/libfont/producers/Makefile \
ns/modules/Makefile \
ns/modules/progress/Makefile \
ns/modules/progress/public \
ns/modules/security/Makefile \
ns/modules/softupdt/Makefile \
ns/modules/zlib/Makefile \
ns/nav-java/Makefile \
ns/lib/mariner \
JavaStubUnix
MozillaMacOnly -a \
ns/cmd/macfe \
ns/lib/mac/AutoAdmin \
ns/lib/mac/Includes \
ns/lib/mac/MacMemoryAllocator \
ns/lib/mac/Misc \
ns/lib/mac/MoreFiles \
ns/lib/mac/NSRuntime \
ns/lib/mac/NSStdLib \
ns/lib/mac/patches \
ns/lib/mac/PowerPlant \
ns/lib/mac/UserInterface \
ns/modules/coreincl \
ns/modules/edtplug/classes \
ns/modules/edtplug/macbuild \
ns/modules/libfont/jmcgen/include \
ns/modules/libfont/jmcgen/src \
ns/modules/libfont/macbuild \
ns/modules/progress/macbuild \
ns/modules/progress/public \
ns/modules/zlib/macbuild \
ns/lib/mariner \
JavaStubMac
JavaStubAll -a \
JavaStubWin \
JavaStubMac \
JavaStubUnix
JavaStubCore -a \
ns/sun-java/stubs/include \
ns/sun-java/stubs/src
JavaStubMac -a \
JavaStubCore \
ns/sun-java/stubs/macbuild \
ns/sun-java/stubs/macjri
JavaStubUnix -a \
JavaStubCore \
ns/sun-java/Makefile \
ns/sun-java/stubs/jri \
ns/sun-java/stubs/Makefile
JavaStubWin -a \
JavaStubCore \
ns/sun-java/makefile.win \
ns/sun-java/stubs/jri \
ns/sun-java/stubs/makefile.win

View File

@@ -0,0 +1,50 @@
/* -*- 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.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// CSecureAttachment.cp
#pragma once
#include "CSecureAttachment.h"
#include "xp_core.h"
#include "secnav.h"
#include "secrng.h"
CSecureAttachment::CSecureAttachment()
: LAttachment(msg_Event)
{
mTickCounter = 0;
}
void CSecureAttachment::ExecuteSelf(
MessageT inMessage,
void *ioParam)
{
if (mTickCounter < 500)
{
EventRecord* theEvent = (EventRecord*)ioParam;
RNG_RandomUpdate(theEvent, sizeof(EventRecord));
long ticks = ::TickCount();
RNG_RandomUpdate(&ticks, sizeof(long));
mTickCounter++;
}
else
delete this;
}

File diff suppressed because it is too large Load Diff

3875
mozilla/cmd/winfe/fegui.cpp Executable file

File diff suppressed because it is too large Load Diff

2031
mozilla/cmd/winfe/nsapp.cpp Normal file

File diff suppressed because it is too large Load Diff

123
mozilla/cmd/winfe/stdafx.h Normal file
View File

@@ -0,0 +1,123 @@
/* -*- 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.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef STDAFX_PCH
#define STDAFX_PCH
#define OEMRESOURCE
#if defined(DEBUG_blythe)
// Set up a flag specific to WFE developers in the client
#define DEBUG_WFE
#endif
/* Very windows specific includes.
*/
/* MFC, KFC, RUN DMC, whatever */
#include <afxwin.h>
#include <afxext.h>
#include <afxpriv.h>
#include <afxole.h>
#include <afxdisp.h>
#include <afxodlgs.h>
#ifdef _WIN32
#include <afxcmn.h>
#endif
/* More XP than anything */
#include "xp.h"
#include "fe_proto.h"
#include "fe_rgn.h"
#include "libi18n.h"
#include "xlate.h"
#include "ntypes.h"
#ifdef EDITOR
#include "edttypes.h"
#endif
#include "xpassert.h"
#include "lo_ele.h"
#include "layers.h"
/* Standard C includes */
#ifndef _WIN32
#include <dos.h>
#endif
#include <malloc.h>
#include <direct.h>
#include <stdarg.h>
#include <time.h>
#include <io.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#ifdef DEBUG
#include <assert.h>
#endif
/* Very windows specific includes.
*/
/* WFE needs a layout file */
extern "C" {
#include "layout.h"
}
/* Some common defines. */
#ifndef _AFXDLL
#define new DEBUG_NEW
#endif
/* All front end forward declarations needed to compile. */
#include "forward.h"
/* Front end Casting macros. */
#include "cast.h"
/* General purpose utilities. */
#include "feutil.h"
/* afxData/sysInfo */
#include "sysinfo.h"
/* Some defines we like everywhere. */
#include "resource.h"
#include "defaults.h"
/* The application include and
* Commonly used, rarely changed headers */
#include "ncapiurl.h"
#include "genedit.h"
#include "genframe.h"
#include "genview.h"
#include "gendoc.h"
#include "intlwin.h"
#include "mozilla.h"
#include "cxwin.h"
#include "winproto.h"
#ifdef DEBUG
#ifdef assert
#undef assert
#endif
#define assert(x) ASSERT(x)
#endif
#endif /* STDAFX_PCH */

View File

@@ -118,7 +118,6 @@ CSRCS = \
strings.c \
visual.c \
MozillaWm.c \
lite_stubs.c \
commands.c \
dialogs.c \
hot.c \
@@ -145,6 +144,12 @@ CSRCS += \
$(NULL)
endif
ifndef MOZ_MAIL_COMPOSE
CSRCS += \
lite_stubs.c \
$(NULL)
endif
ifndef NO_UNIX_ASYNC_DNS
CSRCS += xfe-dns.c
endif
@@ -259,6 +264,13 @@ BASIC_LIBS += \
$(NULL)
endif
ifdef MOZ_MAIL_COMPOSE
BASIC_LIBS += \
$(DIST)/lib/libmailto.a \
$(DIST)/lib/libmime.a \
$(NULL)
endif
BASIC_LIBS += \
$(DIST)/lib/libmisc.a \
$(NULL)

View File

@@ -797,7 +797,7 @@ fe_MakeViewSourceStream (int format_out, void *data_obj,
return stream;
}
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
/* Mailing documents
*/
@@ -840,7 +840,7 @@ fe_mailto_cb (Widget widget, XtPointer closure, XtPointer call_data)
}
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
void
fe_print_cb (Widget widget, XtPointer closure, XtPointer call_data)

View File

@@ -4384,6 +4384,10 @@ fe_attach_dropfunc(Widget dropw, void* closure, fe_dnd_Event type,
#endif /* 0 */
#endif /* MOZ_MAIL_NEWS */
#if MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE
int
FE_GetMessageBody (MSG_Pane* comppane,
char **body,
@@ -4403,7 +4407,6 @@ FE_DoneWithMessageBody(MSG_Pane* comppane, char* body, uint32 body_size)
fe_doneWithMessageBody(context, body, body_size);
}
void
fe_mail_text_modify_cb (Widget text, XtPointer client_data,
XtPointer call_data)
@@ -4414,7 +4417,7 @@ fe_mail_text_modify_cb (Widget text, XtPointer client_data,
/* MSG_MessageBodyEdited(CONTEXT_DATA(context)->comppane); */
}
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
#define cite_abort 0
#define cite_protect_me_from_myself 1

3284
mozilla/cmd/xfe/icons.c Normal file

File diff suppressed because it is too large Load Diff

5215
mozilla/cmd/xfe/mozilla.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,874 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
dialogs.c --- Preference dialogs.
Created: Spence Murray <spence@netscape.com>, 30-Sep-95.
*/
#define PREFS_NET
#define PREFS_SOCKS
#define PREFS_DISK_CACHE
#define PREFS_VERIFY
#define PREFS_CLEAR_CACHE_BUTTONS
#define PREFS_SIG
#define PREFS_NEWS_MAX
#define PREFS_8BIT
/* #define PREFS_EMPTY_TRASH */
/* #define PREFS_QUEUED_DELIVERY */
#include <stdio.h>
#include "mozilla.h"
#include "xlate.h"
#include "xfe.h"
#include "felocale.h"
#include "nslocks.h"
#include "secnav.h"
#include "cert.h"
#include "mozjava.h"
#include "prnetdb.h"
#include "e_kit.h"
#include "pref_helpers.h"
#include "libmocha.h"
#include <Xm/Label.h>
#include <Xm/CascadeBG.h>
#include <Xm/PanedW.h>
#include <Xm/PushB.h>
#include <Xm/ToggleB.h>
#include <Xm/ArrowBG.h>
#ifndef _STDC_
#define _STDC_ 1
#define HACKED_STDC 1
#endif
#include <XmL/Folder.h>
#ifdef HACKED_STDC
#undef HACKED_STDC
#undef _STDC_
#endif
#include "msgcom.h"
#include "libimg.h" /* Image Library public API. */
/* For sys_errlist and sys_nerr */
#include <sys/errno.h>
#if !defined(__FreeBSD__) && !defined(LINUX_GLIBC_2)
extern char *sys_errlist[];
extern int sys_nerr;
#endif
#include "prprf.h"
#include "libi18n.h"
#include "fonts.h"
/* for XP_GetString() */
#include <xpgetstr.h>
extern int XFE_UNKNOWN_ERROR;
extern int XFE_FILE_DOES_NOT_EXIST;
extern int XFE_FTP_PROXY_HOST;
#ifdef MOZ_MAIL_NEWS
extern int XFE_GLOBAL_MAILCAP_FILE;
extern int XFE_GLOBAL_MIME_FILE;
#endif
extern int XFE_GOPHER_PROXY_HOST;
extern int XFE_HOST_IS_UNKNOWN;
extern int XFE_HTTPS_PROXY_HOST;
extern int XFE_HTTP_PROXY_HOST;
extern int XFE_NO_PORT_NUMBER;
#ifdef MOZ_MAIL_NEWS
extern int XFE_MAIL_HOST;
extern int XFE_NEWS_HOST;
extern int XFE_NEWS_RC_DIRECTORY;
extern int XFE_PRIVATE_MAILCAP_FILE;
extern int XFE_PRIVATE_MIME_FILE;
#endif
extern int XFE_SOCKS_HOST;
extern int XFE_TEMP_DIRECTORY;
extern int XFE_WAIS_PROXY_HOST;
extern int XFE_WARNING;
extern int XFE_ERROR_SAVING_OPTIONS;
extern int XFE_GENERAL;
extern int XFE_PASSWORDS;
extern int XFE_PERSONAL_CERTIFICATES;
extern int XFE_SITE_CERTIFICATES;
extern int XFE_APPEARANCE;
extern int XFE_BOOKMARKS;
extern int XFE_COLORS;
extern int XFE_FONTS;
extern int XFE_APPLICATIONS;
extern int XFE_HELPERS;
extern int XFE_IMAGES;
extern int XFE_LANGUAGES;
extern int XFE_CACHE;
extern int XFE_CONNECTIONS;
extern int XFE_PROXIES;
extern int XFE_PROTOCOLS;
extern int XFE_LANG;
extern int XFE_APPEARANCE;
extern int XFE_COMPOSE_DLG;
extern int XFE_SERVERS;
extern int XFE_IDENTITY;
extern int XFE_ORGANIZATION;
extern int XFE_CHANGE_PASSWORD;
extern int XFE_SET_PASSWORD;
#ifdef MOZ_MAIL_NEWS
extern int XFE_PRIVATE_MIMETYPE_RELOAD;
extern int XFE_PRIVATE_MAILCAP_RELOAD;
extern int XFE_PRIVATE_RELOADED_MIMETYPE;
extern int XFE_PRIVATE_RELOADED_MAILCAP;
#endif
extern void fe_installGeneralAppearance(void);
extern void fe_installGeneralFonts(void);
extern void fe_installGeneralColors(void);
extern void fe_installGeneralAdvanced(void);
extern void fe_installGeneralPasswd(void);
extern void fe_installGeneralCache(void);
extern void fe_installGeneralProxies(void);
extern void fe_installBrowser(void);
extern void fe_installBrowserAppl(void);
#ifdef MOZ_MAIL_NEWS
extern void fe_installMailNews(void);
extern void fe_installMailNewsIdentity(void);
extern void fe_installMailNewsComposition(void);
extern void fe_installMailNewsMserver(void);
extern void fe_installMailNewsNserver(void);
extern void fe_installMailNewsAddrBook(void);
extern void fe_installOfflineNews(void);
extern void fe_installMserverMore(void);
#endif
extern void fe_installProxiesView(void);
extern void fe_installDiskMore(void);
extern void fe_installSslConfig(void);
extern void fe_installOffline(void);
extern void fe_installDiskSpace(void);
/* Preferences
*/
struct fe_prefs_data
{
MWContext *context;
Widget shell, form;
Widget promptDialog;
/*=== General prefs folder ===*/
Widget general_form;
/* Appearance page */
Widget styles1_selector, styles1_page;
Widget icons_p, text_p, both_p, tips_p;
Widget browser_p, mail_p, news_p;
Widget blank_p, home_p, home_text;
Widget underline_p;
Widget expire_days_p, expire_days_text, never_expire_p;
/* Applications page */
Widget apps_selector, apps_page;
Widget tmp_text;
Widget telnet_text, tn3270_text, rlogin_text, rlogin_user_text;
#if 0
/* Bookmarks page */
Widget bookmarks_selector, bookmarks_page;
Widget book_text;
#endif
/* Colors page */
Widget colors_selector, colors_page;
/* Fonts page */
Widget fonts_selector, fonts_page;
Widget prop_family_pulldown, fixed_family_pulldown;
Widget prop_family_option, fixed_family_option;
Widget prop_size_pulldown, fixed_size_pulldown;
Widget prop_size_option, fixed_size_option;
Widget prop_size_field, fixed_size_field;
Widget prop_size_toggle, fixed_size_toggle;
int fonts_changed;
/* Helpers page */
Widget helpers_selector, helpers_page;
int helpers_changed;
struct fe_prefs_helpers_data *helpers;
/* Images page */
Widget images_selector, images_page;
Widget auto_p, dither_p, closest_p;
Widget while_loading_p, after_loading_p;
/* Languages page */
Widget languages_selector, languages_page;
Widget lang_reg_avail, lang_reg_pref, lang_reg_text;
Widget tmpDefaultButton;
/*=== Mail/News prefs folder ===*/
Widget mailnews_form;
/* Appearance page */
Widget appearance_selector, appearance_page;
Widget fixed_message_font_p, var_message_font_p;
Widget cite_plain_p, cite_bold_p, cite_italic_p, cite_bold_italic_p;
Widget cite_normal_p, cite_bigger_p, cite_smaller_p;
Widget cite_color_text;
Widget mail_horiz_p, mail_vert_p, mail_stack_p;
Widget news_horiz_p, news_vert_p, news_stack_p;
Widget msgwin_use_mailwin_p, msgwin_use_new_p, msgwin_use_existing_p;
/* Compose page */
Widget compose_selector, compose_page;
Widget eightbit_toggle, qp_toggle;
Widget deliverAuto_toggle, deliverQ_toggle;
Widget mMailOutSelf_toggle, mMailOutOther_text;
Widget nMailOutSelf_toggle, nMailOutOther_text;
Widget mCopyOut_text;
Widget nCopyOut_text;
Widget autoquote_toggle;
/* Servers page */
Widget dirs_selector, dirs_page;
Widget srvr_text, user_text;
Widget pop_toggle;
Widget movemail_text;
Widget external_toggle, builtin_toggle;
Widget no_limit, msg_limit, limit_text;
Widget msg_remove, msg_leave;
Widget check_every, check_never, check_text;
Widget smtp_text, maildir_text;
Widget newshost_text, newsrc_text, newsmax_text;
/* Identity page */
Widget identity_selector, identity_page;
Widget user_name_text, user_mail_text, user_org_text, user_sig_text;
/* Organization page */
Widget organization_selector, organization_page;
Widget emptyTrash_toggle, rememberPswd_toggle;
Widget threadmail_toggle, threadnews_toggle;
Widget mdate_toggle, mnum_toggle, msubject_toggle, msender_toggle;
Widget ndate_toggle, nnum_toggle, nsubject_toggle, nsender_toggle;
/*=== Network prefs folder ===*/
Widget network_form;
/* Cache page */
Widget cache_selector, cache_page;
Widget memory_text, memory_clear;
Widget disk_text, disk_dir, disk_clear;
Widget verify_label, once_p, every_p, expired_p;
Widget cache_ssl_p;
/* Nework page */
Widget network_selector, network_page;
Widget buf_label, buf_text;
Widget conn_label, conn_text;
/* Proxies page */
Widget proxies_selector, proxies_page;
Widget no_proxies_p, manual_p, manual_browse;
Widget auto_proxies_p, proxy_label, proxy_text;
Widget proxy_reload;
Widget ftp_text, ftp_port;
Widget gopher_text, gopher_port;
Widget http_text, http_port;
Widget https_text, https_port;
Widget wais_text, wais_port;
Widget no_text;
Widget socks_text, socks_port;
/* Protocols page */
Widget protocols_selector, protocols_page;
Widget cookie_p; /* Show alert before accepting a cookie */
Widget anon_ftp_p; /* Use email address for anon ftp */
Widget email_form_p; /* Show alert before submiting a form by email */
/* Languages page */
Widget lang_selector, lang_page;
#ifdef JAVA
Widget java_toggle;
#endif
Widget javascript_toggle;
/*=== Security prefs folder ===*/
Widget security_form;
/* General Security page */
Widget sec_general_selector, sec_general_page;
Widget enter_toggle, leave_toggle, mixed_toggle, submit_toggle;
Widget ssl2_toggle, ssl3_toggle;
/* Security Passwords page */
Widget sec_passwords_selector, sec_passwords_page;
Widget once_toggle, every_toggle, periodic_toggle;
Widget periodic_text, change_password;
#ifdef FORTEZZA
Widget fortezza_toggle, fortezza_timeout;
#endif
/* Personal Certificates page */
Widget personal_selector, personal_page;
Widget pers_list, pers_info, pers_delete_cert, pers_new_cert;
Widget site_default, pers_label;
Widget pers_cert_menu;
char *deleted_user_cert;
/* Site Certificates page */
Widget site_selector, site_page;
Widget all_list, all_edit_cert, all_delete_cert;
Widget all_label;
char *deleted_site_cert;
};
void
FE_SetPasswordAskPrefs(MWContext *context, int askPW, int timeout)
{
}
void
FE_SetPasswordEnabled(MWContext *context, PRBool usePW)
{
}
void
fe_MarkHelpersModified(MWContext *context)
{
/* Mark that the helpers have been modified. We need this
* to detect if we need to save/reload all these helpers.
* For doing this, the condition we adopt is
* (1) User clicked on 'OK' button for the Edit Helpers Dialog
* This also covers the "New" case as the same Dialog
* is shown for the "New" and "Edit".
* (2) User deleted a mime/type and confirmed it.
*/
if (context && CONTEXT_DATA(context)->fep)
CONTEXT_DATA(context)->fep->helpers_changed = TRUE;
}
const char *multiline_continuator = "\t\t\n";
/*
* This belongs in a utility module
*
* Convert an array of strings
* to multiline string (embedded new-lines)
*
* returns a string built up from the array
*
* The caller must free the array
*/
char *
array_to_multiline_str(char **array, int cnt)
{
char *mstring, *p;
int i, str_len;
/*
* Handle an empty array
*/
if (cnt == 0) {
/* always allocate an array so the caller can free it */
mstring = strdup("\n");
return mstring;
}
/*
* Get the length of the multiline string
*/
str_len = 0;
for (i=0; i<cnt; i++) {
if (i != 0)
str_len += strlen(multiline_continuator);
str_len += strlen(array[i]);
}
str_len += 2; /* space for new-line and terminator */
mstring = (char *)XP_ALLOC(str_len);
for (p=mstring, i=0; i<cnt; i++) {
if (i != 0) {
strcpy(p, multiline_continuator);
p += strlen(multiline_continuator);
}
strcpy(p, array[i]);
p += strlen(array[i]);
}
/*
* Note: don't add a final line-feed for multiline
* as the prefs_write_string() function handles it funny
*/
return mstring;
}
/*
* This belongs in a utility module
*
* Convert an array of strings
* to multiline preference (embedded new-lines)
*
* returns a preference value string built up from the array
*
* The caller must free the array
*/
char *
array_to_multiline_pref(char **array, int cnt)
{
char *string;
string = array_to_multiline_str(array, cnt);
return string;
}
/*
* This belongs in a utility module
*
* Convert a multiline string (embedded new-lines)
* to an array of strings
* create the array
* copies the lines into the array
* returns length of the array
*
* To free the array:
* for (i=0; i<cnt; i++)
* XP_FREE(array[i]);
* XP_FREE(array);
*/
int
multiline_str_to_array(const char *string, char ***array_p)
{
char *p, *q, **array;
int i, cnt, len;
Boolean at_start_of_line;
/* handle null string */
if (string == NULL) {
/* always allocate an array so the caller can free it */
array = (char **)XP_ALLOC(sizeof(char *));
array[0] = NULL;
*array_p = array;
return 0;
}
/*
* count the number of lines
* (count beginnings so we will count any last line without a '\n')
* This supports multibyte text only because '\n' is less than 0x40
*/
cnt = 0;
at_start_of_line = True;
for (p=(char *)string; *p; p++) {
if (at_start_of_line) {
cnt += 1;
at_start_of_line = False;
}
if (*p == '\n') {
at_start_of_line = True;
}
}
/* copy lines into the array */
array = (char **)XP_ALLOC((cnt+1) * sizeof(char *));
i = 0;
len = 0;
for (p=q=(char *)string; *p; p++) {
if (*p == '\n') {
array[i] = (char *)XP_ALLOC(len+1);
strncpy(array[i], q, len);
/* add a string terminator */
array[i][len] = '\0';
i += 1;
len = 0;
q = p + 1;
}
else
len += 1;
}
if (len) { /* include ending chars with no newline */
array[i] = (char *)XP_ALLOC(len+1);
strncpy(array[i], q, len);
/* add a string terminator */
array[i][len] = '\0';
}
*array_p = array;
return cnt;
}
/*
* This belongs in a utility module
*
* Convert a multiline preference (embedded new-lines)
* to an array of strings
* create the array
* copies the lines into the array
* remove leading/trailing white space
* remove blank lines
* returns length of the array
*
* To free the array:
* for (i=0; i<cnt; i++)
* XP_FREE(array[i]);
* XP_FREE(array);
*/
int
multiline_pref_to_array(const char *string, char ***array_p)
{
int i, j, cnt;
char **array;
/*
* Convert the multiline string to an array
* (with leading/trailing white space and blank lines)
*/
cnt = multiline_str_to_array(string, array_p);
/*
* trim any leading/training white space
*/
array = *array_p;
for (i=0; i<cnt; i++) {
char *tmp;
tmp = XP_StripLine(array[i]);
/* we can't lose the malloc address else free will fail */
/* so if there was white space at the beginning we make a copy */
if (tmp != array[i]) {
char *tmp2 = array[i];
array[i] = strdup(tmp);
XP_FREE(tmp2);
}
}
/*
* remove any blank lines
*/
for (i=0; i<cnt; i++) {
if (array[i][0] == '\0') {
XP_FREE(array[i]);
for (j=i+1; j<cnt; j++)
array[j-1] = array[j];
cnt -= 1;
}
}
return cnt;
}
IL_DitherMode
fe_pref_string_to_dither_mode (char *s)
{
if (!XP_STRCASECMP(s, "True") || !XP_STRCASECMP(s, "Dither"))
return IL_Dither;
else if (!XP_STRCASECMP(s, "False") || !XP_STRCASECMP(s, "ClosestColor"))
return IL_ClosestColor;
/* In the absence of a reasonable value, dithering is auto-selected */
return IL_Auto;
}
#ifdef MOZ_MAIL_NEWS
void
fe_SetMailNewsSortBehavior(MWContext* context, XP_Bool thread, int sortcode)
{
XP_ASSERT(context->type == MWContextMail || context->type == MWContextNews);
if (context->type == MWContextMail || context->type == MWContextNews) {
if (thread) {
MSG_SetToggleStatus(ACTIVE_MAILTAB(context)->threadpane, MSG_SortByThread, NULL, 0,
thread ? MSG_Checked : MSG_Unchecked);
} else {
switch (sortcode) {
case 0:
MSG_Command(ACTIVE_MAILTAB(context)->threadpane, MSG_SortByDate, NULL, 0);
break;
case 1:
MSG_Command(ACTIVE_MAILTAB(context)->threadpane, MSG_SortByMessageNumber, NULL, 0);
break;
case 2:
MSG_Command(ACTIVE_MAILTAB(context)->threadpane, MSG_SortBySubject, NULL, 0);
break;
case 3:
MSG_Command(ACTIVE_MAILTAB(context)->threadpane, MSG_SortBySender, NULL, 0);
break;
}
}
}
}
#endif
void
fe_InstallPreferences (MWContext *context)
{
/* This function is called from main() */
fe_installGeneralAppearance();
fe_installGeneralFonts();
fe_installGeneralColors();
fe_installGeneralAdvanced();
fe_installGeneralPasswd();
fe_installGeneralCache();
fe_installGeneralProxies();
fe_installDiskSpace();
fe_installBrowser();
fe_installBrowserAppl();
#ifdef MOZ_MAIL_NEWS
fe_installMailNews();
fe_installMailNewsIdentity();
fe_installMailNewsComposition();
fe_installMailNewsMserver();
fe_installMailNewsNserver();
fe_installMailNewsAddrBook();
#endif
fe_installOffline();
#ifdef MOZ_MAIL_NEWS
fe_installOfflineNews();
fe_installMserverMore();
#endif
fe_installProxiesView();
fe_installSslConfig();
fe_installDiskMore();
/* CACHE
*/
/* spider begin */
FE_SARCacheDir = fe_globalPrefs.sar_cache_dir ;
/* spider end */
NET_DontDiskCacheSSL(!fe_globalPrefs.cache_ssl_p);
/* bookmark_file
*/
FE_GlobalHist = fe_globalPrefs.history_file;
/* NETWORK
*/
NET_ChangeMaxNumberOfConnections (50);
NET_ChangeMaxNumberOfConnectionsPerContext (fe_globalPrefs.max_connections);
/* The unit for tcp buffer size is changed from kbyes to btyes */
NET_ChangeSocketBufferSize (fe_globalPrefs.network_buffer_size);
/* NEWS
*/
#ifdef MOZ_MAIL_NEWS
NET_SetNumberOfNewsArticlesInListing (fe_globalPrefs.news_max_articles);
NET_SetCacheXOVER (fe_globalPrefs.news_cache_xover);
#endif
/* PROTOCOLS
*/
#ifdef MOZ_MAIL_NEWS
NET_WarnOnMailtoPost(fe_globalPrefs.email_submit);
#endif
#ifdef FORTEZZA
if (fe_globalPrefs.fortezza_toggle) {
int timeout = fe_globalPrefs.fortezza_timeout;
/* '0' minute timeout because 1 minute... still pretty darn fast */
FortezzaSetTimeout(timeout ? timeout : 1);
} else {
FortezzaSetTimeout(0);
}
#endif
}
void
fe_GeneralPrefsDialog (MWContext *context)
{
}
void
fe_MailNewsPrefsDialog (MWContext *context)
{
}
void
fe_NetworkPrefsDialog (MWContext *context)
{
}
void
fe_SecurityPrefsDialog (MWContext *context)
{
}
/* spider begin */
void
fe_VerifyDiskCache (MWContext *context)
{
#ifdef PREFS_DISK_CACHE
static Boolean done = False;
if (done) return;
done = True;
if (fe_globalPrefs.disk_cache_size <= 0)
return;
fe_VerifyDiskCacheExistence(context, fe_globalPrefs.cache_dir) ;
#endif /* PREFS_DISK_CACHE */
#ifdef PREFS_OLD_WAY
#ifdef PREFS_DISK_CACHE
struct stat st;
char file [1024];
char message [4000];
static Boolean done = False;
if (done) return;
done = True;
if (fe_globalPrefs.disk_cache_size <= 0)
return;
strcpy (file, fe_globalPrefs.cache_dir);
if (file [strlen (file) - 1] == '/')
file [strlen (file) - 1] = 0;
if (stat (file, &st))
{
/* Doesn't exist - try to create it. */
if (mkdir (file, 0700))
{
/* Failed. */
char *error = ((errno >= 0 && errno < sys_nerr)
? sys_errlist [errno]
: XP_GetString( XFE_UNKNOWN_ERROR));
PR_snprintf (message, sizeof (message),
fe_globalData.create_cache_dir_message,
file, error);
}
else
{
/* Suceeded. */
PR_snprintf (message, sizeof (message),
fe_globalData.created_cache_dir_message, file);
}
}
else if (! (st.st_mode & S_IFDIR))
{
/* Exists but isn't a directory. */
PR_snprintf (message, sizeof (message),
fe_globalData.cache_not_dir_message, file);
}
else
{
/* The disk cache is ok! */
*message = 0;
}
if (*message)
{
PR_snprintf(message + strlen (message), sizeof (message),
fe_globalData.cache_suffix_message,
fe_globalPrefs.disk_cache_size, fe_progclass);
FE_Alert (context, message);
}
#endif /* PREFS_DISK_CACHE */
#endif /* PREFS_OLD_WAY */
}
void
fe_VerifySARDiskCache (MWContext *context)
{
#ifdef PREFS_DISK_CACHE
fe_VerifyDiskCacheExistence(context, fe_globalPrefs.sar_cache_dir) ;
#endif /* PREFS_DISK_CACHE */
}
void
fe_VerifyDiskCacheExistence (MWContext *context, char * cache_directory)
{
#ifdef PREFS_DISK_CACHE
struct stat st;
char file [1024];
char message [4000];
if (!cache_directory)
return ;
strcpy (file, cache_directory);
if (file [strlen (file) - 1] == '/')
file [strlen (file) - 1] = 0;
if (stat (file, &st))
{
/* Doesn't exist - try to create it. */
if (mkdir (file, 0700))
{
/* Failed. */
char *error = ((errno >= 0 && errno < sys_nerr)
? sys_errlist [errno]
: XP_GetString( XFE_UNKNOWN_ERROR));
PR_snprintf (message, sizeof (message),
fe_globalData.create_cache_dir_message,
file, error);
}
else
{
/* Suceeded. */
PR_snprintf (message, sizeof (message),
fe_globalData.created_cache_dir_message, file);
}
}
else if (! (st.st_mode & S_IFDIR))
{
/* Exists but isn't a directory. */
PR_snprintf (message, sizeof (message),
fe_globalData.cache_not_dir_message, file);
}
else
{
/* The disk cache is ok! */
*message = 0;
}
if (*message)
{
PR_snprintf(message + strlen (message), sizeof (message),
fe_globalData.cache_suffix_message,
fe_globalPrefs.disk_cache_size, fe_progclass);
FE_Alert (context, message);
}
#endif /* PREFS_DISK_CACHE */
}
/* spider end */

View File

@@ -69,11 +69,13 @@ static MSG_HEADER_SET standard_header_set[] = {
extern "C" char *fe_StringTrim (char *string);
extern "C" char * xfe_ExpandName(char * pString, int* iconType, short* security);
#ifdef MOZ_MAIL_NEWS
extern "C"
{
XP_List* FE_GetDirServers();
ABook* fe_GetABook(MWContext *context);
};
#endif /* MOZ_MAIL_NEWS */
const char *XFE_AddressFolderView::tabPrev = "XFE_AddressFolderView::tabPrev";
@@ -334,25 +336,27 @@ void XFE_AddressFolderView::addrMsgCB(ABAddrMsgCBProcStruc* clientData)
False);
}/* XFE_AddressFolderView::addrMsgCB */
#ifdef MOZ_MAIL_NEWS
XFE_CALLBACK_DEFN(XFE_AddressFolderView, openAddrBk)(XFE_NotificationCenter */*obj*/,
void */*clientData*/,
void */*callData*/)
{
fe_showAddrMSGDlg(getToplevel()->getBaseWidget(),
XFE_AddressFolderView::addrMsgCallback, this,
m_contextData);
return;
}
#endif /* MOZ_MAIL_NEWS */
void
XFE_AddressFolderView::doCommand(CommandType command, void *, XFE_CommandInfo*)
{
#ifdef MOZ_MAIL_NEWS
if (command == xfeCmdAddresseePicker)
fe_showAddrMSGDlg(getToplevel()->getBaseWidget(),
XFE_AddressFolderView::addrMsgCallback, this,
m_contextData);
#endif /* MOZ_MAIL_NEWS */
}
// Outlinable Interface starts here
@@ -955,7 +959,7 @@ XFE_AddressFolderView::setupIcons()
MN_Newsgroup.mono_bits, MN_Newsgroup.color_bits,
MN_Newsgroup.mask_bits, FALSE);
#ifdef MOZ_MAIL_NEWS
// Security
fe_NewMakeIcon(getToplevel()->getBaseWidget(),
BlackPixelOfScreen(XtScreen(base)), // umm. fix me
@@ -968,6 +972,7 @@ XFE_AddressFolderView::setupIcons()
MN_CertIndicator.color_bits,
MN_CertIndicator.mask_bits,
FALSE);
#endif /* MOZ_MAIL_NEWS */
}
}
@@ -1044,9 +1049,10 @@ XFE_AddressFolderView::createWidgets(Widget parent_widget)
0);
((XFE_AddressOutliner*)m_outliner)->show();
#ifdef MOZ_MAIL_NEWS
// create drop site for internal drop
fe_dnd_CreateDrop(m_outliner->getBaseWidget(),AddressDropCb,this);
#endif /* MOZ_MAIL_NEWS */
}
void
@@ -1189,19 +1195,19 @@ void XFE_AddressFolderView::updateHeaderInfo ( void )
if ((count != -1)&&(list!=NULL))
{
for (i=0; i<count; i++)
{
XP_ASSERT(list[i].header_value);
MSG_SetCompHeader(pComposePane,list[i].header_type,list[i].header_value);
XP_FREE(list[i].header_value);
}
XP_FREE(list);
for (i=0; i<count; i++)
{
XP_ASSERT(list[i].header_value);
MSG_SetCompHeader(pComposePane,list[i].header_type,list[i].header_value);
XP_FREE(list[i].header_value);
}
XP_FREE(list);
}
for (i=0; i<count; i++)
{
XP_FREE(entry[i].header_value);
}
XP_FREE(entry);
XP_FREE(entry[i].header_value);
}
XP_FREE(entry);
}
}
@@ -1219,6 +1225,7 @@ XFE_AddressFolderView::changedItem(char *pString, int* iconType,
extern "C" char * xfe_ExpandName(char * pString, int* iconID, short* security)
{
#ifdef MOZ_MAIL_NEWS
ABID entryID;
ABID field;
char * fullname;
@@ -1257,6 +1264,7 @@ extern "C" char * xfe_ExpandName(char * pString, int* iconID, short* security)
pAddrBook, entryID, &fullname);
if (fullname) return fullname;
}
#endif /* MOZ_MAIL_NEWS */
return NULL;
}
@@ -1397,6 +1405,8 @@ XFE_AddressFolderView::~XFE_AddressFolderView()
{
}
#ifdef MOZ_MAIL_NEWS
// Address field drop site handler
void
XFE_AddressFolderView::AddressDropCb(Widget,void* cd,
@@ -1563,3 +1573,4 @@ XFE_AddressFolderView::processLDAPDrop(fe_dnd_Source* source)
m_clearAddressee = True;
}
#endif /* MOZ_MAIL_NEWS */

View File

@@ -100,8 +100,10 @@ public:
virtual void Flippyfunc(const OutlineFlippyFuncData *data);
Boolean removeDataAt(int line);
#ifdef MOZ_MAIL_NEWS
// For address book button
XFE_CALLBACK_DECL(openAddrBk)
#endif /* MOZ_MAIL_NEWS */
void setHeader(int line, MSG_HEADER_SET header);
int getHeader(int line);
@@ -151,12 +153,15 @@ public:
void addrMsgCB(ABAddrMsgCBProcStruc* clientData);
void purgeAll();
#ifdef MOZ_MAIL_NEWS
// internal drop callback for addressbook and address search window drops
static void AddressDropCb(Widget,void*,fe_dnd_Event,fe_dnd_Source*,XEvent*);
void addressDropCb(fe_dnd_Source*);
void processAddressBookDrop(XFE_Outliner*,DIR_Server *abDir,ABook *abBook,
AddressPane*);
void processLDAPDrop(fe_dnd_Source*);
#endif /* MOZ_MAIL_NEWS */
private:
XP_Bool m_clearAddressee;

View File

@@ -51,10 +51,12 @@ extern MSG_HEADER_SET MSG_HeaderValue( int pos );
extern "C"
{
#ifdef MOZ_MAIL_NEWS
#include "addrbk.h"
XP_List* FE_GetDirServers();
ABook* fe_GetABook(MWContext *context);
#endif /* MOZ_MAIL_NEWS */
static void KeyIn(
Widget w,
@@ -1465,6 +1467,7 @@ static void TableTraverse(
extern "C" char * xfe_ExpandForNameCompletion(char * pString)
{
#ifdef MOZ_MAIL_NEWS
ABID entryID;
ABID field;
ABook *pAddrBook = fe_GetABook(0);
@@ -1516,6 +1519,7 @@ extern "C" char * xfe_ExpandForNameCompletion(char * pString)
}
}
#endif /* MOZ_MAIL_NEWS */
return NULL;
}

View File

@@ -941,6 +941,7 @@ Pixmap XFE_AttachPanelItem::iconPixmap()
return _imagePixmap;
}
#ifdef MOZ_MAIL_NEWS
if (strncmp(_dataType,"message",7)==0) {
if (_messagePixmap==XmUNSPECIFIED_PIXMAP) {
fe_icon icon={ 0 };
@@ -952,6 +953,7 @@ Pixmap XFE_AttachPanelItem::iconPixmap()
}
return _messagePixmap;
}
#endif /* MOZ_MAIL_NEWS */
if (strncmp(_dataType,"video",5)==0) {
if (_moviePixmap==XmUNSPECIFIED_PIXMAP) {
@@ -965,6 +967,7 @@ Pixmap XFE_AttachPanelItem::iconPixmap()
return _moviePixmap;
}
#ifdef MOZ_MAIL_NEWS
if (strcmp(_dataType,"text/x-vcard")==0) {
if (_vcardPixmap==XmUNSPECIFIED_PIXMAP) {
fe_icon icon={ 0 };
@@ -976,6 +979,7 @@ Pixmap XFE_AttachPanelItem::iconPixmap()
}
return _vcardPixmap;
}
#endif /* MOZ_MAIL_NEWS */
if (strncmp(_dataType,"text",4)==0) {
if (_textPixmap==XmUNSPECIFIED_PIXMAP) {

View File

@@ -43,21 +43,25 @@ XFE_AttachmentMenu::XFE_AttachmentMenu(Widget w, XFE_Frame *frame)
XP_ASSERT(m_submenu);
m_attachmentData = NULL;
#ifdef MOZ_MAIL_NEWS
frame->registerInterest(XFE_MsgView::messageHasChanged,
this,
(XFE_FunctionNotification)attachmentsHaveChanged_cb);
m_attachmentData = NULL;
// make sure we initially install an update callback
attachmentsHaveChanged(NULL, NULL, NULL);
#endif /* MOZ_MAIL_NEWS */
}
XFE_AttachmentMenu::~XFE_AttachmentMenu()
{
#ifdef MOZ_MAIL_NEWS
m_parentFrame->unregisterInterest(XFE_MsgView::messageHasChanged,
this,
(XFE_FunctionNotification)attachmentsHaveChanged_cb);
#endif /* MOZ_MAIL_NEWS */
}
void

View File

@@ -51,13 +51,17 @@
// from lib/libmsg
extern "C" XP_Bool MSG_RequiresMailMsgWindow(const char*);
#ifdef MOZ_MAIL_NEWS
extern "C" XP_Bool MSG_RequiresNewsMsgWindow(const char*);
#endif /* MOZ_MAIL_NEWS */
// Use API from XmP.h - moderately naughty, but implicitly supported for
// widget-writers and happy hackers everywhere.
extern "C" void _XmSetDestination(Display*,Widget);
#ifdef MOZ_MAIL_NEWS
static int IsWebJumper(const char*);
#endif /* MOZ_MAIL_NEWS */
//
// XFE_ComposeAttachFolderView
@@ -428,8 +432,10 @@ int XFE_ComposeAttachFolderView::addAttachments(const char **items,int numItems,
m.desired_type=desiredType;
if (attach_binary)
m.real_type= "application/octet-stream";
#ifdef MOZ_MAIL_NEWS
else if (IsWebJumper(m.url))
m.real_type= "text/webjumper";
#endif /* MOZ_MAIL_NEWS */
else
m.real_type=NULL;
_attachments[_numAttachments]=m;
@@ -522,7 +528,9 @@ int XFE_ComposeAttachFolderView::validateAttachment(Widget widget,const char *ur
// accept anything we know how to display as a document
if (MSG_RequiresMailMsgWindow(url) ||
#ifdef MOZ_MAIL_NEWS
MSG_RequiresNewsMsgWindow(url) ||
#endif /* MOZ_MAIL_NEWS */
MSG_RequiresBrowserWindow(url))
return TRUE;
else {
@@ -851,7 +859,6 @@ static int IsWebJumper(const char *url)
return retval;
}
//
// XFE_ComposeAttachDrop
//
@@ -1018,6 +1025,7 @@ void XFE_ComposeAttachFolderView::processHistoryDrop(fe_dnd_Source *source)
void XFE_ComposeAttachFolderView::processMessageDrop(fe_dnd_Source *source)
{
#ifdef MOZ_MAIL_NEWS
XFE_ThreadView *threadView=(XFE_ThreadView*)source->closure;
XFE_Outliner *outliner=threadView->getOutliner();
const int *selectedList;
@@ -1045,6 +1053,7 @@ void XFE_ComposeAttachFolderView::processMessageDrop(fe_dnd_Source *source)
XP_FREE(items[i]);
delete items;
}
#endif /* MOZ_MAIL_NEWS */
}

View File

@@ -71,13 +71,19 @@ makeOptionMenu(MWContext *context, Widget parent);
Boolean
XFE_ComposeFolderView::isPrioritySelected(MSG_PRIORITY priority)
{
#ifdef MOZ_OPTION_FOLDER
return m_optionFolderViewAlias->isPrioritySelected(priority);
#else /* MOZ_OPTION_FOLDER */
return FALSE;
#endif /* MOZ_OPTION_FOLDER */
}
void
XFE_ComposeFolderView::selectPriority(MSG_PRIORITY priority)
{
#ifdef MOZ_OPTION_FOLDER
m_optionFolderViewAlias->selectPriority(priority);
#endif /* MOZ_OPTION_FOLDER */
}
@@ -230,8 +236,10 @@ XFE_ComposeFolderView::folderActivate(int tabPosition)
}
else if ( tabPosition == 2 ) // ASSUMPTION: Tab #2 is 'Options'
{
#ifdef MOZ_OPTION_FOLDER
if (m_optionFolderViewAlias)
m_optionFolderViewAlias->updateAllOptions();
#endif /* MOZ_OPTION_FOLDER */
}
}
@@ -294,9 +302,11 @@ XFE_ComposeFolderView::createWidgets(Widget parent_widget, XP_Bool /*usePlainTex
str = XmStringCreateSimple(XP_GetString(XFE_MNC_ADDRESS));
Widget m_addressTab = XmLFolderAddTabFromClass(m_tabGroupW, str);
//#ifdef MOZ_MAIL_NEWS
XtVaSetValues(m_addressTab, XmNbuttonLayout, XmBUTTON_PIXMAP_ONLY,
XmNpixmap, MNC_AddressSmall_group.pixmap_icon.pixmap,
NULL);
//#endif /* MOZ_MAIL_NEWS */
XmStringFree(str);
m_addressFormW = XtVaCreateManagedWidget("form_addr",
@@ -309,8 +319,10 @@ XFE_ComposeFolderView::createWidgets(Widget parent_widget, XP_Bool /*usePlainTex
str = XmStringCreateSimple(XP_GetString(XFE_MNC_ATTACHMENT));
//m_attachFormW = XmLFolderAddTabForm(m_tabGroupW, str);
Widget m_attachTab = XmLFolderAddTabFromClass(m_tabGroupW, str);
//#ifdef MOZ_MAIL_NEWS
XtVaSetValues(m_attachTab, XmNbuttonLayout, XmBUTTON_PIXMAP_ONLY,
XmNpixmap, MNC_AttachSmall_group.pixmap_icon.pixmap, NULL);
//#endif /* MOZ_MAIL_NEWS */
XmStringFree(str);
m_attachFormW = XtVaCreateManagedWidget("form_attach",
xmFormWidgetClass, m_tabGroupW,
@@ -320,6 +332,7 @@ XFE_ComposeFolderView::createWidgets(Widget parent_widget, XP_Bool /*usePlainTex
XtVaSetValues(m_attachTab, XmNtabManagedWidget, m_attachFormW, NULL);
#ifdef MOZ_OPTION_FOLDER
str = XmStringCreateSimple(XP_GetString(XFE_MNC_OPTION));
//m_optionFormW = XmLFolderAddTabForm(m_tabGroupW, str);
Widget m_optionTab = XmLFolderAddTabFromClass(m_tabGroupW, str);
@@ -332,6 +345,7 @@ XFE_ComposeFolderView::createWidgets(Widget parent_widget, XP_Bool /*usePlainTex
NULL);
XtVaSetValues(m_optionTab, XmNtabManagedWidget, m_optionFormW, NULL);
#endif /* MOZ_OPTION_FOLDER */
{ // Addressing Folder
XFE_AddressFolderView *addressFolderView =
@@ -368,6 +382,7 @@ XFE_ComposeFolderView::createWidgets(Widget parent_widget, XP_Bool /*usePlainTex
attachFolderView->show();
}
#ifdef MOZ_OPTION_FOLDER
{ // Option Folder
XFE_OptionFolderView *optionFolderView =
new XFE_OptionFolderView( getToplevel(), (XFE_View*)this, getPane(), getContext());
@@ -386,6 +401,7 @@ XFE_ComposeFolderView::createWidgets(Widget parent_widget, XP_Bool /*usePlainTex
XmNrightAttachment, XmATTACH_FORM, NULL);
optionFolderView->show();
}
#endif /* MOZ_OPTION_FOLDER */
} // End of Address Frame
XDEBUG( printf("leave XFE_ComposeFolderView::createWidgets()\n");)
@@ -469,6 +485,7 @@ XFE_ComposeFolderView::setupIcons()
XtVaGetValues(base, XmNbackground, &bg_pixel, 0);
//#ifdef MOZ_MAIL_NEWS
IconGroup_createAllIcons(&MNC_AddressSmall_group,
getToplevel()->getBaseWidget(),
BlackPixelOfScreen(XtScreen(base)), // hack. :(
@@ -483,4 +500,5 @@ XFE_ComposeFolderView::setupIcons()
getToplevel()->getBaseWidget(),
BlackPixelOfScreen(XtScreen(base)), // hack. :(
bg_pixel);
//#endif /* MOZ_MAIL_NEWS */
}

View File

@@ -35,7 +35,13 @@
#include "Dashboard.h"
#include "Xfe/Xfe.h"
#include "edt.h"
#ifdef MOZ_MAIL_NEWS
#include "../../../lib/libmsg/msgcflds.h"
#else /* MOZ_MAIL_NEWS */
#ifdef MOZ_MAIL_COMPOSE
#include <msgcflds.h>
#endif /* MOZ_MAIL_COMPOSE */
#endif /* MOZ_MAIL_NEWS */
#include "msgcom.h"
#include <xpgetstr.h> /* for XP_GetString() */
@@ -46,7 +52,7 @@ extern "C" int FE_GetMessageBody (MSG_Pane* comppane,
extern int XFE_MNC_CLOSE_WARNING;
#ifdef DEBUG_dora
#ifdef DEBUG_akkana
#define XDEBUG(x) x
#else
#define XDEBUG(x)
@@ -145,7 +151,9 @@ MenuSpec XFE_ComposeFrame::menu_bar_spec[] = {
ToolbarSpec XFE_ComposeFrame::toolbar_spec[] = {
{ xfeCmdSendMessageNow, PUSHBUTTON, &MNC_Send_group },
{ xfeCmdQuote, PUSHBUTTON, &MNC_Quote_group },
#ifdef MOZ_MAIL_NEWS
{ xfeCmdAddresseePicker, PUSHBUTTON, &MNC_Address_group },
#endif /* MOZ_MAIL_NEWS */
{
xfeCmdAttach,
CASCADEBUTTON,
@@ -155,13 +163,17 @@ ToolbarSpec XFE_ComposeFrame::toolbar_spec[] = {
XFE_TOOLBAR_DELAY_SHORT // Popup delay
},
{ xfeCmdSpellCheck, PUSHBUTTON, &MNC_SpellCheck_group },
#ifdef MOZ_MAIL_NEWS
{ xfeCmdSaveDraft, PUSHBUTTON, &MNC_Save_group },
#endif /* MOZ_MAIL_NEWS */
TOOLBAR_SEPARATOR,
#ifdef MOZ_MAIL_NEWS
{ xfeCmdViewSecurity, PUSHBUTTON,
&TB_Unsecure_group,
&TB_Secure_group,
&MNTB_SignUnsecure_group,
&MNTB_SignSecure_group},
#endif /* MOZ_MAIL_NEWS */
{ xfeCmdStopLoading, PUSHBUTTON, &TB_Stop_group },
{ NULL }
};
@@ -389,6 +401,7 @@ XFE_ComposeFrame::isCommandEnabled(CommandType cmd, void *cd, XFE_CommandInfo* i
void
XFE_ComposeFrame::doCommand(CommandType cmd, void *cd, XFE_CommandInfo* info)
{
#ifdef MOZ_MAIL_NEWS
if (cmd == xfeCmdSearchAddress)
{
fe_showLdapSearch(XfeAncestorFindApplicationShell(getBaseWidget()), this,
@@ -397,7 +410,9 @@ XFE_ComposeFrame::doCommand(CommandType cmd, void *cd, XFE_CommandInfo* info)
// NOTE... [ we need to intercept these commands in order to be
// [ able to do the "right thing" in the ComposeView
//
else {
else
#endif /* MOZ_MAIL_NEWS */
{
if ( cmd == xfeCmdPaste ||
cmd == xfeCmdCut ||
cmd == xfeCmdCopy ||
@@ -514,6 +529,7 @@ fe_showCompose(Widget toplevel, Chrome *chromespec, MWContext *old_context,
return ((XFE_ComposeFrame*)theFrame)->getPane();
}
#ifdef MOZ_MAIL_NEWS
int
XFE_ComposeFrame::getSecurityStatus()
{
@@ -555,6 +571,7 @@ XFE_ComposeFrame::getSecurityStatus()
}
return status;
}
#endif /* MOZ_MAIL_NEWS */
XP_Bool
XFE_ComposeFrame::isOkToClose()

View File

@@ -57,8 +57,10 @@ public:
void destroyWhenAllConnectionsComplete();
#ifdef MOZ_MAIL_NEWS
// For security icon state...
virtual int getSecurityStatus();
#endif /* MOZ_MAIL_NEWS */
virtual XP_Bool isOkToClose();
protected:

View File

@@ -295,7 +295,7 @@ XFE_ComposeView::XFE_ComposeView(XFE_Component *toplevel_component,
pane = MSG_CreateCompositionPane(m_contextData,
//context_to_copy required by xp
context_to_copy,
fe_mailNewsPrefs, fields, XFE_MNView::m_master );
fe_mailNewsPrefs, fields, XFE_MNView::m_master);
setPane(pane);
CONTEXT_DATA(m_contextData)->comppane = (MSG_Pane*)pane;
@@ -743,7 +743,9 @@ XFE_ComposeView::isCommandEnabled(CommandType command, void *calldata,
MSG_Pane *pane = getPane();
if (pane && MSG_DeliveryInProgress(pane) && command != xfeCmdStopLoading)
{
return False;
}
Widget destW= XmGetDestination(XtDisplay(getBaseWidget()));
Widget focusW= XmGetFocusWidget(getBaseWidget());
@@ -996,9 +998,11 @@ XFE_ComposeView::isCommandEnabled(CommandType command, void *calldata,
{
return True;
}
#ifdef MOZ_MAIL_NEWS
// All other commands we pass to FolderView.
else if (m_folderViewAlias->isCommandEnabled(command, calldata, info))
return True;
#endif /* MOZ_MAIL_NEWS */
else
return XFE_MNView::isCommandEnabled(command, calldata, info);
}
@@ -1219,6 +1223,7 @@ XDEBUG( printf ("Do Command: %s \n", Command::getString(command));)
/* ###tw Should still probably do the commandstatus stuff. */
MSG_Command(getPane(), msg_cmd, NULL, 0);
}
#ifdef MOZ_MAIL_NEWS
else if (command == xfeCmdSendMessageLater)
{
XDEBUG( printf ("XFE_ComposeView::sendMessageLater()\n");)
@@ -1289,6 +1294,7 @@ XDEBUG( printf ("Do Command: %s \n", Command::getString(command));)
MSG_QuoteMessage (getPane(), &XFE_ComposeView::doQuoteMessage, this);
}
}
#endif /* MOZ_MAIL_NEWS */
else if ( command == xfeCmdUndo )
{
if (!m_plaintextP) {
@@ -1485,11 +1491,13 @@ XDEBUG( printf ("Do Command: %s \n", Command::getString(command));)
{
toggleAddressArea();
}
#ifdef MOZ_MAIL_NEWS
else if (command == xfeCmdViewSecurity )
{
updateHeaderInfo();
fe_sec_logo_cb(NULL, getContext(), NULL);
}
#endif /* MOZ_MAIL_NEWS */
else if (command == xfeCmdDeleteItem) {
if ( m_focusW ) {
if ( m_focusW != m_addrTypeW ) {
@@ -1705,6 +1713,7 @@ fe_compose_setAttachment(MWContext *context, void* data)
// ------------ NEW CODE ----------------------
#ifdef MOZ_MAIL_NEWS
int
XFE_ComposeView::quoteMessage(const char *textData)
{
@@ -1732,6 +1741,7 @@ XFE_ComposeView::doQuoteMessage(void *closure, const char *textData)
// Requires to return negative value on error
return obj->quoteMessage(textData);
}
#endif /* MOZ_MAIL_NEWS */
void
XFE_ComposeView::displayDefaultTextBody()
@@ -1795,16 +1805,22 @@ XFE_ComposeView::initialize()
MSG_SetHTMLMarkup(pane, !m_plaintextP);
#ifdef MOZ_MAIL_NEWS
if ( m_pInitialText && XP_STRLEN(m_pInitialText) ) {
m_dontQuoteP = True;
}
else {
m_dontQuoteP = False;
}
#else /* MOZ_MAIL_NEWS */
m_dontQuoteP = True;
#endif /* MOZ_MAIL_NEWS */
#ifdef MOZ_MAIL_NEWS
if ( !m_dontQuoteP && MSG_ShouldAutoQuote (pane) ) {
MSG_QuoteMessage (pane, &XFE_ComposeView::doQuoteMessage, this);
}
#endif /* MOZ_MAIL_NEWS */
cPos = XmTextGetLastPosition(textW);
@@ -2080,6 +2096,7 @@ XFE_ComposeView::initEditorContents()
EDT_BeginOfDocument(m_contextData, False);
#ifdef MOZ_MAIL_NEWS
if ( !m_dontQuoteP && MSG_ShouldAutoQuote (pane) ) {
#ifdef DEBUG_rhess
fprintf(stderr, "initEditorContents::[ quote ]\n");
@@ -2087,7 +2104,9 @@ XFE_ComposeView::initEditorContents()
MSG_QuoteMessage (pane,
&XFE_ComposeView::doQuoteMessage, this);
}
else {
else
#endif /* MOZ_MAIL_NEWS */
{
#ifdef DEBUG_rhess
fprintf(stderr, "initEditorContents::[ default ]\n");
#endif

View File

@@ -95,7 +95,9 @@ public:
MSG_FontCode **font_changes);
void doneWithMessageBody(char *pBody);
void setComposeWrapState(XP_Bool wrap_p);
#ifdef MOZ_MAIL_NEWS
static int doQuoteMessage(void *closure, const char *data);
#endif /* MOZ_MAIL_NEWS */
XP_Bool isDelayedSent();
XP_Bool isHTML();
static const char *newSubject;
@@ -154,7 +156,9 @@ private:
XP_Bool m_delayEditorP;
XP_Bool m_dontQuoteP;
#ifdef MOZ_MAIL_NEWS
int quoteMessage(const char *data);
#endif /* MOZ_MAIL_NEWS */
void displayDefaultTextBody();
XFE_CALLBACK_DECL(tabToEditor)

View File

@@ -138,7 +138,9 @@ extern LO_AnchorData *last_documented_anchor_data;
MenuSpec XFE_Frame::new_menu_spec[] = {
{ xfeCmdOpenBrowser, PUSHBUTTON },
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
{ xfeCmdComposeMessage, PUSHBUTTON },
#endif
#ifdef EDITOR
MENU_SEPARATOR,
MENU_PUSHBUTTON(xfeCmdNewBlank),
@@ -202,7 +204,7 @@ MenuSpec XFE_Frame::window_menu_spec[] = {
// Is there is a reason why this is here? It's the same as new_menu_spec
MenuSpec XFE_Frame::new_submenu_spec[] = {
{ xfeCmdOpenBrowser, PUSHBUTTON },
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
{ xfeCmdComposeMessage, PUSHBUTTON },
#endif
#ifdef EDITOR
@@ -1724,7 +1726,7 @@ XFE_Frame::initializeMWContext(EFrameType frame_type,
struct fe_MWContext_cons *cons;
MWContextType type = MWContextAny;
if (m_context) return;
if (m_context) return;
switch (frame_type)
{
@@ -3220,10 +3222,12 @@ XFE_Frame::isCommandEnabled(CommandType cmd,
|| cmd == xfeCmdToggleMenubar
|| cmd == xfeCmdToggleNavigationToolbar
|| cmd == xfeCmdWindowListRaiseItem
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
|| cmd == xfeCmdComposeMessage
|| cmd == xfeCmdComposeMessageHTML
|| cmd == xfeCmdComposeMessagePlain
#endif
#ifdef MOZ_MAIL_NEWS
|| cmd == xfeCmdOpenAddressBook
|| cmd == xfeCmdOpenInbox
|| cmd == xfeCmdOpenInboxAndGetNewMessages
@@ -3434,7 +3438,7 @@ XFE_Frame::doCommand(CommandType cmd, void *calldata, XFE_CommandInfo* info)
else
hide();
}
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
else if ( cmd == xfeCmdComposeMessage)
{
if (info) {
@@ -3455,6 +3459,8 @@ XFE_Frame::doCommand(CommandType cmd, void *calldata, XFE_CommandInfo* info)
CONTEXT_DATA(m_context)->stealth_cmd = (fe_globalPrefs.send_html_msg == True) ;
MSG_Mail(m_context);
}
#endif
#ifdef MOZ_MAIL_NEWS
else if (cmd == xfeCmdOpenInbox)
{
fe_showInbox(m_toplevelWidget, this, NULL, fe_globalPrefs.reuse_thread_window, False);
@@ -3697,10 +3703,12 @@ XFE_Frame::handlesCommand(CommandType cmd,
|| cmd == xfeCmdFloatingTaskBarAlwaysOnTop
|| cmd == xfeCmdFloatingTaskBarClose
#endif
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
|| cmd == xfeCmdComposeMessage
|| cmd == xfeCmdComposeMessageHTML
|| cmd == xfeCmdComposeMessagePlain
#endif
#ifdef MOZ_MAIL_NEWS
|| cmd == xfeCmdEditMailFilterRules
|| cmd == xfeCmdOpenAddressBook
|| cmd == xfeCmdOpenFolders
@@ -4991,3 +4999,4 @@ XFE_Frame::zaxis_BelowEH(Widget shell,
//
// end of netcaster z axis hackery
//

View File

@@ -520,7 +520,7 @@ XFE_HTMLView::doCommand(CommandType cmd, void *callData, XFE_CommandInfo* info)
getToplevel()->notifyInterested(XFE_View::chromeNeedsUpdating);
return;
}
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
else if (IS_CMD(xfeCmdSendPage))
{
fe_mailto_cb (CONTEXT_WIDGET (m_contextData),
@@ -571,7 +571,7 @@ XFE_HTMLView::doCommand(CommandType cmd, void *callData, XFE_CommandInfo* info)
getToplevel()->notifyInterested(XFE_View::chromeNeedsUpdating);
return;
}
#endif // MOZ_MAIL_NEWS
#endif // MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE
else if (IS_CMD(xfeCmdCut))
{
MWContext *context = fe_GetFocusGridOfContext(m_contextData);
@@ -864,9 +864,9 @@ XFE_HTMLView::doCommand(CommandType cmd, void *callData, XFE_CommandInfo* info)
return;
if (
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
MSG_RequiresComposeWindow(m_urlUnderMouse->address) ||
#endif // MOZ_MAIL_NEWS
#endif // MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE
! XP_STRNCMP ("telnet:", m_urlUnderMouse->address, 7) ||
! XP_STRNCMP ("tn3270:", m_urlUnderMouse->address, 7) ||
! XP_STRNCMP ("rlogin:", m_urlUnderMouse->address, 7)
@@ -937,7 +937,7 @@ XFE_HTMLView::doCommand(CommandType cmd, void *callData, XFE_CommandInfo* info)
XP_GetString(XFE_EDITOR_ALERT_ABOUT_DOCUMENT));
return;
}
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
if (MSG_RequiresComposeWindow(m_urlUnderMouse->address))
getURL (m_urlUnderMouse, FALSE);
else

View File

@@ -117,6 +117,17 @@ static _name_and_group_t _iconGroups[] =
{ "Reload", &TB_Reload_group },
{ "Stop", &TB_Stop_group },
{ "MixSecurity", &TB_MixSecurity_group },
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
// Compose
{ "Send", &MNC_Send_group },
{ "Quote", &MNC_Quote_group },
{ "Address", &MNC_Address_group },
{ "Attach", &MNC_Attach_group },
{ "SpellCheck", &MNC_SpellCheck_group },
{ "Save", &MNC_Save_group },
{ "Directory", &MNC_Directory_group },
{ "Next", &MNTB_Next_group },
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
#ifdef MOZ_MAIL_NEWS
// Mail/News
{ "GetMsg", &MNTB_GetMsg_group },
@@ -127,26 +138,16 @@ static _name_and_group_t _iconGroups[] =
{ "Forward", &MNTB_Forward_group },
{ "File", &MNTB_File_group },
{ "Trash", &MNTB_Trash_group },
{ "Next", &MNTB_Next_group },
{ "Prev", &MNTB_Prev_group },
{ "NewFolder", &MNTB_NewFolder_group },
{ "MarkRead", &MNTB_MarkRead_group },
// Compose
{ "Send", &MNC_Send_group },
{ "Quote", &MNC_Quote_group },
{ "Address", &MNC_Address_group },
{ "Attach", &MNC_Attach_group },
{ "SpellCheck", &MNC_SpellCheck_group },
{ "Save", &MNC_Save_group },
{ "Directory", &MNC_Directory_group },
// Address Book
{ "NewPerson", &MNAB_NewPerson_group },
{ "NewList", &MNAB_NewList_group },
{ "Properties", &MNAB_Properties_group },
{ "Call", &MNAB_Call_group },
#endif
#endif /* MOZ_MAIL_NEWS */
#ifdef EDITOR
// Editor
{ "New", &ed_new_group },

View File

@@ -135,7 +135,6 @@ ICONGROUP(MNTB_ReplyAll)
ICONGROUP(MNTB_Forward)
ICONGROUP(MNTB_File)
ICONGROUP(MNTB_Trash)
ICONGROUP(MNTB_Next)
ICONGROUP(MNTB_Prev)
ICONGROUP(MNTB_MarkRead)
@@ -146,20 +145,6 @@ ICONGROUP(MNTB_NewFolder)
ICONGROUP(MNTB_SignUnsecure)
ICONGROUP(MNTB_SignSecure)
/* Compose Window. */
ICONGROUP(MNC_Send)
/* MNTB_File */
ICONGROUP(MNC_Quote)
ICONGROUP(MNC_Address)
ICONGROUP_VERBOSE(MNC_Attach, &MNC_Attach, NULL, NULL, NULL)
ICONGROUP(MNC_SpellCheck)
ICONGROUP(MNC_Save)
ICONGROUP(MNC_Directory)
/* Tab Icons */
ICONGROUP_VERBOSE(MNC_AddressSmall, &MNC_AddressSmall, NULL, NULL,NULL)
ICONGROUP_VERBOSE(MNC_AttachSmall, &MNC_AttachSmall, NULL, NULL,NULL)
ICONGROUP_VERBOSE(MNC_Options, &MNC_Options, NULL,NULL,NULL)
ICONGROUP(MN_CollectSmall)
ICONGROUP(MN_Collect)
/* TB_Stop */
@@ -175,6 +160,26 @@ ICONGROUP(MNAB_Call)
/* MNTB_Trash */
#endif /* !MOZ_MAIL_NEWS || !WANT_GROUPS */
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE) || !defined(WANT_GROUPS)
/* Compose Window. */
ICONGROUP(MNC_Send)
/* MNTB_File */
ICONGROUP(MNC_Quote)
ICONGROUP(MNC_Address)
ICONGROUP_VERBOSE(MNC_Attach, &MNC_Attach, NULL, NULL, NULL)
ICONGROUP(MNC_SpellCheck)
ICONGROUP(MNC_Save)
ICONGROUP(MNC_Directory)
/* Tab Icons */
ICONGROUP_VERBOSE(MNC_AddressSmall, &MNC_AddressSmall, NULL, NULL,NULL)
ICONGROUP_VERBOSE(MNC_AttachSmall, &MNC_AttachSmall, NULL, NULL,NULL)
ICONGROUP_VERBOSE(MNC_Options, &MNC_Options, NULL,NULL,NULL)
/* Moved from MOZ_MAIL_NEWS because compose window needs it */
ICONGROUP(MNTB_Next)
#endif /* !MOZ_MAIL_NEWS || !WANT_GROUPS */
#if defined(EDITOR) || !defined(WANT_GROUPS)
/* Editor */
ICONGROUP(ed_new)

View File

@@ -102,6 +102,7 @@ XFE_MNListView::isCommandEnabled(CommandType cmd, void *calldata, XFE_CommandInf
if (msg_cmd != (MSG_CommandType)~0)
{
#ifdef MOZ_MAIL_NEWS
if (IS_CMD(xfeCmdGetNewMessages)) {
int num_inboxes = MSG_GetFoldersWithFlag(XFE_MNView::getMaster(),
MSG_FOLDER_FLAG_INBOX,
@@ -118,8 +119,13 @@ XFE_MNListView::isCommandEnabled(CommandType cmd, void *calldata, XFE_CommandInf
(MSG_ViewIndex*)&count,
0, &selectable, NULL, NULL, NULL);
}/* else */
else if (count == 0 ||
(m_pane && MSG_GetNumLines(m_pane) == 0))
else
#endif /* MOZ_MAIL_NEWS */
if (count == 0
#ifdef MOZ_MAIL_NEWS
|| (m_pane && MSG_GetNumLines(m_pane) == 0)
#endif /* MOZ_MAIL_NEWS */
)
{
MSG_CommandStatus(m_pane, msg_cmd,
/* just need some integer pointer here...*/
@@ -135,6 +141,7 @@ XFE_MNListView::isCommandEnabled(CommandType cmd, void *calldata, XFE_CommandInf
return selectable;
}
#ifdef MOZ_MAIL_NEWS
else if (IS_CMD(xfeCmdEditMailFilterRules)
||IS_CMD(xfeCmdSearch))
{
@@ -178,6 +185,7 @@ XFE_MNListView::isCommandEnabled(CommandType cmd, void *calldata, XFE_CommandInf
{
return True; // not sure I feel comfortable with such extremes
}
#endif /* MOZ_MAIL_NEWS */
else
{
return XFE_View::isCommandEnabled(cmd, calldata, info);
@@ -194,6 +202,7 @@ XFE_MNListView::doCommand(CommandType cmd, void *calldata,
{
m_outliner->selectAllItems();
}
#ifdef MOZ_MAIL_NEWS
else if (IS_CMD(xfeCmdEditMailFilterRules))
{
fe_mailfilter_cb(getToplevel()->getBaseWidget(),
@@ -201,6 +210,7 @@ XFE_MNListView::doCommand(CommandType cmd, void *calldata,
(XtPointer) NULL);
}
#endif /* MOZ_MAIL_NEWS */
else
{
XFE_MNView::doCommand(cmd, calldata, info);
@@ -225,6 +235,7 @@ XFE_MNListView::commandToString(CommandType cmd, void *calldata, XFE_CommandInfo
if (msg_cmd != (MSG_CommandType)~0)
{
#ifdef MOZ_MAIL_NEWS
if (IS_CMD(xfeCmdGetNewMessages)) {
int num_inboxes = MSG_GetFoldersWithFlag(XFE_MNView::getMaster(),
MSG_FOLDER_FLAG_INBOX,
@@ -237,7 +248,9 @@ XFE_MNListView::commandToString(CommandType cmd, void *calldata, XFE_CommandInfo
return NULL;
}/* if */
}/* else */
else if (MSG_CommandStatus(m_pane, msg_cmd,
else
#endif /* MOZ_MAIL_NEWS */
if (MSG_CommandStatus(m_pane, msg_cmd,
(MSG_ViewIndex*)selected,
count, NULL, NULL,
(const char **)&display_string, NULL) < 0)
@@ -253,6 +266,7 @@ XFE_MNListView::commandToString(CommandType cmd, void *calldata, XFE_CommandInfo
}
}
}
#ifdef MOZ_MAIL_NEWS
else if (msg_nav != (MSG_MotionType)~0)
{
if (count < 1
@@ -261,6 +275,7 @@ XFE_MNListView::commandToString(CommandType cmd, void *calldata, XFE_CommandInfo
NULL, (const char **)&display_string) < 0)
return NULL;
}
#endif /* MOZ_MAIL_NEWS */
if (display_string)

View File

@@ -25,17 +25,21 @@
#include "ViewGlue.h"
#include "Frame.h"
#ifdef MOZ_MAIL_NEWS
#include "MNView.h"
#ifdef MOZ_MAIL_NEWS
#include "MNListView.h"
#include "MailDownloadFrame.h"
#include "NewsPromptDialog.h"
#include "ComposeFrame.h"
#include "ABListSearchView.h"
#include "ThreadView.h"
#include "dirprefs.h"
#endif
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
#include "ComposeFrame.h"
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
#include "Outlinable.h"
#include "Outliner.h"
#include "xfe.h"
@@ -56,23 +60,29 @@
#endif
#include "xpgetstr.h"
#ifdef MOZ_MAIL_NEWS
extern int XFE_MAIL_PRIORITY_NONE;
extern int XFE_MAIL_PRIORITY_LOWEST;
extern int XFE_MAIL_PRIORITY_LOW;
extern int XFE_MAIL_PRIORITY_NORMAL;
extern int XFE_MAIL_PRIORITY_HIGH;
extern int XFE_MAIL_PRIORITY_HIGHEST;
MSG_Master *XFE_MNView::m_master = NULL;
extern int XFE_PROBLEMS_EXECUTING;
extern int XFE_TERMINATED_ABNORMALLY;
extern int XFE_APP_EXITED_WITH_STATUS;
extern int XFE_COULDNT_FORK_FOR_DELIVERY;
#ifdef MOZ_MAIL_NEWS
MSG_Prefs *XFE_MNView::m_prefs = NULL;
extern int XFE_MAIL_SPOOL_UNKNOWN;
extern int XFE_UNABLE_TO_OPEN;
extern int XFE_NO_KEEP_ON_SERVER_WITH_MOVEMAIL;
extern int XFE_COULDNT_FORK_FOR_MOVEMAIL;
extern int XFE_PROBLEMS_EXECUTING;
extern int XFE_TERMINATED_ABNORMALLY;
extern int XFE_APP_EXITED_WITH_STATUS;
extern int XFE_COULDNT_FORK_FOR_DELIVERY;
extern int XFE_GET_NEXT_N_MSGS;
@@ -80,9 +90,6 @@ extern int XFE_MARKBYDATE_CAPTION;
extern int XFE_MARKBYDATE;
extern int XFE_DATE_MUST_BE_MM_DD_YY;
MSG_Master *XFE_MNView::m_master = NULL;
MSG_Prefs *XFE_MNView::m_prefs = NULL;
MSG_BIFF_STATE XFE_MNView::m_biffstate = MSG_BIFF_Unknown;
fe_icon XFE_MNView::inboxIcon = { 0 };
@@ -138,13 +145,15 @@ const char * XFE_MNView::bannerNeedsUpdating = "XFE_MNView::bannerNeedsUpdating"
const char * XFE_MNView::foldersHaveChanged = "XFE_MNView::foldersHaveChanged";
const char * XFE_MNView::newsgroupsHaveChanged = "XFE_MNView::newsgroupsHaveChanged";
const char * XFE_MNView::folderChromeNeedsUpdating = "XFE_MNView::folderChromeNeedsUpdating";
const char * XFE_MNView::MNChromeNeedsUpdating = "XFE_MNView::MNChromeNeedsUpdating";
const char * XFE_MNView::msgWasDeleted = "XFE_MNView::msgWasDeleted";
const char * XFE_MNView::folderDeleted = "XFE_MNView::folderDeleted";
XP_Bool XFE_MNView::m_messageDownloadInProgress = False;
int XFE_MNView::m_numFolderBeingLoaded = 0; // Indicate how many folder are loaded
#endif /* MOZ_MAIL_NEWS */
const char * XFE_MNView::MNChromeNeedsUpdating = "XFE_MNView::MNChromeNeedsUpdating";
XFE_MNView::XFE_MNView(XFE_Component *toplevel_component,
XFE_View *parent_view,
@@ -154,25 +163,29 @@ XFE_MNView::XFE_MNView(XFE_Component *toplevel_component,
{
m_pane = p;
// a safe default;
m_displayingNewsgroup = FALSE;
// initialize the mail master
getMaster();
#ifdef MOZ_MAIL_NEWS
// a safe default;
m_displayingNewsgroup = FALSE;
XFE_MozillaApp::theApp()->registerInterest(
XFE_MozillaApp::biffStateChanged,
this,
(XFE_FunctionNotification) updateBiffState_cb);
#endif /* MOZ_MAIL_NEWS */
}
XFE_MNView::~XFE_MNView()
{
#ifdef MOZ_MAIL_NEWS
XFE_MozillaApp::theApp()->unregisterInterest(
XFE_MozillaApp::biffStateChanged,
this,
(XFE_FunctionNotification)updateBiffState_cb);
#endif /* MOZ_MAIL_NEWS */
}
void
@@ -245,18 +258,22 @@ XFE_MNView::commandToMsgCmd(CommandType cmd)
#define BEGIN_MN_MSG_MAP() if (0)
#define MN_MSGMAP(the_cmd, the_msg_cmd) else if (cmd == (the_cmd)) msg_cmd = (the_msg_cmd)
BEGIN_MN_MSG_MAP();
MN_MSGMAP(xfeCmdAddAllToAddressBook, MSG_AddAll);
MN_MSGMAP(xfeCmdAddNewsgroup, MSG_AddNewsGroup);
MN_MSGMAP(xfeCmdAddSenderToAddressBook, MSG_AddSender);
MN_MSGMAP(xfeCmdCancelMessages, MSG_CancelMessage);
MN_MSGMAP(xfeCmdClearNewGroups, MSG_ClearNew); // subscribe ui only
MN_MSGMAP(xfeCmdCollapseAll, MSG_CollapseAll); // subscribe ui only
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
MN_MSGMAP(xfeCmdComposeArticle, MSG_PostNew);
MN_MSGMAP(xfeCmdComposeArticleHTML, MSG_PostNew);
MN_MSGMAP(xfeCmdComposeArticlePlain, MSG_PostNew);
MN_MSGMAP(xfeCmdComposeMessage, MSG_MailNew);
MN_MSGMAP(xfeCmdComposeMessageHTML, MSG_MailNew);
MN_MSGMAP(xfeCmdComposeMessagePlain, MSG_MailNew);
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
#ifdef MOZ_MAIL_NEWS
MN_MSGMAP(xfeCmdAddAllToAddressBook, MSG_AddAll);
MN_MSGMAP(xfeCmdAddNewsgroup, MSG_AddNewsGroup);
MN_MSGMAP(xfeCmdAddSenderToAddressBook, MSG_AddSender);
MN_MSGMAP(xfeCmdCancelMessages, MSG_CancelMessage);
MN_MSGMAP(xfeCmdClearNewGroups, MSG_ClearNew); // subscribe ui only
MN_MSGMAP(xfeCmdCollapseAll, MSG_CollapseAll); // subscribe ui only
MN_MSGMAP(xfeCmdCompressAllFolders, MSG_CompressAllFolders);
MN_MSGMAP(xfeCmdCompressFolders, MSG_CompressFolder);
MN_MSGMAP(xfeCmdDeleteFolder, MSG_DeleteFolder);
@@ -331,6 +348,7 @@ XFE_MNView::commandToMsgCmd(CommandType cmd)
MN_MSGMAP(xfeCmdWrapLongLines, MSG_WrapLongLines);
MN_MSGMAP(xfeCmdEditConfiguration, MSG_ManageMailAccount);
MN_MSGMAP(xfeCmdModerateDiscussion, MSG_ModerateNewsgroup);
#endif /* MOZ_MAIL_NEWS */
#undef BEGIN_MN_MSG_MAP
#undef MN_MSG_MAP
@@ -385,6 +403,7 @@ char *
XFE_MNView::commandToString(CommandType cmd, void * calldata, XFE_CommandInfo* info)
{
#define IS_CMD(command) cmd == (command)
#ifdef MOZ_MAIL_NEWS
if (IS_CMD(xfeCmdNewFolder))
{
if (m_displayingNewsgroup)
@@ -428,11 +447,14 @@ XFE_MNView::commandToString(CommandType cmd, void * calldata, XFE_CommandInfo* i
return buf;
}
else
#endif /* MOZ_MAIL_NEWS */
return XFE_View::commandToString(cmd, calldata, info);
#undef IS_CMD
}
#ifdef MOZ_MAIL_NEWS
void
XFE_MNView::markReadByDate()
{
@@ -624,26 +646,22 @@ XFE_MNView::getNewMail()
}
}
void
XFE_MNView::paneChanged(XP_Bool /*asynchronous*/,
MSG_PANE_CHANGED_NOTIFY_CODE notify_code,
int32 /*value*/)
{
notifyInterested(XFE_MNView::bannerNeedsUpdating, (void*)notify_code);
}
#endif /* MOZ_MAIL_NEWS */
MSG_Master *
XFE_MNView::getMaster()
{
if (m_master == NULL)
{
// XFE_MNView::m_prefs = MSG_CreatePrefs();
// XFE_MNView::m_prefs = MSG_CreatePrefs();
m_master = MSG_InitializeMail(fe_mailNewsPrefs);
}
return m_master;
}
#ifdef MOZ_MAIL_NEWS
void
XFE_MNView::destroyMasterAndShutdown()
{
@@ -663,6 +681,18 @@ XFE_MNView::isDisplayingNews()
return m_displayingNewsgroup;
}
#endif /* MOZ_MAIL_NEWS */
void
XFE_MNView::paneChanged(XP_Bool /*asynchronous*/,
MSG_PANE_CHANGED_NOTIFY_CODE notify_code,
int32 /*value*/)
{
#ifdef MOZ_MAIL_NEWS
notifyInterested(XFE_MNView::bannerNeedsUpdating, (void*)notify_code);
#endif /* MOZ_MAIL_NEWS */
}
Boolean
XFE_MNView::handlesCommand(CommandType cmd, void* calldata, XFE_CommandInfo* )
{
@@ -712,6 +742,7 @@ XFE_MNView::doCommand(CommandType cmd, void *calldata, XFE_CommandInfo* info)
CONTEXT_DATA(m_contextData)->stealth_cmd = (fe_globalPrefs.send_html_msg == True) ;
MSG_Command(m_pane, commandToMsgCmd(cmd), NULL, 0);
}
#ifdef MOZ_MAIL_NEWS
else if (cmd == xfeCmdCleanUpDisk)
{
if (MSG_CleanupNeeded(getMaster()))
@@ -724,6 +755,7 @@ XFE_MNView::doCommand(CommandType cmd, void *calldata, XFE_CommandInfo* info)
progressFrame->cleanUpNews();
}
}
#endif /* MOZ_MAIL_NEWS */
else
{
XFE_View::doCommand(cmd, calldata, info);
@@ -732,6 +764,8 @@ XFE_MNView::doCommand(CommandType cmd, void *calldata, XFE_CommandInfo* info)
}
#ifdef MOZ_MAIL_NEWS */
MSG_BIFF_STATE
XFE_MNView::getBiffState()
{
@@ -769,11 +803,6 @@ FE_PaneChanged(MSG_Pane *pane, XP_Bool asynchronous,
// MSG_HandlePaneChangedNotifications(pane, asynchronous, code, value);
}
#endif // MOZ_MAIL_NEWS
#ifdef MOZ_MAIL_NEWS
extern "C" void
FE_UpdateBiff(MSG_BIFF_STATE state)
{
@@ -791,6 +820,10 @@ FE_UpdateToolbar (MWContext *context)
f->notifyInterested(XFE_View::chromeNeedsUpdating, NULL);
}
#endif // MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
extern "C" void
FE_UpdateCompToolbar(MSG_Pane* comppane)
{
@@ -839,6 +872,11 @@ FE_DestroyMailCompositionContext(MWContext* context)
cf->destroyWhenAllConnectionsComplete();
}
#endif // MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE
#ifdef MOZ_MAIL_NEWS
extern "C" MWContext*
FE_GetAddressBookContext(MSG_Pane* pane, XP_Bool /*viewnow*/)
{
@@ -954,12 +992,16 @@ FE_ListChangeFinished(MSG_Pane* pane, XP_Bool asynchronous,
outliner->listChangeFinished(asynchronous, notify, where, num, MSG_GetNumLines(pane));
}
#endif /* MOZ_MAIL_NEWS */
MSG_Master *
fe_getMNMaster()
{
return XFE_MNView::getMaster();
}
#ifdef MOZ_MAIL_NEWS
static void
fe_incdone(void* closure, XP_Bool result)
{
@@ -1136,6 +1178,31 @@ fe_run_movemail (MWContext *context, const char *from, const char *to)
}
}
extern "C" XP_Bool
FE_NewsDownloadPrompt(MWContext *context,
int32 numMessagesToDownload,
XP_Bool *downloadAll)
{
XFE_Frame *f = ViewGlue_getFrame(XP_GetNonGridContext(context));
XP_Bool ret_val;
XFE_NewsPromptDialog *dialog;
if (!f)
return False;
dialog = new XFE_NewsPromptDialog(f->getBaseWidget(), numMessagesToDownload);
ret_val = dialog->post();
*downloadAll = dialog->getDownloadAll();
delete dialog;
return ret_val;
}
#endif // MOZ_MAIL_NEWS
/* If we're set up to deliver mail/news by running a program rather
than by talking to SMTP/NNTP, this does it.
@@ -1158,6 +1225,9 @@ msg_DeliverMessageExternally(MWContext *context, const char *msg_file)
{
struct sigaction newact, oldact;
static char *cmd = 0;
#ifdef DEBUG_akkana
printf("msg_DeliverMessageExternally()\n");
#endif
if (!cmd)
{
/* The first time we're invoked, look up the command in the
@@ -1169,9 +1239,13 @@ msg_DeliverMessageExternally(MWContext *context, const char *msg_file)
cmd = XP_STRDUP(cmd);
}
if (!cmd || !*cmd)
if (!cmd || !*cmd) {
#ifdef DEBUG_akkana
printf("Proceeding with normal delivery\n");
#endif
/* No external command -- proceed with "normal" delivery. */
return 0;
}
else
{
pid_t forked;
@@ -1274,31 +1348,7 @@ msg_DeliverMessageExternally(MWContext *context, const char *msg_file)
}
}
extern "C" XP_Bool
FE_NewsDownloadPrompt(MWContext *context,
int32 numMessagesToDownload,
XP_Bool *downloadAll)
{
XFE_Frame *f = ViewGlue_getFrame(XP_GetNonGridContext(context));
XP_Bool ret_val;
XFE_NewsPromptDialog *dialog;
if (!f)
return False;
dialog = new XFE_NewsPromptDialog(f->getBaseWidget(), numMessagesToDownload);
ret_val = dialog->post();
*downloadAll = dialog->getDownloadAll();
delete dialog;
return ret_val;
}
extern "C" MSG_Master*
FE_GetMaster() {
return fe_getMNMaster();
}
#endif // MOZ_MAIL_NEWS

View File

@@ -37,17 +37,10 @@ public:
XFE_MNView(XFE_Component *toplevel_component, XFE_View *parent_view, MWContext *context, MSG_Pane *p);
virtual ~XFE_MNView();
MSG_Pane *getPane();
void setPane(MSG_Pane *new_pane);
void destroyPane();
/* the one command method we have. */
char *commandToString(CommandType cmd, void *calldata, XFE_CommandInfo *info);
virtual void paneChanged(XP_Bool asynchronous, MSG_PANE_CHANGED_NOTIFY_CODE notify_code, int32 value);
virtual void updateCompToolbar();
/* used by toplevel to see which view can handle a command. Returns true
if we can handle it. */
virtual Boolean handlesCommand(CommandType cmd, void *calldata = NULL,
@@ -58,12 +51,28 @@ public:
XFE_CommandInfo* i = NULL);
virtual void updateCompToolbar();
// these next two are useful in updating more than one window's chrome.
static const char *folderChromeNeedsUpdating;
static const char *MNChromeNeedsUpdating;
virtual void paneChanged(XP_Bool asynchronous, MSG_PANE_CHANGED_NOTIFY_CODE notify_code, int32 value);
MSG_Pane *getPane();
void setPane(MSG_Pane *new_pane);
void destroyPane();
static MSG_Master *getMaster();
#ifdef MOZ_MAIL_NEWS
XP_Bool isDisplayingNews();
static MSG_BIFF_STATE getBiffState();
static void setBiffState(MSG_BIFF_STATE state);
static MSG_Master *getMaster();
static void destroyMasterAndShutdown(); // only do this if we're shutting down the application
static const char *bannerNeedsUpdating; // notify the parent frame that the MNBanner needs updating.
@@ -72,10 +81,6 @@ public:
static const char *msgWasDeleted; // in case we need to close a frame
static const char *folderDeleted; // in case we need to close a frame
// these next two are useful in updating more than one window's chrome.
static const char *folderChromeNeedsUpdating;
static const char *MNChromeNeedsUpdating;
// icons used in the mail/news outliners and proxy icons
// special folder icons
@@ -122,9 +127,16 @@ public:
static fe_icon closedSpoolIcon;
static fe_icon collectionsIcon;
#endif /* MOZ_MAIL_NEWS */
protected:
MSG_Pane *m_pane;
static MSG_Master *m_master;
#ifdef MOZ_MAIL_NEWS
static MSG_Prefs *m_prefs;
/* useful in both the threadview and msgview. */
XP_Bool m_displayingNewsgroup;
@@ -135,21 +147,20 @@ protected:
// Indicating how many folder being
// loaded in the meantime
static MSG_Master *m_master;
static MSG_Prefs *m_prefs;
virtual MSG_MotionType commandToMsgNav(CommandType cmd);
virtual MSG_CommandType commandToMsgCmd(CommandType cmd);
virtual MSG_PRIORITY commandToPriority(CommandType cmd);
virtual char *priorityToString(MSG_PRIORITY priority);
virtual void getNewNews();
virtual void getNewMail();
virtual void markReadByDate();
// update the biff desktop icon
XFE_CALLBACK_DECL(updateBiffState)
#endif /* MOZ_MAIL_NEWS */
virtual MSG_MotionType commandToMsgNav(CommandType cmd);
virtual MSG_CommandType commandToMsgCmd(CommandType cmd);
virtual MSG_PRIORITY commandToPriority(CommandType cmd);
virtual char *priorityToString(MSG_PRIORITY priority);
};
extern "C" MSG_Master *fe_getMNMaster();

View File

@@ -27,6 +27,10 @@ LIBRARY_NAME = xfe2
REQUIRES = nspr layer js jtools applet security img util parse layout hook pref java libfont ldap lay style xfeicons rdf xpcom plug
ifdef MOZ_MAIL_COMPOSE
REQUIRES += mailto
endif
CPPSRCS = \
plugin.cpp \
BackForwardMenu.cpp \
@@ -228,6 +232,45 @@ CPPSRCS += \
$(NULL)
endif
ifdef MOZ_MAIL_COMPOSE
CPPSRCS += \
AddressOutliner.cpp \
AddressFolderView.cpp \
AttachPanel.cpp \
AttachmentMenu.cpp \
ComposeAttachDialog.cpp \
ComposeAttachFolderView.cpp \
ComposeFolderView.cpp \
ComposeFrame.cpp \
ComposeView.cpp \
TextEditorView.cpp \
MNView.cpp \
MNListView.cpp \
$(NULL)
endif
ifdef MOZ_MAIL_COMPOSE_RADICAL
CPPSRCS += \
msgglue.cpp \
msgcflds.cpp \
msgpane.cpp \
msgcpane.cpp \
msgmast.cpp \
msgprefs.cpp \
msgsend.cpp \
msgsendp.cpp \
msgurlq.cpp \
ptrarray.cpp \
msgzap.cpp \
$(NULL)
NOCPPSRC += msgurlq.cpp \
ptrarray.cpp \
$(NULL)
# Also need msgsend.cpp and OptionFolderView.cpp
endif
ifdef MOZ_TASKBAR
CPPSRCS += \
TaskBar.cpp \
@@ -267,6 +310,9 @@ CSRCS = commands.c
include $(DEPTH)/config/rules.mk
INCLUDES += -I$(OBJDIR) -I.. -I../Microline3.0 -I../XfeWidgets -I../DtWidgets -I$(DEPTH)/modules/libreg/include
ifdef MOZ_MAIL_COMPOSE
INCLUDES += -I$(DEPTH)/dist/public/htmldlgs
endif
#ifndef MOZ_LITE
#CFLAGS += -DEDITOR
@@ -287,6 +333,10 @@ ifdef USE_MOTIF_DND
DEFINES += -DUSE_MOTIF_DND
endif
ifdef MOZ_MAIL_COMPOSE
DEFINES += -DMOZ_MAIL_COMPOSE
endif
$(LIBRARY): $(OBJS)

View File

@@ -2727,7 +2727,7 @@ FE_UsersOrganization (void)
return cached_org;
}
#ifdef MOZ_MAIL_NEWS
#if MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE
const char *
FE_UsersSignature (void)
{
@@ -2798,7 +2798,7 @@ FE_UsersSignature (void)
return signature;
}
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
int32

View File

@@ -397,6 +397,9 @@ MOZ_COMMUNICATOR_CONFIG_JS = 1
MOZ_COPY_ALL_JARS = 1
NO_SECURITY = 1
endif
ifdef MOZ_MAIL_COMPOSE
DEFINES += -DMOZ_MAIL_COMPOSE
endif
ifdef MOZ_GOLD
DEFINES += -DGOLD
BUILD_GOLD = 1

2104
mozilla/include/net.h Normal file

File diff suppressed because it is too large Load Diff

129
mozilla/include/shistele.h Normal file
View File

@@ -0,0 +1,129 @@
/* -*- 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.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef SHISTELE_H
#define SHISTELE_H
#include "xp_list.h"
/*
** This structure holds pointer so all saved data in the history. It is
** also used by URL_Structs and is ultimately fed to layout.
**
** Warning: Don't change the names of the fields because they're used by
** macros.
*/
typedef struct SHIST_SavedData {
void* FormList; /* layout data to recreate forms */
void* EmbedList; /* layout data to recreate embeds and applets */
void* Grid; /* layout data to recreate grids */
#ifdef MOCHA
void* Window; /* window object for grid being resized */
/* XXX none of this would be necessary if frameset docs were reparsed */
void* OnLoad; /* JavaScript onload event handler source */
void* OnUnload; /* JavaScript onunload event handler source */
void* OnFocus; /* JavaScript onfocus event handler source */
void* OnBlur; /* JavaScript onblur event handler source */
void* OnHelp; /* JavaScript onhelp event handler source */
void* OnMouseOver; /* JavaScript onmouseover event handler source */
void* OnMouseOut; /* JavaScript onmouseout event handler source */
void* OnDragDrop; /* JavaScript ondragdrop event handler source */
void* OnMove; /* JavaScript onmove event handler source */
void* OnResize; /* JavaScript onresize event handler source */
void* style_stack; /* JSSS style stack info */
#endif
} SHIST_SavedData;
/*
This structure encapsulates all of the information needed for the
session history. It should contain stuff like a list of all of the
documents in the current history and a pointer to where the currently
viewed document sits in the chain.
WARNING!! Some slots of this structure are shared with URL_Struct and
net_CacheObject. If you add a slot, decide whether it needs to be
shared as well.
*/
struct _History_entry {
char * title; /* title for this entry */
char * address; /* URL address string */
char * content_name; /* Server-provided "real name", used for
default file name when saving. */
int method; /* method of acessing URL */
char * referer; /* What document points to this url */
char * post_data; /* post data */
int32 post_data_size; /* post data size */
Bool post_data_is_file; /* is the post data a filename? */
char * post_headers; /* content type for posted data */
int32 position_tag; /* layout specific data for determining
* where in the document the user was
*/
time_t last_modified; /* time of last modification */
time_t last_access; /* time of last access */
int history_num; /* special hack to add navigation */
SHIST_SavedData savedData; /* layout data */
PRPackedBool
is_binary, /* is this a binary object pretending
* to be HTML?
*/
is_active, /* is it an active stream? */
is_netsite, /* did it come from netsite? */
replace; /* did it come from netsite? */
int transport_method; /* network, disk cache, memory cache */
uint32 refresh; /* refresh interval */
char *refresh_url; /* URL to refresh */
char *wysiwyg_url; /* URL for WYSIWYG printing/saving */
/* Security information */
int security_on; /* is security on? */
/* Security info on a connection is opaque */
unsigned char *sec_info;
/* Unique identifier */
int32 unique_id;
int32 ref_count;
/* Page services*/
char *page_services_url; /* If it supports services, what link is used */
/* HTTP_11 support*/
char *etag; /* Unique entity tag */
char *origin_url; /* original referrer of javascript: URL */
};
#define SHIST_CAME_FROM_NETWORK 0
#define SHIST_CAME_FROM_DISK_CACHE 1
#define SHIST_CAME_FROM_MEMORY_CACHE 2
struct History_ {
XP_List * list_ptr; /* pointer to linked list */
int cur_doc; /* an index into the list that points to the current document */
History_entry *cur_doc_ptr; /* a ptr to the current doc entry */
int32 num_entries; /* size of the history list */
int32 max_entries; /* maximum size of list; -1 == no limit */
};
#endif /* SHISTELE_H */

View File

@@ -35,6 +35,10 @@ ifdef MOZ_MAIL_NEWS
DIRS += libmsg
endif
ifdef MOZ_MAIL_COMPOSE
DIRS += mailto libmime
endif
ifdef MOZ_NEO
DIRS += libneo
endif

View File

@@ -1112,8 +1112,8 @@ void EDT_ResetLayoutElement( ED_Element* /* pElement */, intn /* iEditOffset */,
}
#ifdef DEBUG
void EDT_VerifyLayoutElement( MWContext *pContext, LO_Element *pLoElement,
XP_Bool bPrint ){
void EDT_VerifyLayoutElement( MWContext * /*pContext*/, LO_Element *pLoElement,
XP_Bool /*bPrint*/ ){
CEditElement *pElement = pLoElement->lo_any.edit_element;
if( pElement ){
if( !pElement->IsLeaf() ){

View File

@@ -71,7 +71,7 @@ PUBLIC void INTL_CCCReportMetaCharsetTag(MWContext *context, char *charset_tag)
INTL_CSIReportMetaCharsetTag(c, charset_tag, context->type);
}
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
#if 0
/*
@@ -130,7 +130,7 @@ mail_report_autodetect(void *closure, CCCDataObject obj, uint16 doc_csid)
INTL_SetCSIWinCSID(c, INTL_GetCCCToCSID(obj));
}
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
#ifndef XP_WIN
#ifndef XP_MAC
@@ -186,7 +186,7 @@ FE_DefaultDocCharSetID(iDocumentContext context)
#endif /*XP_MAC*/
#endif
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_COMPOSE) || defined(MOZ_MAIL_NEWS)
/*
INTL_ConvMailToWinCharCode
@@ -237,10 +237,7 @@ unsigned char *INTL_ConvMailToWinCharCode(iDocumentContext context,
return NULL ;
return pDest ;
}
#endif /* MOZ_MAIL_NEWS */
#if defined(MOZ_MAIL_COMPOSE) || defined(MOZ_MAIL_NEWS)
/*
This is the ugly hack for Korean News and Mail
Our libmsg code assume mail and news use the same code.

View File

@@ -48,13 +48,12 @@ CSRCS = mimecont.c \
mimetpla.c \
mimetric.c \
mimeunty.c \
mimevcrd.c \
mimecryp.c \
$(NULL)
ifndef NO_SECURITY
CSRCS += mimempkc.c \
mimepkcs.c \
mimecryp.c \
$(NULL)
endif

View File

@@ -471,8 +471,13 @@ mime_parse_stream_complete (NET_StreamClass *stream)
{
fields = MSG_CreateCompositionFields( from, repl, to, cc, bcc, fcc, grps, foll,
org, subj, refs, 0, priority, 0, news_host,
#ifdef MOZ_MAIL_NEWS
MSG_GetMailEncryptionPreference(),
MSG_GetMailSigningPreference());
MSG_GetMailSigningPreference()
#else /* MOZ_MAIL_NEWS */
FALSE, FALSE
#endif /* MOZ_MAIL_NEWS */
);
if (fields)
cpane = FE_CreateCompositionPane(mdd->context, fields, NULL, MSG_DEFAULT);
}

View File

@@ -147,10 +147,10 @@ mime_find_class (const char *content_type, MimeHeaders *hdrs,
class = (MimeObjectClass *)&mimeInlineTextRichtextClass;
else if (!strcasecomp(content_type+5, "plain"))
class = (MimeObjectClass *)&mimeInlineTextPlainClass;
#ifndef MOZILLA_30
#if !defined(MOZILLA_30) && defined(MOZ_MAIL_NEWS)
else if (!strcasecomp(content_type+5, "x-vcard"))
class = (MimeObjectClass *)&mimeInlineTextVCardClass;
#endif /* !MOZILLA_30 */
#endif /* !MOZILLA_30 && MOZ_MAIL_NEWS */
else if (!exact_match_p)
class = (MimeObjectClass *)&mimeInlineTextPlainClass;
}
@@ -387,11 +387,11 @@ mime_create (const char *content_type, MimeHeaders *hdrs,
{
/* change content-Disposition for vcards to be inline so */
/* we can see a nice html display */
#ifndef MOZILLA_30
#if !defined(MOZILLA_30) && defined(MOZ_MAIL_NEWS)
if (mime_subclass_p(class,(MimeObjectClass *)&mimeInlineTextVCardClass))
StrAllocCopy(content_disposition, "inline");
else
#endif /* !MOZILLA_30 */
#endif /* !MOZILLA_30 && MOZ_MAIL_NEWS */
content_disposition = (hdrs
? MimeHeaders_get(hdrs, HEADER_CONTENT_DISPOSITION,
TRUE, FALSE)

View File

@@ -29,7 +29,9 @@
#include "mimetric.h" /* for MIME_RichtextConverter */
#include "mimethtm.h"
#include "mimemsig.h"
#ifndef NO_SECURITY
#include "mimecryp.h"
#endif /* NO_SECURITY */
#ifndef MOZILLA_30
# include "xpgetstr.h"
# include "mimevcrd.h" /* for MIME_VCardConverter */
@@ -1122,11 +1124,13 @@ MIME_MessageConverter (int format_out, void *closure,
)
{
#ifndef MOZILLA_30
#ifdef MOZ_MAIL_NEWS
MSG_Pane* pane = MSG_FindPane(context, MSG_MESSAGEPANE);
msd->options->rot13_p = FALSE;
if (pane) {
msd->options->rot13_p = MSG_ShouldRot13Message(pane);
}
#endif /* MOZ_MAIL_NEWS */
#else /* MOZILLA_30 */
XP_Bool all_headers_p = FALSE;
@@ -1708,9 +1712,12 @@ mime_get_main_object(MimeObject* obj)
obj = cobj->children[0];
for (;;) {
if (!mime_subclass_p(obj->class,
(MimeObjectClass*) &mimeMultipartSignedClass) &&
!mime_subclass_p(obj->class,
(MimeObjectClass*) &mimeFilterClass)) {
(MimeObjectClass*) &mimeMultipartSignedClass)
#ifndef NO_SECURITY
&& !mime_subclass_p(obj->class,
(MimeObjectClass*) &mimeFilterClass)
#endif /* NO_SECURITY */
) {
return obj;
}
/* Our main thing is a signed or encrypted object.
@@ -2083,6 +2090,7 @@ MIME_DisplayAttachmentPane(MWContext* context)
MSG_Pane* pane = context->mime_data->last_pane;
if (!pane)
pane = MSG_FindPane(context, MSG_MESSAGEPANE);
#ifdef MOZ_MAIL_NEWS
if (pane) {
MSG_MessagePaneCallbacks* callbacks;
void* closure;
@@ -2091,11 +2099,13 @@ MIME_DisplayAttachmentPane(MWContext* context)
(*callbacks->UserWantsToSeeAttachments)(pane, closure);
}
}
#else /* MOZ_MAIL_NEWS */
assert(0); /* Do we need to handle this? */
#endif /* MOZ_MAIL_NEWS */
}
return 0;
}
/* This struct is the state we used in MIME_VCardConverter() */
struct mime_vcard_data {
URL_Struct *url; /* original url */
@@ -2248,9 +2258,13 @@ MIME_VCardConverter ( int format_out,
vcd->options->stream_closure = vcd;
vcd->options->html_closure = vcd;
#ifdef PARSE_VCARDS
obj = mime_new ( (MimeObjectClass *) &mimeInlineTextVCardClass,
(MimeHeaders *) NULL,
TEXT_VCARD );
#else /* PARSE_VCARDS */
obj = 0;
#endif /* PARSE_VCARDS */
if ( !obj ) {
FREEIF( vcd->options->part_to_load );

View File

@@ -35,7 +35,9 @@ static int MimeMessage_parse_eof (MimeObject *, XP_Bool);
static int MimeMessage_close_headers (MimeObject *obj);
static int MimeMessage_write_headers_html (MimeObject *);
#ifndef NO_SECURITY
extern MimeObjectClass mimeFilterClass;
#endif /* NO_SECURITY */
#ifdef XP_UNIX
extern void MimeHeaders_do_unix_display_hook_hack(MimeHeaders *);
@@ -439,6 +441,7 @@ MimeMessage_parse_eof (MimeObject *obj, XP_Bool abort_p)
}
}
#ifndef NO_SECURITY
#ifdef MIME_DRAFTS
if ( obj->options &&
obj->options->decompose_file_p &&
@@ -452,6 +455,7 @@ MimeMessage_parse_eof (MimeObject *obj, XP_Bool abort_p)
if ( status < 0 ) return status;
}
#endif /* MIME_DRAFTS */
#endif /* NO_SECURITY */
/* Put out a separator after every message/rfc822 object. */
@@ -476,6 +480,7 @@ MimeMessage_add_child (MimeObject *parent, MimeObject *child)
XP_ASSERT(cont->nchildren == 0);
if (cont->nchildren != 0) return -1;
#ifndef NO_SECURITY
#ifdef MIME_DRAFTS
if ( parent->options &&
parent->options->decompose_file_p &&
@@ -489,6 +494,7 @@ MimeMessage_add_child (MimeObject *parent, MimeObject *child)
if ( status < 0 ) return status;
}
#endif /* MIME_DRAFTS */
#endif /* NO_SECURITY */
return ((MimeContainerClass*)&MIME_SUPERCLASS)->add_child (parent, child);
}

View File

@@ -197,7 +197,11 @@ MimeInlineTextVCard_parse_line (char *line, int32 length, MimeObject *obj)
return 0;
}
/* This routine generates a lot of unresolved symbols in the free src:
Parse_MIME, nextVObjectInList, cleanVObject, isAPropertyOf,
vObjectUStringZValue, fakeCString, writeMemVObjects, vObjectName,
initPropIterator, moreIteration, nextVObject
*/
static int
MimeInlineTextVCard_parse_eof (MimeObject *obj, XP_Bool abort_p)
{

View File

@@ -37,6 +37,10 @@ include $(DEPTH)/config/config.mk
ifdef MOZ_MAIL_NEWS
CSRCS += mime.c dirprefs.c
else
ifdef MOZ_MAIL_COMPOSE
CSRCS += mime.c
endif
endif
include $(DEPTH)/config/rules.mk

1107
mozilla/lib/libmisc/shist.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -111,6 +111,13 @@ CPPSRCS += imaphier.cpp \
$(NULL)
endif
ifdef MOZ_MAIL_COMPOSE
CSRCS += \
mksmtp.c \
mkpop3.c \
$(NULL)
endif
ifndef NO_UNIX_ASYNC_DNS
CSRCS += unix-dns.c
endif

View File

@@ -68,14 +68,6 @@ extern int XP_EDITOR_NON_HTML;
#include "robotxt.h"
#endif
#ifdef MOZ_MAIL_NEWS
/* #### defined in libmsg/msgutils.c */
extern NET_StreamClass *
msg_MakeRebufferingStream (NET_StreamClass *next_stream,
URL_Struct *url,
MWContext *context);
#endif /* MOZ_MAIL_NEWS */
/* defined at the bottom of this file */
NET_StreamClass *
NET_PrintRawToDisk(int format_out,
@@ -83,7 +75,14 @@ NET_PrintRawToDisk(int format_out,
URL_Struct *url_struct,
MWContext *context);
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS)|| defined(MOZ_MAIL_COMPOSE)
/* #### defined in libmsg/msgutils.c */
extern NET_StreamClass *
msg_MakeRebufferingStream (NET_StreamClass *next_stream,
URL_Struct *url,
MWContext *context);
typedef struct MIME_DataObject {
MimeDecoderData *decoder; /* State used by the decoder */
NET_StreamClass *next_stream; /* Where the output goes */
@@ -91,9 +90,6 @@ typedef struct MIME_DataObject {
} MIME_DataObject;
static int
net_mime_decoder_cb (const char *buf, int32 size, void *closure)
{
@@ -165,7 +161,7 @@ PRIVATE void net_MimeEncodingConverterAbort (NET_StreamClass *stream, int status
}
XP_FREE (data);
}
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
PRIVATE NET_StreamClass *
NET_MimeEncodingConverter_1 (int format_out,
@@ -175,7 +171,7 @@ NET_MimeEncodingConverter_1 (int format_out,
XP_Bool partial_p,
NET_StreamClass *next_stream)
{
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
MIME_DataObject* obj;
MimeDecoderData *(*fn) (int (*) (const char*, int32, void*), void*) = 0;
@@ -258,7 +254,7 @@ NET_MimeEncodingConverter_1 (int format_out,
#else
XP_ASSERT(0);
return(NULL);
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
}
@@ -428,8 +424,8 @@ net_RegisterDefaultDecoders (void)
FO_PRESENT,
NULL,
NET_PlainTextConverter);
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS)
#if defined(XP_MAC)
NET_RegisterContentTypeConverter (MULTIPART_APPLEDOUBLE, FO_SAVE_AS,
NULL, fe_MakeAppleDoubleDecodeStream_1);
@@ -786,7 +782,7 @@ NET_RegisterMIMEDecoders (void)
NET_RegisterContentTypeConverter ("*", FO_MULTIPART_IMAGE,
(void *) 1, IL_ViewStream);
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
/* Decoders for libmsg/compose.c */
MSG_RegisterConverters ();
#endif

View File

@@ -0,0 +1,880 @@
/* -*- 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.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* Please leave outside of ifdef for window precompiled headers */
#include "mkutils.h"
#ifdef MOZILLA_CLIENT
/* Publicly released Netscape cache access routines.
*
* These routines are shared between the netscape executable
* and the programs released as a cache developers kit.
*
* Created: Lou Montulli <montulli@netscape.com>, July-95.
* Modifications/Addition: Gagan Saksena, 97
*/
#ifndef EXT_DB_ROUTINES
#include "secnav.h"
#include "sechash.h"
#endif
#include "extcache.h" /* include this for everything */
#ifdef EXT_DB_ROUTINES
#include <fcntl.h>
#include <sys/stat.h>
#include <assert.h>
typedef struct {
int32 len;
char *data;
} SECItem;
#ifdef _sgi
#include <sys/endian.h>
#endif /* _sgi */
/* URL methods
*/
#define URL_GET_METHOD 0
#define URL_POST_METHOD 1
#define URL_HEAD_METHOD 2
#endif /* DB_STORE */
MODULE_PRIVATE DBT *
net_CacheDBTDup(DBT *obj)
{
DBT * rv = XP_NEW(DBT);
if(!rv)
return(NULL);
rv->size = obj->size;
rv->data = XP_ALLOC(rv->size);
if(!rv->data)
{
FREE(rv);
return(NULL);
}
XP_MEMCPY(rv->data, obj->data, rv->size);
return(rv);
}
/* free the cache object
*/
MODULE_PRIVATE void net_freeCacheObj (net_CacheObject * cache_obj)
{
FREEIF(cache_obj->address);
FREEIF(cache_obj->post_data);
FREEIF(cache_obj->post_headers);
FREEIF(cache_obj->content_type);
FREEIF(cache_obj->charset);
FREEIF(cache_obj->content_encoding);
FREEIF(cache_obj->page_services_url);
FREEIF(cache_obj->filename);
#ifndef EXT_DB_ROUTINES
FREEIF(cache_obj->sec_info);
#endif
FREE(cache_obj);
}
/* returns true if this DBT looks like a valid
* entry. It looks at the checksum and the
* version number to see if it's valid
*/
#define MAX_VALID_DBT_SIZE 10000
MODULE_PRIVATE Bool
net_IsValidCacheDBT(DBT *obj)
{
char *cur_ptr, *max_ptr;
uint32 len;
if(!obj || obj->size < 9 || obj->size > MAX_VALID_DBT_SIZE)
return(FALSE);
cur_ptr = (char *)obj->data;
max_ptr = cur_ptr+obj->size;
/* get the total size of the struct out of
* the first field to check it
*/
COPY_INT32(&len, cur_ptr);
cur_ptr += sizeof(int32);
if(len != obj->size)
{
TRACEMSG(("Size going in is not the same as size coming out"));
return(FALSE);
}
/* get the version number of the written structure
*/
if(cur_ptr > max_ptr)
return(FALSE);
COPY_INT32(&len, cur_ptr);
cur_ptr += sizeof(int32);
if(len != CACHE_FORMAT_VERSION)
{
TRACEMSG(("Version of cache structure is wrong!: %d", len));
return(FALSE);
}
/* looks good to me... */
return(TRUE);
}
/* takes a cache object and returns a malloc'd
* (void *) suitible for passing in as a database
* data storage object
*/
MODULE_PRIVATE DBT *
net_CacheStructToDBData(net_CacheObject * old_obj)
{
int32 len;
char *cur_ptr;
void *new_obj;
int32 total_size;
DBT *rv;
rv = XP_NEW(DBT);
if(!rv)
return(NULL);
total_size = sizeof(net_CacheObject);
#define ADD_STRING_SIZE(string) \
total_size += old_obj->string ? XP_STRLEN(old_obj->string)+1 : 0
ADD_STRING_SIZE(address);
total_size += old_obj->post_data_size+1;
ADD_STRING_SIZE(post_headers);
ADD_STRING_SIZE(content_type);
ADD_STRING_SIZE(content_encoding);
ADD_STRING_SIZE(charset);
ADD_STRING_SIZE(filename);
total_size += sizeof(uint32); /* size of secinfo */
total_size += SECNAV_SSLSocketStatusLength(old_obj->sec_info);
ADD_STRING_SIZE(page_services_url);
#undef ADD_STRING_SIZE
new_obj = XP_ALLOC(total_size * sizeof(char));
if(!new_obj)
{
FREE(rv);
return NULL;
}
XP_MEMSET(new_obj, 0, total_size * sizeof(char));
/*
* order is:
* int32 size of the entire structure;
*
* int32 version of the structure format (CACHE_FORMAT_VERSION)
*
* time_t last_modified;
* time_t last_accessed;
* time_t expires;
* uint32 content_length;
* Bool is_netsite;
*
* time_t lock_date;
*
* char * filename;
* int32 filename_len;
*
* int32 security_on;
* unsigned char * sec_info;
*
* int32 method;
*
* # don't store address, or post_data stuff
* # char * address;
* # uint32 post_data_size;
* # char * post_data;
*
* char * post_headers;
* char * content_type;
* char * content_encoding;
* char * charset;
*
* Bool incomplete_file;
* uint32 total_content_length;
*
* char * page_services_url;
*
* string lengths all include null terminators
* all integer constants are stored as 4 bytes
* all booleans are stored as one byte
*/
/* VERY VERY IMPORTANT. Whenever the
* format of the record structure changes
* you must verify that the byte positions
* in extcache.h are updated
*/
#define STUFF_STRING(string) \
{ \
len = (old_obj->string ? XP_STRLEN(old_obj->string)+1 : 0); \
COPY_INT32((void *)cur_ptr, &len); \
cur_ptr = cur_ptr + sizeof(int32); \
if(len) \
XP_MEMCPY((void *)cur_ptr, old_obj->string, len); \
cur_ptr += len; \
}
#define STUFF_NUMBER(number) \
{ \
COPY_INT32((void *)cur_ptr, &old_obj->number); \
cur_ptr = cur_ptr + sizeof(int32); \
}
#define STUFF_TIMET(number) \
{ \
COPY_INT32((void *)cur_ptr, &old_obj->number); \
cur_ptr = cur_ptr + sizeof(time_t); \
}
#define STUFF_BOOL(bool_val) \
{ \
if(old_obj->bool_val) \
((char *)(cur_ptr))[0] = 1; \
else \
((char *)(cur_ptr))[0] = 0; \
cur_ptr = cur_ptr + sizeof(char); \
}
cur_ptr = (char *)new_obj;
/* put the total size of the struct into
* the first field so that we have
* a cross check against corruption
*/
COPY_INT32((void *)cur_ptr, &total_size);
cur_ptr = cur_ptr + sizeof(int32);
/* put the version number of the structure
* format that we are using
* By using a version string when writting
* we can support backwards compatibility
* in our reading code
* (use "len" as a temp variable)
*/
len = CACHE_FORMAT_VERSION;
COPY_INT32((void *)cur_ptr, &len);
cur_ptr = cur_ptr + sizeof(int32);
STUFF_TIMET(last_modified);
STUFF_TIMET(last_accessed);
STUFF_TIMET(expires);
STUFF_NUMBER(content_length);
STUFF_BOOL(is_netsite);
STUFF_TIMET(lock_date);
STUFF_STRING(filename);
STUFF_NUMBER(filename_len);
STUFF_BOOL(is_relative_path);
STUFF_NUMBER(security_on);
#ifndef EXT_DB_ROUTINES
/* save the security info */
if ( old_obj->sec_info ) {
len = SECNAV_SSLSocketStatusLength(old_obj->sec_info);
COPY_INT32((void *)cur_ptr, &len);
cur_ptr = cur_ptr + sizeof(int32);
XP_MEMCPY((void *)cur_ptr, old_obj->sec_info, len);
cur_ptr += len;
} else
#endif
{
len = 0;
COPY_INT32((void *)cur_ptr, &len);
cur_ptr = cur_ptr + sizeof(int32);
}
STUFF_NUMBER(method);
#ifdef STORE_ADDRESS_AND_POST_DATA
STUFF_STRING(address);
STUFF_NUMBER(post_data_size);
/* post_data
* this is special since it not necessarily a string
*/
if(old_obj->post_data_size)
{
XP_MEMCPY(cur_ptr, old_obj->post_data, old_obj->post_data_size+1);
cur_ptr += old_obj->post_data_size+1;
}
#endif /* STORE_ADDRESS_AND_POST_DATA */
STUFF_STRING(post_headers);
STUFF_STRING(content_type);
STUFF_STRING(content_encoding);
STUFF_STRING(charset);
STUFF_BOOL(incomplete_file);
STUFF_NUMBER(real_content_length);
STUFF_STRING(page_services_url);
#undef STUFF_STRING
#undef STUFF_NUMBER
#undef STUFF_BOOL
rv->data = new_obj;
rv->size = total_size;
return(rv);
}
/* takes a database storage object and returns a malloc'd
* cache data object. The cache object needs all of
* it's parts free'd.
*
* returns NULL on parse error
*/
MODULE_PRIVATE net_CacheObject *
net_DBDataToCacheStruct(DBT * db_obj)
{
net_CacheObject * rv = XP_NEW(net_CacheObject);
char * cur_ptr;
char * max_ptr;
uint32 len;
int32 version;
if(!rv)
return NULL;
XP_MEMSET(rv, 0, sizeof(net_CacheObject));
/* if any strings are larger than this then
* there was a serious database error
*/
#define MAX_HUGE_STRING_SIZE 10000
#define RETRIEVE_STRING(string) \
{ \
if(cur_ptr > max_ptr) \
{ \
net_freeCacheObj(rv); \
return(NULL); \
} \
COPY_INT32(&len, cur_ptr); \
cur_ptr += sizeof(int32); \
if(len) \
{ \
if(len > MAX_HUGE_STRING_SIZE) \
{ \
net_freeCacheObj(rv); \
return(NULL); \
} \
rv->string = (char*)XP_ALLOC(len); \
if(!rv->string) \
{ \
net_freeCacheObj(rv); \
return(NULL); \
} \
XP_MEMCPY(rv->string, cur_ptr, len); \
cur_ptr += len; \
} \
}
#define RETRIEVE_NUMBER(number) \
{ \
if(cur_ptr > max_ptr) \
return(rv); \
COPY_INT32(&rv->number, cur_ptr); \
cur_ptr += sizeof(int32); \
}
#define RETRIEVE_TIMET(number) \
{ \
if(cur_ptr > max_ptr) \
return(rv); \
COPY_INT32(&rv->number, cur_ptr); \
cur_ptr += sizeof(time_t); \
}
#define RETRIEVE_BOOL(bool) \
{ \
if(cur_ptr > max_ptr) \
return(rv); \
if(((char *)(cur_ptr))[0]) \
rv->bool = TRUE; \
else \
rv->bool = FALSE; \
cur_ptr += sizeof(char); \
}
cur_ptr = (char *)db_obj->data;
max_ptr = cur_ptr+db_obj->size;
/* get the total size of the struct out of
* the first field to check it
*/
COPY_INT32(&len, cur_ptr);
cur_ptr += sizeof(int32);
if(len != db_obj->size)
{
TRACEMSG(("Size going in is not the same as size coming out"));
FREE(rv);
return(NULL);
}
/* get the version number of the written structure
*/
if(cur_ptr > max_ptr)
return(rv);
COPY_INT32(&version, cur_ptr);
cur_ptr += sizeof(int32);
if(version != CACHE_FORMAT_VERSION)
{
TRACEMSG(("Version of cache structure is wrong!: %d", version));
FREE(rv);
return(NULL);
}
RETRIEVE_TIMET(last_modified);
RETRIEVE_TIMET(last_accessed);
RETRIEVE_TIMET(expires);
RETRIEVE_NUMBER(content_length);
RETRIEVE_BOOL(is_netsite);
RETRIEVE_TIMET(lock_date);
RETRIEVE_STRING(filename);
RETRIEVE_NUMBER(filename_len);
RETRIEVE_BOOL(is_relative_path);
RETRIEVE_NUMBER(security_on);
/* security info */
if(cur_ptr > max_ptr)
return(rv);
COPY_INT32(&len, cur_ptr);
cur_ptr += sizeof(int32);
if ( len == 0 ) {
rv->sec_info = NULL;
} else {
rv->sec_info = XP_ALLOC(len);
if ( rv->sec_info == NULL ) {
return(rv);
}
XP_MEMCPY(rv->sec_info, cur_ptr, len);
cur_ptr += len;
}
RETRIEVE_NUMBER(method);
#ifdef STORE_ADDRESS_AND_POST_DATA
RETRIEVE_STRING(address);
RETRIEVE_NUMBER(post_data_size);
/* post_data
* this is special since it not necessarily a string
*/
if(rv->post_data_size)
{
rv->post_data = XP_ALLOC(rv->post_data_size+1);
if(rv->post_data)
XP_MEMCPY(rv->post_data, cur_ptr, rv->post_data_size+1);
cur_ptr += rv->post_data_size+1;
}
#endif /* STORE_ADDRESS_AND_POST_DATA */
RETRIEVE_STRING(post_headers);
RETRIEVE_STRING(content_type);
RETRIEVE_STRING(content_encoding);
RETRIEVE_STRING(charset);
RETRIEVE_BOOL(incomplete_file);
RETRIEVE_NUMBER(real_content_length);
RETRIEVE_STRING(page_services_url);
#undef RETRIEVE_STRING
#undef RETRIEVE_NUMBER
#undef RETRIEVE_BOOL
return(rv);
}
#if defined(DEBUG) && defined(UNIX)
int
cache_test_me()
{
net_CacheObject test;
net_CacheObject *rv;
int32 total_size;
DBT *db_obj;
XP_MEMSET(&test, 0, sizeof(net_CacheObject));
StrAllocCopy(test.address, "test1");
db_obj = net_CacheStructToDBData(&test);
rv = net_DBDataToCacheStruct(db_obj);
printf("test1: %s\n", rv->address);
XP_MEMSET(&test, 0, sizeof(net_CacheObject));
StrAllocCopy(test.address, "test2");
StrAllocCopy(test.charset, "test2");
db_obj = net_CacheStructToDBData(&test);
rv = net_DBDataToCacheStruct(db_obj);
printf("test2: %s %s\n", rv->address, rv->charset);
XP_MEMSET(&test, 0, sizeof(net_CacheObject));
StrAllocCopy(test.address, "test3");
StrAllocCopy(test.charset, "test3");
test.content_length = 3 ;
test.method = 3 ;
test.is_netsite = 3 ;
db_obj = net_CacheStructToDBData(&test);
rv = net_DBDataToCacheStruct(db_obj);
printf("test3: %s %s %d %d %s\n",
rv->address, rv->charset,
rv->content_length, rv->method,
(rv->is_netsite == 3 ? "TRUE" : "FALSE"));
}
#endif
/* generates a key for use in the cache database
* from a CacheObject struct
*
* Key is based on the address and the post_data
*
* looks like:
* size checksum | size of address | ADDRESS | size of post data | POST DATA
*/
MODULE_PRIVATE DBT *
net_GenCacheDBKey(char *address, char *post_data, int32 post_data_size)
{
DBT *rv = XP_NEW(DBT);
char *hash;
char *data_ptr;
int32 str_len;
int32 size;
#define MD5_HASH_SIZE 16 /* always 16 due to md5 hash type */
if(!rv)
return(NULL);
if(!address)
{
XP_ASSERT(0);
rv->size = 0;
return(rv);
}
hash = XP_STRCHR(address, '#');
/* don't include '#' in a key */
if(hash)
*hash = '\0';
str_len = XP_STRLEN(address)+1;
size = sizeof(int32); /* for check sum */
size += sizeof(int32); /* for size of address */
size += str_len; /* for address string */
size += sizeof(int32); /* for size of post_data */
if(post_data_size)
size += MD5_HASH_SIZE;
rv->size = size;
rv->data = XP_ALLOC(size);
if(!rv->data)
{
FREE(rv);
return NULL;
}
data_ptr = (char *) rv->data;
/* put in the checksum size */
COPY_INT32(data_ptr, &size);
data_ptr = data_ptr + sizeof(int32);
/* put in the size of the address string */
COPY_INT32(data_ptr, &str_len);
data_ptr = data_ptr + sizeof(int32);
/* put in the address string data */
XP_MEMCPY(data_ptr, address, str_len);
data_ptr = data_ptr + str_len;
/* set the address back to it's original form */
if(hash)
*hash = '#';
/* put in the size of the post data */
if(post_data_size)
{
int32 size_of_md5 = MD5_HASH_SIZE;
unsigned char post_data_hash[MD5_HASH_SIZE];
MD5_HashBuf(post_data_hash, (unsigned char*)post_data, post_data_size);
COPY_INT32(data_ptr, &size_of_md5);
data_ptr = data_ptr + sizeof(int32);
/* put in the post data if there is any */
XP_MEMCPY(data_ptr, post_data_hash, sizeof(post_data_hash));
}
else
{
COPY_INT32(data_ptr, &post_data_size);
data_ptr = data_ptr + sizeof(int32);
}
return(rv);
}
/* returns a static string that contains the
* URL->address of the key
*
* returns NULL on error
*/
MODULE_PRIVATE char *
net_GetAddressFromCacheKey(DBT *key)
{
uint32 size;
char *data;
/* check for minimum size */
if(key->size < 10)
return(NULL);
/* validate size checksum */
data = (char *)key->data;
COPY_INT32(&size, data);
data += sizeof(int32);
if(size != key->size)
return(NULL);
/* get size of address string */
COPY_INT32(&size, data);
data += sizeof(int32);
/* make sure it's a valid c string */
if(data[size] != '\0')
return(NULL);
/* it's valid return it */
return(data);
}
/* checks a date within a DBT struct so
* that we don't have to convert it into a CacheObject
*
* This works because of the fixed length record format
* of the first part of the specific DBT format I'm
* using
*
* returns 0 on error
*/
MODULE_PRIVATE time_t
net_GetTimeInCacheDBT(DBT *data, int byte_position)
{
time_t date;
char *ptr = (char *)data->data;
if(data->size < byte_position+sizeof(time_t))
return(0);
if(!net_IsValidCacheDBT(data))
return(0);
COPY_INT32(&date, ptr+byte_position);
/* TRACEMSG(("Got date from cache DBT: %d", date)); */
return(date);
}
/* Sets a date within a DBT struct so
* that we don't have to convert it into a CacheObject
*
* This works because of the fixed length record format
* of the first part of the specific DBT format I'm
* using
*
* returns 0 on error
*/
MODULE_PRIVATE void
net_SetTimeInCacheDBT(DBT *data, int byte_position, time_t date)
{
char *ptr = (char *)data->data;
if(data->size < byte_position+sizeof(time_t))
return;
if(!net_IsValidCacheDBT(data))
return;
COPY_INT32(ptr+byte_position, &date);
return;
}
/* Gets the filename within a cache DBT struct so
* that we don't have to convert it into a CacheObject
*
* This works because of the fixed length record format
* of the first part of the specific DBT format I'm
* using
*
* returns NULL on error
*/
#define MAX_FILE_SIZE 2048
MODULE_PRIVATE char *
net_GetFilenameInCacheDBT(DBT *data)
{
int32 size;
char *rv;
char *ptr = (char*)data->data;
if(data->size < FILENAME_BYTE_POSITION)
return(NULL);
if(!net_IsValidCacheDBT(data))
return(0);
COPY_INT32(&size, ptr+FILENAME_SIZE_BYTE_POSITION);
if(data->size < FILENAME_BYTE_POSITION+size
|| size > MAX_FILE_SIZE)
return(NULL);
rv = (char *)XP_ALLOC(size);
if(!rv)
return(NULL);
XP_MEMCPY(rv, ptr+FILENAME_BYTE_POSITION, size);
TRACEMSG(("Got filename: %s from DBT", rv));
return(rv);
}
/* Gets a int32 within a DBT struct so
* that we don't have to convert it into a CacheObject
*
* This works because of the fixed length record format
* of the first part of the specific DBT format I'm
* using
*
* returns 0 on error
*/
MODULE_PRIVATE time_t
net_GetInt32InCacheDBT(DBT *data, int byte_position)
{
int32 num;
char *ptr = (char *)data->data;
if(!net_IsValidCacheDBT(data))
return(0);
if(data->size < byte_position+sizeof(time_t))
return(0);
COPY_INT32(&num, ptr+byte_position);
/* TRACEMSG(("Got int32 from cache DBT: %d", num)); */
return(num);
}
MODULE_PRIVATE void
net_FreeCacheDBTdata(DBT *stuff)
{
if(stuff)
{
FREE(stuff->data);
FREE(stuff);
}
}
/* takes a database storage object and returns an un-malloc'd
* cache data object. The structure returned has pointers
* directly into the database memory and are only valid
* until the next call to any database function
*
* do not free anything returned by this structure
*/
MODULE_PRIVATE net_CacheObject *
net_Fast_DBDataToCacheStruct(DBT *obj)
{
static net_CacheObject *rv=0;
/* free any previous one */
if(rv)
net_freeCacheObj(rv);
rv = net_DBDataToCacheStruct(obj);
return(rv);
}
#endif /* MOZILLA_CLIENT */

View File

@@ -0,0 +1,273 @@
/* -*- 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.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef EXT_CACHE_H
#define EXT_CACHE_H
#ifndef EXT_DB_ROUTINES
#include "mcom_db.h"
#endif
#ifdef EXT_DB_ROUTINES
#define Bool char
#define uint32 unsigned int
#define int32 int
#define XP_NEW(structure) ((structure *) malloc(sizeof(structure)))
#define XP_ALLOC (void *) malloc
#define XP_MEMCPY memcpy
#define XP_MEMSET memset
#define TRACEMSG(x) printf x
#define FREEIF(x) do { if(x) free(x); } while(0)
#define FREE free
#define XP_STRLEN strlen
#define XP_STRCHR strchr
#define XP_STRCMP strcmp
#define XP_ASSERT assert
#define MODULE_PRIVATE
#define PRIVATE static
#define TRUE !0
#define FALSE 0
#include <stdio.h>
#include <string.h>
#include <db.h>
#endif
#ifndef EXT_DB_ROUTINES
#include "mkutils.h"
#ifndef NSPR20
#include "prosdep.h" /* for IS_LITTLE_ENDIAN / IS_BIG_ENDIAN */
#else
#include "prtypes.h"
#endif
#endif /* EXT_DB_ROUTINES */
#if !defined(IS_LITTLE_ENDIAN) && !defined(IS_BIG_ENDIAN)
ERROR! Must have a byte order
#endif
#ifdef IS_LITTLE_ENDIAN
#define COPY_INT32(_a,_b) XP_MEMCPY(_a, _b, sizeof(int32));
#else
#define COPY_INT32(_a,_b) /* swap */ \
do { \
((char *)(_a))[0] = ((char *)(_b))[3]; \
((char *)(_a))[1] = ((char *)(_b))[2]; \
((char *)(_a))[2] = ((char *)(_b))[1]; \
((char *)(_a))[3] = ((char *)(_b))[0]; \
} while(0)
#endif
#define EXT_CACHE_NAME_STRING "INT_ExternalCacheNameString"
/* Internal WARNING!! Some slots of this structure
* are shared with URL_Struct and
* History_entry. If you add a slot, decide whether it needs to be shared
* as well.
*/
typedef struct _net_CacheObject {
time_t last_modified;
time_t last_accessed;
time_t expires;
Bool is_netsite;
uint32 content_length;
char * filename; /* cache file name */
int32 filename_len; /* optimization */
Bool is_relative_path; /* is the path relative? */
/* Security information */
int32 security_on; /* is security on? */
unsigned char *sec_info;
time_t lock_date; /* the file is locked if this
* is non-zero. The date
* represents the time the
* lock was put in place.
* Locks are only valid for
* one session
*/
int32 method;
char * address;
uint32 post_data_size;
char * post_data;
char * post_headers;
char * content_type;
char * content_encoding;
char * charset;
Bool incomplete_file; /* means that the whole
* file is not there.
* This can only be true
* if the server supports byteranges
*/
uint32 real_content_length; /* the whole content length
* i.e. the server size of a truncated
* client file
*/
char * page_services_url;
char * etag; /* HTTP/1.1 Etag */
} net_CacheObject;
/* this is the version number of the cache database entry.
* It should be incremented in integer ingrements up
* to MAXINT32
*/
#define CACHE_FORMAT_VERSION 5
/* these defines specify the exact byte position
* of the first 4 elements in the DBT data struct
* Change these if you change the order of entry into
* the DBT
*/
#define LAST_MODIFIED_BYTE_POSITION \
sizeof(int32)+sizeof(int32)
#define LAST_ACCESSED_BYTE_POSITION \
sizeof(int32)+sizeof(int32)+sizeof(time_t)
#define EXPIRES_BYTE_POSITION \
sizeof(int32)+sizeof(int32)+sizeof(time_t)+sizeof(time_t)
#define CONTENT_LENGTH_BYTE_POSITION \
sizeof(int32)+sizeof(int32)+sizeof(time_t)+sizeof(time_t) \
+sizeof(time_t)
#define IS_NETSITE_BYTE_POSITION \
sizeof(int32)+sizeof(int32)+sizeof(time_t)+sizeof(time_t) \
+sizeof(time_t)+sizeof(int32)
#define LOCK_DATE_BYTE_POSITION \
sizeof(int32)+sizeof(int32)+sizeof(time_t)+sizeof(time_t) \
+sizeof(time_t)+sizeof(int32)+sizeof(char)
#define FILENAME_SIZE_BYTE_POSITION \
sizeof(int32)+sizeof(int32)+sizeof(time_t)+sizeof(time_t) \
+sizeof(time_t)+sizeof(uint32)+sizeof(char)+sizeof(time_t)
#define FILENAME_BYTE_POSITION \
sizeof(int32)+sizeof(int32)+sizeof(time_t)+sizeof(time_t) \
+sizeof(time_t)+sizeof(uint32)+sizeof(char)+sizeof(time_t) \
+sizeof(int32)
/* generates a key for use in the cache database
* from a CacheObject struct
*
* Key is based on the address and the post_data
*/
extern DBT *
net_GenCacheDBKey(char *address, char *post_data, int32 post_data_size);
/* returns a static string that contains the
* URL->address of the key
*
* returns NULL on error
*/
extern char *
net_GetAddressFromCacheKey(DBT *key);
/* allocs and copies a new DBT from an existing DBT
*/
extern DBT * net_CacheDBTDup(DBT *obj);
/* free the cache object
*/
extern void net_freeCacheObj (net_CacheObject * cache_obj);
/* takes a cache object and returns a malloc'd
* (void *) suitible for passing in as a database
* data storage object
*/
extern DBT * net_CacheStructToDBData(net_CacheObject * old_obj);
/* takes a database storage object and returns a malloc'd
* cache data object. The cache object needs all of
* it's parts free'd.
*
* returns NULL on parse error
*/
extern net_CacheObject * net_DBDataToCacheStruct(DBT * db_obj);
/* checks a date within a DBT struct so
* that we don't have to convert it into a CacheObject
*
* This works because of the fixed length record format
* of the first part of the specific DBT format I'm
* using
*
* returns 0 on error
*/
extern time_t net_GetTimeInCacheDBT(DBT *data, int byte_position);
/* Sets a date within a DBT struct so
* that we don't have to convert it into a CacheObject
*
* This works because of the fixed length record format
* of the first part of the specific DBT format I'm
* using
*
* returns 0 on error
*/
extern void net_SetTimeInCacheDBT(DBT *data, int byte_position, time_t date);
/* Gets the filename within a cache DBT struct so
* that we don't have to convert it into a CacheObject
*
* This works because of the fixed length record format
* of the first part of the specific DBT format I'm
* using
*
* returns NULL on error
*/
extern char * net_GetFilenameInCacheDBT(DBT *data);
/* Gets a int32 within a DBT struct so
* that we don't have to convert it into a CacheObject
*
* This works because of the fixed length record format
* of the first part of the specific DBT format I'm
* using
*
* returns 0 on error
*/
extern time_t net_GetInt32InCacheDBT(DBT *data, int byte_position);
/* free's a DBT struct
*/
extern void net_FreeCacheDBTdata(DBT *stuff);
/* stores a cache object in the DBM database
*/
extern void net_ExtCacheStore(DB *database, net_CacheObject * obj);
/* takes a database storage object and returns an un-malloc'd
* cache data object. The structure returned has pointers
* directly into the database memory and are only valid
* until the next call to any database function
*
* do not free anything returned by this structure
*/
extern net_CacheObject * net_Fast_DBDataToCacheStruct(DBT *obj);
/* returns true if this DBT looks like a valid
* entry. It looks at the checksum and the
* version number to see if it's valid
*/
extern Bool net_IsValidCacheDBT(DBT *obj);
#endif /* EXT_CACHE_H */

3430
mozilla/lib/libnet/mkcache.c Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -61,7 +61,6 @@
#endif
#include "mktcp.h" /* for NET_InGetHostByName semaphore */
#include "cert.h"
#ifdef MOZILLA_CLIENT
#include "secnav.h"
#ifdef MOCHA
@@ -76,7 +75,6 @@
#include "il_strm.h" /* Image Lib public API. */
#include "libi18n.h"
#include "xp_sec.h"
#include "mkmocha.h"
#include "htmldlgs.h"
@@ -781,7 +779,7 @@ NET_InitNetLib(int socket_buffer_size, int max_number_of_connections)
#endif
NET_InitTotallyRandomStuffPeopleAddedProtocols();
NET_InitMailtoProtocol(); /* has a stub for MOZ_MAIL_NEWS */
NET_InitMailtoProtocol();
#ifdef MOZ_MAIL_NEWS
NET_InitNewsProtocol();
NET_InitMailboxProtocol();
@@ -4215,16 +4213,8 @@ NET_FreeURLStruct (URL_Struct * URL_s)
FREEIF(URL_s->wysiwyg_url);
FREEIF(URL_s->error_msg);
FREEIF(URL_s->key_cipher);
FREEIF(URL_s->key_issuer);
FREEIF(URL_s->key_subject);
if ( URL_s->certificate ) {
CERT_DestroyCertificate(URL_s->certificate);
}
if ( URL_s->redirecting_cert ) {
CERT_DestroyCertificate(URL_s->redirecting_cert);
}
FREEIF(URL_s->sec_info);
FREEIF(URL_s->redirect_sec_info);
/* Free all memory associated with header information */
net_FreeURLAllHeaders(URL_s);
@@ -4460,10 +4450,8 @@ net_OutputURLDocInfo(MWContext *ctxt, char *which, char **data, int32 *length)
}
if(URL_s->cache_file || URL_s->memory_copy)
sec_msg = XP_PrettySecurityStatus(URL_s->security_on,
URL_s->key_cipher,
URL_s->key_size,
URL_s->key_secret_size);
sec_msg = SECNAV_PrettySecurityStatus(URL_s->security_on,
URL_s->sec_info);
else
sec_msg = XP_STRDUP(XP_GetString(XP_STATUS_UNKNOWN));
@@ -4473,20 +4461,10 @@ net_OutputURLDocInfo(MWContext *ctxt, char *which, char **data, int32 *length)
FREE(sec_msg);
}
if(URL_s->certificate)
sec_msg = CERT_HTMLCertInfo(URL_s->certificate, PR_TRUE,
PR_TRUE);
else
sec_msg = 0;
sec_msg = SECNAV_SSLSocketCertString(URL_s->sec_info);
if(sec_msg)
{
char *extstring;
extstring = SECNAV_MakeCertButtonString(URL_s->certificate);
if ( extstring ) {
StrAllocCat(sec_msg, extstring);
XP_FREE(extstring);
}
ADD_CELL(XP_GetString(XP_CERTIFICATE_), sec_msg);
FREE(sec_msg);
}
@@ -4653,6 +4631,11 @@ PRIVATE int net_output_about_url(ActiveEntry * cur_entry)
NET_DisplayMemCacheInfoAsHTML(cur_entry);
return(-1);
}
else if(!strcasecomp(which, "logout"))
{
NET_RemoveAllAuthorizations();
return(-1);
}
else if(!strcasecomp(which, "image-cache"))
{
IL_DisplayMemCacheInfoAsHTML(cur_entry->format_out, cur_entry->URL_s,
@@ -5580,7 +5563,7 @@ NET_DestroyEvidence()
NET_SetMemoryCacheSize(oldSize); /* set it back up */
}
#ifndef MOZ_MAIL_NEWS
#if !defined(MOZ_MAIL_NEWS) && !defined(MOZ_MAIL_COMPOSE)
/* this whole mess should get moved to the mksmtp.c file
* where it can share the InitMailtoProtocol function
@@ -5869,7 +5852,7 @@ NET_InitMailtoProtocol(void)
NET_RegisterProtocolImplementation(&mailto_proto_impl, MAILTO_TYPE_URL);
}
#endif /* MOZ_MAIL_NEWS */
#endif /* !MOZ_MAIL_NEWS && !MOZ_MAIL_COMPOSE */
#ifdef PROFILE
#pragma profile off

3772
mozilla/lib/libnet/mkhttp.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1355,7 +1355,7 @@ net_MemoryCacheLoad (ActiveEntry * cur_entry)
FE_EnableClicking(CE_WINDOW_ID);
#ifdef MOZ_MAIL_NEWS
#ifdef MOZ_MAIL_NEWS
if (cur_entry->format_out == FO_PRESENT)
{
if (NET_URL_Type(cur_entry->URL_s->address) == NEWS_TYPE_URL)
@@ -1379,7 +1379,7 @@ net_MemoryCacheLoad (ActiveEntry * cur_entry)
}
}
}
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS */
/* open the outgoing stream
*/

5312
mozilla/lib/libnet/mknews.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -101,6 +101,8 @@ PRIVATE XP_Bool net_uidl_command_unimplemented = FALSE;
PRIVATE XP_Bool net_xtnd_xlst_command_unimplemented = FALSE;
PRIVATE XP_Bool net_top_command_unimplemented = FALSE;
#ifdef MOZ_MAIL_NEWS
/* definitions of extended POP3 capabilities
*/
typedef enum {
@@ -285,6 +287,9 @@ NET_LeavePopMailOnServer(Bool do_it)
/* XP_ASSERT(0);*/ /* This routine is obsolete. */
}
#endif /* MOZ_MAIL_NEWS */
/* Well, someone finally found a legitimate reason to put an @ in the
* mail server user name. They're trying to use the user name as a UID
* in the LDAP directory, and the UIDs happen to have the format
@@ -372,6 +377,8 @@ NET_SetPopPassword2(const char *password)
net_set_pop3_password(password);
}
#ifdef MOZ_MAIL_NEWS
/* sets the size limit for pop3 messages
*
* set the size negative to make it infinite length
@@ -3046,4 +3053,6 @@ NET_InitPop3Protocol(void)
NET_RegisterProtocolImplementation(&pop3_proto_impl, POP3_TYPE_URL);
}
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZILLA_CLIENT */

View File

@@ -26,6 +26,7 @@
#if defined(MOZILLA_CLIENT) || defined(LIBNET_SMTP)
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
#include "mkextcac.h"
#include "mkgeturl.h"
#include "mksmtp.h"
#include "mime.h"
@@ -203,7 +204,7 @@ NET_SetMailRelayHost(char * host)
* gets user domian name out from FE_UsersMailAddress()
*/
PRIVATE const char *
net_smtp_get_user_domain_name()
net_smtp_get_user_domain_name(void)
{
const char *mail_addr, *at_sign = NULL;
mail_addr = FE_UsersMailAddress();
@@ -535,17 +536,19 @@ net_smtp_auth_login_response(ActiveEntry *cur_entry)
switch (CD_RESPONSE_CODE/100) {
case 2:
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
{
char *pop_password = (char *)NET_GetPopPassword();
CD_NEXT_STATE = SMTP_SEND_HELO_RESPONSE;
if (pop_password == NULL)
NET_SetPopPassword2(net_smtp_password);
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS)
if ( IMAP_GetPassword() == NULL )
IMAP_SetPassword(net_smtp_password);
#endif /* MOZ_MAIL_NEWS */
XP_FREEIF(pop_password);
}
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
break;
case 3:
CD_NEXT_STATE = SMTP_SEND_AUTH_LOGIN_PASSWORD;
@@ -591,7 +594,7 @@ net_smtp_auth_login_username(ActiveEntry *cur_entry)
if (!pop_username || !*pop_username)
return (MK_POP3_USERNAME_UNDEFINED);
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
base64Str = NET_Base64Encode(pop_username,
XP_STRLEN(pop_username));
if (base64Str) {
@@ -606,7 +609,7 @@ net_smtp_auth_login_username(ActiveEntry *cur_entry)
return (CE_STATUS);
}
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
return -1;
}
@@ -649,9 +652,9 @@ net_smtp_auth_login_password(ActiveEntry *cur_entry)
if (net_smtp_password) {
char *base64Str = NULL;
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
base64Str = NET_Base64Encode(net_smtp_password, XP_STRLEN(net_smtp_password));
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
if (base64Str) {
PR_snprintf(buffer, sizeof(buffer), "%.256s" CRLF, base64Str);
@@ -1566,5 +1569,68 @@ NET_InitMailtoProtocol(void)
NET_RegisterProtocolImplementation(&mailto_proto_impl, MAILTO_TYPE_URL);
}
/* isOnline funcs moved from mknews.c because it's needed for mail compose,
* which doesn't include mknews.c
*/
static XP_Bool isOnline = TRUE;
static XP_Bool prefInitialized = FALSE;
/* fix Mac warning of missing prototype */
MODULE_PRIVATE int PR_CALLBACK
NET_OnlinePrefChangedFunc(const char *pref, void *data);
MODULE_PRIVATE int PR_CALLBACK NET_OnlinePrefChangedFunc(const char *pref, void *data)
{
int status;
int32 port=0;
char * socksHost = NULL;
char text[MAXHOSTNAMELEN + 8];
if (!XP_STRCASECMP(pref,"network.online"))
status = PREF_GetBoolPref("network.online", &isOnline);
if ( isOnline ) {
CACHE_CloseAllOpenSARCache();
/* If the user wants to use a socks server set it up. */
if ( (NET_GetProxyStyle() == PROXY_STYLE_MANUAL) ) {
PREF_CopyCharPref("network.hosts.socks_server",&socksHost);
PREF_GetIntPref("network.hosts.socks_serverport",&port);
if (socksHost && *socksHost && port) {
PR_snprintf(text, sizeof(text), "%s:%d", socksHost, port);
NET_SetSocksHost(text);
}
else {
NET_SetSocksHost(socksHost); /* NULL is ok */
}
}
}
else {
CACHE_OpenAllSARCache();
}
return status;
}
MODULE_PRIVATE XP_Bool
NET_IsOffline()
{
extern XP_Bool isOnline;
/* Cache this value, and register a pref callback to
find out when it changes.
*/
if (!prefInitialized)
{
/*int status =*/ PREF_GetBoolPref("network.online", &isOnline);
PREF_RegisterCallback("network.online",NET_OnlinePrefChangedFunc, NULL);
#ifdef MOZ_MAIL_NEWS
/* because this routine gets called so often, we can register this callback here too. */
PREF_RegisterCallback("news.max_articles", NET_NewsMaxArticlesChangedFunc, NULL);
#endif /* MOZ_MAIL_NEWS */
prefInitialized = TRUE;
}
return !isOnline;
}
#endif /* defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE) */
#endif /* defined(MOZILLA_CLIENT) || defined(LIBNET_SMTP) */

View File

@@ -2364,7 +2364,7 @@ NET_AddLOSubmitDataToURLStruct(LO_FormSubmitData * sub_data,
/* If we're posting to mailto, then generate the full complement
of mail headers; and allow the url to specify additional headers
as well. */
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
if (!strncasecomp(url_struct->address, "mailto:", 7))
{
#ifdef MOZILLA_CLIENT
@@ -2391,7 +2391,7 @@ NET_AddLOSubmitDataToURLStruct(LO_FormSubmitData * sub_data,
XP_ASSERT(0);
#endif /* MOZILLA_CLIENT */
}
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */
if(encoding && !strcasecomp(encoding, "text/plain"))
{
@@ -3304,7 +3304,7 @@ NET_InitWAISProtocol(void)
NET_RegisterProtocolImplementation(&wais_proto_impl, WAIS_TYPE_URL);
}
#ifdef MOZ_MAIL_NEWS
#if defined(MOZ_MAIL_NEWS) || defined(MOZ_MAIL_COMPOSE)
PUBLIC char *
NET_Base64Encode (char *src, int32 srclen)
{
@@ -3368,4 +3368,4 @@ NET_Base64Decode (char *src,
return bs.buffer;
}
#endif /* MOZ_MAIL_NEWS */
#endif /* MOZ_MAIL_NEWS || MOZ_MAIL_COMPOSE */

90
mozilla/lib/xp/Makefile Normal file
View File

@@ -0,0 +1,90 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
DEPTH = ../..
MODULE = xp
LIBRARY_NAME = xp
CSRCS = xp_alloc.c \
xp_cntxt.c \
xp_core.c \
xp_error.c \
xp_file.c \
xp_hash.c \
xp_list.c \
xp_ncent.c \
xp_reg.c \
xp_rgb.c \
xp_qsort.c \
xp_str.c \
xp_thrmo.c \
xp_time.c \
xp_trace.c \
xp_wrap.c \
xpassert.c \
xplocale.c \
$(NULL)
REQUIRES = js nspr dbm security img util jtools layer java lay style pref rdf
CSRCS += allxpstr.c xp_intl.c
ifeq ($(STAND_ALONE_JAVA),1)
CSRCS = xp_qsort.c
endif
include $(DEPTH)/config/rules.mk
EMACS = lemacs
AUDIO_FILES = $(wildcard *.au)
GIF_FILES = $(wildcard *.gif)
JPEG_FILES = $(wildcard *.jpg)
GEN_OUT = $(AUDIO_FILES:.au=.h) $(GIF_FILES:.gif=.h) $(JPEG_FILES:.jpg=.h)
#
# Uncomment these to (re)generate the headers.
#
#GARBAGE += $(GEN_OUT) $(wildcard *~)
#
#all:: $(GEN_OUT)
$(LIBRARY): $(OBJS)
#
# Generate c header's for various binary files
#
.SUFFIXES: .au .gif .jpg
.au.h:
@echo generating $*.h from $<...; \
CNAME=`echo $*_au`; \
$(EMACS) -batch -q -l bin-to-c.el -f batch-bin-to-c $$CNAME $< $*.h
.gif.h:
@echo generating $*.h from $<...; \
CNAME=`echo $*_gif`; \
$(EMACS) -batch -q -l bin-to-c.el -f batch-bin-to-c $$CNAME $< $*.h
.jpg.h:
@echo generating $*.h from $<...; \
CNAME=`echo $*_jpg`; \
$(EMACS) -batch -q -l bin-to-c.el -f batch-bin-to-c $$CNAME $< $*.h

View File

@@ -0,0 +1,663 @@
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "secnav.h"
#include "libmocha.h"
#include "prlink.h"
#include "prinrval.h"
int
SSL_SetSockPeerID(PRFileDesc *fd, char *peerID)
{
return(0);
}
void
SECNAV_Posting(PRFileDesc *fd)
{
return;
}
void
SECNAV_HTTPHead(PRFileDesc *fd)
{
return;
}
void
SECNAV_RegisterNetlibMimeConverters()
{
return;
}
char *
SECNAV_MungeString(const char *unmunged_string)
{
return(NULL);
}
char *
SECNAV_UnMungeString(const char *munged_string)
{
return(NULL);
}
PRBool
SECNAV_GenKeyFromChoice(void *proto_win, LO_Element *form,
char *choiceString, char *challenge,
char *typeString, char *pqgString,
char **pValue, PRBool *pDone)
{
return(PR_FALSE);
}
char **
SECNAV_GetKeyChoiceList(char *type, char *pqgString)
{
return(NULL);
}
PRBool
SECNAV_SecurityDialog(MWContext *context, int state)
{
return (state == SD_INSECURE_POST_FROM_INSECURE_DOC);
}
JSObject *
lm_DefinePkcs11(MochaDecoder *decoder)
{
return((JSObject *)1);
}
JSObject *
lm_DefineCrypto(MochaDecoder *decoder)
{
return((JSObject *)1);
}
void
NET_InitCertLdapProtocol(void)
{
}
CERTCertificate *
CERT_DupCertificate(CERTCertificate *cert)
{
return(NULL);
}
void
CERT_DestroyCertificate(CERTCertificate *cert)
{
return;
}
CERTCertificate *
CERT_NewTempCertificate (CERTCertDBHandle *handle, SECItem *derCert,
char *nickname, PRBool isperm, PRBool copyDER)
{
return(NULL);
}
CERTCertDBHandle *
CERT_GetDefaultCertDB(void)
{
return(NULL);
}
CERTCertificate *
CERT_DecodeCertFromPackage(char *certbuf, int certlen)
{
return(NULL);
}
char *
CERT_HTMLCertInfo(CERTCertificate *cert, PRBool showImages, PRBool showIssuer)
{
return(NULL);
}
PRBool
CERT_CompareCertsForRedirection(CERTCertificate *c1, CERTCertificate *c2)
{
return(PR_FALSE);
}
const char *
SECNAV_GetPolicyNameString(void)
{
return(NULL);
}
int
SECNAV_InitConfigObject(void)
{
return(0);
}
int
SECNAV_RunInitialSecConfig(void)
{
return(0);
}
void
SECNAV_EarlyInit(void)
{
return;
}
void
SECNAV_Init(void)
{
return;
}
void
SECNAV_Shutdown(void)
{
return;
}
void
SECNAV_SecurityAdvisor(void *proto_win, URL_Struct *url)
{
return;
}
char *
SECNAV_MakeCertButtonString(CERTCertificate *cert)
{
return(NULL);
}
int
SECNAV_SecURLData(char *which, NET_StreamClass *stream, MWContext *cx)
{
return(-1);
}
char *
SECNAV_SecURLContentType(char *which)
{
return(NULL);
}
int
SECNAV_SecHandleSecurityAdvisorURL(MWContext *cx, const char *which)
{
return(-1);
}
void
SECNAV_HandleInternalSecURL(URL_Struct *url, MWContext *cx)
{
return;
}
PRBool
SSL_IsDomestic(void)
{
return(PR_FALSE);
}
SECStatus
SECNAV_ComputeFortezzaProxyChallengeResponse(MWContext *context,
char *asciiChallenge,
char **signature_out,
char **clientRan_out,
char **certChain_out)
{
return(SECFailure);
}
char *
SECNAV_PrettySecurityStatus(int level, unsigned char *status)
{
return(NULL);
}
char *
SECNAV_SecurityVersion(PRBool longForm)
{
return("N");
}
char *
SECNAV_SSLCapabilities(void)
{
return(NULL);
}
unsigned char *
SECNAV_SSLSocketStatus(PRFileDesc *fd, int *return_security_level)
{
return(NULL);
}
unsigned char *
SECNAV_CopySSLSocketStatus(unsigned char *status)
{
return(NULL);
}
unsigned int
SECNAV_SSLSocketStatusLength(unsigned char *status)
{
return(0);
}
char *
SECNAV_SSLSocketCertString(unsigned char *status)
{
return(NULL);
}
PRBool
SECNAV_CompareCertsForRedirection(unsigned char *status1,
unsigned char *status2)
{
return(PR_FALSE);
}
CERTCertificate *
SECNAV_CertFromSSLSocketStatus(unsigned char *status)
{
return(NULL);
}
SECStatus
RNG_RNGInit(void)
{
return(SECSuccess);
}
/*
* probably need to provide something here
*/
SECStatus
RNG_GenerateGlobalRandomBytes(void *dest, size_t len)
{
/* This is a temporary implementation to avoid */
/* the cache filename horkage. This needs to have a more */
/* secure/free implementation here - Gagan */
char* output=dest;
size_t i;
srand((unsigned int) PR_IntervalToMilliseconds(PR_IntervalNow()));
for (i=0;i<len; i++)
{
int t = rand();
*output = (char) (t % 256);
output++;
}
return(SECSuccess);
}
/*
** Get the "noisiest" information available on the system.
*/
size_t
RNG_GetNoise(void *buf, size_t maxbytes)
{
return(0);
}
/*
** RNG_SystemInfoForRNG should be called before any use of SSL. It
** gathers up the system specific information to help seed the
** state of the global random number generator.
*/
void
RNG_SystemInfoForRNG(void)
{
return;
}
/*
** Use the contents (and stat) of a file to help seed the
** global random number generator.
*/
void RNG_FileForRNG(char *filename)
{
return;
}
/*
** Update the global random number generator with more seeding
** material
*/
SECStatus
RNG_RandomUpdate(void *data, size_t bytes)
{
return(SECFailure);
}
PRStaticLinkTable jsl_nodl_tab[1];
void
_java_jsl_init(void)
{
}
DIGESTS *PR_CALLBACK
SOB_calculate_digest(void XP_HUGE *data, long length)
{
return(NULL);
}
int PR_CALLBACK
SOB_verify_digest(ZIG *siglist, const char *name, DIGESTS *dig)
{
return(-1);
}
void PR_CALLBACK
SOB_destroy (ZIG *zig)
{
return;
}
char *
SOB_get_error (int status)
{
return(NULL);
}
ZIG_Context *
SOB_find(ZIG *zig, char *pattern, int type)
{
return(NULL);
}
int
SOB_find_next(ZIG_Context *ctx, SOBITEM **it)
{
return(-1);
}
void
SOB_find_end(ZIG_Context *ctx)
{
return;
}
char *
SOB_get_url (ZIG *zig)
{
return(NULL);
}
ZIG *
SOB_new (void)
{
return(NULL);
}
int
SOB_set_callback (int type, ZIG *zig,
int (*fn) (int status, ZIG *zig,
const char *metafile,
char *pathname, char *errortext))
{
return(-1);
}
int PR_CALLBACK
SOB_cert_attribute(int attrib, ZIG *zig, long keylen, void *key,
void **result, unsigned long *length)
{
return(-1);
}
int PR_CALLBACK
SOB_stash_cert(ZIG *zig, long keylen, void *key)
{
return(-1);
}
int SOB_parse_manifest(char XP_HUGE *raw_manifest, long length,
const char *path, const char *url, ZIG *zig)
{
return(-1);
}
void
SECNAV_signedAppletPrivileges(void *proto_win, char *javaPrin,
char *javaTarget, char *risk, int isCert)
{
return;
}
char *
SOB_JAR_list_certs (void)
{
return(NULL);
}
int
SOB_JAR_validate_archive (char *filename)
{
return(-1);
}
void *
SOB_JAR_new_hash (int alg)
{
return(NULL);
}
void *
SOB_JAR_hash (int alg, void *cookie, int length, void *data)
{
return(NULL);
}
void *
SOB_JAR_end_hash (int alg, void *cookie)
{
return(NULL);
}
int
SOB_JAR_sign_archive (char *nickname, char *password, char *sf, char *outsig)
{
return(-1);
}
int
SOB_set_context (ZIG *zig, MWContext *mw)
{
return(-1);
}
int
SOB_pass_archive(int format, char *filename, const char *url, ZIG *zig)
{
return(-1);
}
int
SOB_get_metainfo(ZIG *zig, char *name, char *header, void **info,
unsigned long *length)
{
return(-1);
}
int
SOB_verified_extract(ZIG *zig, char *path, char *outpath)
{
return(-1);
}
/*
** Hash a non-null terminated string "src" into "dest" using MD5
*/
SECStatus
MD5_HashBuf(unsigned char *dest, const unsigned char *src,
uint32 src_length)
{
return(SECFailure);
}
/*
** Create a new MD5 context
*/
MD5Context *
MD5_NewContext(void)
{
return(NULL);
}
/*
** Destroy an MD5 secure hash context.
** "cx" the context
** "freeit" if PR_TRUE then free the object as well as its sub-objects
*/
void
MD5_DestroyContext(MD5Context *cx, PRBool freeit)
{
return;
}
/*
** Reset an MD5 context, preparing it for a fresh round of hashing
*/
void
MD5_Begin(MD5Context *cx)
{
return;
}
/*
** Update the MD5 hash function with more data.
** "cx" the context
** "input" the data to hash
** "inputLen" the amount of data to hash
*/
void
MD5_Update(MD5Context *cx, const unsigned char *input, unsigned int inputLen)
{
return;
}
/*
** Finish the MD5 hash function. Produce the digested results in "digest"
** "cx" the context
** "digest" where the 16 bytes of digest data are stored
** "digestLen" where the digest length (16) is stored
** "maxDigestLen" the maximum amount of data that can ever be
** stored in "digest"
*/
void
MD5_End(MD5Context *cx, unsigned char *digest,
unsigned int *digestLen, unsigned int maxDigestLen)
{
return;
}
/*
** Hash a non-null terminated string "src" into "dest" using SHA-1
*/
SECStatus
SHA1_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length)
{
return(SECFailure);
}
/*
** Create a new SHA-1 context
*/
SHA1Context *
SHA1_NewContext(void)
{
return(NULL);
}
/*
** Destroy a SHA-1 secure hash context.
** "cx" the context
** "freeit" if PR_TRUE then free the object as well as its sub-objects
*/
void
SHA1_DestroyContext(SHA1Context *cx, PRBool freeit)
{
return;
}
/*
** Reset a SHA-1 context, preparing it for a fresh round of hashing
*/
void
SHA1_Begin(SHA1Context *cx)
{
return;
}
/*
** Update the SHA-1 hash function with more data.
** "cx" the context
** "input" the data to hash
** "inputLen" the amount of data to hash
*/
void
SHA1_Update(SHA1Context *cx, const unsigned char *input, unsigned int inputLen)
{
return;
}
/*
** Finish the SHA-1 hash function. Produce the digested results in "digest"
** "cx" the context
** "digest" where the 16 bytes of digest data are stored
** "digestLen" where the digest length (20) is stored
** "maxDigestLen" the maximum amount of data that can ever be
** stored in "digest"
*/
void
SHA1_End(SHA1Context *cx, unsigned char *digest,
unsigned int *digestLen, unsigned int maxDigestLen)
{
return;
}
/*
** Return a malloc'd ascii string which is the base64 encoded
** version of the input string.
*/
char *
BTOA_DataToAscii(const unsigned char *data, unsigned int len)
{
return(NULL);
}
/*
** Return a malloc'd string which is the base64 decoded version
** of the input string; set *lenp to the length of the returned data.
*/
unsigned char *
ATOB_AsciiToData(const char *string, unsigned int *lenp)
{
return(NULL);
}

View File

@@ -0,0 +1,236 @@
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _SECSTUBN_H_
#define _SECSTUBN_H_
#include "xp.h"
#include "ntypes.h"
#include "net.h"
typedef struct _digests DIGESTS;
typedef struct _zig ZIG;
typedef struct _zigcontext ZIG_Context;
typedef struct _peheader PEHeader;
typedef struct SOBITEM_ {
char *pathname;
int type;
size_t size;
void *data;
} SOBITEM;
typedef struct FINGERZIG_ {
size_t length;
void *key;
CERTCertificate *cert;
} FINGERZIG;
#define ZIG_CB_SIGNAL 1
#define ZIG_SIGN 10
#define ZIG_F_GUESS 0
#define ZIG_MF 2
#define ZIG_ERR_PNF 12
SEC_BEGIN_PROTOS
void
SECNAV_Posting(PRFileDesc *fd);
void
SECNAV_HTTPHead(PRFileDesc *fd);
void
SECNAV_RegisterNetlibMimeConverters();
char *
SECNAV_MungeString(const char *unmunged_string);
char *
SECNAV_UnMungeString(const char *munged_string);
PRBool
SECNAV_GenKeyFromChoice(void *proto_win, LO_Element *form,
char *choiceString, char *challenge,
char *typeString, char *pqgString,
char **pValue, PRBool *pDone);
char **
SECNAV_GetKeyChoiceList(char *type, char *pqgString);
PRBool
SECNAV_SecurityDialog(MWContext *context, int state);
void
NET_InitCertLdapProtocol(void);
const char *
SECNAV_GetPolicyNameString(void);
int
SECNAV_InitConfigObject(void);
int
SECNAV_RunInitialSecConfig(void);
void
SECNAV_EarlyInit(void);
void
SECNAV_Init(void);
void
SECNAV_Shutdown(void);
void
SECNAV_SecurityAdvisor(void *proto_win, URL_Struct *url);
char *
SECNAV_MakeCertButtonString(CERTCertificate *cert);
int
SECNAV_SecURLData(char *which, NET_StreamClass *stream, MWContext *cx);
char *
SECNAV_SecURLContentType(char *which);
int
SECNAV_SecHandleSecurityAdvisorURL(MWContext *cx, const char *which);
void
SECNAV_HandleInternalSecURL(URL_Struct *url, MWContext *cx);
SECStatus
SECNAV_ComputeFortezzaProxyChallengeResponse(MWContext *context,
char *asciiChallenge,
char **signature_out,
char **clientRan_out,
char **certChain_out);
char *
SECNAV_PrettySecurityStatus(int level, unsigned char *status);
char *
SECNAV_SecurityVersion(PRBool longForm);
char *
SECNAV_SSLCapabilities(void);
unsigned char *
SECNAV_SSLSocketStatus(PRFileDesc *fd, int *return_security_level);
unsigned char *
SECNAV_CopySSLSocketStatus(unsigned char *status);
unsigned int
SECNAV_SSLSocketStatusLength(unsigned char *status);
char *
SECNAV_SSLSocketCertString(unsigned char *status);
PRBool
SECNAV_CompareCertsForRedirection(unsigned char *status1,
unsigned char *status2);
CERTCertificate *
SECNAV_CertFromSSLSocketStatus(unsigned char *status);
DIGESTS *PR_CALLBACK
SOB_calculate_digest(void XP_HUGE *data, long length);
int PR_CALLBACK
SOB_verify_digest(ZIG *siglist, const char *name, DIGESTS *dig);
void PR_CALLBACK
SOB_destroy (ZIG *zig);
char *
SOB_get_error (int status);
ZIG_Context *
SOB_find(ZIG *zig, char *pattern, int type);
int
SOB_find_next(ZIG_Context *ctx, SOBITEM **it);
void
SOB_find_end(ZIG_Context *ctx);
char *
SOB_get_url (ZIG *zig);
ZIG *
SOB_new (void);
int
SOB_set_callback (int type, ZIG *zig,
int (*fn) (int status, ZIG *zig,
const char *metafile,
char *pathname, char *errortext));
int PR_CALLBACK
SOB_cert_attribute(int attrib, ZIG *zig, long keylen, void *key,
void **result, unsigned long *length);
int PR_CALLBACK
SOB_stash_cert(ZIG *zig, long keylen, void *key);
int SOB_parse_manifest(char XP_HUGE *raw_manifest, long length,
const char *path, const char *url, ZIG *zig);
void
SECNAV_signedAppletPrivileges(void *proto_win, char *javaPrin,
char *javaTarget, char *risk, int isCert);
char *
SOB_JAR_list_certs (void);
int
SOB_JAR_validate_archive (char *filename);
void *
SOB_JAR_new_hash (int alg);
void *
SOB_JAR_hash (int alg, void *cookie, int length, void *data);
void *
SOB_JAR_end_hash (int alg, void *cookie);
int
SOB_JAR_sign_archive (char *nickname, char *password, char *sf, char *outsig);
int
SOB_set_context (ZIG *zig, MWContext *mw);
int
SOB_pass_archive(int format, char *filename, const char *url, ZIG *zig);
int
SOB_get_metainfo(ZIG *zig, char *name, char *header, void **info,
unsigned long *length);
int
SOB_verified_extract(ZIG *zig, char *path, char *outpath);
NET_StreamClass *
SECNAV_MakePreencryptedWriteStream(FO_Present_Types format_out, void *data,
URL_Struct *url, MWContext *window_id);
SEC_END_PROTOS
#endif /* _SECSTUBN_H_ */

View File

@@ -1,66 +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.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include <stdio.h>
#include "nsID.h"
const static char gIDFormat[] =
"{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}";
/*
* Turns a {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} string into
* an nsID
*/
PRBool nsID::Parse(char *aIDStr) {
int count, n1, n2, n3[8];
long int n0;
count = sscanf(aIDStr, gIDFormat,
&n0, &n1, &n2,
&n3[0],&n3[1],&n3[2],&n3[3],
&n3[4],&n3[5],&n3[6],&n3[7]);
m0 = (PRInt32) n0;
m1 = (PRInt16) n1;
m2 = (PRInt16) n2;
for (int i = 0; i < 8; i++) {
m3[i] = (PRInt8) n3[i];
}
return (PRBool) (count == 11);
}
/*
* Returns an allocated string in {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
* format. Caller should delete [] the string.
*/
char *nsID::ToString() const
{
char *res = new char[39];
if (res != NULL) {
sprintf(res, gIDFormat,
(long int) m0, (int) m1, (int) m2,
(int) m3[0], (int) m3[1], (int) m3[2], (int) m3[3],
(int) m3[4], (int) m3[5], (int) m3[6], (int) m3[7]);
}
return res;
}