From a7df13353f28a6923b871cbe222e7db4546df51e Mon Sep 17 00:00:00 2001 From: "bryner%uiuc.edu" Date: Mon, 2 Apr 2001 00:22:19 +0000 Subject: [PATCH] Bug 38061 - removing obsolete headers. sr=cls. --- include/MANIFEST | 19 - include/Makefile.in | 4 - include/client.h | 49 - include/ctxtfunc.h | 39 - include/edttypes.h | 699 ------------ include/fe_proto.h | 1341 ----------------------- include/m_cvstrm.h | 97 -- include/makefile.win | 4 - include/merrors.h | 78 -- include/mk_cx_fn.h | 171 --- include/msgtypes.h | 49 - include/ncompat.h | 255 ----- include/net.h | 2469 ------------------------------------------ include/ntypes.h | 219 ---- include/proto.h | 431 -------- include/shistele.h | 136 --- include/structs.h | 481 -------- include/winfile.h | 121 --- include/xp.h | 47 - include/xpgetstr.h | 103 -- 20 files changed, 6812 deletions(-) delete mode 100644 include/client.h delete mode 100644 include/ctxtfunc.h delete mode 100644 include/edttypes.h delete mode 100644 include/fe_proto.h delete mode 100644 include/m_cvstrm.h delete mode 100644 include/merrors.h delete mode 100644 include/mk_cx_fn.h delete mode 100644 include/msgtypes.h delete mode 100644 include/ncompat.h delete mode 100644 include/net.h delete mode 100644 include/ntypes.h delete mode 100644 include/proto.h delete mode 100644 include/shistele.h delete mode 100644 include/structs.h delete mode 100644 include/winfile.h delete mode 100644 include/xp.h delete mode 100644 include/xpgetstr.h diff --git a/include/MANIFEST b/include/MANIFEST index 28197cb7f9eb..ba6c83c23bb4 100644 --- a/include/MANIFEST +++ b/include/MANIFEST @@ -2,31 +2,12 @@ # This is a list of local files which get copied to the mozilla:dist directory # -client.h csid.h -ctxtfunc.h -edttypes.h -fe_proto.h -libc_r.h -merrors.h minicom.h -mk_cx_fn.h -msgtypes.h -m_cvstrm.h -ncompat.h -net.h npapi.h npupp.h -ntypes.h platform.h -proto.h -shistele.h -structs.h -unix-dns.h -winfile.h -xp.h xpassert.h -xpgetstr.h xp_core.h xp_debug.h xp_file.h diff --git a/include/Makefile.in b/include/Makefile.in index 65204faee1ad..31b710b4c4a0 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -26,12 +26,8 @@ VPATH = @srcdir@ EXPORTS = \ csid.h \ - merrors.h \ - msgtypes.h \ - net.h \ npapi.h \ npupp.h \ - ntypes.h \ platform.h \ xp_core.h \ xp_file.h \ diff --git a/include/client.h b/include/client.h deleted file mode 100644 index 4805c6817a2d..000000000000 --- a/include/client.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - - -/* - * This file should be included after xp_mcom.h - * - * All definitions for intermodule communications in the Netscape - * client should be contained in this file - */ - -#ifndef _CLIENT_H_ -#define _CLIENT_H_ - -#define NEW_FE_CONTEXT_FUNCS - -/* include header files needed for prototypes/etc */ - -#include "xp_mcom.h" - -#include "ntypes.h" /* typedefs for commonly used Netscape data structures */ -#include "fe_proto.h" /* all the standard FE functions */ -#include "proto.h" /* library functions */ - -/* global data structures */ -#include "structs.h" -#include "merrors.h" - -#endif /* _CLIENT_H_ */ - diff --git a/include/ctxtfunc.h b/include/ctxtfunc.h deleted file mode 100644 index 8e76b571f6b5..000000000000 --- a/include/ctxtfunc.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -/* the context function table - * - * This was typedef'd to ContextFuncs in structs.h - */ -#ifndef _ContextFunctions_ -#define _ContextFunctions_ - -#include "il_types.h" -#include "xp_obs.h" - -struct _ContextFuncs { -#define MAKE_FE_FUNCS_STRUCT -#include "mk_cx_fn.h" -}; - -#endif /* _ContextFunctions_ */ - diff --git a/include/edttypes.h b/include/edttypes.h deleted file mode 100644 index 81d49903daca..000000000000 --- a/include/edttypes.h +++ /dev/null @@ -1,699 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -/* - * File defines external editor types. - * - * These types are remapped internally to the editor. -*/ - -#ifndef _edt_types_h_ -#define _edt_types_h_ - -#ifndef EDITOR_TYPES -#define ED_Element void -#define ED_Buffer void -#define ED_TagCursor void -#define ED_BitArray void -#endif - -#include "xp_core.h" - -/* Number of "Netscape Colors" All are in - * Color cube -*/ -#define MAX_NS_COLORS 70 - -/* Limits on table parameters */ -#define MAX_TABLE_ROWS 500 -#define MAX_TABLE_COLUMNS 100 -/* This is also limit used for cell size, padding, and borders */ -#define MAX_TABLE_PIXELS 10000 - -typedef int32 ED_BufferOffset; - -/* - * Handle to Internal structure used for maintaining links. -*/ -typedef struct ED_Link* ED_LinkId; -#define ED_LINK_ID_NONE 0 - -/* this id is passed to FE_GetImageData.. when it returns, we know to pass - * the call to EDT_SetImageData -*/ -#define ED_IMAGE_LOAD_HACK_ID -10 - -typedef enum { - ED_ELEMENT_NONE, /* Not returned from EDT_GetCurrentElement, needed to have a "not known" value */ - ED_ELEMENT_SELECTION, /* a selection instead of a single element */ - ED_ELEMENT_TEXT, - ED_ELEMENT_IMAGE, - ED_ELEMENT_HRULE, - ED_ELEMENT_UNKNOWN_TAG, - ED_ELEMENT_TARGET, - ED_ELEMENT_TABLE, /* Keep these at the end so we can use type >= ED_ELEMENT_TABLE to test for any of them */ - ED_ELEMENT_CELL, - ED_ELEMENT_ROW, /* May not need these. Currently returning ED_ELEMENT_CELL instead */ - ED_ELEMENT_COL -} ED_ElementType; - -typedef enum { - ED_CARET_BEFORE = 0, - ED_CARET_AFTER = 1 -} ED_CaretObjectPosition; - -#define TF_NONE 0 -#define TF_BOLD 1 -#define TF_ITALIC 2 -#define TF_FIXED 4 -#define TF_SUPER 8 -#define TF_SUB 0x10 -#define TF_STRIKEOUT 0x20 -#define TF_BLINK 0x40 -#define TF_FONT_COLOR 0x80 /* set if font has color */ -#define TF_FONT_SIZE 0x100 /* set if font has size */ -#define TF_HREF 0x200 -#define TF_SERVER 0x400 -#define TF_SCRIPT 0x800 -#define TF_STYLE 0x1000 -#define TF_UNDERLINE 0x2000 -#define TF_FONT_FACE 0x4000 -#define TF_NOBREAK 0x8000 -#define TF_SPELL 0x10000 -#define TF_INLINEINPUT 0x20000 -#define TF_INLINEINPUTTHICK 0x40000 -#define TF_INLINEINPUTDOTTED 0x80000 -#define TF_FONT_WEIGHT 0x100000 -#define TF_FONT_POINT_SIZE 0x200000 - -typedef int32 ED_TextFormat; /* Prefered type for the editor text format. */ -typedef ED_TextFormat ED_ETextFormat; /* Alias for old code. Remove when possible. */ - -/* Similar to ED_TextFormat. Used when multiple cells are represented in EDT_TableCellData */ - -#define CF_NONE 0 -#define CF_ALIGN 1 -#define CF_VALIGN 2 -#define CF_COLSPAN 4 -#define CF_ROWSPAN 8 -#define CF_HEADER 0x10 -#define CF_NOWRAP 0x20 -#define CF_WIDTH 0x40 -#define CF_HEIGHT 0x80 -#define CF_BACK_COLOR 0x100 -#define CF_BACK_IMAGE 0x200 -#define CF_BACK_NOSAVE 0x400 -#define CF_EXTRA_HTML 0x800 - -typedef int32 ED_CellFormat; /* Prefered type for the editor cell format. */ - -/* - * The names here are confusing, and have a historical basis that is - * lost in the mists of time. The trouble is that the "ED_ALIGN_CENTER" - * tag is really "abscenter", while the ED_ALIGN_ABSCENTER tag is - * really "center". (and the same for the TOP and BOTTOM tags.) - * - * Someday, if we have a lot of spare time we could switch the names. - */ - -typedef enum { - ED_ALIGN_DEFAULT = -1, /* HTML string */ - ED_ALIGN_CENTER = 0, /* abscenter NOT SUPPORTED IN COMPOSER FE STARTING IN 5.0 */ - ED_ALIGN_LEFT = 1, /* left */ - ED_ALIGN_RIGHT = 2, /* right */ - ED_ALIGN_TOP = 3, /* texttop */ - ED_ALIGN_BOTTOM = 4, /* absbottom NOT SUPPORTED IN COMPOSER FE STARTING IN 5.0 */ - ED_ALIGN_BASELINE = 5, /* baseline (default, no param written out) */ - ED_ALIGN_ABSCENTER = 6, /* center */ - ED_ALIGN_ABSBOTTOM = 7, /* bottom Used for Table Cells only */ - ED_ALIGN_ABSTOP = 8 /* top */ -} ED_Alignment; - - -/*------------------- TABLE SIZING AND SELECTION --------------------*/ - -/* SizeStyle defines */ -#define ED_SIZE_NONE 0 -#define ED_SIZE_TOP 0x0001 -#define ED_SIZE_RIGHT 0x0002 -#define ED_SIZE_BOTTOM 0x0004 -#define ED_SIZE_LEFT 0x0008 -#define ED_SIZE_ADD_ROWS 0x0010 -#define ED_SIZE_ADD_COLS 0x0020 - -/* Hotspot at corners */ -#define ED_SIZE_TOP_RIGHT (ED_SIZE_TOP | ED_SIZE_RIGHT) -#define ED_SIZE_BOTTOM_RIGHT (ED_SIZE_BOTTOM | ED_SIZE_RIGHT) -#define ED_SIZE_TOP_LEFT (ED_SIZE_TOP | ED_SIZE_LEFT) -#define ED_SIZE_BOTTOM_LEFT (ED_SIZE_BOTTOM | ED_SIZE_LEFT) - -typedef intn ED_SizeStyle; - -typedef enum { /* Return value for EDT_GetTableHitRegion) */ - ED_HIT_NONE, - ED_HIT_SEL_TABLE, /* Upper left corner */ - ED_HIT_SEL_COL, /* Near top table border */ - ED_HIT_SEL_ROW, /* Near left table border */ - ED_HIT_SEL_CELL, /* Near top cell border */ - ED_HIT_SEL_ALL_CELLS, /* Upper left corner when Ctrl is pressed */ - ED_HIT_SIZE_TABLE_WIDTH, /* Near right table border */ - ED_HIT_SIZE_TABLE_HEIGHT, /* Near bottom table border */ - ED_HIT_SIZE_COL, /* Near right border of a cell and between columns */ - ED_HIT_SIZE_ROW, /* Near bottom border of a cell and between columns */ - ED_HIT_ADD_ROWS, /* Lower left corner */ - ED_HIT_ADD_COLS, /* Lower right corner */ - ED_HIT_DRAG_TABLE, /* Near bottom border and between rows when table or cell is already selected */ - ED_HIT_CHANGE_COLSPAN, /* Near Right border of cell having COLSPAN (Not used yet) */ - ED_HIT_CHANGE_ROWSPAN /* Bottom edge of cell having ROWSPAN (Not used yet) */ -} ED_HitType; - -typedef enum { /* Return types for EDT_GetTableDragDropRegion */ - ED_DROP_NONE, /* Don't allow drop - when pasting wouldn't change anything */ - ED_DROP_NORMAL, /* No special table behavior - do the same as any HTML drop */ - ED_DROP_ROW_ABOVE, /* Between rows - near top border of cell when source = row */ - ED_DROP_ROW_BELOW, /* Between rows - near bottom border of cell when source = row */ - ED_DROP_COLUMN_BEFORE, /* Between columns - near left border of cell when source = column */ - ED_DROP_COLUMN_AFTER, /* Between columns - near right border of cell when source = column */ - ED_DROP_REPLACE_CELLS /* Inside cell - when we want to replace cell contents */ -} ED_DropType; - -/* Different behavior when pasting table cells. 2nd param values for EDT_PasteHTML() */ -typedef enum { - ED_PASTE_NORMAL, - ED_PASTE_TABLE, /* Create a new table at insert point */ - ED_PASTE_ROW_ABOVE, /* Insert new row(s) above current row */ - ED_PASTE_ROW_BELOW, /* Insert new row(s) below current row*/ - ED_PASTE_COLUMN_BEFORE, /* Insert new column(s) before current column */ - ED_PASTE_COLUMN_AFTER, /* Insert new column(s) after current column */ - ED_PASTE_REPLACE_CELLS, /* Replace cell contents of cells marked with - the "special selection" attribute */ - /* Next 2 are used only when pasting tab-delimited text or image representation from Excel */ - ED_PASTE_TEXT, /* Paste plain text, not a table */ - ED_PASTE_IMAGE /* Paste the image representation of the text */ -} ED_PasteType; -/* Note: Keep the range from ROW_ABOVE through REPLACE_CELLS in synch with ED_DropType values - for quick conversion from ED_DropType into ED_PasteType */ - -/* Data type written to stream. Used to decide how to paste into existing table */ -typedef enum { - - ED_COPY_NORMAL, /* Default = 0. Normal HTML copying, not a table */ - ED_COPY_TABLE, /* Entire Table was copied */ - ED_COPY_ROWS, /* Only entire rows were copied */ - ED_COPY_COLUMNS, /* Only entire columns were copied */ - ED_COPY_CELLS /* Arbitrary set of selected cells were copied */ -} ED_CopyType; - -struct _EDT_DragTableData { - LO_TableStruct *pSourceTable; /* So we can tell if dragging over the source table */ - ED_HitType iSourceType; /* One of the ED_HIT_SEL_... enums */ - ED_DropType iDropType; /* One of ED_DROP_... enums */ - LO_Element *pFirstSelectedCell; /* First cell in source being dragged */ - LO_Element *pDragOverCell; /* Cell being dragged over */ - int32 iRows; /* Number of rows being dragged */ - int32 iColumns; /* Number of columns being dragged (counts COLSPAN) */ - int32 *pCellsPerRow; /* Array of number of actual cells in each row (size = iRows) */ - /* (this doesn't count COLSPAN effects) */ - int32 X; /* Location to place highlighting or make caret */ - int32 Y; /* to show where to drop cells */ - int32 iWidth; /* The width and */ - int32 iHeight; /* height of the insert-between-cells feedback */ -}; -typedef struct _EDT_DragTableData EDT_DragTableData; - - -typedef enum { /* Return values from EDT_GetMergeCellsType */ - ED_MERGE_NONE, - ED_MERGE_NEXT_CELL, - ED_MERGE_SELECTED_CELLS -} ED_MergeType; - -/* Used with EDT_ChangeTableSelection to tell if we should move - * to next Cell, Row, or Columns along with changing the selected cells -*/ -typedef enum { - ED_MOVE_NONE, - ED_MOVE_PREV, - ED_MOVE_NEXT -} ED_MoveSelType; - -/*--------------------------- HREF --------------------------------*/ - -struct _EDT_HREFData { - char *pURL; - char *pExtra; -}; - -typedef struct _EDT_HREFData EDT_HREFData; - -/*--------------------------- Image --------------------------------*/ - -struct _EDT_ImageData { - XP_Bool bIsMap; -/* char *pUseMap; created with XP_ALLOC() Now in pExtra, hardts */ - ED_Alignment align; - char *pSrc; - char *pLowSrc; - char *pName; - char *pAlt; - int32 iWidth; - int32 iHeight; - XP_Bool bWidthPercent; /* Range: 1 - 100 if TRUE, else = pixels (default) */ - XP_Bool bHeightPercent; - int32 iHSpace; - int32 iVSpace; - int32 iBorder; -/* Added hardts */ - XP_Bool bNoSave; -/* Added by CLM: */ - int32 iOriginalWidth; /* Width and Height we got on initial loading */ - int32 iOriginalHeight; - EDT_HREFData *pHREFData; - char *pExtra; -}; - -typedef struct _EDT_ImageData EDT_ImageData; - -/*--------------------------- Target --------------------------------*/ - -struct _EDT_TargetData { - char *pName; - char *pExtra; -}; - -typedef struct _EDT_TargetData EDT_TargetData; - -/*--------------------------- Character --------------------------------*/ -#define ED_FONT_POINT_SIZE_DEFAULT 0 -#define ED_FONT_POINT_SIZE_MIN 1 -#define ED_FONT_POINT_SIZE_MAX 1000 - -#define ED_FONT_WEIGHT_MIN 100 -#define ED_FONT_WEIGHT_NORMAL 400 -#define ED_FONT_WEIGHT_BOLD 700 -#define ED_FONT_WEIGHT_MAX 900 - -enum { - ED_FONT_VARIABLE, - ED_FONT_FIXED, - ED_FONT_LOCAL -}; - -struct _EDT_CharacterData { - ED_TextFormat mask; /* bits to set or get */ - ED_TextFormat values; /* values of the bits in the mask */ - LO_Color *pColor; /* color if mask bit is set */ - int32 iSize; /* size if mask bit is set */ - EDT_HREFData *pHREFData; /* href if mask bit is set */ - ED_LinkId linkId; /* internal use only */ - char* pFontFace; /* FontFace name */ - int16 iWeight; /* font weight range = 100-900, 400=Normal, 700=Bold*/ - int16 iPointSize; /* not sure what default is! Use 0 to mean "default" */ -}; - -typedef struct _EDT_CharacterData EDT_CharacterData; - -/*--------------------------- Horizonal Rule --------------------------------*/ - -struct _EDT_HorizRuleData { - ED_Alignment align; /* only allows left and right alignment */ - int32 size; /* value 1 to 100 indicates line thickness */ - int32 iWidth; /* CM: default = 100% */ - XP_Bool bWidthPercent; /* Range: 1 - 100 if TRUE(default), else = pixels */ - XP_Bool bNoShade; - char *pExtra; -}; - -typedef struct _EDT_HorizRuleData EDT_HorizRuleData; - -/*--------------------------- ContainerData --------------------------------*/ - -struct _EDT_ContainerData { - ED_Alignment align; /* only allows left and right alignment */ - char *pExtra; -}; - -typedef struct _EDT_ContainerData EDT_ContainerData; - -/*--------------------------- TableData --------------------------------*/ - -struct _EDT_TableData { - ED_Alignment align; /* ED_ALIGN_LEFT, ED_ALIGN_ABSCENTER, ED_ALIGN_RIGHT */ - ED_Alignment malign; /* margin alignment: ED_ALIGN_DEFAULT, ED_ALIGN_LEFT, ED_ALIGN_RIGHT */ - XP_Bool bUseCols; /* TRUE means COLS= will be output, which speeds up layout in 4.0 */ - int32 iRows; - int32 iColumns; - XP_Bool bBorderWidthDefined; - int32 iBorderWidth; - int32 iCellSpacing; - int32 iCellPadding; - XP_Bool bWidthDefined; - XP_Bool bWidthPercent; - int32 iWidth; - int32 iWidthPixels; - XP_Bool bHeightDefined; - XP_Bool bHeightPercent; - int32 iHeight; - int32 iHeightPixels; - LO_Color *pColorBackground; /* null in the default case */ - char *pBackgroundImage; /* null in the default case */ - XP_Bool bBackgroundNoSave; - char *pExtra; -}; - -typedef struct _EDT_TableData EDT_TableData; - -/*--------------------------- TableCaptionData --------------------------------*/ - -struct _EDT_TableCaptionData { - ED_Alignment align; - char *pExtra; -}; - -typedef struct _EDT_TableCaptionData EDT_TableCaptionData; - -/*--------------------------- TableRowData --------------------------------*/ - -struct _EDT_TableRowData { - ED_Alignment align; - ED_Alignment valign; - LO_Color *pColorBackground; /* null in the default case */ - char *pBackgroundImage; /* null in the default case */ - XP_Bool bBackgroundNoSave; - char *pExtra; -}; - -typedef struct _EDT_TableRowData EDT_TableRowData; - -/*--------------------------- TableCellData --------------------------------*/ - -struct _EDT_TableCellData { - ED_CellFormat mask; /* bits to tell us what we know for all cells */ - ED_HitType iSelectionType; /* Either: ED_HIT_SEL_CELL, ED_HIT_SEL_COL, ED_HIT_SEL_ROW, or ED_HIT_NONE */ - intn iSelectedCount; /* Number of cells selected. Usually >= 1 */ - ED_Alignment align; - ED_Alignment valign; - int32 iColSpan; - int32 iRowSpan; - XP_Bool bHeader; /* TRUE == th, FALSE == td */ - XP_Bool bNoWrap; - int32 X; - int32 Y; - intn iRow; - XP_Bool bWidthDefined; - XP_Bool bWidthPercent; - int32 iWidth; - int32 iWidthPixels; - XP_Bool bHeightDefined; - XP_Bool bHeightPercent; - int32 iHeight; - int32 iHeightPixels; - LO_Color *pColorBackground; /* null in the default case */ - char *pBackgroundImage; /* null in the default case */ - XP_Bool bBackgroundNoSave; - char *pExtra; -}; - -typedef struct _EDT_TableCellData EDT_TableCellData; - -/*--------------------------- LayerData --------------------------------*/ - -struct _EDT_LayerData { - char *pExtra; -}; - -typedef struct _EDT_LayerData EDT_LayerData; - -/*--------------------------- DivisionData --------------------------------*/ - -struct _EDT_DivisionData { - ED_Alignment align; - char *pExtra; -}; - -typedef struct _EDT_DivisionData EDT_DivisionData; - -/*--------------------------- Page Properties --------------------------------*/ -struct _EDT_MetaData { - XP_Bool bHttpEquiv; /* true, http-equiv="fdsfds", false name="fdsfds" */ - char *pName; /* http-equiv's or name's value */ - char *pContent; /* value of the CONTENT param */ - char *pPrevContent; /* The previous CONTENT value to search for - so we can support multiple items with same - name or http-equiv param */ -}; - -typedef struct _EDT_MetaData EDT_MetaData; - -struct _EDT_PageData { - LO_Color *pColorBackground; /* null in the default case */ - LO_Color *pColorLink; - LO_Color *pColorText; - LO_Color *pColorFollowedLink; - LO_Color *pColorActiveLink; - char *pBackgroundImage; - XP_Bool bBackgroundNoSave; - char *pFontDefURL; /* For Web Fonts. */ - XP_Bool bFontDefNoSave; - char *pTitle; - XP_Bool bKeepImagesWithDoc; -}; - -typedef struct _EDT_PageData EDT_PageData; - -typedef enum { - ED_COLOR_BACKGROUND, - ED_COLOR_LINK, - ED_COLOR_TEXT, - ED_COLOR_FOLLOWED_LINK -} ED_EColor; - -/* - * CLM: Java and PlugIn data structures -*/ - struct _EDT_ParamData { - char *pName; - char *pValue; -}; -typedef struct _EDT_ParamData EDT_ParamData; - -typedef int32 EDT_ParamID; - -struct _EDT_PlugInData { - EDT_ParamID ParamID; /* Identifies which Param list is associated */ - char *pSrc; - XP_Bool bHidden; - ED_Alignment align; - int32 iWidth; - int32 iHeight; - XP_Bool bWidthPercent; /* Range: 1 - 100 if TRUE, else = pixels default) */ - XP_Bool bHeightPercent; - XP_Bool bForegroundPalette; /* PC systems only. For controling 256-color palette wars */ - int32 iHSpace; - int32 iVSpace; - int32 iBorder; -}; -typedef struct _EDT_PlugInData EDT_PlugInData; - -struct _EDT_JavaData { - EDT_ParamID ParamID; - char *pCode; - char *pCodebase; - char *pName; - ED_Alignment align; - char *pSrc; - int32 iWidth; - int32 iHeight; - XP_Bool bWidthPercent; /* Range: 1 - 100 if TRUE, else = pixels default) */ - XP_Bool bHeightPercent; - int32 iHSpace; - int32 iVSpace; - int32 iBorder; -}; -typedef struct _EDT_JavaData EDT_JavaData; - -/* CLM: Error codes for file writing - * Return 0 if no error - */ -typedef enum { - ED_ERROR_NONE, - ED_ERROR_READ_ONLY, /* File is marked read-only */ - ED_ERROR_BLOCKED, /* Can't write at this time, edit buffer blocked */ - ED_ERROR_BAD_URL, /* URL was not a "file:" type or no string */ - ED_ERROR_FILE_OPEN, - ED_ERROR_FILE_WRITE, - ED_ERROR_CREATE_BAKNAME, - ED_ERROR_DELETE_BAKFILE, - ED_ERROR_FILE_RENAME_TO_BAK, - ED_ERROR_CANCEL, - ED_ERROR_FILE_EXISTS, /* We really didn't save -- file existed and no overwrite */ - ED_ERROR_SRC_NOT_FOUND, - ED_ERROR_FILE_READ, - - /* The following are used internally by the editor and will not be passed to the front end. */ - ED_ERROR_PUBLISHING, /* When netlib encounters an error http or ftp publishing. */ - ED_ERROR_TAPEFS_COMPLETION /* The tape file system for saving encountered an error when - the Complete() method was called. E.g. an error sending a - mail message. */ -} ED_FileError; - -typedef enum { - ED_PUBLISH_OK, - ED_PUBLISH_ERROR_FILENAME, - ED_PUBLISH_ERROR_LOCATION -} ED_PublishError; - -typedef enum { - ED_TAG_OK, - ED_TAG_UNOPENED, - ED_TAG_UNCLOSED, - ED_TAG_UNTERMINATED_STRING, - ED_TAG_PREMATURE_CLOSE, - ED_TAG_TAGNAME_EXPECTED -} ED_TagValidateResult; - -typedef enum { - ED_LIST_TYPE_DEFAULT, - ED_LIST_TYPE_DIGIT, - ED_LIST_TYPE_BIG_ROMAN, - ED_LIST_TYPE_SMALL_ROMAN, - ED_LIST_TYPE_BIG_LETTERS, - ED_LIST_TYPE_SMALL_LETTERS, - ED_LIST_TYPE_CIRCLE, - ED_LIST_TYPE_SQUARE, - ED_LIST_TYPE_DISC, - ED_LIST_TYPE_CITE /* For Mail Quoting */ -} ED_ListType; - - -struct _EDT_ListData { - /* This should be TagType, but there are problems with the include file dependencies. */ - int8 iTagType; /* P_UNUM_LIST, P_NUM_LIST, P_BLOCKQUOTE, */ - /* P_DIRECTOR, P_MENU, P_DESC_LIST */ - XP_Bool bCompact; - ED_ListType eType; - int32 iStart; /* automatically maps, start is one */ - char *pBaseURL; /* If an ED_LIST_TYPE_CITE, this is the URL from the enclosing tag. - Don't expose this to users because not actually written out in the HTML. */ - char *pExtra; -}; - -typedef struct _EDT_ListData EDT_ListData; - -typedef enum { - ED_BREAK_NORMAL, /* just break the line, ignore images */ - ED_BREAK_LEFT, /* break so it passes the image on the left */ - ED_BREAK_RIGHT, /* break past the right image */ - ED_BREAK_BOTH /* break past both images */ -} ED_BreakType; - -typedef enum { - ED_SAVE_OVERWRITE_THIS, - ED_SAVE_OVERWRITE_ALL, - ED_SAVE_DONT_OVERWRITE_THIS, - ED_SAVE_DONT_OVERWRITE_ALL, - ED_SAVE_CANCEL -} ED_SaveOption; - -/* After saving, what to do with the editor buffer. */ -typedef enum { - ED_FINISHED_GOTO_NEW, /* Point the editor to the location of the - newly saved document. */ - ED_FINISHED_REVERT_BUFFER, /* Revert the buffer to the state before - the save operation began. */ - ED_FINISHED_SAVE_DRAFT, /* Like ED_FINISHED_REVERT_BUFFER, except clears the dirty flag - on success. */ - ED_FINISHED_MAIL_SEND /* If we succeed we're going to throw the buffer - away, so don't revert it. If failure, revert the buffer. - Used for mail compose, we don't - want the editor to start any operation that - causes problems when libmsg destroys the editor - context. */ -} ED_SaveFinishedOption; - - -/* For FE_SaveDialogCreate */ -typedef enum { - ED_SAVE_DLG_SAVE_LOCAL, /* "saving files to local disk" */ - ED_SAVE_DLG_PUBLISH, /* "uploading files to remote server" */ - ED_SAVE_DLG_PREPARE_PUBLISH /* "preparing files to publish" */ -} ED_SaveDialogType; - -typedef int32 EDT_ClipboardResult; -#define EDT_COP_OK 0 -#define EDT_COP_DOCUMENT_BUSY 1 -#define EDT_COP_SELECTION_EMPTY 2 -#define EDT_COP_SELECTION_CROSSES_TABLE_DATA_CELL 3 -#define EDT_COP_SELECTION_CROSSES_NESTED_TABLE 4 - -/* For the result EDT_COP_CLIPBOARD_BAD the XP code has already - * given the user an error dialog. So FE code should not - * give an additional error dialog. (Only occurs on - * paste and paste-like operations.) - */ -#define EDT_COP_CLIPBOARD_BAD 4 - - -#ifdef FIND_REPLACE - -#define ED_FIND_FIND_ALL_WORDS 1 /* used to enumerate all words in a */ - /* buffer */ -#define ED_FIND_MATCH_CASE 2 /* default is to ignore case */ -#define ED_FIND_REPLACE 4 /* call back the replace routine */ -#define ED_FIND_WHOLE_BUFFER 8 /* start search from the top */ -#define ED_FIND_REVERSE 0x10 /* reverse search from this point */ - -typedef intn ED_FindFlags; - -typedef void (*EDT_PFReplaceFunc)( void *pMWContext, - char *pFoundWord, - char **pReplaceWord ); - -struct _EDT_FindAndReplaceData { - char* pSearchString; - ED_FindFlags fflags; - EDT_PFReplaceFunc pfReplace; -}; - -typedef struct _EDT_FindAndReplaceData EDT_FindAndReplaceData; - -#endif /* FIND_REPLACE */ - -/* Callback function for image encoder */ - -typedef int32 EDT_ImageEncoderReference; -typedef unsigned char EDT_ImageEncoderStatus; -#define ED_IMAGE_ENCODER_OK 0 -#define ED_IMAGE_ENCODER_USER_CANCELED 1 -#define ED_IMAGE_ENCODER_EXCEPTION 2 - -typedef void (*EDT_ImageEncoderCallbackFn)(EDT_ImageEncoderStatus status, void* hook); - -/* Outcomes which can be returned by FE_EncodingDialog(): */ -typedef enum { - ED_ENCODE_CANCEL, /* User canceled - close the page */ - ED_ENCODE_CHANGE_CHARSET, /* Convert current document's charset */ - ED_ENCODE_CHANGE_METATAG /* Just write charset to meta tag */ - /* (doesn't change content) */ -} ED_CharsetEncode; - -#endif diff --git a/include/fe_proto.h b/include/fe_proto.h deleted file mode 100644 index 9cf43d71d76e..000000000000 --- a/include/fe_proto.h +++ /dev/null @@ -1,1341 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - - -#ifndef _FrontEnd_ -#define _FrontEnd_ - -#include "net.h" -#include "xp_obs.h" -#include "il_types.h" -#ifdef EDITOR -#include "edttypes.h" -#endif /* EDITOR */ -#include "ctxtfunc.h" - -#include "prio.h" /* for netlib function decls */ -#include "prnetdb.h" /* for netlib function decls */ - -XP_BEGIN_PROTOS - -typedef void * XP_Rect; -typedef void * LO_TextBlock; - -/* Carriage return and linefeeds */ - -#define CR '\015' -#define LF '\012' -#define VTAB '\013' -#define FF '\014' -#define TAB '\011' -#define CRLF "\015\012" /* A CR LF equivalent string */ - -#ifdef XP_MAC -# define LINEBREAK "\012" -# define LINEBREAK_LEN 1 -#else -# if defined(XP_WIN) || defined(XP_OS2) -# define LINEBREAK "\015\012" -# define LINEBREAK_LEN 2 -# else -# if defined(XP_UNIX) || defined(XP_BEOS) -# define LINEBREAK "\012" -# define LINEBREAK_LEN 1 -# endif /* XP_UNIX */ -# endif /* XP_WIN */ -#endif /* XP_MAC */ - -/* set a timer and load the specified URL after the - * timer has elapsed. Cancel the timer if the user - * leaves the current page - */ -extern void FE_SetRefreshURLTimer(MWContext *context, - URL_Struct *URL_s ); - -#ifdef _USRDLL -extern void NDLLFE_SetRefreshURLTimer(MWContext *context, - URL_Struct *URL_s ); -#endif - -/* this function should register a function that will - * be called after the specified interval of time has - * elapsed. This function should return an id - * that can be passed to FE_ClearTimeout to cancel - * the Timeout request. - * - * A) Timeouts never fail to trigger, and - * B) Timeouts don't trigger *before* their nominal timestamp expires, and - * C) Timeouts trigger in the same ordering as their timestamps - * - * After the function has been called it is unregistered - * and will not be called again unless re-registered. - * - * func: The function to be invoked upon expiration of - * the Timeout interval - * closure: Data to be passed as the only argument to "func" - * msecs: The number of milli-seconds in the interval - */ -typedef void -(*TimeoutCallbackFunction) (void * closure); - -extern void * -FE_SetTimeout(TimeoutCallbackFunction func, void * closure, uint32 msecs); - -/* This function cancels a Timeout that has previously been - * set. - * Callers should not pass in NULL or a timer_id that - * has already expired. - */ -extern void -FE_ClearTimeout(void *timer_id); - -/* set and clear select fd's - */ -#ifdef XP_UNIX -extern void FE_SetReadPoll(PRFileDesc *fd); -extern void FE_ClearReadPoll(PRFileDesc *fd); -extern void FE_SetConnectPoll(PRFileDesc *fd); -extern void FE_ClearConnectPoll(PRFileDesc *fd); -#endif /* XP_UNIX */ - -/* do async dns */ -extern int FE_AsyncDNSLookup(MWContext *context, - char * host_port, - PRHostEnt ** hoststruct_ptr_ptr, - PRFileDesc *sock); -extern void FE_AbortDNSLookup(PRFileDesc *sock); - -/* all the other selects are depricated and should be removed shortly */ - -/* tell the front end to call ProcessNet with fd when fd - * has data ready for reading - */ -extern void FE_SetDNSSelect(MWContext * win_id, int fd); -extern void FE_ClearDNSSelect(MWContext * win_id, int fd); - -/* set and clear select fd's - */ -/* tell the front end to call ProcessNet with fd when fd - * has data ready for reading - */ -extern void FE_SetReadSelect(MWContext * win_id, int fd); -extern void FE_ClearReadSelect(MWContext * win_id, int fd); - -/* tell the front end to call ProcessNet with fd when fd - * has connected. (write select and exception select) - */ -extern void FE_SetConnectSelect(MWContext * win_id, int fd); -extern void FE_ClearConnectSelect(MWContext * win_id, int fd); - -/* tell the front end to call ProcessNet with fd whenever fd - * has data ready for reading - */ -extern void FE_SetFileReadSelect(MWContext * win_id, int fd); -extern void FE_ClearFileReadSelect(MWContext * win_id, int fd); - -#if defined(XP_UNIX) -/* Are we in CallNetlibAllTheTime mode? Called by security only - */ -extern XP_Bool XFE_IsCallNetlibAllTheTime(); -#endif - -/* tell the front end to call ProcessNet as often as possible - * This superseeds FE_SetCallNetlibAllTheTime - */ -extern void FE_SetCallNetlibAllTheTime(MWContext * win_id); -/* Same as,FE_SetCallNetlibAllTheTime but not in context's function table */ -extern void XP_SetCallNetlibAllTheTime(MWContext * win_id); - -/* tell the front end to stop calling ProcessNet as often as possible - * This superseeds FE_ClearCallNetlibAllTheTime - */ -extern void FE_ClearCallNetlibAllTheTime(MWContext * win_id); -/* Same as,FE_SetCallNetlibAllTheTime but not in context's function table */ -extern void XP_ClearCallNetlibAllTheTime(MWContext * win_id); - -/* use telnet, rlogin or tn3270 to connect to a remote host - * this function should be non_blocking if you want your front - * end to continue working. - */ -#define FE_TELNET_URL_TYPE 1 -#define FE_TN3270_URL_TYPE 2 -#define FE_RLOGIN_URL_TYPE 3 -PUBLIC void FE_ConnectToRemoteHost(MWContext * ctxt, int url_type, char *hostname, char * port, char *username); -#ifdef _USRDLL -PUBLIC void NDLLFE_ConnectToRemoteHost(MWContext * ctxt, int url_type, char *hostname, char * port, char *username); -#endif - -/* returns the users mail address as a constant string. If not known the - * routine should return NULL. - */ -extern const char * FE_UsersMailAddress(void); -/* returns the users full name as a constant string. If not known the - * routine should return NULL. - */ -extern const char * FE_UsersFullName(void); - -/* returns the contents of the users signature file as a constant string. - * If not known the routine should return NULL. - * The signature data should end with a single newline. - */ -extern const char *FE_UsersSignature(void); - -/* puts up a FE security dialog - * - * Should return TRUE if the url should continue to - * be loaded - * Should return FALSE if the url should be aborted - */ -extern Bool FE_SecurityDialog(MWContext * context, int message, XP_Bool *prefs_toggle); -#ifdef _USRDLL -extern Bool NDLLFE_SecurityDialog(MWContext * context, int message); -#endif - -#define SD_INSECURE_POST_FROM_SECURE_DOC 1 -#define SD_INSECURE_POST_FROM_INSECURE_DOC 2 -#define SD_ENTERING_SECURE_SPACE 3 -#define SD_LEAVING_SECURE_SPACE 4 -#define SD_INSECURE_DOCS_WITHIN_SECURE_DOCS_NOT_SHOWN 5 -#define SD_REDIRECTION_TO_INSECURE_DOC 6 -#define SD_REDIRECTION_TO_SECURE_SITE 7 - -/* -** Pass the password related preferences from the security library to the FE. -** "cx" is the window context -** "usePW" is true for "use a password", false otherwise -** "askPW" is when to ask for the password: -** -1 = every time its needed -** 0 = once per session -** 1 = after 'n' minutes of inactivity -** "timeout" is the number of inactive minutes to forget the password -*/ -extern void FE_SetPasswordPrefs(MWContext *context, - PRBool usePW, int askPW, int timeout); - -/* - * Inform the FE that the security library is or is not using a password. - * "cx" is the window context - * "usePW" is true for "use a password", false otherwise - */ -extern void FE_SetPasswordEnabled(MWContext *context, PRBool usePW); - -/* - * Inform the FE that the user has chosen when-to-ask-for-password preferences. - * "cx" is the window context - * "askPW" is when to ask for the password: - * -1 = every time its needed - * 0 = once per session - * 1 = after 'n' minutes of inactivity - * "timeout" is the number of inactive minutes to forget the password - * (this value should be ignored unless askPW is 1) - */ -extern void FE_SetPasswordAskPrefs(MWContext *context, int askPW, int timeout); - -/* Cipher preference handling: - * - * Sets the cipher preference item in the FE and saves the preference file. - * The FE will take a copy of passed in cipher argument. - * If context is NULL, FE will choose an appropriate context if neccessary. - */ -void FE_SetCipherPrefs(MWContext *context, char *cipher); - -/* Return the copy of the current state of the cipher preference item. - * Caller is expected to free the returned string. - */ -char * FE_GetCipherPrefs(void); - -/* causes the application to display a non modal mail/news editing window - * - * after the completion of mail editing the function controling the - * mail window should package the data as post data and call - * NET_GetURL with a mailto URL. Any mail headers should be contained within - * URL_Struct->post_headers and the body of the mail message within - * the URL_Struct->post_data. - * - * if the newsgroups field is non-empty the same post data used for the - * call to the smtp code should be called with a newspost url. - * the news url minus the newsgroups is given as the "news_url" argument - * of this function. If the newsgroups line is "comp.infosystems.www" - * then it should just be strcat'd onto the end of the "news_url" - * argument and passed to netlib. - */ -extern void FE_EditMailMessage(MWContext *context, - const char * to_address, - const char * subject, - const char * newsgroups, - const char * references, - const char * news_url); - - -/* graph the progress of a transfer with a bar of - * some sort. This will be called in place - * of FE_Progress when a content length is known - */ -extern void FE_GraphProgressInit (MWContext *context, - URL_Struct *URL_s, - int32 content_length); -extern void FE_GraphProgressDestroy (MWContext *context, - URL_Struct *URL_s, - int32 content_length, - int32 total_bytes_read); - -extern void FE_GraphProgress (MWContext *context, - URL_Struct *URL_s, - int32 bytes_received, - int32 bytes_since_last_time, - int32 content_length); - -/* When the netlib or a netlib stream change state, they should inform the - front end so it can provide feedback */ -typedef enum _Net_RequestStatus { - nsStarted, nsConnected, nsResolved, nsProgress, nsFinished, nsAborted -} Net_RequestStatus; -extern void FE_NetStatus (MWContext *context, void *request, Net_RequestStatus status); - -/* netlib and netlib streams will use this to keep the front end informed of - state changes but this information does not specify which request it - refers to, and the text message is only good for user text feedback */ -extern void FE_Progress (MWContext *context, const char * Msg); - -extern void FE_Alert (MWContext * context, const char * Msg); - -#if defined(XP_UNIX) || defined(XP_BEOS) -extern void FE_Alert_modal (MWContext * context, const char * Msg); -#endif - -#if defined(XP_MAC)||defined(XP_UNIX) -extern void FE_Message (MWContext * context, const char * Msg); -#else -#define FE_Message FE_Alert -#endif - -extern Bool FE_Confirm(MWContext * context, const char * Msg); - -extern char * FE_Prompt (MWContext * context, const char * Msg, const char * dflt); - -extern char * FE_PromptPassword (MWContext * context, const char * Msg); - -extern char * FE_PromptMessageSubject(MWContext * context); - - -/* Prompt for a username and password - * - * message is a prompt message. - * - * if username and password are not NULL they should be used - * as default values and NOT MODIFIED. New values should be malloc'd - * and put in their place. - * - * If the user hits cancel, FALSE should be returned; otherwise, - * TRUE should be returned. - */ -PUBLIC Bool FE_PromptUsernameAndPassword (MWContext * window_id, - const char * message, - char ** username, - char ** password); - -/* - * If the user has requested it, save the pop3 password. - */ -extern void FE_RememberPopPassword(MWContext * context, const char * password); - - -/* Callback for FE_PromptForFileName() and FE_PromptForNewsHost() */ -typedef void (*ReadFileNameCallbackFunction) (MWContext *context, - char *file_name, - void *closure); - - -/* Prompt the user for a file name. - This simply creates and raises the dialog, and returns. - When the user hits OK or Cancel, the callback will be run. - - prompt_string: the window title, or whatever. - - default_path: the directory which should be shown to the user by default. - This may be 0, meaning "use the same one as last time." The pathname - will be in URL (Unix) syntax. (If the FE can't do this, or if it - violates some guidelines, nevermind. Unix uses it.) - - file_must_exist_p: if true, the user won't be allowed to enter the name - of a file that doesn't exist, otherwise, they will be allowed to make - up new names. - - directories_allowed_p: if true, then the user will be allowed to select - directories/folders as well; otherwise, they will be constrained to - select only files. - - The dialog should block the user interface while allowing - network activity to happen. - - The callback should be called with NULL if the user hit cancel, - and a newly-allocated string otherwise. - - The caller should be prepared for the callback to run before - FE_PromptForFileName() returns, though normally it will be - run some time later. - - Returns negative if something went wrong (in which case the - callback will not be run.) -*/ -extern int FE_PromptForFileName (MWContext *context, - const char *prompt_string, - const char *default_path, - XP_Bool file_must_exist_p, - XP_Bool directories_allowed_p, - ReadFileNameCallbackFunction fn, - void *closure); - -/* Prompts the user for a news host, port, and protocol - (two text fields and a check box for `news' versus `snews'.) - Same callback conventions as FE_PromptForFileName(), except - that the returned string is a URL of the form "http://host:port" - */ -extern int FE_PromptForNewsHost (MWContext *context, - const char *prompt_string, - ReadFileNameCallbackFunction fn, - void *closure); - - - - -/* FE_FileSortMethod - * returns one of: SORT_BY_SIZE - * SORT_BY_TYPE - * SORT_BY_DATE - * SORT_BY_NAME - * this determines how files are sorted in FTP and file listings - */ -extern int FE_FileSortMethod(MWContext * window_id); - -/* defines to define the sort method - * for FTP and file listings - * - * these should be returned by: FE_FileSortMethod - */ -#define SORT_BY_NAME 0 -#define SORT_BY_TYPE 1 -#define SORT_BY_SIZE 2 -#define SORT_BY_DATE 3 - -/* FE_UseFancyFTP: check whether or not to use fancy ftp - */ -extern Bool FE_UseFancyFTP (MWContext * window_id); - -/* FE_UseFancyNewsgroupListing() - * - * check whether or not to use fancy newsgroup listings - */ -extern Bool FE_UseFancyNewsgroupListing(MWContext *window_id); - -/* FE_ShowAllNewsArticles - * - * Return true if the user wants to see all newsgroup - * articles and not have the number restricted by - * .newsrc entries - */ -extern XP_Bool FE_ShowAllNewsArticles(MWContext *window_id); - -/* - * Return builtin strings for about: displaying - */ -extern void* FE_AboutData(const char *which, - char **data_ret, - int32 *length_ret, - char **content_type_ret); - -extern void FE_FreeAboutData (void * data, const char* which); - - -typedef enum PREF_Enum { - PREF_EmailAddress, - PREF_Pop3ID, - PREF_SMTPHost, - PREF_PopHost, - PREF_NewsHost -} PREF_Enum ; -/* - * Open a preferences window for a particular preference - */ -extern void FE_EditPreference(PREF_Enum which); - -/* FE_GetContextID(MWContext * window_id) - * - * Gets a unique id for the window - */ -extern int32 FE_GetContextID(MWContext * window_id); -#ifdef _USRDLL -extern int32 NDLLFE_GetContextID(MWContext * window_id); -#endif - - -/* Given a local file path (file:///) returns the MIME type of the - * file. - * This is needed on the Mac (and possibly on Win95, because not all - * files have the right extension - * fileType and encoding should be freed by the caller - * both can be NULL on return. If they are NULL, useDefault is true - */ -#if !defined(XP_WIN) && !defined(XP_OS2) -void FE_FileType(char * path, - Bool * useDefault, - char ** fileType, - char ** encoding); -#else -BOOL FE_FileType(char * path, - char * fileType, - char * encoding); -#endif -#ifdef NEW_FE_CONTEXT_FUNCS - -/* --------------------------------------------------------------------------- - * Front end window control - */ - -#define FE_CreateNewDocWindow(context, URL) \ - (*context->funcs->CreateNewDocWindow)(context, URL) - -/* --------------------------------------------------------------------------- - * Front end setup for layout - */ - -#define FE_LayoutNewDocument(context, url_struct, iWidth, iHeight, mWidth, mHeight) \ - (*context->funcs->LayoutNewDocument)(context, url_struct, iWidth, iHeight, mWidth, mHeight) -#define FE_FinishedLayout(context) \ - (*context->funcs->FinishedLayout)(context) -#define FE_SetDocTitle(context, title) \ - (*context->funcs->SetDocTitle)(context, title) - -/* --------------------------------------------------------------------------- - * Front end Information stuff - */ - -#define FE_TranslateISOText(context, charset, ISO_Text) \ - (*context->funcs->TranslateISOText)(context, charset, ISO_Text) -#define FE_GetTextInfo(context, text, text_info) \ - (*context->funcs->GetTextInfo)(context, text, text_info) -#if 0 -#define FE_GetTextFrame(context, element, start, end, frame) \ - (*context->funcs->GetTextFrame)(context, element, start, end, frame) -#endif -#ifndef MOZ_NGLAYOUT -#define FE_GetEmbedSize(context, embed_struct, force_reload) \ - (*context->funcs->GetEmbedSize)(context, embed_struct, force_reload) -#endif -#define FE_GetJavaAppSize(context, java_struct, force_reload) \ - (*context->funcs->GetJavaAppSize)(context, java_struct, force_reload) -#ifndef MOZ_NGLAYOUT -#define FE_GetFormElementInfo(context, form_element) \ - (*context->funcs->GetFormElementInfo)(context, form_element) -#define FE_GetFormElementValue(context, form_element,hide,submit) \ - (*context->funcs->GetFormElementValue)(context, form_element,hide,submit) -#define FE_ResetFormElement(context, form_element) \ - (*context->funcs->ResetFormElement)(context, form_element) -#define FE_SetFormElementToggle(context, form_element,toggle) \ - (*context->funcs->SetFormElementToggle)(context, form_element,toggle) -#define FE_FreeEmbedElement(context, data) \ - (*context->funcs->FreeEmbedElement)(context, data) -#define FE_FreeBuiltinElement(context, data) \ - (*context->funcs->FreeBuiltinElement)(context, data) -#endif /* MOZ_NGLAYOUT */ -#define FE_CreateEmbedWindow(context, data) \ - (*context->funcs->CreateEmbedWindow)(context, data) -#define FE_SaveEmbedWindow(context, data) \ - (*context->funcs->SaveEmbedWindow)(context, data) -#define FE_RestoreEmbedWindow(context, data) \ - (*context->funcs->RestoreEmbedWindow)(context, data) -#define FE_DestroyEmbedWindow(context, data) \ - (*context->funcs->DestroyEmbedWindow)(context, data) -#define FE_FreeJavaAppElement(context, data) \ - (*context->funcs->FreeJavaAppElement)(context, data) -#define FE_HideJavaAppElement(context, data) \ - (*context->funcs->HideJavaAppElement)(context, data) -#ifndef MOZ_NGLAYOUT -#define FE_FreeEdgeElement(context, data) \ - (*context->funcs->FreeEdgeElement)(context, data) -#define FE_FormTextIsSubmit(context, form_element) \ - (*context->funcs->FormTextIsSubmit)(context, form_element) -#endif - - -/* --------------------------------------------------------------------------- - * Front end Drawing stuff - */ - -/* defines for iLocation parameter of display functions */ -#define FE_TLEDGE 0 /* Top Ledge */ -#define FE_VIEW 1 /* Main View Window */ -#define FE_BLEDGE 2 /* Bottom Ledge */ - -#define FE_DisplaySubtext(context, iLocation, text, start_pos, end_pos, need_bg) \ - (*context->funcs->DisplaySubtext)(context, iLocation, text, start_pos, end_pos, need_bg) -#define FE_DisplayText(context, iLocation, text, need_bg) \ - (*context->funcs->DisplayText)(context, iLocation, text, need_bg) -#ifndef MOZ_NGLAYOUT -#define FE_DisplayEmbed(context, iLocation , embed_struct) \ - (*context->funcs->DisplayEmbed)(context, iLocation ,embed_struct) -#define FE_DisplayBuiltin(context, iLocation , builtin_struct) \ - (*context->funcs->DisplayBuiltin)(context, iLocation ,builtin_struct) -#endif /* MOZ_NGLAYOUT */ -#define FE_DisplayJavaApp(context, iLocation , java_struct) \ - (*context->funcs->DisplayJavaApp)(context, iLocation ,java_struct) -#ifndef MOZ_NGLAYOUT -#define FE_DisplayEdge(context, iLocation ,edge_struct) \ - (*context->funcs->DisplayEdge)(context, iLocation ,edge_struct) -#endif /* MOZ_NGLAYOUT */ -#define FE_DisplayTable(context, iLocation ,table_struct) \ - (*context->funcs->DisplayTable)(context, iLocation ,table_struct) -#define FE_DisplayCell(context, iLocation ,cell_struct) \ - (*context->funcs->DisplayCell)(context, iLocation ,cell_struct) - -/* brade: not sure why this doesn't work on Windows but seems to work elsewhere */ -/* therefore, short-term hack is to #ifdef out these lines */ -#ifdef XP_MAC -#define FE_DisplayEntireTableOrCell(context, element) \ - (*context->funcs->InvalidateEntireTableOrCell)(context, element) -#define FE_DisplayAddRowOrColBorder(context, pRect, bErase) \ - (*context->funcs->DisplayAddRowOrColBorder)(context, pRect, bErase) -#define FE_UpdateEnableStates(context) \ - (*context->funcs->UpdateEnableStates)(context) -#endif - -#define FE_DisplaySubDoc(context, iLocation ,subdoc_struct) \ - (*context->funcs->DisplaySubDoc)(context, iLocation ,subdoc_struct) -#define FE_DisplayLineFeed(context, iLocation , line_feed, need_bg) \ - (*context->funcs->DisplayLineFeed)(context, iLocation , line_feed, need_bg) -#define FE_DisplayHR(context, iLocation , HR_struct) \ - (*context->funcs->DisplayHR)(context, iLocation , HR_struct) -#define FE_DisplayBullet(context, iLocation, bullet) \ - (*context->funcs->DisplayBullet)(context, iLocation, bullet) -#ifndef MOZ_NGLAYOUT -#define FE_DisplayFormElement(context, iLocation, form_element) \ - (*context->funcs->DisplayFormElement)(context, iLocation, form_element) -#endif -#define FE_DisplayBorder(context, iLocation, x, y, width, height, bw, color, style) \ - (*context->funcs->DisplayBorder)(context, iLocation, x, y, width, height, bw, color, style) -#define FE_DisplayFeedback(context, iLocation, element) \ - (*context->funcs->DisplayFeedback)(context, iLocation, element) - -#define FE_ClearView(context, which) \ - (*context->funcs->ClearView)(context, which) - -#define FE_SetDocDimension(context, iLocation, iWidth, iLength) \ - (*context->funcs->SetDocDimension)(context, iLocation, iWidth, iLength) -#define FE_SetDocPosition(context, iLocation, iX, iY) \ - (*context->funcs->SetDocPosition)(context, iLocation, iX, iY) -#define FE_GetDocPosition(context, iLocation, iX, iY) \ - (*context->funcs->GetDocPosition)(context, iLocation, iX, iY) -#define FE_BeginPreSection(context) \ - (*context->funcs->BeginPreSection)(context) -#define FE_EndPreSection(context) \ - (*context->funcs->EndPreSection)(context) -#define FE_SetProgressBarPercent(context, percent) \ - (*context->funcs->SetProgressBarPercent)(context, percent) -#define FE_SetBackgroundColor(context, red, green, blue) \ - (*context->funcs->SetBackgroundColor)(context, red, green, blue) -#define FE_Progress(cx,msg) \ - (*cx->funcs->Progress)(cx,msg) -#define FE_SetCallNetlibAllTheTime(cx) \ - (*cx->funcs->SetCallNetlibAllTheTime)(cx) -#define FE_ClearCallNetlibAllTheTime(cx) \ - (*cx->funcs->ClearCallNetlibAllTheTime)(cx) -#define FE_GraphProgressInit(cx, URL_s, content_length) \ - (*cx->funcs->GraphProgressInit)(cx, URL_s, content_length) -#define FE_GraphProgressDestroy(cx, URL_s, content_length, total_read) \ - (*cx->funcs->GraphProgressDestroy)(cx, URL_s, content_length, total_read) -#define FE_GraphProgress(cx, URL_s, rec, new, len) \ - (*cx->funcs->GraphProgress)(cx, URL_s, rec, new, len) -#define FE_UseFancyFTP(window_id) \ - (*window_id->funcs->UseFancyFTP)(window_id) -#define FE_UseFancyNewsgroupListing(window_id) \ - (*window_id->funcs->UseFancyNewsgroupListing)(window_id) -#define FE_FileSortMethod(window_id) \ - (*window_id->funcs->FileSortMethod)(window_id) -#define FE_ShowAllNewsArticles(window_id) \ - (*window_id->funcs->ShowAllNewsArticles)(window_id) -#define FE_Confirm(context,Msg) \ - (*context->funcs->Confirm)(context,Msg) -#define FE_Prompt(context,Msg,dflt) \ - (*context->funcs->Prompt)(context,Msg,dflt) -#define FE_PromptWithCaption(context,caption,Msg,dflt) \ - (*context->funcs->PromptWithCaption)(context,caption,Msg,dflt) -#define FE_PromptPassword(context, Msg) \ - (*context->funcs->PromptPassword)(context, Msg) -#define FE_PromptUsernameAndPassword(cx, Msg, username, password) \ - (*cx->funcs->PromptUsernameAndPassword)(cx,Msg,username,password) -#define FE_CheckConfirm(context,msg,checkmsg,okmsg,cancelmsg,checked) \ - (*context->funcs->CheckConfirm)(context,msg,checkmsg,okmsg,cancelmsg,checked) -#define FE_SelectDialog(context,msg,list,count) \ - (*context->funcs->SelectDialog)(context,msg,list,count) -#define FE_EnableClicking(context) \ - (*context->funcs->EnableClicking)(context) -#define FE_GetDefaultBackgroundColor(context,color) \ - (*context->funcs->GetDefaultBackgroundColor)(context,color) - -/* these functions are to allow dealyed native window applet creation and transparent applet */ -#define FE_HandleClippingView(context, data, x, y, width, height) \ - (*context->funcs->HandleClippingView)(context, data, x, y, width, height) -#define FE_DrawJavaApp(context, iLocation, pJava) \ - (*context->funcs->DrawJavaApp)(context, iLocation, pJava) - -/* This will be called after ALL exit routines have been called and - * when there are no more pending or active connections in the Netlib. - * After FE_AllConnectionsComplete(MWContext *) the context will not - * be referenced again by the NetLib so the context can be free'd in - * that call if desired. - */ -#define FE_AllConnectionsComplete(context) \ - (*context->funcs->AllConnectionsComplete)(context) -#else - -/* --------------------------------------------------------------------------- - * Front end window control - */ - -extern MWContext * FE_CreateNewDocWindow(MWContext * calling_context,URL_Struct * URL); - -/* --------------------------------------------------------------------------- - * Front end setup for layout - */ - -extern void FE_LayoutNewDocument(MWContext *context, URL_Struct *url_struct, int32 *iWidth, int32 *iHeight, int32 *mWidth, int32 *mHeight); -extern void FE_SetDocTitle(MWContext * context, char * title); -extern void FE_FinishedLayout (MWContext *context); -extern void FE_BeginPreSection (MWContext *context); -extern void FE_EndPreSection (MWContext *context); - -/* --------------------------------------------------------------------------- - * Front end Information stuff - */ - -extern char * FE_TranslateISOText(MWContext * context, int charset, char *ISO_Text); -extern int FE_GetTextInfo(MWContext * context, LO_TextStruct *text, LO_TextInfo *text_info); -#ifdef XP_OS2 /* performance */ -extern int FE_GetMaxWidth(MWContext *pContext, LO_TextStruct *pText); /* performance */ -#endif -#if 0 -void FE_GetTextFrame(MWContext * context, LO_TextStruct *text, int32 start, int32 end, XP_Rect *frame); -#endif -#ifndef MOZ_NGLAYOUT -void FE_GetEmbedSize(MWContext * context, LO_EmbedStruct *embed_struct, NET_ReloadMethod force_reload); -#endif -void FE_GetJavaAppSize(MWContext * context, LO_JavaAppStruct *java_struct, NET_ReloadMethod force_reload); -void FE_GetFormElementInfo(MWContext * context, LO_FormElementStruct * form_element); -void FE_GetFormElementValue(MWContext * context, LO_FormElementStruct * form_element, Bool hide, Bool submit); -void FE_ResetFormElement(MWContext * context, LO_FormElementStruct * form_element); -void FE_SetFormElementToggle(MWContext * context, LO_FormElementStruct * form_element, Bool toggle); -#ifndef MOZ_NGLAYOUT -void FE_FreeEmbedElement(MWContext *context, LO_EmbedStruct *); -void FE_FreeBuiltinElement(MWContext *context, LO_BuiltinStruct *); -#endif /* MOZ_NGLAYOUT */ -void FE_FreeJavaAppElement(MWContext *context, struct LJAppletData *appletData); -void FE_HideJavaAppElement(MWContext *context, void*); -#ifndef MOZ_NGLAYOUT -void FE_FreeEdgeElement(MWContext *context, LO_EdgeStruct *); -void FE_FormTextIsSubmit(MWContext * context, LO_FormElementStruct * form_element); -#endif /* MOZ_NGLAYOUT */ -void FE_SetProgressBarPercent(MWContext *context, int32 percent); -void FE_SetBackgroundColor(MWContext *context, uint8 red, uint8 green, uint8 blue); - - -/* --------------------------------------------------------------------------- - * Front end Drawing stuff - */ - -/* defines for iLocation parameter of display functions */ -#define FE_TLEDGE 0 /* Top Ledge */ -#define FE_VIEW 1 /* Main View Window */ -#define FE_BLEDGE 2 /* Bottom Ledge */ - -extern void FE_DisplaySubtext(MWContext * context, int iLocation, LO_TextStruct *text, int32 start_pos, int32 end_pos, Bool need_bg); -extern void FE_DisplayText(MWContext * context, int iLocation, LO_TextStruct *text, Bool need_bg); -#ifndef MOZ_NGLAYOUT -void FE_DisplayEmbed(MWContext * context, int iLocation ,LO_EmbedStruct *embed_struct); -void FE_DisplayBuiltin(MWContext * context, int iLocation ,LO_BuiltinStruct *builtin_struct); -#endif /* MOZ_NGLAYOUT */ -void FE_DisplayJavaApp(MWContext * context, int iLocation ,LO_JavaAppStruct *java_struct); -#ifndef MOZ_NGLAYOUT -void FE_DisplayEdge(MWContext * context, int iLocation ,LO_EdgeStruct *edge_struct); -#endif /* MOZ_NGLAYOUT */ -void FE_DisplayTable(MWContext * context, int iLocation ,LO_TableStruct *table_struct); -void FE_DisplayCell(MWContext * context, int iLocation ,LO_CellStruct *cell_struct); -void FE_DisplaySubDoc(MWContext * context, int iLocation ,LO_SubDocStruct *subdoc_struct); -void FE_DisplayLineFeed(MWContext * context, int iLocation , LO_LinefeedStruct *line_feed, Bool need_bg); -void FE_DisplayHR(MWContext * context, int iLocation , LO_HorizRuleStruct *HR_struct); -void FE_DisplayBullet(MWContext *context, int iLocation, LO_BullettStruct *bullet); -void FE_DisplayFormElement(MWContext * context, int iLocation, LO_FormElementStruct * form_element); -void FE_DisplayBorder(MWContext *context, int iLocation, int x, int y, int width, int height, int bw, LO_Color *color, LO_LineStyle style); -void FE_DisplayFeedback(MWContext *context, int iLocation, LO_Element *element); -#if 0 -void FE_EraseBackground(MWContext * context, int iLocation, int32 x, int32 y, uint32 width, uint32 height, LO_Color *bg); -void FE_SetClipRegion(MWContext *context, int iLocation, FE_Region region); -#endif -void FE_ClearView(MWContext * context, int which); - -void FE_SetDocDimension(MWContext *context, int iLocation, int32 iWidth, int32 iLength); -void FE_SetDocPosition(MWContext *context, int iLocation, int32 iX, int32 iY); -void FE_GetDocPosition(MWContext *context, int iLocation, int32 *iX, int32 *iY); - -/* temporary testing fn's */ - -extern int FE_DrawText(MWContext * context, const char * buffer); -extern int FE_DrawImage(MWContext * context, const char * filename); - -extern void FE_EnableClicking(MWContext * context); - -/* these functions are to allow dealyed native window applet creation and transparent applet */ -void FE_HandleClippingView(MWContext *pContext, struct LJAppletData *appletD, int x, int y, int width, int height); -void FE_DrawJavaApp(MWContext *pContext, int iLocation, LO_JavaAppStruct *pJava); - -/* This will be called after ALL exit routines have been called and - * when there are no more pending or active connections in the Netlib. - * After FE_AllConnectionsComplete(MWContext *) the context will not - * be referenced again by the NetLib so the context can be free'd in - * that call if desired. - */ -extern void FE_AllConnectionsComplete(MWContext * context); - -#endif /* NEW_FE_CONTEXT_FUNCS */ - -/* - * Logically grouped with FE_GetTextInfo - */ -extern void FE_ReleaseTextAttrFeData(MWContext * context, LO_TextAttr *attr); - -#ifndef MOZ_NGLAYOUT -/* - * Liberated from context function table - */ -void FE_FreeFormElement(MWContext * context, LO_FormElementData *); -#endif - -/* -------------------------------------------------------------------------- - * Front end history stuff - */ - -extern int FE_EnableBackButton(MWContext * context); -extern int FE_EnableForwardButton(MWContext * context); -extern int FE_DisableBackButton(MWContext * context); -extern int FE_DisableForwardButton(MWContext * context); - -/* ------------------------------------------------------------------------- - * Generic FE stuff - */ -/* display given string in 'view source' window */ -extern void FE_DisplaySource(MWContext * context, char * source); -extern void FE_SaveAs(MWContext * context, char * source); - -/* This is called when there's a chance that the state of the - * Stop button (and corresponding menu item) has changed. - * The FE should use XP_IsContextStoppable to determine the - * new state. - */ -extern void FE_UpdateStopState(MWContext * context); - -#ifndef MOZ_NGLAYOUT -/* ------------------------------------------------------------------------- - * Grid stuff (where should this go?) - */ -extern MWContext *FE_MakeGridWindow (MWContext *old_context, - void *hist_list, void *history, - int32 x, int32 y, int32 width, int32 height, - char *url_str, char *window_name, int8 scrolling, - NET_ReloadMethod force_reload - , Bool no_edge - ); -extern void *FE_FreeGridWindow(MWContext *context, XP_Bool save_history); -extern void FE_RestructureGridWindow(MWContext *context, int32 x, int32 y, - int32 width, int32 height); -extern void FE_GetFullWindowSize(MWContext *context, - int32 *width, int32 *height); -extern void FE_GetEdgeMinSize(MWContext *context, int32 *size -#if defined(XP_WIN) || defined(XP_OS2) - /* Windows needs this info here */ - , Bool no_edge -#endif - ); -extern void FE_LoadGridCellFromHistory(MWContext *context, void *hist, - NET_ReloadMethod force_reload); -#endif /* MOZ_NGLAYOUT */ - -/* - * Ugh for scrolling chat window. And now for JavaScript - */ -extern void FE_ShiftImage (MWContext *context, LO_ImageStruct *lo_image); -extern void FE_ScrollDocTo (MWContext *context, int iLocation, int32 x,int32 y); -extern void FE_ScrollDocBy (MWContext *context, int iLocation, int32 x,int32 y); - -/* JavaScript commands to allow full UI control of a window */ -extern void FE_BackCommand (MWContext *context); -extern void FE_ForwardCommand (MWContext *context); -extern void FE_HomeCommand (MWContext *context); -extern void FE_PrintCommand (MWContext *context); -/* Note: on Unix, the position reported by FE_GetWindowOffset() may get out - * of sync with reality, because we're relying on incoming events to tell - * us the offset, rather than have to make a round trip to the X server - * every time we need it. If it causes a problem, come talk to francis. - * - * For more details, see FE_GetWindowOffset() in ns/cmd/xfe/context_func.cpp. - */ -extern void FE_GetWindowOffset (MWContext *pContext, int32 *sx, int32 *sy); -extern void FE_GetScreenSize (MWContext *pContext, int32 *sx, int32 *sy); -extern void FE_GetAvailScreenRect (MWContext *pContext, int32 *sx, int32 *sy, - int32 *left, int32 *top); -extern XP_Bool FE_FindCommand (MWContext *context, char *szName, XP_Bool bCaseSensitve, - XP_Bool bBackwards, XP_Bool bWrap); -extern void FE_GetPixelAndColorDepth (MWContext *pContext, int32 *pixelDepth, - int32 *colorDepth); -/* - * To get information about the hardware - */ -/* - * (need to add functions for other platforms!!!) - */ -#if defined(XP_WIN) -extern char *FE_SystemCPUInfo(void); -extern int32 FE_SystemRAM( void ); -extern int32 FE_SystemClockSpeed( void ); -#endif -/* - * Named windows needs this. - */ -extern MWContext *FE_MakeBlankWindow(MWContext *old_context, - URL_Struct *url, char *window_name); -extern void FE_SetWindowLoading(MWContext *context, URL_Struct *url, - Net_GetUrlExitFunc **exit_func); - -/* - * Raise the window to the top of the view order - */ -extern void FE_RaiseWindow(MWContext *context); - -/* Chrome controlled windows. */ -/* FE_MakeNewWindow() - * - * if Chrome is NULL, the behaviour will exactly be as FE_MakeBlankWindow - */ -extern MWContext *FE_MakeNewWindow(MWContext *old_context, - URL_Struct *url, char *window_name, Chrome *chrome); -extern void FE_DestroyWindow(MWContext *context); - -#if defined(XP_WIN) || defined(XP_MAC) || defined(XP_OS2) -/* ------------------------------------------------------------------------- - * FE Remote Control APIs called by netlib - */ -XP_Bool FE_UseExternalProtocolModule(MWContext *pContext, - FO_Present_Types iFormatOut, URL_Struct *pURL, - Net_GetUrlExitFunc *pExitFunc); - -#ifdef _USRDLL -XP_Bool NDLLFE_UseExternalProtocolModule(MWContext *pContext, - FO_Present_Types iFormatOut, URL_Struct *pURL, - Net_GetUrlExitFunc *pExitFunc); -#endif - -void FE_URLEcho(URL_Struct *pURL, int iStatus, MWContext *pContext); -#ifdef _USRDLL -void NDLLFE_URLEcho(URL_Struct *pURL, int iStatus, MWContext *pContext); -#endif - -#endif /* XP_WIN */ - -PUBLIC void FE_GetDocAndWindowPosition(MWContext * context, int32 *pX, int32 *pY, - int32 *pWidth, int32 *pHeight ); - -#ifdef EDITOR -PUBLIC void FE_DisplayTextCaret(MWContext * context, int loc, LO_TextStruct * text_data, int char_offset); - -PUBLIC void FE_DisplayImageCaret(MWContext * context, LO_ImageStruct * pImageData, - ED_CaretObjectPosition caretPos ); - -PUBLIC void FE_DisplayGenericCaret(MWContext * context, LO_Any * pLoAny, - ED_CaretObjectPosition caretPos ); - -#ifdef XP_WIN -/* Ask front end to show where a dragged set of table cells may be dropped */ -PUBLIC void FE_DisplayDropTableFeedback(MWContext * context, EDT_DragTableData *pDragData); - -/* Convert an HTML SIZE param value (1-7) into POINT-SIZE value */ -PUBLIC int16 FE_CalcFontPointSize(MWContext * pMWContext, intn iSize, XP_Bool bFixedWidth); -#endif - -PUBLIC Bool FE_GetCaretPosition(MWContext *context, LO_Position* where, - int32* caretX, int32* caretYLow, int32* caretYHigh); - -PUBLIC void FE_DestroyCaret(MWContext *pContext); -PUBLIC void FE_ShowCaret(MWContext *pContext); -PUBLIC void FE_DocumentChanged(MWContext * context, int32 iStartY, int32 iHeight ); - -PUBLIC MWContext *FE_CreateNewEditWindow(MWContext *pContext, URL_Struct *pURL); - -/* Set default colors, background from user Preferences via the Page Data structure -*/ -void FE_SetNewDocumentProperties(MWContext * pMWContext); - -/* - * Formatting has changed. - */ -PUBLIC void FE_EditFormattingUpdate( MWContext *pContext ); - -/* - * Dialog to confirm change of document encoding. - */ -PUBLIC ED_CharsetEncode FE_EncodingDialog(MWContext* pMWContext, char *pCharSet); - -/* - * Brings up a modal image load dialog and returns. Calls - * EDT_ImageLoadCancel() if the cancel button is pressed -*/ -PUBLIC void FE_ImageLoadDialog( MWContext *pContext ); - -/* - * called by the editor engine after the image has been loaded -*/ -PUBLIC void FE_ImageLoadDialogDestroy( MWContext *pContext ); - -/* - * Bring up a files saving progress dialog. While the dialog is modal to the edit - * window. but should return immediately from the create call. If cancel button - * is pressed, EDT_SaveCancel(pMWContext) should be called if saving locally, - * or NET_InterruptWindow(pMWContext) if uploading files - * Use bUpload = TRUE for Publishing file and images to remote site -*/ -PUBLIC void FE_SaveDialogCreate( MWContext *pContext, int iFileCount, ED_SaveDialogType saveType ); -/* Sent after filename is made, but before opening or saving */ -PUBLIC void FE_SaveDialogSetFilename( MWContext *pContext, char *pFilename ); - -/* Sent after file is completely saved, even if user said no to overwrite - * (then status = ED_ERROR_FILE_EXISTS) - * Not called if failed to open source file at all, but is called with error - * status if failed during writing -*/ -PUBLIC void FE_FinishedSave( MWContext *pMWContext, int status, char *pDestURL, int iFileNumber ); -/* Sent after all files are saved or user cancels */ -PUBLIC void FE_SaveDialogDestroy( MWContext *pContext, int status, char *pFilename ); - -PUBLIC ED_SaveOption FE_SaveFileExistsDialog( MWContext *pContext, char* pFilename ); - -/* Sent after file is opened (or failed) -- same time saving is initiated */ -PUBLIC Bool FE_SaveErrorContinueDialog( MWContext *pContext, char* pFileName, ED_FileError error ); - -PUBLIC void FE_ClearBackgroundImage( MWContext *pContext ); - -PUBLIC void FE_EditorDocumentLoaded( MWContext *pContext ); - -/* - * return a valid local base file name for the given URL. If there is no - * base name, return 0. -*/ -PUBLIC char* FE_URLToLocalName( char* ); - -PUBLIC Bool FE_EditorPrefConvertFileCaseOnWrite(void); - -/* Defines to use for second parameter to FE_LoadUrl - * for better readability -*/ -#define LOAD_URL_COMPOSER TRUE -#define LOAD_URL_NAVIGATOR FALSE - -/* Access function for calling from outside to Edit or Navigate - * Primarily called by LiveWire SiteManager - * Set bEdit = TRUE to start Editor - * Existing frames are searched first and activated if - * URL is already loaded - * Nothing happens if szURL is NULL -*/ -void FE_LoadUrl( char *szURL, XP_Bool bEdit ); - -/* This is used to find an existing Browser or Editor frame - * and load supplied URL. It is important to prevent - * multiple windows editing the same file -*/ -MWContext * FE_ActivateFrameWithURL(char *szURL, Bool bFindEditor); - -/* Primarily an error recovery routine: - * Try to find frame with our URL, - * or the previous frame in list, - * or create a new browser frame - * Then close current frame - * Return frame found or created -*/ -void FE_RevertToPreviousFrame(char *szURL, MWContext *pMWContext); - -/* Does editor-specific stuff when done loading a URL -*/ -void FE_EditorGetUrlExitRoutine(URL_Struct *pUrl, int iStatus, MWContext *pMWContext); - -/* Check if change was made to an edit document, - * prompt user to save if they was. - * Returns TRUE for all cases except CANCEL by the user in any dialog - * Call this before any URL load into the current frame window -*/ -Bool FE_CheckAndSaveDocument(MWContext *pMWContext); - -/* Similar to above, but dialog to ask user if they want to save changes - * should have "AutoSave" caption and extra line to - * tell them "Cancel" will turn off Autosave until they - * save the file later. -*/ -Bool FE_CheckAndAutoSaveDocument(MWContext *pMWContext); - -/* Checks for new doc or remote editing and prompts - * to save. Return FALSE only if user cancels out of dialog - * Use bSaveNewDocument = FALSE to not force saving of a new document -*/ -Bool FE_SaveNonLocalDocument(MWContext *pMWContext, Bool bSaveNewDocument); - -#if defined(XP_WIN) || defined(XP_OS2) -/* Tell the front end every time we finish relaying out so - * it can invalidate cached pointers to layout elements -*/ -void FE_FinishedRelayout(MWContext * pMWContext); - -/* Call the front end to force updating button enable/disabling - * Currently used after every Autosave event so toolbar SAVE button can be grayed -*/ -void FE_UpdateEnableStates(MWContext * pMWContext); -#endif /* XP_WIN */ - -#if defined(XP_WIN) || defined(XP_UNIX) || defined(XP_BEOS) -/* MOVE THESE OUT OF XP_WIN WHEN ALL PLATFORMS IMPLEMENT IT*/ -/* Called during "sizing" of a table when we are really adding/subtracting - * rows or columns. Front end should draw a line - * from the point {rect.left, rect.top} to the point {rect.right,rect.bottom} - * (Thickness and style are left to FE, Windows uses a dashed line) - * This will be called with bErase = TRUE to remove the line when appropriate, - * so FEs don't need to worry about removing selection, - * but you must call EDT_CancelSizing or EDT_EndSizing for final removal. -*/ -void FE_DisplayAddRowOrColBorder(MWContext * pMWContext, void *pRect, XP_Bool bErase); - -/* This should invalidate the entire table or cell rect to cause redrawing of backgrounds - * and all table or cell contents. Use to unselect table/cell selection feedback -*/ -void FE_DisplayEntireTableOrCell(MWContext * pMWContext, LO_Element * pLoElement); - -#endif /* XP_WIN || XP_UNIX */ - -#endif /* Editor */ - -/* This is how the libraries ask the front end to load a URL just - as if the user had typed/clicked it (thermo and busy-cursor - and everything.) NET_GetURL doesn't do all this stuff. - */ -extern int FE_GetURL (MWContext *context, URL_Struct *url); - -/* ------------------------------------------------------------------------- - * Input focus and event controls, for Mocha. - */ - -/* - * Force input to be focused on an element in the given window. - */ -void FE_FocusInputElement(MWContext *window, LO_Element *element); - -/* - * Force input to be defocused from an element in the given window. - * It's ok if the input didn't have input focus. - */ -void FE_BlurInputElement(MWContext *window, LO_Element *element); - -/* - * Selectin input in a field, highlighting it and preparing for change. - */ -void FE_SelectInputElement(MWContext *window, LO_Element *element); - -/* - * Tell the FE that something in element changed, and to redraw it in a way - * that reflects the change. The FE is responsible for telling layout about - * radiobutton state. - */ -void FE_ChangeInputElement(MWContext *window, LO_Element *element); - -/* - * Tell the FE that a form is being submitted without a UI gesture indicating - * that fact, i.e., in a Mocha-automated fashion ("document.form.submit()"). - * The FE is responsible for emulating whatever happens when the user hits the - * submit button, or auto-submits by typing Enter in a single-field form. - */ -void FE_SubmitInputElement(MWContext *window, LO_Element *element); - -/* - * Emulate a button or HREF anchor click for element. - */ -/* -#ifndef NO_TAB_NAVIGATION - FE_ClickAnyElement() is based on FE_ClickInputElement(), and should replace the latter. - If haveXY != 0, the xx, yy will be used for click. otherwise click the center of element. - - xx, yy are element coordinates, This function take care of : - lo_any.x_offset, pWinCX->GetOriginX(), ClientToScreen(), and ScreenToClient() -*/ -int FE_ClickAnyElement(MWContext * pContext, LO_Element * pElement, int haveXY, int32 xx, int32 yy ); -/* NO_TAB_NAVIGATION */ - - -void FE_ClickInputElement(MWContext *window, LO_Element *element); - - -char *FE_GetAcceptLanguage(void); - -#if 0 -PRBool FE_HandleLayerEvent(MWContext *context, CL_Layer *layer, - CL_Event *event); -PRBool FE_HandleEmbedEvent(MWContext *context, LO_EmbedStruct *embed, - CL_Event *event); -#endif /* LAYERS */ - -/* - * Configurable chrome for existing contexts. - * - * This routine uses only these entries from the chrome structure. - * show_url_bar, show_button_bar, show_directory_buttons, - * show_security_bar, show_menu, show_bottom_status_bar - */ -void FE_UpdateChrome(MWContext *window, Chrome *chrome); - -/* - * JavaScript calls to the window must be able to find the state of - * the existing chrome structure - */ -void FE_QueryChrome(MWContext *window, Chrome *chrome); - -/* - * Returns a string representing the default installed location of - * the NetHelp directory as a file:// URL. The caller is expected to - * free the returned string. Used by mkhelp.c to retrieve NetHelp content. - */ - -extern char * FE_GetNetHelpDir(void); - -/* - * Returns the "default" MWContext to use when bringing up a nethelp - * topic. This should try to return the context associated with the topmost - * visible window. - */ - -extern MWContext * FE_GetNetHelpContext(void); - -/* - * Netcaster calls - EA - */ - -/* - * Returns true if Netcaster is installed, false otherwise. - */ - -extern XP_Bool FE_IsNetcasterInstalled(void); - -/* - * If Netcaster is running, returns its context. If not, returns NULL. - * This function will always return NULL if Netcaster is not installed. - */ - -extern MWContext * FE_IsNetcasterRunning(void); -/* - * If the Netcaster component is not currently running, starts it and opens - * the Netcaster drawer. If the component is running, but it does not have - * focus (it's not on top), or the drawer is closed, brings the window to top - * and opens the drawer. If the component is running, has focus, and is open, - * does nothing. - */ - -extern void FE_RunNetcaster(MWContext *context); - - -#if defined(XP_WIN) || defined(XP_OS2) /* removed this #ifdef when other platform implement this. */ -extern XP_Bool FE_CheckFormTextAttributes(MWContext *context, - LO_TextAttr *oldAttr, LO_TextAttr *newAttr, int32 type); -#endif - -#if defined(XP_WIN) || defined(XP_OS2) -/* - * Windows needs a way to know when a URL switches contexts, - * so that it can keep the NCAPI progress messages - * specific to a URL loading and not specific to the - * context attempting to load. - */ -void FE_UrlChangedContext(URL_Struct *pUrl, MWContext *pOldContext, MWContext *pNewContext); - -/* these are used to load and use the compuserv auth DLL - */ -extern int WFE_DoCompuserveAuthenticate(MWContext *context, - URL_Struct *URL_s, - char *authenticate_header_value); - -extern char *WFE_BuildCompuserveAuthString(URL_Struct *URL_s); - -/* convert logical pixels to device pixels */ -extern int32 FE_LPtoDPoint(MWContext * context, int32 logicalPoint); - -#endif /* XP_WIN */ - - -extern void FE_MochaImageGroupObserver(XP_Observable observable, - XP_ObservableMsg message, - void *message_data, - void *closure); - -/* - * Get a context at init time suitable for putting up a password prompt. - * We can add other features as necessary. This context is only needed before - * we get the first window up. This function is need if FIPS140 is turned on. - */ -MWContext * FE_GetInitContext(void); - -/* Way to attempt to keep the application messages flowing - * when need to block a return value. - */ -extern void FEU_StayingAlive(void); - -#ifdef XP_UNIX -/* Get the dimensions of an icon in pixels for the PostScript front end. */ -extern void -FE_GetPSIconDimensions(int icon_number, int *width, int *height); - -/* Fill in the bits of an icon for the PostScript front end. */ -extern XP_Bool -FE_GetPSIconData(int icon_number, IL_Pixmap *image, IL_Pixmap *mask); -#endif - -#ifdef XP_WIN -/* Check if Netscape is registered as default browser */ -PRBool FE_IsNetscapeDefault(void); - -/* Tell front end to set Netscape as default browser (if applicable on platform) */ -PRBool FE_MakeNetscapeDefault(void); -#endif - -#ifdef XP_UNIX -/* This should be a FE specific feature. -cls */ -extern XP_Bool -FE_GetLabelAndMnemonic(char* name, char** str, void* v_xm_str, void* v_mnemonic -); - -/* To stream or not to stream, that is the question to the FE. -cls */ -extern int -FE_AskStreamQuestion(MWContext* window_id); -#endif - -XP_END_PROTOS - -#endif /* _FrontEnd_ */ diff --git a/include/m_cvstrm.h b/include/m_cvstrm.h deleted file mode 100644 index e07a4a071682..000000000000 --- a/include/m_cvstrm.h +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - - -/* -** Mac_Convert_Stream.h -** -------------------- -** -** The header file for the constructing functions of apple file -** encode/decode stream. -** -** 27sep95 mym created. -*/ - -#ifndef M_CVStrm_h -#define M_CVStrm_h - -XP_BEGIN_PROTOS - -PUBLIC NET_StreamClass * -fe_MakeBinHexEncodeStream (int format_out, - void *data_obj, - URL_Struct *URL_s, - MWContext *window_id, - char* dst_filename); - -PUBLIC NET_StreamClass * -fe_MakeBinHexDecodeStream (int format_out, - void *data_obj, - URL_Struct *URL_s, - MWContext *window_id ); - -PUBLIC NET_StreamClass * -fe_MakeAppleDoubleDecodeStream (int format_out, - void *data_obj, - URL_Struct *URL_s, - MWContext *window_id, - XP_Bool write_as_binhex, - char *dst_filename); - -PUBLIC NET_StreamClass * -fe_MakeAppleSingleDecodeStream (int format_out, - void *data_obj, - URL_Struct *URL_s, - MWContext *window_id, - XP_Bool write_as_binhex, - char *dst_filename); - -#ifdef XP_MAC - -PUBLIC NET_StreamClass * -fe_MakeAppleDoubleEncodeStream (int format_out, - void *data_obj, - URL_Struct *URL_s, - MWContext *window_id, - char* src_filename, - char* dst_filename, - char* separator); - -XP_Bool isMacFile(char* filename); - -#endif - -PUBLIC NET_StreamClass * -fe_MakeAppleDoubleDecodeStream_1 (int format_out, - void *data_obj, - URL_Struct *URL_s, - MWContext *window_id); - -PUBLIC NET_StreamClass * -fe_MakeAppleSingleDecodeStream_1 (int format_out, - void *data_obj, - URL_Struct *URL_s, - MWContext *window_id); - -XP_END_PROTOS - -#endif diff --git a/include/makefile.win b/include/makefile.win index f0f7f62bb03c..1219e82f0891 100644 --- a/include/makefile.win +++ b/include/makefile.win @@ -50,13 +50,9 @@ DEPTH = .. #INSTALL_DIR=$(XPDIST)\include EXPORTS = \ csid.h \ - merrors.h \ minicom.h \ - msgtypes.h \ - net.h \ npapi.h \ npupp.h \ - ntypes.h \ platform.h \ xp_core.h \ xp_file.h \ diff --git a/include/merrors.h b/include/merrors.h deleted file mode 100644 index 58c76039f3e1..000000000000 --- a/include/merrors.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- 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.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - - -/* merrors.h --- error codes for netlib. */ - - -#ifndef _MERRORS_H_ -#define _MERRORS_H_ - -/* - * Return codes - */ - -#define MK_INTERRUPTED -201 - -#define MK_UNABLE_TO_CONVERT -208 - -#define MK_UNABLE_TO_LOGIN -210 - -#define MK_NO_NEWS_SERVER -224 -#define MK_USE_FTP_INSTEAD -225 -#define MK_USE_COPY_FROM_CACHE -226 -#define MK_EMPTY_NEWS_LIST -227 - -#define MK_MAILTO_NOT_READY -228 - -#define MK_OBJECT_NOT_IN_CACHE -239 - -#define MK_UNABLE_TO_LISTEN_ON_SOCKET -244 - -#define MK_WAITING_FOR_LOOKUP -248 /* response for async dns */ -#define MK_DO_REDIRECT -249 /* tells mkgeturl to redirect */ - -#define MK_MIME_NEED_B64 -270 /* used internally */ -#define MK_MIME_NEED_QP -271 /* used internally */ -#define MK_MIME_NEED_TEXT_CONVERTER -272 /* used internally */ -#define MK_MIME_NEED_PS_CONVERTER -273 /* used internally */ - -#define MK_IMAGE_LOSSAGE -277 - -#define MK_TOO_MANY_OPEN_FILES -310 - -#define MK_FILE_WRITE_ERROR -350 - -#define MK_GET_REST_OF_PARTIAL_FILE_FROM_NETWORK -399 - -#define MK_MULTIPART_MESSAGE_COMPLETED -437 - -#define MK_OFFLINE -438 - -/* success codes */ -#define MK_DATA_LOADED 1 -#define MK_NO_DATA 2 -#define MK_NO_ACTION 3 -#define MK_CHANGING_CONTEXT 4 - - -#endif /* _MERRORS_H_ */ diff --git a/include/mk_cx_fn.h b/include/mk_cx_fn.h deleted file mode 100644 index 66b97b156d7d..000000000000 --- a/include/mk_cx_fn.h +++ /dev/null @@ -1,171 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -/* -** This file is Michael Toy's fault. If you hate it or have troubles figuring -** it out, you should bother him about it. -** -** This file generates both the fields of the front end structure, and the -** fe specific prototypes for your front end implementations, AND the -** the code to fill in the structure in your context initilization code -** -** To use it: -** -** #define MAKE_FE_FUNCS_STRUCT -** #include "mk_cx_fn.h" -** This will generate the field definitions for the structure. -** -** #define MAKE_FE_FUNCS_PREFIX(func) prefix_##func -** #define MAKE_FE_FUNCS_ASSIGN cx-> -** #include "mk_cx_fn.h" -** Substitute your naming prefix for "prefix" (e.g XFE) -** This will generate the assignment statements to fill in the structure, -** the definition of MAKE_FE_FUNCS_ASSIGN will be the left hand side of the -** assignment statement. -** -** #define MAKE_FE_FUNCS_PREFIX(func) prefix_##func -** #define MAKE_FE_FUNCS_EXTERN -** #include "mk_cx_fn.h" -** This will generate the prototypes for all your front end functions. -*/ - -#if defined(MAKE_FE_FUNCS_TYPES) -#define FE_DEFINE(func, returns, args) typedef returns (*MAKE_FE_TYPES_PREFIX(func)) args; -#elif defined(MAKE_FE_FUNCS_STRUCT) -#define FE_DEFINE(func, returns, args) returns (*func) args; -#elif defined(MAKE_FE_FUNCS_EXTERN) -#define FE_DEFINE(func, returns, args) extern returns MAKE_FE_FUNCS_PREFIX(func) args; -#elif defined(MAKE_FE_FUNCS_ASSIGN) -#define FE_DEFINE(func, returns, args) MAKE_FE_FUNCS_ASSIGN func = MAKE_FE_FUNCS_PREFIX(func); -#elif !defined(FE_DEFINE) -You;Should;Read;The;Header;For;This;File;Before;Including;Error;Error;Error; -#endif - -FE_DEFINE(CreateNewDocWindow, MWContext*, (MWContext * calling_context,URL_Struct * URL)) -FE_DEFINE(LayoutNewDocument, void, (MWContext *context, URL_Struct *url_struct, int32 *iWidth, int32 *iHeight, int32 *mWidth, int32 *mHeight)) -FE_DEFINE(SetDocTitle,void, (MWContext * context, char * title)) -FE_DEFINE(FinishedLayout,void, (MWContext *context)) -FE_DEFINE(TranslateISOText,char *, (MWContext * context, int charset, char *ISO_Text)) -FE_DEFINE(GetTextInfo,int, (MWContext * context, LO_TextStruct *text, LO_TextInfo *text_info)) -#ifdef XP_MAC -FE_DEFINE(MeasureText,int, (MWContext * context, LO_TextStruct *text, short *charLocs)) -#endif -#ifndef MOZ_NGLAYOUT -FE_DEFINE(GetEmbedSize,void, (MWContext * context, LO_EmbedStruct *embed_struct, NET_ReloadMethod force_reload)) -#endif -FE_DEFINE(GetJavaAppSize,void, (MWContext * context, LO_JavaAppStruct *java_struct, NET_ReloadMethod force_reload)) -#ifndef MOZ_NGLAYOUT -FE_DEFINE(GetFormElementInfo,void, (MWContext * context, LO_FormElementStruct * form_element)) -FE_DEFINE(GetFormElementValue,void, (MWContext * context, LO_FormElementStruct * form_element, XP_Bool hide, XP_Bool submit)) -FE_DEFINE(ResetFormElement,void, (MWContext * context, LO_FormElementStruct * form_element)) -FE_DEFINE(SetFormElementToggle,void, (MWContext * context, LO_FormElementStruct * form_element, XP_Bool toggle)) -FE_DEFINE(FreeEmbedElement,void, (MWContext *context, LO_EmbedStruct *)) -FE_DEFINE(FreeBuiltinElement,void, (MWContext *context, LO_BuiltinStruct *)) -#endif /* MOZ_NGLAYOUT */ -FE_DEFINE(CreateEmbedWindow, void, (MWContext *context, NPEmbeddedApp *app)) -FE_DEFINE(SaveEmbedWindow, void, (MWContext *context, NPEmbeddedApp *app)) -FE_DEFINE(RestoreEmbedWindow, void, (MWContext *context, NPEmbeddedApp *app)) -FE_DEFINE(DestroyEmbedWindow, void, (MWContext *context, NPEmbeddedApp *app)) -FE_DEFINE(FreeJavaAppElement,void, (MWContext *context, struct LJAppletData *appletData)) -FE_DEFINE(HideJavaAppElement,void, (MWContext *context, struct LJAppletData *)) -#ifndef MOZ_NGLAYOUT -FE_DEFINE(FreeEdgeElement,void, (MWContext *context, LO_EdgeStruct *)) -FE_DEFINE(FormTextIsSubmit,void, (MWContext * context, LO_FormElementStruct * form_element)) -#endif /* MOZ_NGLAYOUT */ -FE_DEFINE(DisplaySubtext,void, (MWContext * context, int iLocation, LO_TextStruct *text, int32 start_pos, int32 end_pos, XP_Bool need_bg)) -FE_DEFINE(DisplayText,void, (MWContext * context, int iLocation, LO_TextStruct *text, XP_Bool need_bg)) -#ifndef MOZ_NGLAYOUT -FE_DEFINE(DisplayEmbed,void, (MWContext * context, int iLocation ,LO_EmbedStruct *embed_struct)) -FE_DEFINE(DisplayBuiltin,void, (MWContext * context, int iLocation ,LO_BuiltinStruct *builtin_struct)) -#endif /* MOZ_NGLAYOUT */ -FE_DEFINE(DisplayJavaApp,void, (MWContext * context, int iLocation ,LO_JavaAppStruct *java_struct)) -#ifndef MOZ_NGLAYOUT -FE_DEFINE(DisplayEdge,void, (MWContext * context, int iLocation ,LO_EdgeStruct *edge_struct)) -#endif -FE_DEFINE(DisplayTable,void, (MWContext * context, int iLocation ,LO_TableStruct *table_struct)) -FE_DEFINE(DisplayCell,void, (MWContext * context, int iLocation ,LO_CellStruct *cell_struct)) -#ifdef XP_MAC -FE_DEFINE(InvalidateEntireTableOrCell,void, (MWContext * context, LO_Element *element)) -FE_DEFINE(DisplayAddRowOrColBorder,void, (MWContext * context, void* r ,XP_Bool bErase)) -#endif -FE_DEFINE(DisplaySubDoc,void, (MWContext * context, int iLocation ,LO_SubDocStruct *subdoc_struct)) -FE_DEFINE(DisplayLineFeed,void, (MWContext * context, int iLocation , LO_LinefeedStruct *line_feed, XP_Bool need_bg)) -FE_DEFINE(DisplayHR,void, (MWContext * context, int iLocation , LO_HorizRuleStruct *HR_struct)) -FE_DEFINE(DisplayBullet,void, (MWContext *context, int iLocation, LO_BullettStruct *bullet)) -#ifndef MOZ_NGLAYOUT -FE_DEFINE(DisplayFormElement,void, (MWContext * context, int iLocation, LO_FormElementStruct * form_element)) -#endif -FE_DEFINE(DisplayBorder,void, (MWContext *context, int iLocation, int x, int y, int width, int height, int bw, LO_Color *color, LO_LineStyle style)) -#ifdef XP_MAC -FE_DEFINE(UpdateEnableStates,void, (MWContext *context)) -#endif -FE_DEFINE(DisplayFeedback,void, (MWContext *context, int iLocation, LO_Element *element)) -FE_DEFINE(ClearView,void, (MWContext * context, int which)) -FE_DEFINE(SetDocDimension,void, (MWContext *context, int iLocation, int32 iWidth, int32 iLength)) -FE_DEFINE(SetDocPosition,void, (MWContext *context, int iLocation, int32 iX, int32 iY)) -FE_DEFINE(GetDocPosition,void, (MWContext *context, int iLocation, int32 *iX, int32 *iY)) -FE_DEFINE(BeginPreSection,void, (MWContext *context)) -FE_DEFINE(EndPreSection,void, (MWContext *context)) -FE_DEFINE(SetProgressBarPercent,void, (MWContext *context, int32 percent)) -FE_DEFINE(SetBackgroundColor,void, (MWContext *context, uint8 red, uint8 green, uint8 blue)) -FE_DEFINE(Progress, void, (MWContext * cx, const char *msg)) -FE_DEFINE(Alert, void, (MWContext * cx, const char *msg)) -FE_DEFINE(SetCallNetlibAllTheTime, void, (MWContext * win_id)) -FE_DEFINE(ClearCallNetlibAllTheTime, void, (MWContext * win_id)) -FE_DEFINE(GraphProgressInit, void, (MWContext *context, URL_Struct *URL_s, int32 content_length)) -FE_DEFINE(GraphProgressDestroy, void, (MWContext *context, URL_Struct *URL_s, int32 content_length, int32 total_bytes_read)) -FE_DEFINE(GraphProgress, void, (MWContext *context, URL_Struct *URL_s, int32 bytes_received, int32 bytes_since_last_time, int32 content_length)) -FE_DEFINE(UseFancyFTP, XP_Bool, (MWContext * window_id)) -FE_DEFINE(UseFancyNewsgroupListing, XP_Bool, (MWContext *window_id)) -FE_DEFINE(FileSortMethod, int, (MWContext * window_id)) -FE_DEFINE(ShowAllNewsArticles, XP_Bool, (MWContext *window_id)) -FE_DEFINE(Confirm, XP_Bool,(MWContext * context, const char * Msg)) -FE_DEFINE(CheckConfirm, XP_Bool, (MWContext *pContext, const char *pConfirmMessage, const char *pCheckMessage, const char *pOKMessage, const char *pCancelMessage, XP_Bool *pChecked)) -FE_DEFINE(SelectDialog, XP_Bool, (MWContext *pContext, const char *pMessage, const char **pList, int16 *pCount)) -FE_DEFINE(Prompt,char*,(MWContext * context, const char * Msg, const char * dflt)) -FE_DEFINE(PromptWithCaption,char*,(MWContext * context, const char *caption, const char * Msg, const char * dflt)) -FE_DEFINE(PromptUsernameAndPassword, XP_Bool, (MWContext *,const char *,char **, char **)) -FE_DEFINE(PromptPassword,char*,(MWContext * context, const char * Msg)) -FE_DEFINE(EnableClicking,void,(MWContext*)) -FE_DEFINE(AllConnectionsComplete,void,(MWContext * context)) -#ifdef XP_OS2 /* performance */ -FE_DEFINE(GetMaxWidth,int, (MWContext * context, LO_TextStruct *text)) -#endif -#if 0 -FE_DEFINE(EraseBackground, void, (MWContext *, int, int32, int32, uint32, uint32, LO_Color *)) -FE_DEFINE(SetDrawable, void, (MWContext *, CL_Drawable *)) -FE_DEFINE(GetTextFrame, void, (MWContext *, LO_TextStruct *, int32, int32, void *)) -#ifdef XP_MAC -FE_DEFINE(GetDefaultBackgroundColor, void, (MWContext* context, LO_Color* color)) -#endif -#endif -#ifdef TRANSPARENT_APPLET -/* these functions are to allow dealyed native window applet creation and transparent applet */ -FE_DEFINE(HandleClippingView, void, (MWContext *pContext, struct LJAppletData *appletD, int x, int y, int width, int height)) -FE_DEFINE(DrawJavaApp, void, (MWContext *pContext, int iLocation, LO_JavaAppStruct *pJava)) -#endif - -#undef FE_DEFINE -#undef MAKE_FE_FUNCS_PREFIX -#undef MAKE_FE_FUNCS_ASSIGN -#undef MAKE_FE_FUNCS_EXTERN -#undef MAKE_FE_FUNCS_STRUCT diff --git a/include/msgtypes.h b/include/msgtypes.h deleted file mode 100644 index 65b13307c59c..000000000000 --- a/include/msgtypes.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -/* msgtypes.h --- types for the mail/news reader module. - */ - -#ifndef _MSGTYPES_H_ -#define _MSGTYPES_H_ - -/* This file defines types that are used by libmsg. Actually, it's rather - underpopulated right now; much more should be moved here from msgcom.h. */ - - - - -/* Instances of MSG_Pane are used to represent the various panes in the user - interfaces. The FolderPanes and MessagePanes must have a context associated - with them, but the ThreadPane generally does not. MSG_Pane is deliberately - an opaque type; FE's can't manipulate them except via the calls defined - here. */ - -#ifdef XP_CPLUSPLUS -class MSG_Pane; -#else -typedef struct MSG_Pane MSG_Pane; -#endif - - - -#endif /* _MSGTYPES_H_ */ diff --git a/include/ncompat.h b/include/ncompat.h deleted file mode 100644 index ef71ec09d527..000000000000 --- a/include/ncompat.h +++ /dev/null @@ -1,255 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)compat.h 8.13 (Berkeley) 2/21/94 - */ - -#ifndef _COMPAT_H_ -#define _COMPAT_H_ - -#include -#include "platform.h" - -/* - * If your system doesn't typedef u_long, u_short, or u_char, change - * the 0 to a 1. - */ -/*DSR041497 - these are defined in pmwsock.h, so only need for DOUGSOCK*/ -#ifdef XP_OS2_DOUGSOCK -typedef unsigned char u_char; /* 4.[34]BSD names. */ -typedef unsigned int u_int; -typedef unsigned long u_long; -typedef unsigned short u_short; -#endif - -/* If your system doesn't typedef size_t, change the 0 to a 1. */ -#if 0 -typedef unsigned int size_t; /* POSIX, 4.[34]BSD names. */ -#endif - -/* If your system doesn't typedef ssize_t, change the 0 to a 1. */ -#if 0 -typedef int ssize_t; /* POSIX names. */ -#endif - -/* - * If your system doesn't have the POSIX type for a signal mask, - * change the 0 to a 1. - */ -#if 0 /* POSIX 1003.1 signal mask type. */ -typedef unsigned int sigset_t; -#endif - -/* - * If your system's vsprintf returns a char *, not an int, - * change the 0 to a 1. - */ -#ifdef SUNOS4 -#define VSPRINTF_CHARSTAR -#endif -/* - * If you don't have POSIX 1003.1 signals, the signal code surrounding the - * temporary file creation is intended to block all of the possible signals - * long enough to create the file and unlink it. All of this stuff is - * intended to use old-style BSD calls to fake POSIX 1003.1 calls. - */ -#ifdef NO_POSIX_SIGNALS -#define sigemptyset(set) (*(set) = 0) -#define sigfillset(set) (*(set) = ~(sigset_t)0, 0) -#define sigaddset(set,signo) (*(set) |= sigmask(signo), 0) -#define sigdelset(set,signo) (*(set) &= ~sigmask(signo), 0) -#define sigismember(set,signo) ((*(set) & sigmask(signo)) != 0) - -#define SIG_BLOCK 1 -#define SIG_UNBLOCK 2 -#define SIG_SETMASK 3 - -static int __sigtemp; /* For the use of sigprocmask */ - -/* Repeated test of oset != NULL is to avoid "*0". */ -#define sigprocmask(how, set, oset) \ - ((__sigtemp = \ - (((how) == SIG_BLOCK) ? \ - sigblock(0) | *(set) : \ - (((how) == SIG_UNBLOCK) ? \ - sigblock(0) & ~(*(set)) : \ - ((how) == SIG_SETMASK ? \ - *(set) : sigblock(0))))), \ - ((oset) ? (*(oset ? oset : set) = sigsetmask(__sigtemp)) : \ - sigsetmask(__sigtemp)), 0) -#endif - -/* - * If your system doesn't have an include file with the appropriate - * byte order set, make sure you specify the correct one. - */ -#ifndef BYTE_ORDER -#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define BYTE_ORDER BIG_ENDIAN /* Set for your system. */ -#endif - -#if defined(SYSV) || defined(SYSTEM5) || defined(__sun) -#define index(a, b) strchr(a, b) -#define rindex(a, b) strrchr(a, b) -#define bzero(a, b) memset(a, 0, b) -#define bcmp(a, b, n) memcmp(a, b, n) -#define bcopy(a, b, n) memmove(b, a, n) -#endif - -#if defined(BSD) || defined(BSD4_3) -#define strchr(a, b) index(a, b) -#define strrchr(a, b) rindex(a, b) -#define memcmp(a, b, n) bcmp(a, b, n) -#define memmove(a, b, n) bcopy(b, a, n) -#endif - -/* - * 32-bit machine. The db routines are theoretically independent of - * the size of u_shorts and u_longs, but I don't know that anyone has - * ever actually tried it. At a minimum, change the following #define's - * if you are trying to compile on a different type of system. - */ -#ifndef USHRT_MAX -#define USHRT_MAX 0xFFFF -#define ULONG_MAX 0xFFFFFFFF -#endif - -#ifndef O_ACCMODE /* POSIX 1003.1 access mode mask. */ -#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) -#endif - -#ifndef _POSIX2_RE_DUP_MAX /* POSIX 1003.2 RE limit. */ -#define _POSIX2_RE_DUP_MAX 255 -#endif - -/* - * If you can't provide lock values in the open(2) call. Note, this - * allows races to happen. - */ -#ifndef O_EXLOCK /* 4.4BSD extension. */ -#define O_EXLOCK 0 -#endif - -#ifndef O_SHLOCK /* 4.4BSD extension. */ -#define O_SHLOCK 0 -#endif - -#ifndef EFTYPE -#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */ -#endif - -#ifndef WCOREDUMP /* 4.4BSD extension */ -#define WCOREDUMP(a) 0 -#endif - -#ifndef STDERR_FILENO -#define STDIN_FILENO 0 /* ANSI C #defines */ -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 -#endif - -#ifndef SEEK_END -#define SEEK_SET 0 /* POSIX 1003.1 seek values */ -#define SEEK_CUR 1 -#define SEEK_END 2 -#endif - -#ifndef _POSIX_VDISABLE /* POSIX 1003.1 disabling char. */ -#define _POSIX_VDISABLE 0 /* Some systems used 0. */ -#endif - -#ifndef TCSASOFT /* 4.4BSD extension. */ -#define TCSASOFT 0 -#endif - -#ifndef _POSIX2_RE_DUP_MAX /* POSIX 1003.2 values. */ -#define _POSIX2_RE_DUP_MAX 255 -#endif - -#ifndef NULL /* ANSI C #defines NULL everywhere. */ -#define NULL 0 -#endif - -#ifndef MAX /* Usually found in . */ -#define MAX(_a,_b) ((_a)<(_b)?(_b):(_a)) -#endif -#ifndef MIN /* Usually found in . */ -#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b)) -#endif - -/* Default file permissions. */ -#ifndef DEFFILEMODE /* 4.4BSD extension. */ -#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) -#endif - -#ifndef __sun -#ifndef S_ISDIR /* POSIX 1003.1 file type tests. */ -#define S_ISDIR(m) ((m & 0170000) == 0040000) /* directory */ -#define S_ISCHR(m) ((m & 0170000) == 0020000) /* char special */ -#define S_ISBLK(m) ((m & 0170000) == 0060000) /* block special */ -#define S_ISREG(m) ((m & 0170000) == 0100000) /* regular file */ -#define S_ISFIFO(m) ((m & 0170000) == 0010000) /* fifo */ -#endif -#ifndef S_ISLNK /* BSD POSIX 1003.1 extensions */ -#define S_ISLNK(m) ((m & 0170000) == 0120000) /* symbolic link */ -#define S_ISSOCK(m) ((m & 0170000) == 0140000) /* socket */ -#endif -#endif /* __sun */ - -/* The type of a va_list. */ -#ifndef _BSD_VA_LIST_ /* 4.4BSD #define. */ -#define _BSD_VA_LIST_ char * -#endif - -#endif /* !_COMPAT_H_ */ diff --git a/include/net.h b/include/net.h deleted file mode 100644 index 90496ba9ce14..000000000000 --- a/include/net.h +++ /dev/null @@ -1,2469 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -/* - This file should contain prototypes of all public functions for - the network module in the client library. Also all NET lib - related public data structures should be in here. - - This file will be included automatically when source includes "xp.h". - By the time this file is included, all global typedefs have been - executed. -*/ - -/* make sure we only include this once */ -#ifndef _NET_PROTO_H_ -#define _NET_PROTO_H_ - -#include "xp_core.h" -#include "ntypes.h" -#ifdef XP_MAC -#include "prio.h" -#include "shistele.h" -#include "xp_list.h" -#include "msgtypes.h" - -#ifdef XP_UNIX -#include /* for MAXPATHLEN */ -#endif - -/* larubbio */ -#if !defined(XP_UNIX) && !defined(XP_WIN32) && !defined(XP_BEOS) -#include "mcom_db.h" -#endif - -/* #include "jri.h" */ - -/* - prototypes for external structures -*/ -typedef struct _net_MemoryCacheObject net_MemoryCacheObject; - -/* ------------------------------------------------------------------------ */ -/* ============= Typedefs for the network module structures =============== */ - -#define VIEW_SOURCE_URL_PREFIX "view-source:" -#define NETHELP_URL_PREFIX "nethelp:" - -/* spider begin */ -#define MARIMBA_URL_PREFIX "castanet:" -/* spider end */ - -/* Format out codes - * - * Notice that there is no wildcard for format out. - * you must register a wildcard format_in and - * regular format_out pair for every format_out - * listed or used in the application. That way - * there can never be a mime pair that doesn't - * match. - */ -#define SET_PRESENT_BIT(X,B) ((FO_Present_Types) ( (int)X | B )) -#define CLEAR_PRESENT_BIT(X,B) ((FO_Present_Types) ( (int)X & ~(B) )) -#define CLEAR_CACHE_BIT(X) CLEAR_PRESENT_BIT(X,FO_CACHE_ONLY) - -/* If you add a FO_TYPE below for the client, please tell a windows - * front end person that is working on your product immediately. - * GAB - */ -#define FO_PRESENT 1 -#define FO_INTERNAL_IMAGE 2 -#define FO_OUT_TO_PROXY_CLIENT 3 -#define FO_VIEW_SOURCE 4 -#define FO_SAVE_AS 5 -#define FO_SAVE_AS_TEXT 6 -#define FO_SAVE_AS_POSTSCRIPT 7 -#define FO_QUOTE_MESSAGE 8 /* very much like FO_SAVE_AS_TEXT */ -#define FO_MAIL_TO 9 -#define FO_OLE_NETWORK 10 -#define FO_MULTIPART_IMAGE 11 -#define FO_EMBED 12 -#define FO_PRINT 13 -#define FO_PLUGIN 14 -#define FO_APPEND_TO_FOLDER 15 /* used by the mail/news code */ -#define FO_DO_JAVA 16 -#define FO_BYTERANGE 17 -#define FO_EDT_SAVE_IMAGE 18 -#define FO_EDIT 19 -#define FO_LOAD_HTML_HELP_MAP_FILE 20 -#define FO_SAVE_TO_NEWS_DB 21 /* used by off-line news for art. caching */ -#define FO_OPEN_DRAFT 22 /* used by the mail/news code */ -#define FO_PRESENT_INLINE 23 /* like FO_PRESENT, but doesn't blow away */ -#define FO_OBJECT 24 /* see layobj.c */ -#define FO_FONT 25 /* Downloadable Fonts */ -#define FO_SOFTWARE_UPDATE 26 /* Software updates */ -#define FO_JAVASCRIPT_CONFIG 27 -#define FO_QUOTE_HTML_MESSAGE 28 -#define FO_CMDLINE_ATTACHMENTS 29 /* for initializing compose window with attachments via commandline */ -#define FO_MAIL_MESSAGE_TO 30 /* for S/MIME */ -#define FO_LOCATION_INDEPENDENCE 31 /* Location independence stuff */ -#define FO_RDF 32 -#define FO_CRAWL_PAGE 33 /* for crawling HTML pages */ -#define FO_CRAWL_RESOURCE 34 /* for crawling images and resources */ -#define FO_ROBOTS_TXT 35 /* web robots control */ -#define FO_XMLCSS 36 /* CSS for formatting XML */ -#define FO_XMLHTML 37 /* HTML inclusions in XML */ -#define FO_NGLAYOUT 38 /* NGLayout streams */ -#define FO_AUTOUPDATE 39 -#define FO_LASTFORMAT 40 /* If you create another FO_Format, bump this value! */ - -/* bitfield detectable CACHE FO's - */ -#define FO_CACHE_ONLY 64 -#define FO_CACHE_AND_PRESENT (FO_CACHE_ONLY | FO_PRESENT) -#define FO_CACHE_AND_INTERNAL_IMAGE (FO_CACHE_ONLY | FO_INTERNAL_IMAGE) -#define FO_CACHE_AND_OUT_TO_PROXY_CLIENT (FO_CACHE_ONLY | \ - FO_OUT_TO_PROXY_CLIENT) -#define FO_CACHE_AND_VIEW_SOURCE (FO_CACHE_ONLY | FO_VIEW_SOURCE) -#define FO_CACHE_AND_SAVE_AS (FO_CACHE_ONLY | FO_SAVE_AS) -#define FO_CACHE_AND_SAVE_AS_TEXT (FO_CACHE_ONLY | FO_SAVE_AS_TEXT) -#define FO_CACHE_AND_SAVE_AS_POSTSCRIPT (FO_CACHE_ONLY | FO_SAVE_AS_POSTSCRIPT) -#define FO_CACHE_AND_QUOTE_MESSAGE (FO_CACHE_ONLY | FO_QUOTE_MESSAGE) -#define FO_CACHE_AND_MAIL_TO (FO_CACHE_ONLY | FO_MAIL_TO) -#define FO_CACHE_AND_MAIL_MESSAGE_TO (FO_CACHE_ONLY | FO_MAIL_MESSAGE_TO) -#define FO_CACHE_AND_OLE_NETWORK (FO_CACHE_ONLY | FO_OLE_NETWORK) -#define FO_CACHE_AND_MULTIPART_IMAGE (FO_CACHE_ONLY | FO_MULTIPART_IMAGE) -#define FO_CACHE_AND_EMBED (FO_CACHE_ONLY | FO_EMBED) -#define FO_CACHE_AND_PRINT (FO_CACHE_ONLY | FO_PRINT) -#define FO_CACHE_AND_PLUGIN (FO_CACHE_ONLY | FO_PLUGIN) -#define FO_CACHE_AND_APPEND_TO_FOLDER (FO_CACHE_ONLY | FO_APPEND_TO_FOLDER) -#define FO_CACHE_AND_DO_JAVA (FO_CACHE_ONLY | FO_DO_JAVA) -#define FO_CACHE_AND_BYTERANGE (FO_CACHE_ONLY | FO_BYTERANGE) -#define FO_CACHE_AND_EDIT (FO_CACHE_ONLY | FO_EDIT) -#define FO_CACHE_AND_LOAD_HTML_HELP_MAP_FILE (FO_CACHE_ONLY | FO_LOAD_HTML_HELP_MAP_FILE) -#define FO_CACHE_AND_PRESENT_INLINE (FO_CACHE_ONLY | FO_PRESENT_INLINE) -#define FO_CACHE_AND_OBJECT (FO_CACHE_ONLY | FO_OBJECT) -#define FO_CACHE_AND_FONT (FO_CACHE_ONLY | FO_FONT) -#define FO_CACHE_AND_JAVASCRIPT_CONFIG (FO_CACHE_ONLY | FO_JAVASCRIPT_CONFIG) -#define FO_CACHE_AND_SOFTUPDATE (FO_CACHE_ONLY | FO_SOFTWARE_UPDATE) -#define FO_CACHE_AND_RDF (FO_CACHE_ONLY | FO_RDF) -#define FO_CACHE_AND_XMLCSS (FO_CACHE_ONLY | FO_XMLCSS) -#define FO_CACHE_AND_XMLHTML (FO_CACHE_ONLY | FO_XMLHTML) -#define FO_CACHE_AND_CRAWL_PAGE (FO_CACHE_ONLY | FO_CRAWL_PAGE) -#define FO_CACHE_AND_CRAWL_RESOURCE (FO_CACHE_ONLY | FO_CRAWL_RESOURCE) -#define FO_CACHE_AND_ROBOTS_TXT (FO_CACHE_ONLY | FO_ROBOTS_TXT) -#define FO_CACHE_AND_NGLAYOUT (FO_CACHE_ONLY | FO_NGLAYOUT) -#define FO_CACHE_AND_AUTOUPDATE (FO_CACHE_ONLY | FO_AUTOUPDATE) - -/* bitfield detectable ONLY_FROM_CACHE FO's - */ -#define FO_ONLY_FROM_CACHE 128 -#define FO_ONLY_FROM_CACHE_AND_PRESENT (FO_ONLY_FROM_CACHE | \ - FO_PRESENT) -#define FO_ONLY_FROM_CACHE_AND_INTERNAL_IMAGE (FO_ONLY_FROM_CACHE | \ - FO_INTERNAL_IMAGE) -#define FO_ONLY_FROM_CACHE_AND_OUT_TO_PROXY_CLIENT (FO_ONLY_FROM_CACHE | \ - FO_OUT_TO_PROXY_CLIENT) -#define FO_ONLY_FROM_CACHE_AND_VIEW_SOURCE (FO_ONLY_FROM_CACHE | \ - FO_VIEW_SOURCE) -#define FO_ONLY_FROM_CACHE_AND_SAVE_AS (FO_ONLY_FROM_CACHE | \ - FO_SAVE_AS) -#define FO_ONLY_FROM_CACHE_AND_SAVE_AS_TEXT (FO_ONLY_FROM_CACHE | \ - FO_SAVE_AS_TEXT) -#define FO_ONLY_FROM_CACHE_AND_SAVE_AS_POSTSCRIPT (FO_ONLY_FROM_CACHE | \ - FO_SAVE_AS_POSTSCRIPT) -#define FO_ONLY_FROM_CACHE_AND_QUOTE_MESSAGE (FO_ONLY_FROM_CACHE | \ - FO_QUOTE_MESSAGE) -#define FO_ONLY_FROM_CACHE_AND_MAIL_TO (FO_ONLY_FROM_CACHE | \ - FO_MAIL_TO) -#define FO_ONLY_FROM_CACHE_AND_MAIL_MESSAGE_TO (FO_ONLY_FROM_CACHE | \ - FO_MAIL_MESSAGE_TO) -#define FO_ONLY_FROM_CACHE_AND_OLE_NETWORK (FO_ONLY_FROM_CACHE | \ - FO_OLE_NETWORK) -#define FO_ONLY_FROM_CACHE_AND_MULTIPART_IMAGE (FO_ONLY_FROM_CACHE | \ - FO_MULTIPART_IMAGE) -#define FO_ONLY_FROM_CACHE_AND_EMBED (FO_ONLY_FROM_CACHE | FO_EMBED) - -#define FO_ONLY_FROM_CACHE_AND_PRINT (FO_ONLY_FROM_CACHE | FO_PRINT) - -#define FO_ONLY_FROM_CACHE_AND_PLUGIN (FO_ONLY_FROM_CACHE | FO_PLUGIN) - -#define FO_ONLY_FROM_CACHE_AND_APPEND_TO_FOLDER (FO_ONLY_FROM_CACHE | \ - FO_APPEND_TO_FOLDER) -#define FO_ONLY_FROM_CACHE_AND_DO_JAVA (FO_ONLY_FROM_CACHE | FO_DO_JAVA) - -#define FO_ONLY_FROM_CACHE_AND_BYTERANGE (FO_ONLY_FROM_CACHE | FO_BYTERANGE) - -#define FO_ONLY_FROM_CACHE_AND_EDIT (FO_ONLY_FROM_CACHE | FO_EDIT) -#define FO_ONLY_FROM_CACHE_AND_LOAD_HTML_HELP_MAP_FILE (FO_ONLY_FROM_CACHE | FO_LOAD_HTML_HELP_MAP_FILE) -#define FO_ONLY_FROM_CACHE_AND_PRESENT_INLINE (FO_ONLY_FROM_CACHE | FO_PRESENT_INLINE) -#define FO_ONLY_FROM_CACHE_AND_NGLAYOUT (FO_ONLY_FROM_CACHE | FO_NGLAYOUT) - -#define MAX_FORMATS_OUT (FO_LASTFORMAT | FO_ONLY_FROM_CACHE)+1 - -typedef void -Net_GetUrlExitFunc (URL_Struct *URL_s, int status, MWContext *window_id); - -typedef void -Net_GetUrlProgressFunc (URL_Struct *URL_s, int status, MWContext *window_id); - -#endif - -/* A structure to store all headers that can be passed into HTTPLOAD. - * Used for supporting URLConnection object of Java - */ -typedef struct _NET_AllHeaders { - char **key; /* The Key portion of each HTTP header */ - char **value; /* The value portion of each HTTP header */ - uint32 empty_index; /* pointer to the next free slot */ - uint32 max_index; /* maximum no of free slots allocated */ -} NET_AllHeaders; - -#ifdef XP_MAC -/* Forward declaration to make compiler happy on OSF1 */ -#if defined (OSF1) -#ifdef XP_CPLUSPLUS -class MSG_Pane; -#endif -#endif - -/* larubbio */ -/* moved from mkextcac, this is used for 197 SAR caches, - * and external cache - */ -/* -typedef struct _ExtCacheDBInfo { - DB *database; - char *filename; - char *path; - char *name; - Bool queried_this_session; - int type; - uint32 DiskCacheSize; - uint32 NumberInDiskCache; - uint32 MaxSize; - void *logFile; - -} ExtCacheDBInfo; -*/ -#endif - -typedef enum { - Normal_priority, - Prefetch_priority, /* passed in to prefetch a URL in the background */ - CurrentlyPrefetching_priority /* a prefetch url currently loading */ -} URLLoadPriority; - - -/* passing in structure - * - * use this structure to pass a URL and associated data - * into the load_URL() routine - * - * This structure can then be used to look up associated - * data after the transfer has taken place - * - * WARNING!! If you ever change this structure, there is a good chance - * you will have to also change History_entry, and the functions - * SHIST_CreateHistoryEntry and SHIST_CreateURLStructFromHistoryEntry which - * copy URLs to and from the history. You may also need to change the - * net_CacheObject structure in mkcache.c, and the code therein which copies - * URLs to and from the memory and disk caches. - */ -struct URL_Struct_ { - URLLoadPriority priority; /* load priority */ - char * address; /* the URL part */ - - char * username; /* Put username/password info into the URL struct without */ - char * password; /* using the address field. The problem was that the user's password - * became visible on screen in a number of cases. Bug 35243, 39418 */ - - char * destination; /* for copy and move methods */ - char * IPAddressString; /* ASCII string of IP address. - * If this field exists, then NET_BeginConnect - * should use it rather than the hostname in - * the address. - * This is here for Java DNS security firedrill - * see jar or jsw... - */ - int method; /* post or get or ... */ - char * referer; /* What document points to this url */ - char * post_data; /* data to be posted */ - int32 post_data_size; /* size of post_data */ - char * range_header; /* requested ranges (bytes usually) */ - char * post_headers; /* Additional headers for the post. - * Should end with \n */ - NET_ReloadMethod - force_reload; /* forced refresh? either NORMAL or SUPER */ - char * http_headers; /* headers that can be passed into - * HTTPLoad. Used to support - * proxying - */ - char * window_target; /* named window support */ -#ifdef XP_MAC - Chrome * window_chrome; /* pointer to a Chrome structure that - * if non-null specifies the characteristics - * of the target window named in - * the window_target variable - */ -#endif - - /* attributes of the URL that are assembled - * during and after transfer of the data - */ - int server_status; /* status code returned by server */ - int32 content_length; /* length of the incoming data */ - int32 real_content_length; /* real length of the partial file */ - char * content_type; /* the content type of incoming - * data - */ - char * content_name; /* passed in name for object */ - char * transfer_encoding; /* first encoding of incoming data */ - char * content_encoding; /* encoding of incoming data */ - - char *x_mac_creator, *x_mac_type; /* If we somehow know the Mac-types - of this document, these are they. - This is only of interest on Macs, - and currently only happens with - mail/news attachments. */ - - char * charset; /* charset of the data */ - char * boundary; /* mixed multipart boundary */ - char * redirecting_url; /* the Location: of the redirect */ - char * authenticate; /* auth scheme */ - char * proxy_authenticate; /* proxy auth scheme */ - char * protection_template; /* name of server auth template */ - uint32 refresh; /* refresh interval */ - char * refresh_url; /* url to refresh */ - char * wysiwyg_url; /* URL for WYSIWYG printing/saving */ - time_t expires; - time_t last_modified; - time_t server_date; /* Date: header returned by - * HTTP servers - */ - char * cache_file; - /* if non-NULL then it contains - * the filename of its local cache - * file containing it's data - */ -#ifdef XP_MAC -#ifdef NU_CACHE - void* cache_object; -#else - net_MemoryCacheObject * memory_copy; /* if non-NULL then it contains - * a structure with - * a pointer to a list of - * memory segments - * containing it's data - */ -#endif -#endif - - void * fe_data; /* random front end data to be passed - * up the line - */ - -#if defined(XP_WIN) || defined(XP_OS2) - void *ncapi_data; /* Window ncapi data structure - * to track loads by URL and not context - */ -#endif /* XP_WIN */ - uint32 localIP; /* a local ip address that should be - * bound to the socket. */ - - int history_num; /* == add this to history list - * dflt TRUE - */ - - uint32 position; /* for plug-in streams */ - uint32 low_range; - uint32 high_range; /* these range tags represent - * the byte offsets that - * this URL contains. - * if high_range is non-zero - * then this URL represents - * just a subset of the URL. - */ - - int32 position_tag; /* tag number of last position */ - -#ifdef XP_MAC - SHIST_SavedData savedData; /* layout data */ - - Net_GetUrlExitFunc *pre_exit_fn; /* If set, called just before the - exit routine that was passed - in to NET_GetURL. */ -#endif - - /* Security information */ - int security_on; /* is security on? */ - /* Security info on a connection is opaque */ - unsigned char *sec_info; - unsigned char *redirect_sec_info; - - void *sec_private; /* private libsec info */ - - char *error_msg; /* what went wrong */ - - char **files_to_post; /* zero terminated array - * of char * filenames - * that need to be posted - */ - char **post_to; /* Only meaningful if files_to_post is set. If post_to is non-NULL, it is a NULL-terminated - array of the URLs to post the files in files_to_post to. If NULL, files_to_post along with - address(a directory) will be used to decide where to post the files (like before). */ - XP_Bool *add_crlf; /* Only meaningful if files_to_post is non-NULL. If set, it specifies for each file in files_to_post, - whether or not to make all line endings be crlf. */ - uint32 auto_scroll; /* set this if you want - * the window to autoscroll - * to the bottom at all times - * The value represents - * the number of lines to - * buffer - */ - PRPackedBool - bypassProxy, /* should we bypass the proxy (if any) */ - dontAllowDiffHostRedirect, /* Do we want to allow a redirect from host A to host B */ - post_data_is_file, /* is the post_data field a filename? */ - address_modified, /* was the address modified? */ - resize_reload, /* persistent NET_RESIZE_RELOAD flag */ - use_local_copy, /* ignore force reload */ - is_directory, /* filled in upon return in to indicate - * the url points to a directory - */ - preset_content_type, /* set this if you want to pass in - * a known content-type - */ - is_binary, /* should mailto and save-as be - * wary of this object - */ - is_active, /* is it an active stream */ - is_netsite, /* did it come from Netsite? */ - intr_on_load, /* set this to interrupt any - * existing transfers for the window - * when this URL begins to load - */ - internal_url, /* set to true if this - * is a for internal use - * only url. If it's not - * set for an internal - * URL the netlib will - * return an unrecognized url - * error - */ - ext_cache_file, /* the cache file referenced - * is from an external cache - */ - - must_cache, /* overrides cache logic, used by plugins */ - - dont_cache, /* This gets set by a mime - * header and tells us not - * to cache the document - */ - can_reuse_connection, /* set when the connetion is reusable - * as in HTTP/1.1 or NG. - */ - server_can_do_byteranges, /* can the server do byteranges */ - server_can_do_restart, /* can the (ftp) server do restarts? */ - - load_background, /* Load in the "background". - Suppress thermo, progress, etc. */ - mailto_post, /* is this a mailto: post? */ - allow_content_change, /* Set to TRUE if we are allowed to change the - content that it is displayed to the user. - Currently only used for IMAP partial fetches. */ - content_modified, /* TRUE if the content of this URL has been modified - internally. Used for IMAP partial fetches. */ - open_new_window_specified, /* TRUE if the invoker of the URL has specifically - set the open_new_window bit - otherwise, msg_GetURL - will clear it. */ - open_new_window; /* TRUE if the invoker of the URL wants a new window - to open */ -#ifdef XP_CPLUSPLUS - class MSG_Pane *msg_pane; -#else - struct MSG_Pane *msg_pane; -#endif - - NET_AllHeaders all_headers; /* All headers that can be passed into - * HTTPLOAD. Used to support - * URLConnection object of Java - */ - int ref_count; /* how many people have a pointer to me */ - /* ExtCacheDBInfo *SARCache; */ /* a pointer to the structure telling - * us which cache this is in, if it's - * NULL it's in the normal navigator - * cache - */ /* larubbio */ - int owner_id; /* unique ID for each library: - NPL (plugins) => 0x0000BAC0; - */ - void *owner_data; /* private data owned by whomever created the URL_Struct */ - char *page_services_url; - char *privacy_policy_url; - char *etag; /* HTTP/1.1 Etag */ - char *origin_url; /* original referrer of javascript: URL */ -#ifdef TRUST_LABELS - XP_List *TrustList; /* the list of trust labels that came in the header */ -#endif -}; - -#ifdef XP_MAC -#ifndef NU_CACHE /* Not on my branch you don't */ -/* silly macro's (methods) to access the URL Struct that nobody uses - */ -#define NET_URLStruct_Address(S) S->address -#define NET_URLStruct_AddressModified(S) S->address_modified -#define NET_URLStruct_PostData(S) S->post_data -#define NET_URLStruct_Method(S) S->method -#define NET_URLStruct_ContentLength(S) S->content_length -#define NET_URLStruct_ContentType(S) S->content_type - -#endif -/* stream functions - */ -typedef unsigned int -(*MKStreamWriteReadyFunc) (NET_StreamClass *stream); - -#define MAX_WRITE_READY (((unsigned) (~0) << 1) >> 1) /* must be <= than MAXINT!!!!! */ - -typedef int -(*MKStreamWriteFunc) (NET_StreamClass *stream, const char *str, int32 len); - -typedef void -(*MKStreamCompleteFunc) (NET_StreamClass *stream); - -typedef void -(*MKStreamAbortFunc) (NET_StreamClass *stream, int status); - -/* streamclass function - */ -struct _NET_StreamClass { - - char * name; /* Just for diagnostics */ - - MWContext * window_id; /* used for progress messages, etc. */ - - void * data_object; /* a pointer to whatever - * structure you wish to have - * passed to the routines below - * during writes, etc... - * - * this data object should hold - * the document, document - * structure or a pointer to the - * document. - */ - - MKStreamWriteReadyFunc is_write_ready; /* checks to see if the stream is ready - * for writing. Returns 0 if not ready - * or the number of bytes that it can - * accept for write - */ - MKStreamWriteFunc put_block; /* writes a block of data to the stream */ - MKStreamCompleteFunc complete; /* normal end */ - MKStreamAbortFunc abort; /* abnormal end */ - - Bool is_multipart; /* is the stream part of a multipart sequence */ -}; - -/*DSR040197 - new and improved position for BEGIN_PROTOS*/ -XP_BEGIN_PROTOS -/* - * this defines the prototype for - * stream converter routines. - */ -typedef NET_StreamClass * NET_Converter (FO_Present_Types rep_out, /* the output format */ - void * data_obj, /* saved from registration */ - URL_Struct * URL_s, /* the URL info */ - MWContext * context);/* window id */ - -/* - * The ContentInfo structure. - * - * Currently, we support the following attributes: - * - * 1. Type: This identifies what kind of data is in the file. - * 2. Encoding: Identifies any compression or otherwise content-independent - * transformation which has been applied to the file (uuencode, etc.) - * 3. Language: Identifies the language a text document is in. - * 4. Description: A text string describing the file. - * - * Multiple items are separated with a comma, e.g. - * encoding="x-gzip, x-uuencode" - */ - -typedef struct { - char *type; - char *encoding; - char *language; - char *desc; - char *icon; - char *alt_text; - Bool is_default; /* is it the default because a type couldn't be found? */ - void *fe_data; /* used by fe to save ext. viewer/save to disk options */ -} NET_cinfo; - -/* this is a list item struct that holds extension lists and - * cinfo structs. - * - * call cinfo_MasterListPointer to return - * the master list held by the net library - */ -typedef struct _cdata { - int num_exts; - char **exts; - NET_cinfo ci; - Bool is_external; /* did this entry come from an external file? */ - Bool is_modified; /* Is this entry modified externally; default = False */ - Bool is_local; /* Is personal copy*/ - Bool is_new; /* indicate if this is - added by user via helper */ - char* src_string; /* For output use */ - char* pref_name; /* If the mimetype came from preferences */ -} NET_cdataStruct; - - -#ifdef XP_UNIX -/* This is only used in UNIX */ - -typedef struct _mdata { - char *contenttype; - char *command; - char *testcommand; - char *label; - char *printcommand; - int32 stream_buffer_size; - Bool test_succeed; - char* xmode; - char* src_string; /* For output use */ - Bool is_local; - Bool is_modified; -} NET_mdataStruct; -#endif - - - -/* Defines for various MIME content-types and encodings. - Whenever you type in a content-type, you should use one of these defines - instead, to help catch typos, and make central management of them easier. - */ -#ifndef AUDIO_WILDCARD -#define AUDIO_WILDCARD "audio/*" -#endif -#ifndef IMAGE_WILDCARD -#define IMAGE_WILDCARD "image/*" -#endif -#ifndef APPLICATION_APPLEFILE -#define APPLICATION_APPLEFILE "application/applefile" -#endif -#ifndef APPLICATION_BINHEX -#define APPLICATION_BINHEX "application/mac-binhex40" -#endif -#ifndef APPLICATION_MACBINARY -#define APPLICATION_MACBINARY "application/x-macbinary" -#endif -#ifndef APPLICATION_COMPRESS -#define APPLICATION_COMPRESS "application/x-compress" -#endif -#ifndef APPLICATION_COMPRESS2 -#define APPLICATION_COMPRESS2 "application/compress" -#endif -#ifndef APPLICATION_FORTEZZA_CKL -#define APPLICATION_FORTEZZA_CKL "application/x-fortezza-ckl" -#endif -#ifndef APPLICATION_FORTEZZA_KRL -#define APPLICATION_FORTEZZA_KRL "application/x-fortezza-krl" -#endif -#ifndef APPLICATION_GZIP -#define APPLICATION_GZIP "application/x-gzip" -#endif -#ifndef APPLICATION_GZIP2 -#define APPLICATION_GZIP2 "application/gzip" -#endif -#ifndef APPLICATION_HTTP_INDEX_FORMAT -#define APPLICATION_HTTP_INDEX_FORMAT "application/http-index-format" -#endif -#ifndef APPLICATION_JAVASCRIPT -#define APPLICATION_JAVASCRIPT "application/x-javascript" -#endif -#ifndef APPLICATION_NETSCAPE_REVOCATION -#define APPLICATION_NETSCAPE_REVOCATION "application/x-netscape-revocation" -#endif -#ifndef APPLICATION_NS_PROXY_AUTOCONFIG -#define APPLICATION_NS_PROXY_AUTOCONFIG "application/x-ns-proxy-autoconfig" -#endif -#ifndef APPLICATION_NS_JAVASCRIPT_AUTOCONFIG -#define APPLICATION_NS_JAVASCRIPT_AUTOCONFIG "application/x-javascript-config" -#endif -#ifndef APPLICATION_OCTET_STREAM -#define APPLICATION_OCTET_STREAM "application/octet-stream" -#endif -#ifndef APPLICATION_PGP -#define APPLICATION_PGP "application/pgp" -#endif -#ifndef APPLICATION_PGP2 -#define APPLICATION_PGP2 "application/x-pgp-message" -#endif -#ifndef APPLICATION_POSTSCRIPT -#define APPLICATION_POSTSCRIPT "application/postscript" -#endif -#ifndef APPLICATION_PRE_ENCRYPTED -#define APPLICATION_PRE_ENCRYPTED "application/pre-encrypted" -#endif -#ifndef APPLICATION_UUENCODE -#define APPLICATION_UUENCODE "application/x-uuencode" -#endif -#ifndef APPLICATION_UUENCODE2 -#define APPLICATION_UUENCODE2 "application/x-uue" -#endif -#ifndef APPLICATION_UUENCODE3 -#define APPLICATION_UUENCODE3 "application/uuencode" -#endif -#ifndef APPLICATION_UUENCODE4 -#define APPLICATION_UUENCODE4 "application/uue" -#endif -#ifndef APPLICATION_X509_CA_CERT -#define APPLICATION_X509_CA_CERT "application/x-x509-ca-cert" -#endif -#ifndef APPLICATION_X509_SERVER_CERT -#define APPLICATION_X509_SERVER_CERT "application/x-x509-server-cert" -#endif -#ifndef APPLICATION_X509_EMAIL_CERT -#define APPLICATION_X509_EMAIL_CERT "application/x-x509-email-cert" -#endif -#ifndef APPLICATION_X509_USER_CERT -#define APPLICATION_X509_USER_CERT "application/x-x509-user-cert" -#endif -#ifndef APPLICATION_X509_CRL -#define APPLICATION_X509_CRL "application/x-pkcs7-crl" - #endif -#ifndef APPLICATION_XPKCS7_MIME -#define APPLICATION_XPKCS7_MIME "application/x-pkcs7-mime" -#endif -#ifndef APPLICATION_XPKCS7_SIGNATURE -#define APPLICATION_XPKCS7_SIGNATURE "application/x-pkcs7-signature" -#endif -#ifndef APPLICATION_WWW_FORM_URLENCODED -#define APPLICATION_WWW_FORM_URLENCODED "application/x-www-form-urlencoded" -#endif -#ifndef APPLICATION_OLEOBJECT -#define APPLICATION_OLEOBJECT "application/oleobject" -#endif -#ifndef APPLICATION_OLEOBJECT2 -#define APPLICATION_OLEOBJECT2 "application/x-oleobject" -#endif -#ifndef APPLICATION_JAVAARCHIVE -#define APPLICATION_JAVAARCHIVE "application/java-archive" -#endif -#ifndef APPLICATION_MARIMBA -#define APPLICATION_MARIMBA "application/marimba" -#endif -#ifndef APPLICATION_XMARIMBA -#define APPLICATION_XMARIMBA "application/x-marimba" -#endif - -#ifndef AUDIO_BASIC -#define AUDIO_BASIC "audio/basic" -#endif - -#ifndef IMAGE_GIF -#define IMAGE_GIF "image/gif" -#endif -#ifndef IMAGE_JPG -#define IMAGE_JPG "image/jpeg" -#endif -#ifndef IMAGE_PJPG -#define IMAGE_PJPG "image/pjpeg" -#endif -#ifndef IMAGE_PNG -#define IMAGE_PNG "image/png" -#endif -#ifndef IMAGE_ART -#define IMAGE_ART "image/x-art" -#endif -#ifndef IMAGE_ART2 -#define IMAGE_ART2 "image/x-jg" -#endif -#ifndef IMAGE_PPM -#define IMAGE_PPM "image/x-portable-pixmap" -#endif -#ifndef IMAGE_XBM -#define IMAGE_XBM "image/x-xbitmap" -#endif -#ifndef IMAGE_XBM2 -#define IMAGE_XBM2 "image/x-xbm" -#endif -#ifndef IMAGE_XBM3 -#define IMAGE_XBM3 "image/xbm" -#endif - -#ifndef MESSAGE_EXTERNAL_BODY -#define MESSAGE_EXTERNAL_BODY "message/external-body" -#endif -#ifndef MESSAGE_NEWS -#define MESSAGE_NEWS "message/news" -#endif -#ifndef MESSAGE_RFC822 -#define MESSAGE_RFC822 "message/rfc822" -#endif - -#ifndef MULTIPART_ALTERNATIVE -#define MULTIPART_ALTERNATIVE "multipart/alternative" -#endif -#ifndef MULTIPART_APPLEDOUBLE -#define MULTIPART_APPLEDOUBLE "multipart/appledouble" -#endif -#ifndef MULTIPART_DIGEST -#define MULTIPART_DIGEST "multipart/digest" -#endif -#ifndef MULTIPART_HEADER_SET -#define MULTIPART_HEADER_SET "multipart/header-set" -#endif -#ifndef MULTIPART_MIXED -#define MULTIPART_MIXED "multipart/mixed" -#endif -#ifndef MULTIPART_PARALLEL -#define MULTIPART_PARALLEL "multipart/parallel" -#endif -#ifndef MULTIPART_SIGNED -#define MULTIPART_SIGNED "multipart/signed" -#endif -#ifndef MULTIPART_RELATED -#define MULTIPART_RELATED "multipart/related" -#endif -#ifndef SUN_ATTACHMENT -#define SUN_ATTACHMENT "x-sun-attachment" -#endif - -#ifndef TEXT_ENRICHED -#define TEXT_ENRICHED "text/enriched" -#endif -#ifndef TEXT_CALENDAR -#define TEXT_CALENDAR "text/calendar" -#endif -#ifndef TEXT_HTML -#define TEXT_HTML "text/html" -#endif -#ifndef TEXT_MDL -#define TEXT_MDL "text/mdl" -#endif -#ifndef TEXT_PLAIN -#define TEXT_PLAIN "text/plain" -#endif -#ifndef TEXT_RICHTEXT -#define TEXT_RICHTEXT "text/richtext" -#endif -#ifndef TEXT_VCARD -#define TEXT_VCARD "text/x-vcard" -#endif -#ifndef TEXT_CSS -#define TEXT_CSS "text/css" -#endif -#ifndef TEXT_JSSS -#define TEXT_JSSS "text/jsss" -#endif -#ifndef TEXT_XML -#define TEXT_XML "text/xml" -#endif - -#ifndef VIDEO_MPEG -#define VIDEO_MPEG "video/mpeg" -#endif - - -#ifndef UUENCODE_APPLE_SINGLE /* x-uuencode-apple-single. QuickMail made me do this. */ -#define UUENCODE_APPLE_SINGLE "x-uuencode-apple-single" -#endif - - -/* The standard MIME message-content-encoding values:*/ -#ifndef ENCODING_7BIT -#define ENCODING_7BIT "7bit" -#endif -#ifndef ENCODING_8BIT -#define ENCODING_8BIT "8bit" -#endif -#ifndef ENCODING_BINARY -#define ENCODING_BINARY "binary" -#endif -#ifndef ENCODING_BASE64 -#define ENCODING_BASE64 "base64" -#endif -#ifndef ENCODING_QUOTED_PRINTABLE -#define ENCODING_QUOTED_PRINTABLE "quoted-printable" -#endif - - -/* Some nonstandard encodings. Note that the names are TOTALLY RANDOM, - and code that looks for these in network-provided data must look for - all the possibilities.*/ -#ifndef ENCODING_COMPRESS -#define ENCODING_COMPRESS "x-compress" -#endif -#ifndef ENCODING_COMPRESS2 -#define ENCODING_COMPRESS2 "compress" -#endif -#ifndef ENCODING_ZLIB -#define ENCODING_ZLIB "x-zlib" -#endif -#ifndef ENCODING_ZLIB2 -#define ENCODING_ZLIB2 "zlib" -#endif -#ifndef ENCODING_GZIP -#define ENCODING_GZIP "x-gzip" -#endif -#ifndef ENCODING_GZIP2 -#define ENCODING_GZIP2 "gzip" -#endif -#ifndef ENCODING_DEFLATE -#define ENCODING_DEFLATE "x-deflate" -#endif -#ifndef ENCODING_DEFLATE2 -#define ENCODING_DEFLATE2 "deflate" -#endif -#ifndef ENCODING_UUENCODE -#define ENCODING_UUENCODE "x-uuencode" -#endif -#ifndef ENCODING_UUENCODE2 -#define ENCODING_UUENCODE2 "x-uue" -#endif -#ifndef ENCODING_UUENCODE3 -#define ENCODING_UUENCODE3 "uuencode" -#endif -#ifndef ENCODING_UUENCODE4 -#define ENCODING_UUENCODE4 "uue" -#endif - - -/* Some names of parameters that various MIME headers include.*/ -#ifndef PARAM_PROTOCOL -#define PARAM_PROTOCOL "protocol" -#endif -#ifndef PARAM_MICALG -#define PARAM_MICALG "micalg" -#endif -#ifndef PARAM_MICALG_MD2 -#define PARAM_MICALG_MD2 "rsa-md2" -#endif -#ifndef PARAM_MICALG_MD5 -#define PARAM_MICALG_MD5 "rsa-md5" -#endif -#ifndef PARAM_MICALG_SHA1 -#define PARAM_MICALG_SHA1 "sha1" -#endif -#ifndef PARAM_MICALG_SHA1_2 -#define PARAM_MICALG_SHA1_2 "sha-1" -#endif -#ifndef PARAM_MICALG_SHA1_3 -#define PARAM_MICALG_SHA1_3 "rsa-sha1" -#endif -#ifndef PARAM_MICALG_SHA1_4 -#define PARAM_MICALG_SHA1_4 "rsa-sha-1" -#endif -#ifndef PARAM_MICALG_SHA1_5 -#define PARAM_MICALG_SHA1_5 "rsa-sha" -#endif -#ifndef PARAM_X_MAC_CREATOR -#define PARAM_X_MAC_CREATOR "x-mac-creator" -#endif -#ifndef PARAM_X_MAC_TYPE -#define PARAM_X_MAC_TYPE "x-mac-type" -#endif - - - -/* This is like text/html, but also implies that the charset is that of - the window. This type should not escape to the outside world!*/ -#ifndef INTERNAL_PARSER -#define INTERNAL_PARSER "internal/parser" -#endif - - -/* This type represents a document whose type was unknown. Note that this - is not the same as "application/octet-stream". UNKNOWN_CONTENT_TYPE is - an internal marker used to distinguish between documents *without* a - specified type, and documents which had their type explicitly specified - as octet_stream. - - This type should not be allowed to escape to the outside world -- if we - feed a content type to an external consumer, we must translate this type - to application/octet-stream first. - */ -#ifndef UNKNOWN_CONTENT_TYPE -#define UNKNOWN_CONTENT_TYPE "application/x-unknown-content-type" -#endif - - -/* I have no idea what these are... */ -#define MAGNUS_INTERNAL_UNKNOWN "magnus-internal/unknown" -/* pre-encrypted file that has passed the cache */ -#define INTERNAL_PRE_ENCRYPTED "internal/pre-encrypted" -/* html file that needs to be pre-encrypted */ -#define INTERNAL_PRE_ENC_HTML "internal/preenc-html" - -#define NET_AUTH_FAILED_DONT_DISPLAY 1 -#define NET_AUTH_FAILED_DISPLAY_DOCUMENT 2 -#define NET_AUTH_SUCCEEDED 3 -#define NET_RETRY_WITH_AUTH 4 -#define NET_WAIT_FOR_AUTH 5 - -#ifdef XP_UNIX -#define NET_COMMAND_NETSCAPE "internal" -#define NET_COMMAND_PLUGIN "plugin:" -#define NET_COMMAND_SAVE_TO_DISK "save" -#define NET_COMMAND_SAVE_BY_NETSCAPE "plugin-error" -#define NET_COMMAND_UNKNOWN "prompt" -#define NET_COMMAND_DELETED "deleted" -#define NET_MOZILLA_FLAGS "x-mozilla-flags" -#endif - -/* this is the interface struct for password auth with - the front-end dialog. this is a hack to bridge the - new and old parts of netlib XXX */ -typedef struct _NET_AuthClosure { - char * msg; - char * user; - char * pass; - void * _private; -} NET_AuthClosure; - - -/* the entry file info structure contains information about - * an ftp directory entry broken down into components - */ -typedef struct _NET_FileEntryInfo { - char * filename; - NET_cinfo * cinfo; - char * content_type; - int special_type; - time_t date; - int32 size; - Bool display; /* show this entry? */ - int32 permissions; -} NET_FileEntryInfo; - -#define NET_FILE_TYPE 0 -#define NET_DIRECTORY 1 -#define NET_SYM_LINK 2 -#define NET_SYM_LINK_TO_DIR 3 -#define NET_SYM_LINK_TO_FILE 4 - -/* bit wise or'able permissions */ -#define NET_READ_PERMISSION 4 -#define NET_WRITE_PERMISSION 2 -#define NET_EXECUTE_PERMISSION 1 - -typedef struct _HTTPIndexParserData HTTPIndexParserData; - -/* define HTML help mapping file parser */ -#define HTML_HELP_ID_FOUND 999 - -/* ====================================================================== */ -/* Prototypes for NetLib */ - -/* set this to see debug messages if compiled with -DDEBUG - */ -extern int MKLib_trace_flag; - -/* load the HTML help mapping file and search for - * the id or text to load a specific document - */ -extern void -NET_GetHTMLHelpFileFromMapFile(MWContext *context, - char *map_file_url, - char *id, - char *search_text); - -/* print a text string in place of the NET_FileEntryInfo special_type int */ -extern char * NET_PrintFileType(int special_type); - -/* streamclass parser for application/http-index-format */ -extern NET_StreamClass * -NET_HTTPIndexFormatToHTMLConverter(int format_out, - void *data_object, - URL_Struct *URL_s, - MWContext *window_id); - -/* parser routines to parse application/http-index-format - */ -extern HTTPIndexParserData * NET_HTTPIndexParserInit(void); - -extern void NET_HTTPIndexParserFree(HTTPIndexParserData *obj); - -extern int -NET_HTTPIndexParserPut(HTTPIndexParserData *obj, char *data, int32 len); - -extern int -NET_HTTPIndexParserSort(HTTPIndexParserData *data_obj, int sort_method); - -extern int32 NET_HTTPIndexParserGetTotalFiles(HTTPIndexParserData *data_obj); - -extern NET_FileEntryInfo * -NET_HTTPIndexParserGetFileNum(HTTPIndexParserData *data_obj, int32 num); - -extern char * NET_HTTPIndexParserGetTextMessage(HTTPIndexParserData *data_obj); - -extern char * NET_HTTPIndexParserGetHTMLMessage(HTTPIndexParserData *data_obj); - -extern char * NET_HTTPIndexParserGetBaseURL(HTTPIndexParserData *data_obj); - -/* the view source converter. Data_obj should be the - * content type of the object - */ -extern NET_StreamClass * -net_ColorHTMLStream (int format_out, - void *data_obj, - URL_Struct *URL_s, - MWContext *window_id); - -/* socks support function - * - * if set to NULL socks is off. If set to non null string the string will be - * used as the socks host and socks will be used for all connections. - * - * returns 0 on hostname error (gethostbyname returning bad) - * 1 otherwise - */ -extern int NET_SetSocksHost(char * host); - -/* set the number of seconds for the tcp connect timeout - * - * this timeout is used to end connections that do not - * timeout on there own - */ -extern void NET_SetTCPConnectTimeout(uint32 seconds); - -/* Is there a registered converter for the passed mime_type */ -extern XP_Bool NET_HaveConverterForMimeType(char *content_type); - -/* builds an outgoing stream and returns a stream class structure - * containing a stream function table - */ -PR_EXTERN(NET_StreamClass *) - NET_StreamBuilder ( - FO_Present_Types format_out, - URL_Struct * anchor, - MWContext * window_id); - - -/* bit flags for determining what we want to parse from the URL - */ -#define GET_ALL_PARTS 127 -#define GET_PASSWORD_PART 64 -#define GET_USERNAME_PART 32 -#define GET_PROTOCOL_PART 16 -#define GET_HOST_PART 8 -#define GET_PATH_PART 4 -#define GET_HASH_PART 2 -#define GET_SEARCH_PART 1 - - - /* return codes used by NET_BeginConnection - * and MSG_BeginOpenFolder - */ -#define MK_WAITING_FOR_CONNECTION 100 -#define MK_CONNECTED 101 - -/* This function assumes a url that includes the protocol. - * Parses and returns peices of URL as defined by the - * bit flags in "wanted" which are defined above. - * - * Note: GET_HOST_PART returns the port number if one exists. - * always mallocs a returned string that must be freed - */ -extern char * NET_ParseURL (const char *url, int wanted); - -/* decode % escaped hex codes into character values, - * modifies the parameter, returns the same buffer - */ -extern char * NET_UnEscape (char * str); - -/* decode % escaped hex codes into character values, - * modifies the parameter buffer, returns the length of the result - * (result may contain \0's). - */ -extern int NET_UnEscapeCnt (char * str); - -/* Like UnEscapeCnt but uses len to bound str, does not assume NUL termination - */ -extern int32 NET_UnEscapeBytes (char * str, int32 len); - -/* a converter for plain text - */ -PUBLIC NET_StreamClass * -NET_PlainTextConverter (FO_Present_Types format_out, - void *data_obj, - URL_Struct *URL_s, - MWContext *window_id); - - -MODULE_PRIVATE NET_StreamClass * -NET_ProxyAutoConfig(int fmt, void *data_obj, URL_Struct *URL_s, MWContext *w); - -/* set the host to be used as an SMTP relay - */ -extern void NET_SetMailRelayHost(char * host); - - -/* Silly utility routine to send a message without user interaction. */ - -extern int -NET_SendMessageUnattended(MWContext* context, char* to, char* subject, - char* otherheaders, char* body); - - - -/* add coordinates to the URL address - * in the form url?x,y - * - * any # or ? data previously on the URL is stripped - */ -extern int NET_AddCoordinatesToURLStruct(URL_Struct * url_struct, int32 x_coord, int32 y_coord); - - -/* take a Layout generated LO_FormSubmitData_struct - * and use it to add post data to the URL Structure - * generated by CreateURLStruct - * - * DOES NOT Generate the URL Struct, it must be created prior to - * calling this function - * - * returns 0 on failure and 1 on success - */ -extern int NET_AddLOSubmitDataToURLStruct(LO_FormSubmitData * sub_data, - URL_Struct * url_struct); - -typedef enum { - IdententifyViaUniqueID, - IdentintifyViaEmailAddress, - DoNotIdentifyMe -} IdentifyMeEnum; - -/* set the method that the user wishes to identify themselves - * with. - * Default is DoNotIdentify unless this is called at startup - */ -extern void NET_SetIdentifyMeType(IdentifyMeEnum method); - -/* set the users cookie prefs */ -typedef enum { - NET_SilentCookies, - NET_WhineAboutCookies, - NET_DontAcceptNewCookies, - NET_DisableCookies -} NET_CookiePrefsEnum; - -/* sets users inline cookie prefs */ -typedef enum { - NET_AllowForeignCookies, - NET_DoNotAllowForeignCookies -} NET_ForeignCookiesEnum; - -typedef enum { - NET_Accept, - NET_DontAcceptForeign, - NET_DontUse -} NET_CookieBehaviorEnum; - - -/* Register the cookie preferences callback functions. Only called once from mkgeturl. */ -extern void NET_RegisterCookiePrefCallbacks(void); - -/* Save the cookies. libnet ignores whatever filename is specified, for now. - */ -extern int NET_SaveCookies(char *filename); - -/* Should referer by supressed for anonymity sake */ -extern Bool NET_SupressRefererForAnonymity(); - -#if defined(SingleSignon) -extern void SI_DisplaySignonInfoAsHTML(MWContext *context); -#endif - -/* returns a malloc'd string containing a unique id - * generated from the sec random stuff. - */ -extern char * NET_GetUniqueIdString(void); - -/* pass in TRUE to disable disk caching - * of SSL documents. - * pass in FALSE to enable disk cacheing - * of SSL documents - */ -extern void NET_DontDiskCacheSSL(XP_Bool set); - -/* removes the specified number of objects from the - * cache taking care to remove only the oldest objects. - */ -extern int32 -NET_RemoveDiskCacheObjects(uint32 remove_num); - -/* cleans up the cache directory by listing every - * file and deleting the ones it doesn't know about - * that begin with the cacheing prefix - * - * on entry: Set - * dir_name: equal to the name of the directory where cache files reside - * prefix: equal to the file prefix that cache files use. - * (i.e. "cache" if all files begin with cacheXXXX) - * - * remember that cache file names were generated by WH_TempName with - * the xpCache enum - * - */ -extern int NET_CleanupCacheDirectory(char * dir_name, const char * prefix); - -/* locks or unlocks a cache file. The - * cache lock is only good for a single - * session - * set=TRUE locks a file - * set=FALSE unlocks a file - */ -extern Bool NET_ChangeCacheFileLock(URL_Struct *URL_s, Bool set); - -/* Find an actively-loading cache file for URL_s in context, and copy the first - * nbytes of it to a new cache file. Return a cache converter stream by which - * the caller can append to the cloned cache file. - */ -extern NET_StreamClass * -NET_CloneWysiwygCacheFile(MWContext *context, URL_Struct *URL_s, - uint32 nbytes, const char * wysiwyg_url, - const char * base_href); - -/* returns TRUE if the url is in the disk cache - */ -extern Bool NET_IsURLInDiskCache(URL_Struct *URL_s); - -/* Returns TRUE if the URL is currently in the - * memory cache and false otherwise. - */ -extern Bool NET_IsURLInMemCache(URL_Struct *URL_s); - -/* returns TRUE if the URL->address passed in - * is a local file URL - */ -extern XP_Bool NET_IsLocalFileURL(char *address); - - -/* read the Cache File allocation table. - */ -extern void NET_ReadCacheFAT(char * cachefatfile, XP_Bool stat_files); - -/* unload the disk cache FAT list to disk - * - * set final_call to true if this is the last call to - * this function before cleaning up the cache and shutting down. - * - * Front ends should never set final_call to TRUE, this will - * be done by the cache cleanup code when the netlib is being - * shutdown. - */ -extern void NET_WriteCacheFAT(char *filename, Bool final_call); - -/* removes all cache files from the cache directory - * and deletes the cache FAT - */ -extern int NET_DestroyCacheDirectory(char * dir_name, char * prefix); - -/* set the size of the Memory cache in bytes - * (The size should almost never be breached except when set exceptionally low) - * Set it to 0 if you want cacheing turned off - * completely - * - * - * if you want to free up a bunch of memory - * set the size to zero and then set it back - * to some normal value. - */ -extern void NET_SetMemoryCacheSize(int32 new_size); - -/* set the size of the Disk cache. - * Set it to 0 if you want cacheing turned off - * completely - */ -extern void NET_SetDiskCacheSize(int32 new_size); - -/* returns the number of bytes currently in use by the Memory cache - */ -extern int32 NET_GetMemoryCacheSize(void); - -/* returns the ceiling on the memory cache - */ -extern int32 NET_GetMaxMemoryCacheSize(void); - -/* returns the number of bytes currently in use by the disk cache - */ -extern int32 NET_GetDiskCacheSize(void); - -/* returns the number of files currently in the - * disk cache - */ -extern uint32 NET_NumberOfFilesInDiskCache(); - -/* remove the last memory cache object if one exists - * returns the total size of the memory cache in bytes - * after performing the operation - */ -extern int32 NET_RemoveLastMemoryCacheObject(void); - -/* remove the last disk cache object if one exists - * returns the total size of the disk cache in bytes - * after performing the operation - */ - - -/* larubbio 197 SAR cache functions */ -/* returns and creates a handle to the specified SAR cache - * the user is responsible for freeing the return struct - */ -/* extern ExtCacheDBInfo * CACHE_GetCache(ExtCacheDBInfo *db); */ - -/* - * Adds the specified file to the cache. - */ -extern Bool CACHE_Put(char *filename, URL_Struct *url_s); - -/* returns 0 if the url is not found, non-zero otherwise. It - * fills in URL_Struct as needed - */ -extern int CACHE_FindURLInCache(URL_Struct *URL_s, MWContext *ctxt); - -/* Flushes the caches data to disk */ -/* extern void CACHE_FlushCache(ExtCacheDBInfo *db_info); */ - -/* Closes the SARcache database */ -/* extern int CACHE_CloseCache(ExtCacheDBInfo *db); */ - -/* Emptys all the URL's from a cache */ -/* extern int CACHE_EmptyCache(ExtCacheDBInfo *db); */ - -/* Removes the URL from the cache */ -extern void NET_RemoveURLFromCache(URL_Struct *URL_s); - -/* Removes the cache from the list of cache's being managed */ -/* extern int CACHE_RemoveCache(ExtCacheDBInfo *db); */ - -/* Returns an already opened ExtCache struct */ -/* extern ExtCacheDBInfo * CACHE_GetCacheStruct(char * path, char * filename, char * name); */ - -/* Returns the platform specific path to a cache file */ -extern char * CACHE_GetCachePath(char * filename); - -/* Returns the list of managed caches */ -extern XP_List * CACHE_GetManagedCacheList(); - -/* Saves the cache struct to the DB */ -/* extern void CACHE_SaveCacheInfoToDB(ExtCacheDBInfo *db_info); */ - -/* Writes any changes to the cache's properties to disk */ -/* extern void CACHE_UpdateCache(ExtCacheDBInfo *db_info); */ - -extern int32 NET_RemoveLastDiskCacheObject(void); - -/*-------------------------------------------------------------- - * cdata routines to manipulate extention to mime type mapping - */ - -/* return the master cdata List pointer - * - * use the normal XP_List routines to iterate through - */ -extern XP_List * cinfo_MasterListPointer(void); - -/* get the presumed content-type of the filename given - */ -extern NET_cinfo *NET_cinfo_find_type(char *uri); - -/* return a cinfo from a mime_type - */ -extern NET_cinfo * NET_cinfo_find_info_by_type(char *mime_type); - -/* remove an item from the cdata list - */ -extern void NET_cdataRemove(NET_cdataStruct *cd); - -/* create a cdata struct - * - * does not fill anything in - */ -extern NET_cdataStruct * NET_cdataCreate(void); - -/* fills in cdata structure - * - * if cdata for a given type do not exist, create a new one - */ -extern void NET_cdataCommit(char * mimeType, char * cdataString); - -/* returns an extension (without the ".") for - * a given mime type. - * - * If no match is found NULL is returned. - * - * Do not free the returned char * - */ -extern char * NET_cinfo_find_ext(char *mime_type); - -/* check to see if this is an old mime type */ -extern XP_Bool NET_IsOldMimeTypes (XP_List *masterList); - -#ifdef XP_UNIX -extern XP_List * mailcap_MasterListPointer(void); -extern NET_mdataStruct *NET_mdataCreate(void); -extern void NET_mdataAdd(NET_mdataStruct *md); -extern void NET_mdataRemove(NET_mdataStruct *md); -extern void NET_mdataFree(NET_mdataStruct *md); -extern NET_mdataStruct* NET_mdataExist(NET_mdataStruct *old_md ); -#endif - - -/* toggles netlib trace messages on and off - */ -PUBLIC void NET_ToggleTrace(void); - -/* Makes a relative URL into an absolute one. - * - * If an absolute url is passed in it will be copied and returned. - * - * Always returns a malloc'd string or NULL on out of memory error - */ -PUBLIC char * -NET_MakeAbsoluteURL(char * absolute_url, char * relative_url); - -/* FE_SetupAsyncSelect - * - * This function will setup the messages needed for windows Async functionality - */ - - -/* encode illegal characters into % escaped hex codes. - * - * mallocs and returns a string that must be freed - */ -PUBLIC char * NET_Escape (const char * str, int mask); - -/* Like NET_Escape, but if out_len is non-null, return result string length - * in *out_len, and uses len instead of NUL termination. - */ -PUBLIC char * NET_EscapeBytes (const char * str, int32 len, int mask, - int32 * out_len); - -/* return the size of a string if it were to be escaped. - */ -extern int32 NET_EscapedSize (const char * str, int mask); - -/* - * valid mask values for NET_Escape() and NET_EscapedSize(). - */ -#define URL_XALPHAS (unsigned char) 1 -#define URL_XPALPHAS (unsigned char) 2 -#define URL_PATH (unsigned char) 4 - - - -#if !defined(XP_UNIX) - -/* these routines are depricated and should be removed shortely */ - -extern int -FE_SetupAsyncSelect(unsigned int sock, MWContext * context); - -/* Start an async DNS lookup - */ -extern int -FE_StartAsyncDNSLookup(MWContext *context, char * host_port, void ** hoststruct_ptr_ptr, int sock); -#endif - -extern void NET_DownloadAutoAdminCfgFile(); - -#ifdef MOZ_LI - -/* LDAP METHOD IDs for URL_s->method */ -#define LDAP_SEARCH_METHOD 100 /* Address book search */ -#define LDAP_LI_SEARCH_METHOD 101 /* Get LDAPMessage* results from a LDAP URL to search */ -#define LDAP_LI_ADD_METHOD 102 /* Add an entry given LDAPMods */ -#define LDAP_LI_MOD_METHOD 103 /* Modify an entry given LDAPMods */ -#define LDAP_LI_DEL_METHOD 104 /* Delete an entry given the DN */ -#define LDAP_LI_PUTFILE_METHOD 105 /* Put a file into a given DN and attribute, given a local path */ -#define LDAP_LI_GETFILE_METHOD 106 /* Retreive an attribute into a local file, given DN and attribute */ -#define LDAP_LI_ADDGLM_METHOD 107 /* Add an entry, then return the result - * of a search for the modified entry's - * modifyTimeStamp attribute - */ -#define LDAP_LI_MODGLM_METHOD 108 /* Modify an entry, then return the result - * of a search for the modified entry's - * modifyTimeStamp attribute - */ -#define LDAP_LI_GETLASTMOD_METHOD 109 /* Return an entry's modifyTimeStamp attribute. - * Any attributes specified in the URL will be ignored - */ -#define LDAP_LI_BIND_METHOD 110 /* Bind as a particular user DN to an ldap server. - */ -#endif - -/* - * NET_GetURL is called to begin the transfer of a URL - * - * URL_s: see above - * output_format: is a variable that specifies what to - * do with the outgoing data stream. - * window_id: is an identifier that will be used to - * determine where status messages and displayed data - * will be sent. - * exit_routine: is a callback function that will be - * invoked by the network library at the completion of a - * transfer or in case of error. - * - * Returns negative if the entire GET operation completes - * in a single call or an error causes the transfer to - * not happen. In that case the exit_routine will be called - * before returning from NET_GetURL. A negative response - * does not carry any other meaning than finished. The status - * passed into the exit_routine relays the success or failure - * of the actual load and contains a meaningfull error status code. - */ - -extern int -NET_GetURL (URL_Struct * URL_s, - FO_Present_Types output_format, - MWContext * context, - Net_GetUrlExitFunc* exit_routine); -PUBLIC int -NET_GetURLQuick (URL_Struct * URL_s, - FO_Present_Types output_format, - MWContext * context, - Net_GetUrlExitFunc* exit_routine); - -/* URL methods - */ -#define URL_GET_METHOD 0 -#define URL_POST_METHOD 1 -#define URL_HEAD_METHOD 2 -#define URL_PUT_METHOD 3 -#define URL_DELETE_METHOD 4 -#define URL_MKDIR_METHOD 5 -#define URL_MOVE_METHOD 6 -#define URL_INDEX_METHOD 7 -#define URL_GETPROPERTIES_METHOD 8 -#define URL_COPY_METHOD 9 - -/* LDAP METHOD IDs for URL_s->method */ -#define LDAP_SEARCH_METHOD 100 /* Address book search */ -#define LDAP_LI_GET_METHOD 101 /* Get LDAPMessage* results from a LDAP URL to search */ -#define LDAP_LI_ADD_METHOD 102 /* Add an entry given LDAPMods */ -#define LDAP_LI_MOD_METHOD 103 /* Modify an entry given LDAPMods */ -#define LDAP_LI_DEL_METHOD 104 /* Delete an entry given the DN */ -#define LDAP_LI_PUTFILE_METHOD 105 /* Put a file into a given DN and attribute, given a local path */ -#define LDAP_LI_GETFILE_METHOD 106 /* Retreive an attribute into a local file, given DN and attribute */ -#define LDAP_LI_ADDGLM_METHOD 107 /* Add an entry, then return the result - * of a search for the modified entry's - * modifyTimeStamp attribute - */ -#define LDAP_LI_MODGLM_METHOD 108 /* Modify an entry, then return the result - * of a search for the modified entry's - * modifyTimeStamp attribute - */ -#define LDAP_LI_GETLASTMOD_METHOD 109 /* Return an entry's modifyTimeStamp attribute. - * Any attributes specified in the URL will be ignored - */ -#define LDAP_LI_BIND_METHOD 110 /* Bind as a particular user DN to an ldap server. - */ - -/* - * NET_ProcessNet should be called repeatedly from the - * clients main event loop to process network activity. - * When there are active connections in progress - * NET_ProcessNet will return one(1). If there are no - * active connections open NET_ProcessNet will return - * zero(0). - */ -PUBLIC int NET_ProcessNet(PRFileDesc *ready_fd, int fd_type); -#define NET_UNKNOWN_FD 0 -#define NET_LOCAL_FILE_FD 1 -#define NET_SOCKET_FD 2 -#define NET_EVERYTIME_TYPE 3 - -/* call PR_Poll and call Netlib if necessary - * - * return FALSE if no sockets to process - * - * Should be called in OnIdle loop to service netlib - */ -PUBLIC XP_Bool NET_PollSockets(void); - -/* NET_InterruptWindow interrupts all in progress transfers - * that were initiated with the same window_id - * - * FE_GetContextID() is used internally to compare the - * unique window_id's of the in progress transfers and - * the window_id passed in - */ -extern int NET_InterruptWindow(MWContext * window_id); - -/* Does the same thing as interruptWindow, but it - * doesn't complain about reentrancy since it is - * expected when calling this routine. - * - * NOTE that you can interrupt the stream that - * you are calling from - */ -extern int NET_SilentInterruptWindow(MWContext * window_id); - -/* - * NET_InterruptStream kills just stream associated with an URL. - */ -extern int NET_InterruptStream (URL_Struct *nurl); - -/* set the netlib active entry coresponding to the - * passed in URL to the busy state passed in. - * TRUE to set busy, FALSE to set non-busy - * - * returns TRUE if found and set - * returns FALSE if entry not found - */ -Bool NET_SetActiveEntryBusyStatus(URL_Struct *nurl, Bool set_busy); - -/* interrupt a LoadURL action by using a socket number as - * an index. NOTE: that this cannot interrupt non-socket - * based operations such as file or memory cache loads - * - * returns -1 on error. - */ -extern int NET_InterruptSocket (PRFileDesc *sock); - -/* check for any active URL transfers in progress for the given - * window Id - * - * It is possible that there exist URL's on the wait queue that - * will not be returned by this function. It is recommended - * that you call NET_InterruptWindow(MWContext * window_id) - * when FALSE is returned to make sure that the wait queue is - * cleared as well. - */ -extern Bool NET_AreThereActiveConnectionsForWindow(MWContext * window_id); - -extern Bool NET_AreThereActiveConnections(); - - -#ifdef XP_MAC -/* pchen - Fix bug #72831. Same as - * NET_AreThereActiveConnectionsForWindow except that it will - * return false if there is an active connection that is busy. - */ -extern Bool NET_AreThereNonBusyActiveConnectionsForWindow(MWContext * window_id); -#endif /* XP_MAC */ - -/* check for network activity in general (not local disk or memory). - */ -extern Bool NET_HasNetworkActivity(MWContext * window_id, Bool waiting, Bool background); - -/* NET_CreateURLStruct is used to build the URL structure - * and to fill it with data. - * - * NET_FreeURLStruct should be called to free the returned - * structure after the transfer is completed. ( this should - * probably take place in the exit_routine passed as the callback - * function to NET_GetURL) - */ -extern URL_Struct * NET_CreateURLStruct (const char *url, NET_ReloadMethod force_reload); - -/* Append Key, Value pair into AllHeaders list of URL_struct - */ -extern Bool NET_AddToAllHeaders(URL_Struct * URL_s, char *name, char *value); - -/* Set the option IPAddressString field - * This field overrides the hostname when doing the connect, - * and allows Java to specify a spelling of an IP number. - * returns 0 on success, non-zero for failure (out of memory) - */ -extern int NET_SetURLIPAddressString (URL_Struct * URL_s, const char *ip_string); - -/* Free's the contents of the structure as well as - * the structure - */ -extern void NET_FreeURLStruct (URL_Struct * URL_s); - -/* Let someone keep a pointer to the URL struct without them - * having to worry about it going away out from under them - */ -extern URL_Struct * NET_HoldURLStruct (URL_Struct * URL_s); - -/* Macro sugar to complement NET_HoldURLStruct */ -#define NET_DropURLStruct NET_FreeURLStruct - -/* returns a text string explaining the negative status code - * returned from mkgeturl - */ -extern const char * NET_ExplainError(int code); - -/* returns true if the URL is a secure URL address - */ -extern Bool NET_IsURLSecure(char * address); - -/* - * NewMKStream - * Utility to create a new initialized NET_StreamClass object - */ -extern NET_StreamClass * NET_NewStream(char *, - MKStreamWriteFunc, - MKStreamCompleteFunc, - MKStreamAbortFunc, - MKStreamWriteReadyFunc, - void *, - MWContext *); - -/* this should really be a FE function - */ -extern void NET_RegisterConverters(char * personal_file, char * global_file); -extern XP_List *NET_GetRegConverterList(FO_Present_Types iFormatOut); -extern void *NET_GETDataObject(XP_List *list, char *pMimeType, void** obj); -extern void NET_CleanupMailCapList(char* filename); - -/* Register a routine to convert between format_in and format_out - */ -/* Reroute XP handling of streams for windows. - */ -extern void NET_RegContentTypeConverter (char * format_in, - FO_Present_Types format_out, - void * data_obj, - NET_Converter * converter_func, - XP_Bool bAutomated); - -/* This function found in the windows front end. - */ -extern void NET_RegisterContentTypeConverter (char * format_in, - FO_Present_Types format_out, - void * data_obj, - NET_Converter * converter_func); - -extern void NET_DeregisterContentTypeConverter (char * format_in, - FO_Present_Types format_out); - -extern void -NET_RegisterExternalViewerCommand(char * format_in, - char * system_command, - unsigned int stream_block_size); - -/* register a routine to decode a stream - */ -extern void NET_RegisterEncodingConverter (char * encoding_in, - void * data_obj, - NET_Converter * converter_func); - -#ifdef NEW_DECODERS -/* removes all registered converters of any kind - */ -extern void NET_ClearAllConverters(void); -#endif /* NEW_DECODERS */ - - -#ifdef XP_UNIX -/* register an external program to act as a content-encoding - * converter - */ -extern void NET_RegisterExternalDecoderCommand (char * format_in, - char * format_out, - char * system_command); -#endif /* XP_UNIX */ - - - -/* set the NNTP server hostname - */ -extern void NET_SetNewsHost(const char * hostname); - -extern NET_StreamClass * NET_CacheConverter (FO_Present_Types format_out, - void *converter_obj, - URL_Struct *URL_s, - MWContext *window_id); - -/* init types loads standard types so that a config file - * is not required and can also read - * a mime types file if filename is passed in non empty and - * non null - * - * on each call to NET_InitFileFormatTypes the extension list - * will be completely free'd and rebuilt. - * - * if you pass in NULL filename pointers they will not be - * attempted to be read - */ -extern int NET_InitFileFormatTypes(char * personal_file, char *global_file); -extern void NET_cdataAdd(NET_cdataStruct *cd); -extern NET_cdataStruct* NET_cdataExist(NET_cdataStruct *old_cd ); -extern void NET_cdataFree(NET_cdataStruct *cd); - -#ifdef XP_UNIX -extern void NET_CleanupFileFormat(char *filename); -#else -extern void NET_CleanupFileFormat(void); -#endif - -/* reads HTTP cookies from disk - * - * on entry pass in the name of the file to read - * - * returns 0 on success -1 on failure. - * - */ -extern int NET_ReadCookies(char * filename); - -/* removes all cookies structs from the cookie list */ -extern void -NET_RemoveAllCookies(); - -/* initialize the netlibrary - */ -extern int NET_InitNetLib(int socket_buffer_size, int max_number_of_connections); - -/* -finish the netlib startup stuff - needed if li is on -*/ -extern void NET_FinishInitNetLib(); - -/* reads a mailcap file and adds entries to the - * external viewers converter list - */ -extern int NET_ProcessMailcapFile (char *file, Bool is_local); - -/* removes all external viewer commands - */ -extern void NET_ClearExternalVieweraConverters(void); - -/* shutdown the netlibrary, cancel all - * conections and free all - * memory - */ -extern void NET_ShutdownNetLib(void); - -/* set the maximum allowable number of open connections at any one - * time - */ -extern void NET_ChangeMaxNumberOfConnections(int max_number_of_connections); - -/* set the maximum allowable number of open connections at any one - * time on a per context basis - */ -extern void NET_ChangeMaxNumberOfConnectionsPerContext(int max_number_of_connections); - -/* allocate memory for the TCP socket - * buffer - * this is an optional call - */ -extern int NET_ChangeSocketBufferSize (int size); - -typedef enum { - FTP_PROXY = 0, - GOPHER_PROXY, - HTTP_PROXY, - HTTPS_PROXY, - NEWS_PROXY, - WAIS_PROXY, - NO_PROXY, - PROXY_AUTOCONF_URL -} NET_ProxyType; - -typedef enum { - PROXY_STYLE_UNSET = 0, /* do not change these without notifying macfe */ - PROXY_STYLE_MANUAL = 1, - PROXY_STYLE_AUTOMATIC = 2, - PROXY_STYLE_NONE = 3 -} NET_ProxyStyle; - -/* set (or unset) a proxy server - * - * call with a host[:port] string or an http url - * of the form http://host[:port]/ - * - * if type is NO_PROXY send a comma deliminated string - * of host and port numbers of the form - * host[:port]{,host[:port]}* - * - * if type is PROXY_AUTOCONFIG_URL it sets the URL pointing to - * a new-style automatic proxy configuration file. - * - * A call to function NET_SelectProxyStyle() should be made after - * *ALL* the calls to these functions have been done. - * - * you can unset values by setting the type and passing - * NULL as the host_port string - */ -PUBLIC void NET_SetProxyServer(NET_ProxyType type, const char * host_port); - - -/* - * Select proxy style; - * one of: - * - * PROXY_STYLE_MANUAL -- for old style proxies - * PROXY_STYLE_AUTOMATIC -- for new style proxies - * PROXY_STYLE_NONE -- for no proxies at all - * - * This function should be called only *AFTER* all the calls to - * NET_SetProxyServer() function have been made. - * - */ -PUBLIC void -NET_SelectProxyStyle(NET_ProxyStyle style); - - -/* - * Force to reload automatic proxy config. - * Has any effect only if proxy style has been set to - * PROXY_STYLE_AUTOMATIC. - * - */ -PUBLIC void -NET_ReloadProxyConfig(MWContext *window_id); - - -/* - * NET_SetNoProxyFailover - * Sets a flag that indicates that proxy failover should not - * be done. This is used by the Enterprise Kit code, where - * the customer might configure the client to use specific - * proxies. In these cases, failover can cause different - * proxies, or no proxies to be used. - */ -PUBLIC void -NET_SetNoProxyFailover(void); - - -/* - * Returns a pointer to a NULL-terminted buffer which contains - * the text of the proxy autoconfig file. - * - * NULL if not enabled. - * - */ -PUBLIC char * NET_GetProxyConfigSource(void); - - - -typedef enum { - CU_CHECK_PER_SESSION, - CU_CHECK_ALL_THE_TIME, - CU_NEVER_CHECK -} CacheUseEnum; - -/* set the way the cache objects should - * be checked - */ -extern void NET_SetCacheUseMethod(CacheUseEnum method); - -/* set the number of articles shown in news at any one time - */ -extern void NET_SetNumberOfNewsArticlesInListing(int32 number); - - -/* Set whether to cache XOVER lines in an attempt to make news go faster - */ -extern void NET_SetCacheXOVER(XP_Bool value); - - -/* Tell netlib to clean up any strictly temporary cache files it has for XOVER - data. (This is called by msglib when the news context is destroyed.) */ -extern void NET_CleanTempXOVERCache(void); - - -/* Register decoder functions for the standard MIME encodings. */ -PUBLIC void NET_RegisterMIMEDecoders (void); - -/* Create a netlib stream for interpreting Mocha. */ -PUBLIC NET_StreamClass * -NET_CreateMochaConverter(FO_Present_Types format_out, - void *data_object, - URL_Struct *URL_struct, - MWContext *window_id); - -/* check the date and set off the timebomb if necessary - * - * Calls FE_Alert with a message and then disables - * all network calls to hosts not in our domains, - * except for FTP connects. - */ -extern Bool NET_CheckForTimeBomb(MWContext *context); - -/* parse a mime header. - * the outputFormat is passed in and passed to NET_SetCookieStringFromHttp - * - * Both name and value strings will be modified during - * parsing. If you need to retain your strings make a - * copy before passing them in. - * - * Values will be placed in the URL struct. - * - * returns TRUE if it found a valid header - * and FALSE if it didn't - */ -PUBLIC Bool -NET_ParseMimeHeader(FO_Present_Types outputFormat, - MWContext *context, - URL_Struct *URL_s, - char *name, - char *value, - XP_Bool is_http); - - -/* scans a line for references to URL's and turns them into active - * links. If the output size is exceeded the line will be - * truncated. "output" must be at least "output_size" characters - * long. If urls_only_p is FALSE, then also tweak citations (lines starting - * with ">"). - * - * The MSG_Pane* parameter is used to determine preferences for fonts - * used in citations. If it is NULL, then boring defaults are used. - */ - -extern int NET_ScanForURLs(MSG_Pane* pane, const char *input, int32 input_size, - char *output, int output_size, XP_Bool urls_only_p); - - -/* Takes an arbitrary chunk of HTML, and returns another chunk which has had - any URLs turned into references. The result is in a new string that - must be free'd using XP_FREE(). */ - -extern char* NET_ScanHTMLForURLs(const char* input); - - - -/* escapes all '<', '>' and '&' characters in a string - * returns a string that must be freed - */ -extern char * NET_EscapeHTML(const char * string); - - -/* escapes doubles quotes in a url, to protect - * the html page embedding the url. - */ -extern char * NET_EscapeDoubleQuote(const char * string); - - -/* register a newsrc file mapping - */ -extern Bool NET_RegisterNewsrcFile(char *filename, - char *hostname, - Bool is_secure, - Bool is_newsgroups_file); - -/* removes a newshost to file mapping. Removes both - * the newsrc and the newsgroups mapping - * this function does not remove the actual files, - * that is left up to the caller - */ -extern void NET_UnregisterNewsHost(const char *host, Bool is_secure); - -/* user has removed a news host from the UI. - * be sure it has also been removed from the - * connection cache so we renegotiate news host - * capabilities if we try to use it again - */ -extern void NET_OnNewsHostDeleted (const char *host); - -/* map a filename and security status into a filename - * - * returns NULL on error or no mapping. - */ -extern char * NET_MapNewsrcHostToFilename(char *host, - Bool is_secure, - Bool is_newsgroups_file); - -/* save newsrc file mappings from memory onto disk - */ -extern Bool NET_SaveNewsrcFileMappings(void); - -/* read newsrc file mappings from disk into memory - */ -extern Bool NET_ReadNewsrcFileMappings(void); - -/* free newsrc file mappings in the memory - */ -extern void NET_FreeNewsrcFileMappings(void); - -/* returns a malloc'd string that has a bunch of netlib - * status info in it. - * - * please free the pointer when done. - */ -extern char * NET_PrintNetlibStatus(void); - -/* add an external URL type prefix - * - * this prefix will be used to see if a URL is an absolute - * or a relative URL. - * - * you should just pass in the prefix of the URL - * - * for instance "http" or "ftp" or "foobar". - * - * do not pass in a colon or double slashes. - */ -extern void NET_AddExternalURLType(char * type); - -/* remove an external URL type prefix - */ -extern void NET_DelExternalURLType(char * type); - -/* - * NET_SetNewContext changes the context associated with a URL Struct. - * can also change the url exit routine, which will cause the old one - * to be called with a status of MK_CHANGING_CONTEXT - */ -extern int NET_SetNewContext(URL_Struct *URL_s, MWContext * new_context, Net_GetUrlExitFunc *exit_routine); - -/* returns true if the stream is safe for setting up a new - * context and using a separate window. - * - * This will return FALSE in multipart/mixed cases where - * it is impossible to use separate windows for the - * same stream. - */ -extern Bool NET_IsSafeForNewContext(URL_Struct *URL_s); - -/* set the pop3 option to leave a copy of old - * mail on the server - */ -extern void NET_LeavePopMailOnServer(Bool do_it); - -/* Set the pop3 option of the biggest message to download. If negative, - * then there is no limit (this should be the default). */ -extern void NET_SetPopMsgSizeLimit(int32 size); - -/* Return what the current message size limit is (again, negative means no - * limit.) */ -extern int32 NET_GetPopMsgSizeLimit(void); - -/* set the pop account username - */ -extern void NET_SetPopUsername(const char *username); - -/* get the pop account username - */ -extern const char * NET_GetPopUsername(void); - -/* set the pop account password - */ -extern void NET_SetPopPassword(const char *password); - -/* get the pop account password - */ -extern const char * NET_GetPopPassword(void); - -/* call this to enable/disable FTP PASV mode. - * Note: PASV mode is on by default - */ -extern void NET_UsePASV(Bool do_it); - -#if defined(XP_MAC) || defined(XP_UNIX) -/* call this with TRUE to enable the sending of the email - * address as the default user "anonymous" password. - * The default is OFF. - */ -extern void NET_SendEmailAddressAsFTPPassword(Bool do_it); -#endif - -/* begins the upload of the contents of a directory. - * local_directory and remote_directory can both be NULL. - * if either are NULL then it will prompt the user for them. - */ -extern void -NET_PublishDirectory(MWContext *context, - char *local_directory, - char *remote_directory); - -/* upload a set of local files (array of char*) - * all files must have full path name - * first file is primary html document, - * others are included images or other files - * in the same directory as main file - */ -extern void -NET_PublishFiles(MWContext *context, - char **files_to_publish, - char *remote_directory); -/* NET_PublishFiles is obsolete and should be removed (hardts). Use Net_PublishFilesTo. */ -/* files_to_publish and publish_to will be freed by NET_PublishFilesTo. */ -extern void -NET_PublishFilesTo(MWContext *context, - char **files_to_publish, - char **publish_to, /* Absolute URLs of the location to - * publish the files to. */ - XP_Bool *add_crlf, /* For each file in files_to_publish, should every line - end in a CRLF. */ - char *base_url, /* Directory to publish to, or the destination - * URL of the root HTML document. */ - char *username, /* may be NULL, don't pass in through base_url. */ - char *password, /* may be NULL, don't pass in through base_url. */ - Net_GetUrlExitFunc *exit_func, /* Called after publishing files is complete. - Can be NULL. */ - void *fe_data); /* Will be added as the fe_data field of the URL_Struct. - So, it can be used as an argument that exit_func() can get - ahold of. */ - -/* assemble username, password, and ftp:// or http:// - * URL into ftp://user:password@/blah format for uploading - * user_name or password are optional, allowing - * construction of ftp://user@/blah for security reasons -*/ -extern Bool -NET_MakeUploadURL( char **full_location, char *location, - char *user_name, char *password ); - -/* extract the username, password, and reassembled URL - * string (e.g.: ftp://user:pass@neon -> ftp://neon) - * from an ftp:// or http:// URL -*/ -extern Bool -NET_ParseUploadURL( char *full_location, char **location, - char **user_name, char **password ); - - -/* opens a directory and puts all the files therein into a - * null terminated array of filenames - * Returns NULL on error - */ -extern char ** -NET_AssembleAllFilesInDirectory(MWContext *context, char * local_dir_name); - -/* takes a local and a remote directory and loads all of the - * files in the directory into a URL struct that it creates - * and calls FE_GetURL to start the upload - */ -extern void -NET_UploadDirectory(MWContext *context, char *local_dir, char *remote_dir_url); - - -/* convert + to space within str. - */ -extern void NET_PlusToSpace(char *str); - -/* url_type return types */ -#define FILE_TYPE_URL 1 -#define FTP_TYPE_URL 2 -#define GOPHER_TYPE_URL 3 -#define HTTP_TYPE_URL 4 -#define MAILTO_TYPE_URL 5 -#define NEWS_TYPE_URL 6 -#define RLOGIN_TYPE_URL 7 -#define TELNET_TYPE_URL 8 -#define TN3270_TYPE_URL 9 -#define WAIS_TYPE_URL 10 -#define ABOUT_TYPE_URL 11 -#define FILE_CACHE_TYPE_URL 12 -#ifdef NU_CACHE -#define NU_CACHE_TYPE_URL 13 -#endif -#define MEMORY_CACHE_TYPE_URL 13 /* Will go away later */ -#define SECURE_HTTP_TYPE_URL 14 -#define INTERNAL_IMAGE_TYPE_URL 15 -#define URN_TYPE_URL 16 -#define POP3_TYPE_URL 17 -#define MAILBOX_TYPE_URL 18 -#define INTERNAL_NEWS_TYPE_URL 19 -#define SECURITY_TYPE_URL 20 -#define MOCHA_TYPE_URL 21 -#define VIEW_SOURCE_TYPE_URL 22 -#define HTML_DIALOG_HANDLER_TYPE_URL 23 -#define HTML_PANEL_HANDLER_TYPE_URL 24 -#define INTERNAL_SECLIB_TYPE_URL 25 -#define MSG_SEARCH_TYPE_URL 26 -#define IMAP_TYPE_URL 27 -#define LDAP_TYPE_URL 28 -#define SECURE_LDAP_TYPE_URL 29 -#define WYSIWYG_TYPE_URL 30 -#define ADDRESS_BOOK_TYPE_URL 31 -#define CLASSID_TYPE_URL 32 -#define JAVA_TYPE_URL 33 -#define DATA_TYPE_URL 34 -#define NETHELP_TYPE_URL 35 -#define NFS_TYPE_URL 36 -#define MARIMBA_TYPE_URL 37 -#define INTERNAL_CERTLDAP_TYPE_URL 38 -#define ADDRESS_BOOK_LDAP_TYPE_URL 39 -#define LDAP_REPLICATION_TYPE_URL 40 -#define LDAP_QUERY_DSE_TYPE_URL 41 -#define CALLBACK_TYPE_URL 42 -#define SOCKSTUB_TYPE_URL 43 - -#define LAST_URL_TYPE 43 /* defines the max number of URL types there are */ - -/* A usefull function to test URL types (mkutils.cpp) - * Unfortunately, we can't get to return values - * We are most interested in FILE_TYPE_URL, which is 1 -*/ -extern int NET_URL_Type(const char *URL); - -/* CM these functions added to \libnet\MKPARSE.C: */ -/* Returns TRUE if URL type is HTTP_TYPE_URL or SECURE_HTTP_TYPE_URL */ -extern Bool NET_IsHTTP_URL(const char *URL); - -/* Return values for NET_MakeRelativeURL */ -enum { - NET_URL_SAME_DIRECTORY, /* Base and URL type only filename is different */ - NET_URL_SAME_DEVICE, /* Base and URL are on same device, different directory */ - NET_URL_NOT_ON_SAME_DEVICE, /* One is remote, other is local, or on different local drives */ - NET_URL_FAIL /* Failed for lack of params, etc. */ -}; - -/* Converts absolute URL into an URL relative to the base URL - * BasePath must be an HTTP: or FILE: URL type - * absolute_url should be absolute url of the same type, - * but we pass it through NET_MakeAbsoluteURL so we can use - * relative input - ASSUMES SAME TYPE! - * If relative_url is not supplied, tests are done, - * but no relative URL string is created - * Caller must XP_FREE the string -*/ -int NET_MakeRelativeURL( char *base_url, - char *absolute_url, - char **relative_url ); - -/* Extract the filename from a source URL - * and construct add it the same path as - * a base URL (replacing file in base) - * BasePath should be an HTTP: or FILE: URL type, - * but we don't check it. - * src_url may be a relative URL, - * (if its an HTTP, and base_url is FILE, - * this creates the filename for saving - * remote image locally.) - * If relative_url is supplied, - * the new relative URL is returned - * (just the "file" portion of src_url) - * Caller must XP_FREE the string(s) -*/ -char * NET_MakeTargetURL( char *base_url, - char *src_url, - char **relative_url ); - -/* - * call this function on navigator initialization and whenever the pref - * changes. PR_TRUE means that the warning dialog will be generated, - * and PR_FALSE means that the warning dialog will NOT be generated. - */ -extern void NET_WarnOnMailtoPost(PRBool warn); - -/* Is the user off-line - uses the network.online preference */ -extern XP_Bool NET_IsOffline(); - -#ifndef SOCKET_ERRNO -#define SOCKET_INACTIVE 0 /* value that determines if a socket is inactive */ -#define SOCKET_INVALID -1 -#define SOCKET_ERRNO (int)PR_GetError() /* normal socket errno */ -#endif - - -XP_END_PROTOS - -#endif /* 0 */ -#endif /* _NET_PROTO_H_ */ diff --git a/include/ntypes.h b/include/ntypes.h deleted file mode 100644 index 0f2be6edb617..000000000000 --- a/include/ntypes.h +++ /dev/null @@ -1,219 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - - -#ifndef _NetscapeTypes_ -#define _NetscapeTypes_ - -#include "xp_core.h" - -#if XP_MAC -/* - netlib -*/ -typedef int FO_Present_Types; -typedef struct URL_Struct_ URL_Struct; -typedef struct _NET_StreamClass NET_StreamClass; -#endif - -/* - * libi18n - */ -typedef struct OpaqueCCCDataObject *CCCDataObject; -typedef struct OpaqueINTL_CharSetInfo *INTL_CharSetInfo; - -/* This lists the data input policies for the image lib. - Note that only the last 3 policies request server validation of - image data. These policies are very distinct from the netlib - cache attributes, but are used to set the netlib cache attributes - for a specific image request. -*/ -typedef enum NET_ReloadMethod -{ - IMG_CACHE_ONLY, /* imgcache, no validation, don't go to netlib cache */ - IMG_NTWK_SERVER, /* imgcache 1st, netcache 2nd, server 3rd, no initial validation */ - TV_IMG_NTWK_SERVER, /* test validation, use imgcache first. This is now - implemented as TV_NTWK_SERVER_ONLY, since the image cache - is not saved once we know we have to check with the server anyway. - */ - TV_NTWK_SERVER_ONLY, /* test validation, use necko cache first */ - SERVER_ONLY /* server only, force_reload */ -} NET_ReloadMethod; - -#if XP_MAC -/* - plugins -*/ -typedef struct _NPEmbeddedApp NPEmbeddedApp; - -/* - history -*/ -typedef struct _History_entry History_entry; -typedef struct History_ History; - -/* - bookmarks (so shist.h doesn't have to include all of bkmks.h.) - - Note, BM_Entry_struct is defined in bkmks.c. Not good practice - since this hides dependency info about the struct i.e., if you - change the struct, clients of the struct in other source files - will not indirectly recompile. -*/ - -typedef struct BM_Entry_struct BM_Entry; - -/* - parser -*/ -typedef struct _PA_Functions PA_Functions; -typedef struct PA_Tag_struct PA_Tag; - -/* - layout -*/ -typedef union LO_Element_struct LO_Element; - -typedef struct LO_AnchorData_struct LO_AnchorData; -typedef struct LO_Color_struct LO_Color; -typedef struct LO_TextAttr_struct LO_TextAttr; -typedef struct LO_TextInfo_struct LO_TextInfo; -typedef struct LO_TextStruct_struct LO_TextStruct; -typedef struct LO_ImageAttr_struct LO_ImageAttr; -typedef struct LO_ImageStruct_struct LO_ImageStruct; -typedef struct LO_SubDocStruct_struct LO_SubDocStruct; -typedef struct LO_CommonPluginStruct_struct LO_CommonPluginStruct; -typedef struct LO_EmbedStruct_struct LO_EmbedStruct; -typedef struct LO_BuiltinStruct_struct LO_BuiltinStruct; -typedef struct LO_JavaAppStruct_struct LO_JavaAppStruct; -typedef struct LO_EdgeStruct_struct LO_EdgeStruct; -typedef struct LO_ObjectStruct_struct LO_ObjectStruct; - -typedef union LO_FormElementData_struct LO_FormElementData; - -typedef struct lo_FormElementOptionData_struct lo_FormElementOptionData; -typedef struct lo_FormElementSelectData_struct lo_FormElementSelectData; -typedef struct lo_FormElementTextData_struct lo_FormElementTextData; -typedef struct lo_FormElementTextareaData_struct lo_FormElementTextareaData; -#ifdef MOZ_ENDER_MIME -typedef struct lo_FormElementHtmlareaData_struct lo_FormElementHtmlareaData; -#endif /*MOZ_ENDER_MIME*/ -typedef struct lo_FormElementMinimalData_struct lo_FormElementMinimalData; -typedef struct lo_FormElementToggleData_struct lo_FormElementToggleData; -typedef struct lo_FormElementObjectData_struct lo_FormElementObjectData; -typedef struct lo_FormElementKeygenData_struct lo_FormElementKeygenData; - -typedef struct LO_Any_struct LO_Any; -typedef struct LO_FormSubmitData_struct LO_FormSubmitData; -typedef struct LO_FormElementStruct_struct LO_FormElementStruct; -typedef struct LO_LinefeedStruct_struct LO_LinefeedStruct; -typedef struct LO_HorizRuleStruct_struct LO_HorizRuleStruct; -typedef struct LO_BulletStruct_struct LO_BulletStruct; -/* was misspelled as LO_BullettStruct */ -#define LO_BullettStruct LO_BulletStruct -typedef struct LO_TableStruct_struct LO_TableStruct; -typedef struct LO_CellStruct_struct LO_CellStruct; -typedef struct LO_Position_struct LO_Position; -typedef struct LO_Selection_struct LO_Selection; -typedef struct LO_HitLineResult_struct LO_HitLineResult; -typedef struct LO_HitElementResult_struct LO_HitElementResult; -typedef union LO_HitResult_struct LO_HitResult; - -/* Line style parameter for displaying borders */ -typedef enum { - LO_SOLID, - LO_DASH, - LO_BEVEL -} LO_LineStyle; - - -typedef struct LO_tabFocus_struct LO_TabFocusData; - -/* - XLation -*/ -typedef struct PrintInfo_ PrintInfo; -typedef struct PrintSetup_ PrintSetup; - -/* - mother of data structures -*/ -typedef struct MWContext_ MWContext; - -/* - Chrome structure -*/ -typedef struct _Chrome Chrome; - -/* - Editor -*/ -#include "edttypes.h" - -typedef enum -{ - MWContextAny = -1, /* Used as a noopt when searching for a context of a particular type */ - MWContextBrowser, /* A web browser window */ - MWContextMail, /* A mail reader window */ - MWContextNews, /* A news reader window */ - MWContextMailMsg, /* A window to display a mail msg */ - MWContextNewsMsg, /* A window to display a news msg */ - MWContextMessageComposition, /* A news-or-mail message editing window */ - MWContextSaveToDisk, /* The placeholder window for a download */ - MWContextText, /* non-window context for text conversion */ - MWContextPostScript, /* non-window context for PS conversion */ - MWContextBiff, /* non-window context for background mail - notification */ - MWContextJava, /* non-window context for Java */ - MWContextBookmarks, /* Context for the bookmarks */ - MWContextAddressBook, /* Context for the addressbook */ - MWContextOleNetwork, /* non-window context for the OLE network1 object */ - MWContextPrint, /* non-window context for printing */ - MWContextDialog, /* non-browsing dialogs. view-source/security */ - MWContextMetaFile, /* non-window context for Windows metafile support */ - MWContextEditor, /* An Editor Window */ - MWContextSearch, /* a window for modeless search dialog */ - MWContextSearchLdap, /* a window for modeless LDAP search dialog */ - MWContextHTMLHelp, /* HTML Help context to load map files */ - MWContextMailFilters, /* Mail filters context */ - MWContextHistory, /* A history window */ - MWContextMailNewsProgress, /* a progress pane for mail/news URLs */ - MWContextPane, /* Misc browser pane/window in weird parts of - * the UI, such as the navigation center */ - MWContextRDFSlave, /* Slave context for RDF network loads */ - MWContextProgressModule, /* Progress module (PW_ functions) */ - MWContextIcon /* Context for loading images as icons */ -} MWContextType; - -#define MAIL_NEWS_TYPE(x) ( \ - ((x) == MWContextMail) || \ - ((x) == MWContextNews) || \ - ((x) == MWContextMailMsg) || \ - ((x) == MWContextNewsMsg) ) - - -struct LJAppletData; - -#endif /* XP_MAC */ - -#endif /* _NetscapeTypes_ */ - diff --git a/include/proto.h b/include/proto.h deleted file mode 100644 index 3fc86451d780..000000000000 --- a/include/proto.h +++ /dev/null @@ -1,431 +0,0 @@ -/* -*- 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.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - - -/* This file should contain prototypes of all public functions for all - modules in the client library. - - This file will be included automatically when source includes "client.h". - By the time this file is included, all global typedefs have been executed. -*/ - -/* make sure we only include this once */ -#ifndef _PROTO_H_ -#define _PROTO_H_ - -#include "ntypes.h" - -XP_BEGIN_PROTOS - -/* put your prototypes here..... */ - -/* -------------------------------------------------------------------------- - * Parser stuff - */ - -extern intn PA_ParserInit(PA_Functions *); -extern NET_StreamClass *PA_BeginParseMDL(FO_Present_Types, void *, - URL_Struct *, MWContext *); -extern intn PA_ParseBlock(NET_StreamClass *, const char *, int); -extern void PA_MDLComplete(NET_StreamClass *); -extern void PA_MDLAbort(NET_StreamClass *, int); -extern Bool PA_HasMocha(PA_Tag *tag); -extern PA_Tag * PA_CloneMDLTag(PA_Tag * src); -extern intn PA_ParseStringToTags(MWContext *, char *, int32, void *); -extern const char *PA_TagString(int32); -extern int32 PA_TagIndex(char *); - - -/* -------------------------------------------------------------------------- - * Layout stuff - */ - -/*#ifndef NO_TAB_NAVIGATION */ - -extern Bool LO_isTabableElement(MWContext *context, LO_TabFocusData *pCurrentFocus ); -extern Bool LO_isTabableFormElement( LO_FormElementStruct * next_ele ); -extern Bool LO_isFormElementNeedTextTabFocus( LO_FormElementStruct *pElement ); -extern LO_Element * LO_getFirstLastElement(MWContext *context, int wantFirst ); -extern Bool LO_getNextTabableElement( MWContext *context, LO_TabFocusData *currentFocus, int forward ); - -/* NO_TAB_NAVIGATION */ - -extern LO_FormElementStruct * -LO_ReturnNextFormElement(MWContext *context, - LO_FormElementStruct *current_element); -extern LO_FormElementStruct * -LO_ReturnPrevFormElement(MWContext *context, - LO_FormElementStruct *current_element); - -/* NO_TAB_NAVIGATION, - LO_ReturnNextFormElementInTabGroup() is used to tab through form elements. - Since the winfe now has TAB_NAVIGATION, it is not used any more. - If mac and Unix don't use it either, it can be removed. -*/ -extern LO_FormElementStruct * -LO_ReturnNextFormElementInTabGroup(MWContext *context, - LO_FormElementStruct *current_element, - XP_Bool go_backwards); - -extern intn LO_ProcessTag(void *, PA_Tag *, intn); -extern void LO_RefreshArea(MWContext *context, int32 left, int32 top, - uint32 width, uint32 height); -extern Bool LO_CheckForUnload(MWContext *context); - -#if 0 -extern void LO_MoveLayer(CL_Layer *layer, int32 x, int32 y); -extern int32 LO_GetLayerXOffset(CL_Layer *layer); -extern int32 LO_GetLayerYOffset(CL_Layer *layer); - -extern int32 LO_GetLayerWrapWidth(CL_Layer *layer); -extern int32 LO_GetLayerScrollWidth(CL_Layer *layer); -extern int32 LO_GetLayerScrollHeight(CL_Layer *layer); -extern void LO_SetLayerScrollWidth(CL_Layer *layer, uint32 width); -extern void LO_SetLayerScrollHeight(CL_Layer *layer, uint32 height); - -extern void LO_SetLayerBbox(CL_Layer *layer, XP_Rect *bbox); - -#ifdef DOM -/* Setters for span contents */ -extern void LO_SetSpanColor(MWContext *context, void *span, LO_Color *color); -extern void LO_SetSpanBackground(MWContext *context, void *span, LO_Color *color); -extern void LO_SetSpanFontFamily(MWContext* context, void *span, char *family); -extern void LO_SetSpanFontWeight(MWContext* context, void *span, char *weight); -extern void LO_SetSpanFontSize(MWContext* context, void *span, int32 size); -extern void LO_SetSpanFontSlant(MWContext* context, void *span, char *slant); - -/* Setters for table contents */ -extern void LO_SetTableCellAttribute(MWContext *context, void *cell, - const char *name, const char *value); -#endif - -extern void LO_SetLayerBgColor(CL_Layer *layer, LO_Color *color); -extern LO_Color * LO_GetLayerBgColor(CL_Layer *layer); -extern void LO_SetLayerBackdropURL(CL_Layer *layer, const char *url); -extern const char *LO_GetLayerBackdropURL(CL_Layer *layer); -extern LO_ImageStruct *LO_GetLayerBackdropImage(CL_Layer *layer); -extern void LO_SetImageURL(MWContext *context, IL_GroupContext *mocha_img_cx, - LO_ImageStruct *image, const char *url, - NET_ReloadMethod reload_policy); -extern void LO_SetDocBgColor(MWContext *context, LO_Color *rgb); - -extern void -lo_SetLayerClipExpansionPolicy(CL_Layer *layer, int policy); -extern int -lo_GetLayerClipExpansionPolicy(CL_Layer *layer); - -#ifdef JAVA -/* Java Applet layer code */ -extern void LO_SetJavaAppTransparent(LO_JavaAppStruct *javaData); -#endif - -extern void LO_SetEmbedType(LO_EmbedStruct *embed, PRBool is_windowed); -extern void LO_SetEmbedSize( MWContext *context, LO_EmbedStruct *embed, int32 width, int32 height ); - -extern char* LO_GetBuiltInAttribute (LO_BuiltinStruct *pBuiltin_struct, - char* att); - -#ifdef JAVA -extern void LO_SetJavaAppTransparent(LO_JavaAppStruct *javaData); -#endif - -extern void *LO_GetLayerMochaObjectFromId(MWContext *context, int32 layer_id); -extern void *LO_GetLayerMochaObjectFromLayer(MWContext *context, - CL_Layer *layer); -extern void LO_SetLayerMochaObject(MWContext *context, int32 layer_id, - void *mocha_object); -extern CL_Layer *LO_GetLayerFromId(MWContext *context, int32 layer_id); -extern int32 LO_GetIdFromLayer(MWContext *context, CL_Layer *layer); -extern int32 LO_GetNumberOfLayers(MWContext *context); -#endif -extern NET_ReloadMethod LO_GetReloadMethod(MWContext *context); - -extern LO_Element *LO_XYToElement(MWContext *, int32, int32); -extern LO_Element *LO_XYToNearestElement(MWContext *, int32, int32); - -extern void LO_MoveGridEdge(MWContext *context, LO_EdgeStruct *edge, - int32 x, int32 y); -extern void LO_SetImageInfo(MWContext *context, int32 ele_id, - int32 width, int32 height); -extern void LO_SetForceLoadImage(char *url, XP_Bool all_images); -extern void LO_SetUserOverride(Bool override); -extern void LO_SetDefaultBackdrop(char *url); -extern void LO_SetDefaultColor(intn type, uint8 red, uint8 green, uint8 blue); -extern Bool LO_ParseRGB(char *rgb, uint8 *red, uint8 *green, uint8 *blue); -extern Bool LO_ParseStyleSheetRGB(char *rgb, uint8 *red, uint8 *green, uint8 *blue); -extern void LO_ClearBackdropBlock(MWContext *context, - LO_ImageStruct *image, Bool fg_ok); -extern void LO_ClearEmbedBlock(MWContext *context, LO_EmbedStruct *embed); -extern Bool LO_BlockedOnImage(MWContext *, LO_ImageStruct *image); -extern void LO_CloseAllTags(MWContext *); -extern void LO_DiscardDocument(MWContext *); -extern LO_FormSubmitData *LO_SubmitForm(MWContext *context, - LO_FormElementStruct *form_element); -extern LO_FormSubmitData *LO_SubmitImageForm(MWContext *context, - LO_ImageStruct *image, int32 x, int32 y); -extern void LO_ResetForm(MWContext *context, - LO_FormElementStruct *form_element); -extern LO_FormElementStruct * -LO_FormRadioSet(MWContext *context, LO_FormElementStruct *form_element); -extern void LO_SaveFormData(MWContext *context); -extern void LO_CloneFormData(SHIST_SavedData *, MWContext *context, - URL_Struct *url_struct); -extern void LO_HighlightAnchor(MWContext *context, LO_Element *element,Bool on); -#ifdef OLD_POS_HIST -extern void LO_SetDocumentPosition(MWContext *context, int32 x, int32 y); -#endif /* OLD_POS_HIST */ -extern void LO_SetDocumentDimensions(MWContext *context, - int32 width, int32 height); -extern void LO_StartSelection(MWContext *context, int32 x, int32 y); - -typedef enum { - SMALL_BM_ICON, - LARGE_BM_ICON -} BMIconType; - -extern char * LO_GetBookmarkIconURLForPage(MWContext *context, BMIconType type); - -/* Re-layout layout elements on resize without destroying them and reloading page - from scratch */ -extern void LO_RelayoutOnResize(MWContext *context, int32 width, int32 height, int32 leftMargin, int32 topMargin); -/* Re-layout layout elements when one changes size. */ -extern void LO_RelayoutFromElement(MWContext *context, LO_Element *element); - -extern void LO_ExtendSelection(MWContext *context, int32 x, int32 y); -extern void LO_EndSelection(MWContext *context); -extern void LO_ClearSelection(MWContext *context); -extern XP_Block LO_GetSelectionText(MWContext *context); -extern Bool LO_FindText(MWContext *context, char *text, - LO_Element **start_ele_loc, int32 *start_position, - LO_Element **end_ele_loc, int32 *end_position, - Bool use_case, Bool forward); -extern Bool LO_FindGridText(MWContext *context, MWContext **ret_context, - char *text, - LO_Element **start_ele_loc, int32 *start_position, - LO_Element **end_ele_loc, int32 *end_position, - Bool use_case, Bool forward); -extern Bool LO_SelectAll(MWContext *context); -extern void LO_SelectText(MWContext *context, LO_Element *start,int32 start_pos, - LO_Element *end, int32 end_pos, int32 *x, int32 *y); -extern void LO_RefreshAnchors(MWContext *context); -extern Bool LO_HaveSelection(MWContext *context); -extern void LO_GetSelectionEndpoints(MWContext *context, - LO_Element **start, LO_Element **end, int32 *start_pos, int32 *end_pos, void **sel_layer); -extern void LO_FreeSubmitData(LO_FormSubmitData *submit_data); -extern void LO_FreeDocumentFormListData(MWContext *context, void *form_data); -extern void LO_FreeDocumentEmbedListData(MWContext *context, void *embed_data); -extern void LO_FreeDocumentGridData(MWContext *context, void *grid_data); -extern void LO_FreeDocumentAppletData(MWContext *context, void *applet_data); -extern void LO_RedoFormElements(MWContext *context); -extern void LO_InvalidateFontData(MWContext *context); -extern void LO_GetDocumentMargins(MWContext *context, - int32 *margin_width, int32 *margin_height); -extern Bool LO_HasBGImage(MWContext *context); -extern Bool LO_LocateNamedAnchor(MWContext *context, URL_Struct *url_struct, - int32 *xpos, int32 *ypos); -extern int32 LO_EmptyRecyclingBin(MWContext *context); -extern LO_AnchorData *LO_MapXYToAreaAnchor(MWContext *context, - LO_ImageStruct *image, int32 x, int32 y); -extern intn LO_DocumentInfo(MWContext *context, NET_StreamClass *stream); -extern intn LO_ChangeFontSize(intn size, char *size_str); -extern double LO_GetScalingFactor(int32 scaler); -extern int16 LO_WindowWidthInFixedChars(MWContext *context); -extern void LO_CleanupGridHistory(MWContext *context); -extern void LO_UpdateGridHistory(MWContext *context); -extern Bool LO_BackInGrid(MWContext *context); -extern Bool LO_ForwardInGrid(MWContext *context); -extern Bool LO_GridCanGoForward(MWContext *context); -extern Bool LO_GridCanGoBackward(MWContext *context); - -#if defined(SingleSignon) -extern void SI_RestoreSignonData - (char* URLName, char* name, char** value); -extern void SI_RememberSignonData - (char* URLName, char** name_array, char** value_array, char** type_array, PRInt32 value_cnt); -extern void SI_RememberSignonDataFromBrowser - (char* URLName, char* username, char* password); -extern void SI_RestoreOldSignonDataFromBrowser - (MWContext *context, char* URLName, Bool pickFirstUser, - char** username, char** password); -extern int SI_LoadSignonData(char *filename); -extern int SI_SaveSignonData(char *filename); -extern void SI_RemoveAllSignonData(); -extern Bool SI_RemoveUser(char *URLName, char *userName, Bool save); -extern int SI_PromptUsernameAndPassword - (MWContext *context, char *buf, - char **username, char **password, char *URLName); -extern char *SI_PromptPassword - (MWContext *context, char *prompt, char *URLName, Bool pickFirstUser); -extern char * SI_Prompt - (MWContext *context, char *prompt, char* defaultUsername, char *URLName); -extern void SI_AnonymizeSignons(); -extern void SI_UnanonymizeSignons(); -extern void SI_StartOfForm(); -#endif - -extern Bool LO_Click( MWContext *context, int32 x, int32 y, Bool requireCaret ); -extern void LO_Hit(MWContext *context, int32 x, int32 y, - Bool requireCaret, LO_HitResult *result); -/* Similar to lo_Click, but doesn't process click - Returns TRUE if line would be selected if user clicked here - We only use this in Editor, so we can assume "layer" is NULL -*/ -Bool LO_CanSelectLine(MWContext *context, int32 x, int32 y); - -extern int32 LO_TextElementWidth(MWContext *context, LO_TextStruct *text_ele, int charOffset); - -extern void LO_AddEmbedData(MWContext* context, LO_EmbedStruct* embed, void* data); -extern void LO_CopySavedEmbedData(MWContext* context, SHIST_SavedData* newdata); -extern NET_StreamClass* LO_NewObjectStream(FO_Present_Types format_out, void* type, - URL_Struct* urls, MWContext* context); - -extern void LO_CreateReblockTag(MWContext* context, LO_Element* element); -extern void LO_LockLayout(void); -extern void LO_UnlockLayout(void); -extern Bool LO_VerifyUnlockedLayout(); -extern void LO_NetlibComplete(MWContext * context); - -extern void LO_UpdateTextData(lo_FormElementTextData * textData, const char * text); - -#ifdef EDITOR - -/* -------------------------------------------------------------------------- - * Layout stuff specific to the editor - */ - - -extern void LO_PositionCaret( MWContext *context, int32 x, int32 y ); -extern void LO_DoubleClick( MWContext *context, int32 x, int32 y ); - -void LO_PositionCaretBounded(MWContext *context, int32 x, int32 y, - int32 minY, int32 maxY ); - -extern ED_Buffer* LO_GetEDBuffer( MWContext *context); -extern void LO_GetEffectiveCoordinates( MWContext *pContext, LO_Element *pElement, int32 position, - int32* pX, int32* pY, int32* pWidth, int32* pHeight ); -extern void LO_UpDown( MWContext *pContext, LO_Element *pElement, int32 position, int32 iDesiredX, Bool bSelect, Bool bForward ); -extern Bool LO_PreviousPosition( MWContext *pContext,LO_Element *pElement, intn iOffset, - ED_Element **ppEdElement, intn* pOffset); -extern Bool LO_NextPosition( MWContext *pContext,LO_Element *pElement, intn iOffset, - ED_Element **ppEdElement, intn* pOffset); -extern Bool LO_NavigateChunk( MWContext *pContext, intn chunkType, Bool bSelect, Bool bForward ); -extern Bool LO_ComputeNewPosition( MWContext *context, intn chunkType, - Bool bSelect, Bool bDeselecting, Bool bForward, - LO_Element** pElement, int32* pPosition ); - -extern LO_Element* LO_BeginOfLine( MWContext *pContext, LO_Element *pElement ); -extern LO_Element* LO_EndOfLine( MWContext *pContext, LO_Element *pElement); -extern LO_Element* LO_FirstElementOnLine( MWContext *pContext, - int32 x, int32 y, int32 *pLineNum); -extern void LO_StartSelectionFromElement( MWContext *context, LO_Element *eptr, - int32 new_pos ); -extern void LO_ExtendSelectionFromElement( MWContext *context, LO_Element *eptr, - int32 position, Bool bFromStart ); -extern Bool LO_SelectElement( MWContext *context, LO_Element *eptr, - int32 position, Bool bFromStart ); -extern void LO_SelectRegion( MWContext *context, LO_Element *begin, - int32 beginPosition, LO_Element *end, int32 endPosition, - Bool fromStart, Bool forward ); -extern Bool LO_IsSelected( MWContext *context ); -extern Bool LO_IsSelectionStarted( MWContext *context ); -extern void LO_GetSelectionEndPoints( MWContext *context, - LO_Element **ppStart, intn *pStartOffset, LO_Element **ppEnd, - intn *pEndOffset, Bool *pbFromStart, Bool *pbSingleElementSelection ); -extern void LO_GetSelectionNewPoint( MWContext *context, - LO_Element **ppNew, intn *pNewOffset); -extern LO_Element* LO_PreviousEditableElement( LO_Element *pElement ); -extern LO_Element* LO_NextEditableElement( LO_Element *pElement ); -extern LO_ImageStruct* LO_NewImageElement( MWContext* context ); -extern void LO_SetBackgroundImage( MWContext *context, char *pUrl ); -extern void LO_RefetchWindowDimensions( MWContext *pContext ); -extern void LO_Relayout( MWContext *context, ED_TagCursor *pCursor, - int32 iLine, int iStartEditOffset, XP_Bool bDisplayTables ); - -#endif /*EDITOR*/ - -extern void LO_SetBaseURL( MWContext *pContext, char *pURL ); -extern char* LO_GetBaseURL( MWContext *pContext ); - -#if 0 -extern Bool LO_Click( MWContext *context, int32 x, int32 y, Bool requireCaret ); -extern void LO_Hit(MWContext *context, int32 x, int32 y, Bool requireCaret, LO_HitResult *result); -#endif - -extern void LO_SelectObject( MWContext *context, int32 x, int32 y ); - -#ifdef XP_UNIX -extern void LO_DisplayFormElement(LO_FormElementStruct *form); -#endif /* XP_UNIX */ - -/* Allows front ends to test for empty cell. - * Used in Composer to display "zero width border" - * in cells that layout would normally not display -*/ -XP_Bool LO_IsEmptyCell(LO_CellStruct *cell); - -Bool LO_LayingOut(MWContext * context); - - -#ifdef DOM -/* Returns true if the layout element is enclosed - in */ -Bool LO_IsWithinSpan( LO_Element *ele ); -#endif - -/* - * This is probably the wrong place to add this, but tough, - * this stuff shouldn't have to exist anyways. - */ -extern void XP_InitializeContext(MWContext *context); -extern MWContext *XP_NewContext(void); -extern void XP_DeleteContext(MWContext *context); -extern XP_List *XP_GetGlobalContextList(void); -extern void XP_AddContextToList(MWContext *context); -extern Bool XP_IsContextInList(MWContext *context); -extern void XP_RemoveContextFromList(MWContext *context); -extern MWContext *XP_GetNonGridContext(MWContext *context); -extern Bool XP_IsChildContext(MWContext* parent, MWContext* child); - -extern MWContext *XP_FindNamedContextInList(MWContext * context, char *name); -extern MWContext *XP_FindContextOfType(MWContext *, MWContextType); -extern MWContext *XP_FindSomeContext(void); -extern Bool XP_FindNamedAnchor(MWContext * context, URL_Struct * url, - int32 *xpos, int32 *ypos); -extern void XP_RefreshAnchors(void); -extern void XP_InterruptContext(MWContext * context); -extern Bool XP_IsContextBusy(MWContext * context); -extern Bool XP_IsContextStoppable(MWContext * context); -extern void XP_UpdateParentContext(MWContext * context); -extern int XP_GetSecurityStatus(MWContext *pContext); -extern int XP_ContextCount(MWContextType cxType, XP_Bool bTopLevel); - -extern char *XP_PromptPassword(MWContext *pContext, const char *pMessage); -extern char *XP_Prompt(MWContext *pContext, const char *pMessage, const char * pDef); -extern PRBool XP_PromptUsernameAndPassword (MWContext * window_id, - const char * message, - char ** username, - char ** password); -extern PRBool XP_Confirm( MWContext * c, const char * msg); - -XP_END_PROTOS - -# endif /* _PROTO_H_ */ diff --git a/include/shistele.h b/include/shistele.h deleted file mode 100644 index 734130c3af7b..000000000000 --- a/include/shistele.h +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - - -#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 */ - - 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 */ - -} 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 */ - - /* Privacy Policy support */ - char *privacy_policy_url; /* Associated privacy policy, if any */ -}; - -#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 */ diff --git a/include/structs.h b/include/structs.h deleted file mode 100644 index 9bed7dd7b750..000000000000 --- a/include/structs.h +++ /dev/null @@ -1,481 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - - -/* - * This file is included by client.h - * - * It can be included by hand after mcom.h - * - * All intermodule data structures (i.e. MWContext, etc) should be included - * in this file - */ -#ifndef _STRUCTS_H_ -#define _STRUCTS_H_ - -#include "ntypes.h" -#include "xp_mcom.h" - -#include "il_types.h" -#include "shistele.h" -#include "edttypes.h" - -#ifdef JAVA -#include "prlong.h" -#include "prclist.h" -#endif /* JAVA */ - -/* ------------------------------------------------------------------------ */ -/* ============= Typedefs for the global context structure ================ */ - -/* will come out of the ctxtfunc.h file eventually - */ -typedef struct _ContextFuncs ContextFuncs; -/* - * This stuff is front end specific. Add whatever you need. - */ -#if defined(OSF1) && defined(__cplusplus) - struct fe_ContextData; -#endif - -#if defined(XP_MAC) && defined(__cplusplus) -class NetscapeContext; -class CHyperView; - -class CNSContext; -class CHTMLView; -#endif - -#if ( defined(XP_WIN) || defined(XP_OS2) ) && defined(__cplusplus) -class CAbstractCX; -class CEditView; -class CSaveProgress; -#endif - -typedef struct FEstruct_ { -#ifndef MOZILLA_CLIENT - void * generic_data; -#elif defined(XP_WIN) || defined(XP_OS2) -#ifdef __cplusplus - CAbstractCX *cx; -#else - void *cx; -#endif -#elif defined(XP_TEXT) - int doc_cols; - int doc_lines; - int cur_top_line; - int num_anchors; - int cur_anchor; - -#elif defined(XP_UNIX) - struct fe_ContextData *data; -#elif defined(XP_MAC) -#ifdef __cplusplus - class NetscapeContext* realContext; - class CHyperView* view; - - class CNSContext* newContext; - class CHTMLView* newView; -#else - void* realContext; - void* view; - - void* newContext; - void* newView; -#endif - -/* -** These members are only used by the EDITOR... However, if they -** are removed for non-editor builds the MWContext structure -** becomes skewed for java (and the rest of DIST)... -*/ -#ifdef __cplusplus - class CEditView* editview; - class CSaveProgress* savedialog; -#else - void* editview; - void* savedialog; -#endif - -#endif -#ifdef MOZILLA_CLIENT - void* webWidget; /* Really a nsIWebWidget */ -#endif -} FEstruct; - -#define FEUNITS_X(x,context) ((int32) ((MWContext *)context)->convertPixX * (x)) -#define FEUNITS_Y(y,context) ((int32) ((MWContext *)context)->convertPixY * (y)) - -struct MessageCopyInfo; - -/* - This is a generic context structure. There should be one context - per document window. The context will allow assorted modules to - pull out things like the URL of the current document as well as - giving them a place to hand their window specific stuff. - -*/ - -#if defined (OSF1) -/* Forward declaration to make compiler happy on OSF1 */ -struct MSG_SearchFrame; -#ifdef XP_CPLUSPLUS -class MSG_IMAPFolderInfoMail; -class MSG_Master; -class MSG_Pane; -class TImapServerState; -#endif -#endif - - -#if defined(__cplusplus) -class nsITransferListener; -#endif - -struct MWContext_ { - MWContextType type; - - char *url; /* URL of current document */ - char * name; /* name of this context */ - History hist; /* Info needed for the window history module */ - FEstruct fe; /* Front end specific stuff */ - PRPackedBool fancyFTP; /* use fancy ftp ? */ - PRPackedBool fancyNews; /* use fancy news ? */ - PRPackedBool intrupt; /* the user just interrupted things */ - PRPackedBool graphProgress; /* should the user get visual feedback */ - PRPackedBool waitingMode; /* Has a transfer been initiated? Once a */ - /* transfer is started, the user cannot select another */ - /* anchor until either the transfer is aborted, has */ - /* started to layout, or has been recognized as a */ - /* separate document handled through an external stream/viewer */ - PRPackedBool reSize; /* the user wants to resize the window once the */ - /* current transfer is over */ - int fileSort; /* file sorting method */ - char * save_as_name; /* name to save current file as */ - char * title; /* title (if supplied) of current document */ - Bool is_grid_cell; /* Is this a grid cell */ - struct MWContext_ *grid_parent; /* pointer to parent of grid cell */ - XP_List * grid_children; /* grid children of this context */ - int convertPixX; /* convert from pixels to fe-specific coords */ - int convertPixY; /* convert from pixels to fe-specific coords */ - ContextFuncs * funcs; /* function table of display routines */ - PrintSetup *prSetup; /* Info about print job */ - PrintInfo *prInfo; /* State information for printing process */ - - /* XXXM12N Stuff for the new, modular Image Library. *********************/ - IL_GroupContext *img_cx; /* Created by Front Ends. Passed into Image - Library function calls. */ - IL_ColorSpace *color_space; /* Colorspace information for images. This - should become a part of the FE's display - context when MWContext goes away. */ - IL_IRGB *transparent_pixel; /* Background color to be passed into - IL_GetImage. Set by Front Ends (?) */ - /*************************************************************************/ - - int32 images; /* # of distinct images on this page */ - - /* ! do not use these ! */ - /* ! these are going away soon ! */ - /* instead see intl_csi.h for the i18n accessor functions */ - int16 do_not_use_win_csid; /* code set ID of current window */ - int16 do_not_use_doc_csid; /* code set ID of current document */ - int16 do_not_use_relayout; /* tell conversion to treat relayout case */ - char *do_not_use_mime_charset; /* MIME charset from URL */ - - struct MSG_CompositionFrame *msg_cframe; /* ditto. */ - struct MSG_SearchFrame *msg_searchFrame; /*state for search, for search contexts*/ - struct MSG_BiffFrame *biff_frame; /* Biff info for this context, if any. */ - struct BM_Frame *bmframe; /* Bookmarks info for this context, if any. */ - - /* for now, add IMAP mail stuff here */ -#ifdef XP_CPLUSPLUS - class MSG_IMAPFolderInfoMail *currentIMAPfolder; - class MSG_Pane *imapURLPane; /* used when updated folders */ - class MSG_Master *mailMaster; - class TNavigatorImapConnection *imapConnection; -#else - struct MSG_IMAPFolderInfoMail *currentIMAPfolder; - struct MSG_Pane *imapURLPane; /* used when updated folders */ - struct MSG_Master *mailMaster; - struct TNavigatorImapConnection *imapConnection; -#endif - - /* for now, add message copy info stuff here */ - struct MessageCopyInfo *msgCopyInfo; - - NPEmbeddedApp *pluginList; /* plugins on this page */ - void *pluginReconnect; /* yet another full screen hack */ - - struct MimeDisplayData *mime_data; /* opaque data used by MIME message - parser (not Mail/News specific, - since MIME objects can show up - in Browser windows too.) */ - /* Also overloaded by progress module to hold private crap! */ - - - struct JSContext *mocha_context; /* opaque handle to Mocha state */ - uint32 event_bit; /* sum of all event capturing objects */ - XP_Bool js_drag_enabled; /* indicates JS drag enabled */ - int8 js_dragging; /* indicates which button has JS drag in process */ - XP_List * js_dependent_list; /* lifetime-linked children of this context */ - MWContext *js_parent; - int32 js_timeouts_pending; /* Number of pending JavaScript timeouts */ - - - XP_Bool restricted_target; /* TRUE if window is off-limits for opening links into - from mail or other window-grabbing functions.*/ - - NPEmbeddedApp *pEmbeddedApp; /* yet another full screen hack */ - char * defaultStatus; /* What string to show in the status area - whenever there's nothing better to show. - FE's should implement FE_Progress so that - if it is passed NULL or "" it will instead - display this string. libmsg changes this - string all the time for mail and news - contexts. */ - int32 doc_id; /* unique identifier for generated documents */ - int32 context_id; /* unique identifier for context */ - - void *pHelpInfo; /* pointer to additional help information; - see ns/lib/libnet/mkhelp.c [EA] */ - -#ifdef JAVA - /* See ns/sun-java/netscape/net/netStubs.c for the next 2 items: */ - - /* - ** This mysterious list is used in two ways: (1) If you're a real - ** window context, it's a list of all dummy java contexts that were - ** created for java's network connections. (2) If you're a dummy java - ** context, it's where you're linked into the list of connections for - ** the real context: - */ - PRCList javaContexts; - - /* - ** Second, if you're a dummy java context, you'll need a pointer to - ** the stream data so that you can shut down the netlib connection: - */ - struct nsn_JavaStreamData* javaContextStreamData; - - /* - ** Stuff for GraphProgress. See lj_embed.c - */ - Bool displayingMeteors; - int64 timeOfFirstMeteorShower; - int16 numberOfSimultaneousShowers; - -#endif /* JAVA */ - - /* - ** Put the editor stuff at the end so that people can still use the - ** the Java DLL from the 2.0 dist build with Navigator Gold. - */ - PRPackedBool is_editor; /* differentiates between Editor and Browser modes */ - PRPackedBool is_new_document; /* quick access to new doc state (unsaved-no file yet)*/ - PRPackedBool display_paragraph_marks; /* True if we should display paragraph and hard-return symbols. */ - PRPackedBool display_table_borders; /* True if we should display dotted lines around tables with invisible borders. */ - PRPackedBool edit_view_source_hack; - PRPackedBool edit_loading_url; /* Hack to let us run the net while in a modal dialog */ - PRPackedBool edit_saving_url; /* " */ - PRPackedBool edit_has_backup; /* Editor has made a session backup */ - PRPackedBool bIsComposeWindow; /* Editor is a compose window */ - - /* - * Webfonts that were loaded by this context - */ - void *webfontsList; - - /* web font stuff */ - /* On Windows, they are initialized to 0 in cxdc.cpp */ - int16 WebFontDownLoadCount; /* # of download for this doc( one download can have multiple fonts) */ - int16 MissedFontFace; /* have we missed any font? */ - - /* number of pixels per point-size */ - double XpixelsPerPoint; - double YpixelsPerPoint; - - Bool bJavaScriptCalling; - /* Allow JavaScript in certain internally generated contexts even - * when the "enable javascript" pref is turned off. - * This flag will also be inherited by child grid cells. - */ - PRPackedBool forceJSEnabled; - - /* For increase and decrease font */ - double fontScalingPercentage; - - int INTL_tag; /* used to tell that we have a valid INTL_CSIInfo */ - INTL_CharSetInfo INTL_CSIInfo; /* new home of private i18n data */ - - /* the current tab focused data */ - LO_TabFocusData *tab_focus_data; - - void *ncast_channel_context; - /* if the window is displaying an XML file, keep a pointer to the XML file structure here */ - void* xmlfile; - Bool anonymous; - URL_Struct* modular_data; - PRInt32 ref_count; - - /* This gets set to `true' when layout encounters an image with no - width or height: layout will proceed to place the image, but - the FE will have to do a reflow once all the netlib connections - terminate for the page to be correctly displayed. The idea is - to get visible content to the user ASAP, even if it means that - stuff looks funny for a couple seconds. */ - PRPackedBool requires_reflow; - -#if defined(__cplusplus) - nsITransferListener* progressManager; -#else - void* progressManager; -#endif /* __cplusplus */ -}; - - -/* This tells libmime.a whether it has the mime_data slot in MWContext - (which should always be true eventually, but having this #define here - makes life easier for me today.) -- jwz */ -#define HAVE_MIME_DATA_SLOT - - -/* this is avialible even in non GOLD builds. */ -#define EDT_IS_EDITOR(context) (context != NULL && context->is_editor) -#define EDT_DISPLAY_PARAGRAPH_MARKS(context) (context && context->is_editor && context->display_paragraph_marks) -#define EDT_DISPLAY_TABLE_BORDERS(context) (context && context->is_editor && context->display_table_borders) -#define EDT_RELAYOUT_FLAG (0x2) -#define EDT_IN_RELAYOUT(context) (context != NULL && ((context->is_editor & EDT_RELAYOUT_FLAG) != 0)) - -#ifdef JAVA - -/* -** This macro is used to recover the MWContext* from the javaContexts -** list pointer: -*/ -#define MWCONTEXT_PTR(context) \ - ((MWContext*) ((char*) (context) - offsetof(MWContext,javaContexts))) - -#endif /* JAVA */ - -/* ------------------------------------------------------------------------ */ -/* ====================== NASTY UGLY SHORT TERM HACKS ===================== */ - -#define XP_CONTEXTID(ctxt) ((ctxt)->context_id) -#define XP_DOCID(ctxt) ((ctxt)->doc_id) -#define XP_SET_DOCID(ctxt, id) ((ctxt)->doc_id = (id)) - -/* ------------------------------------------------------------------------ */ -/* ============= Typedefs for the parser module structures ================ */ - -/* - * I *think* (but am unsure) that these should be forked off into a - * parser specific client level include file - * - */ - -typedef int8 TagType; - -struct PA_Tag_struct { - TagType type; - PRPackedBool is_end; - uint16 newline_count; -#if defined(XP_WIN) || defined(XP_OS2) - union { /* use an anonymous union for debugging purposes*/ - PA_Block data; - char* data_str; - }; -#else - PA_Block data; -#endif - int32 data_len; - int32 true_len; - void *lo_data; - struct PA_Tag_struct *next; - ED_Element *edit_element; -}; - -typedef struct _TagList { - PA_Tag *tagList; - PA_Tag *lastTag; -} TagList; - -#define PA_HAS_PDATA( tag ) (tag->pVoid != 0 ) - -#ifdef XP_UNIX -typedef char *PAAllocate (intn byte_cnt); -typedef void PAFree (char *ptr); -#else -typedef void *PAAllocate (unsigned int byte_cnt); -typedef void PAFree (void *ptr); -#endif -typedef intn PA_OutputFunction (void *data_object, PA_Tag *tags, intn status); - -struct _PA_Functions { - PAAllocate *mem_allocate; - PAFree *mem_free; - PA_OutputFunction *PA_ParsedTag; -}; - -typedef struct PA_InitData_struct { - PA_OutputFunction *output_func; -} PA_InitData; - -/* Structure that defines the characteristics of a new window. - * Each entry should be structured so that 0 should be the - * default normal value. Currently all 0 values - * bring up a chromeless MWContextBrowser type window of - * arbitrary size. - */ -struct _Chrome { - MWContextType type; /* Must be set to the correct type you want, - * if doesn't exist, define one!!! - */ - Bool show_button_bar; /* TRUE to display button bar */ - Bool show_url_bar; /* TRUE to show URL entry area */ - Bool show_directory_buttons; /* TRUE to show directory buttons */ - Bool show_bottom_status_bar; /* TRUE to show bottom status bar */ - Bool show_menu; /* TRUE to show menu bar */ - Bool show_security_bar; /* TRUE to show security bar */ - Bool hide_title_bar; /* TRUE to hide title bar and window controls */ - int32 w_hint, h_hint; /* hints for width and height */ - int32 outw_hint, outh_hint; /* hints for outer window width and height */ - int32 l_hint, t_hint; /* hints for left and top window positioning */ - Bool topmost; /* TRUE for window alwaysOnTop */ - Bool bottommost; /* TRUE for 'desktop' window */ - Bool z_lock; /* TRUE for window which cannot move within z-order */ - Bool is_modal; /* TRUE to make window be modal */ - Bool show_scrollbar; /* TRUE to show scrollbars on window */ - Bool location_is_chrome; /* TRUE if top or left is specified */ - Bool allow_resize; /* TRUE to allow resize of windows */ - Bool allow_close; /* TRUE to allow window to be closed */ - Bool copy_history; /* TRUE to copy history of prototype context*/ - Bool dependent; /* TRUE if this window is to be closed with its parent*/ - Bool disable_commands; /* TRUE if user has set hot-keys / menus off */ - Bool restricted_target; /* TRUE if window is off-limits for opening links into - from mail or other window-grabbing functions.*/ - void (* close_callback)(void *close_arg); /* called on window close */ - void *close_arg; /* passed to close_callback */ -}; - - -#endif /* _STRUCTS_H_ */ diff --git a/include/winfile.h b/include/winfile.h deleted file mode 100644 index 603318a04bbb..000000000000 --- a/include/winfile.h +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -/* --------------------------------------------------------------------------- - Stuff to fake unix file I/O on windows boxes - ------------------------------------------------------------------------*/ - -#ifndef WINFILE_H -#define WINFILE_H - -#ifdef _WINDOWS -#if defined(XP_WIN32) || defined(_WIN32) -/* 32-bit stuff here */ -#include -#include -#include -#include - -typedef struct DIR_Struct { - void * directoryPtr; - WIN32_FIND_DATA data; -} DIR; - -#define _ST_FSTYPSZ 16 - -#ifndef __BORLANDC__ - typedef unsigned long mode_t; - typedef long uid_t; - typedef long gid_t; - typedef long off_t; - typedef unsigned long nlink_t; -#endif - -typedef struct timestruc { - time_t tv_sec; /* seconds */ - long tv_nsec; /* and nanoseconds */ -} timestruc_t; - - -struct dirent { /* data from readdir() */ - ino_t d_ino; /* inode number of entry */ - off_t d_off; /* offset of disk direntory entry */ - unsigned short d_reclen; /* length of this record */ - char d_name[_MAX_FNAME]; /* name of file */ -}; - -#ifndef __BORLANDC__ -#define S_ISDIR(s) ((s) & _S_IFDIR) -#endif - -#else /* _WIN32 */ -/* 16-bit windows stuff */ - -#include -#include -#include - - - -/* Getting cocky to support multiple file systems */ -typedef struct dirStruct_tag { - struct _find_t file_data; - char c_checkdrive; -} dirStruct; - -typedef struct DIR_Struct { - void * directoryPtr; - dirStruct data; -} DIR; - -#define _ST_FSTYPSZ 16 -typedef unsigned long mode_t; -typedef long uid_t; -typedef long gid_t; -typedef long off_t; -typedef unsigned long nlink_t; - -typedef struct timestruc { - time_t tv_sec; /* seconds */ - long tv_nsec; /* and nanoseconds */ -} timestruc_t; - -struct dirent { /* data from readdir() */ - ino_t d_ino; /* inode number of entry */ - off_t d_off; /* offset of disk direntory entry */ - unsigned short d_reclen; /* length of this record */ -#ifdef XP_WIN32 - char d_name[_MAX_FNAME]; /* name of file */ -#else - char d_name[20]; /* name of file */ -#endif -}; - -#define S_ISDIR(s) ((s) & _S_IFDIR) - -#endif /* 16-bit windows */ - -#define CONST const - -#endif /* _WINDOWS */ - -#endif /* WINFILE_H */ diff --git a/include/xp.h b/include/xp.h deleted file mode 100644 index 83d18b0b3580..000000000000 --- a/include/xp.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - - -/* -xp.h - -This file is left around for backwards compatability. Nothing new should -be added to this file. Rather, add it to the client specific section or -the cross-platform specific area depending on what is appropriate. - --------------------------------------------------------------------------*/ -#ifndef _XP_H_ -#define _XP_H_ - -#include "xp_mcom.h" -#include "client.h" - -#ifdef HEAPAGENT - -#define MEM_DEBUG 1 -#define DEFINE_NEW_MACRO 1 -#include - -#endif /* HEAPAGENT */ - -#endif /* !_XP_H_ */ - diff --git a/include/xpgetstr.h b/include/xpgetstr.h deleted file mode 100644 index a6afc51a557a..000000000000 --- a/include/xpgetstr.h +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -#ifndef _XPGETSTR_H_ -#define _XPGETSTR_H_ -#include "prtypes.h" - -XP_BEGIN_PROTOS - -/**@name Platform Independent String Resources */ -/*@{*/ -/** - * Get a cross platform string resource by ID. - * - * This function makes localization easier for cross platform strings. - * The cross platfrom string resources are defined in allxpstr.h. - * You should use XP_GetString when: - *
    - *
  1. Any human readable string that not in front-end - *
  2. With the exception of HTML strings (use XP_GetStringForHTML) - *
  3. The translator/localizer will then translate the string defined - * in allxpstr.h and show the translated version to user. - *
- * The caller should make a copy of the returned string if it needs to use - * it for a while. The same memory buffer will be used to store - * another string the next time this function is called. The caller - * does not need to free the memory of the returned string. - * @param id Specifies the string resource ID - * @return Localized (translated) string - * @see XP_GetStringForHTML - * @see INTL_ResourceCharSet - */ -PUBLIC char *XP_GetString(int id); - -PUBLIC char *XP_CopyStringInUTF8(int id); -PUBLIC char *XP_CopyString(int id); -/** - * Get a cross platform HTML string resource by ID. - * - * This function makes localization easier for cross platform strings used - * for generating HTML. The cross platfrom string resources are defined in - * allxpstr.h. You should use XP_GetStringForHTML when: - *
    - *
  1. Human readable string not defined in front-end - *
  2. The code generates HTML page and will go into HTML window - *
  3. Only use this when the message will be generated into HTML. - *
  4. Only use this if you can access to the winCharSetID. - *
  5. This is needed because half of the text is generated from resource - * (in resource charset) and half of the text is coming from the net - * (in winCharSetID charset). When we meet this kind of mixing charset - * condition. We use this function instead of XP_GetString(). - *
- * - * The code checks the current CharSetID in the resource and the - * CharSetID of the data from the net. If they are equal, it returns the - * string defined in the resource, otherwise, it will return the English - * version. So a French client can display French if the data from the - * net is in the CharSetID of French and it will use half English and half - * Japanese if the French client receives Japanese data from the net. - * - * The caller should make a copy of the returned string if it needs to use - * it for a while. The same memory buffer will be used to store - * another string the next time this function get called. The caller - * does not need to free the memory of the returned string. - * - * @param id Specifies the string resource ID - * @param winCharSetID Specifies the winCharSetID of the HTML - * @param english Specifies the English string - * @return Localized (translated) string if the winCharSetID - * matches the CharSetID of the resource. Otherwise it - * returns the English message or the English string - * @see XP_GetStringForHTML - * @see INTL_ResourceCharSet - */ -PUBLIC char *XP_GetStringForHTML( - int id, - int16 winCharSetID, - char* english -); -/*@}*/ - -XP_END_PROTOS - -#endif