home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / edttypes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  23.0 KB  |  654 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /*
  20.  *  File defines external editor types.
  21.  *
  22.  * These types are remapped internally to the editor.
  23. */
  24.  
  25. #ifndef _edt_types_h_
  26. #define _edt_types_h_
  27.  
  28. #ifndef EDITOR_TYPES
  29. #define ED_Element void
  30. #define ED_Buffer void
  31. #define ED_TagCursor void
  32. #define ED_BitArray void
  33. #endif
  34.  
  35. #include "xp_core.h"
  36.  
  37. /* Number of "Netscape Colors" All are in 
  38.  * Color cube 
  39. */
  40. #define   MAX_NS_COLORS        70
  41.  
  42. typedef int32  ED_BufferOffset;
  43.  
  44. /*
  45.  * Handle to Internal structure used for maintaining links.
  46. */
  47. typedef struct ED_Link* ED_LinkId;
  48. #define ED_LINK_ID_NONE     0
  49.  
  50. /* this id is passed to FE_GetImageData.. when it returns, we know to pass
  51.  *  the call to EDT_SetImageData
  52. */
  53. #define ED_IMAGE_LOAD_HACK_ID -10
  54.  
  55. typedef enum {
  56.     ED_ELEMENT_NONE,            /* Not returned from EDT_GetCurrentElement, needed to have a "not known" value */
  57.     ED_ELEMENT_SELECTION,       /* a selection instead of a single element */
  58.     ED_ELEMENT_TEXT,
  59.     ED_ELEMENT_IMAGE,
  60.     ED_ELEMENT_HRULE,
  61.     ED_ELEMENT_UNKNOWN_TAG,
  62.     ED_ELEMENT_TARGET,
  63.     ED_ELEMENT_TABLE,           /* Keep these at the end so we can use type >= ED_ELEMENT_TABLE to test for any of them */
  64.     ED_ELEMENT_CELL,
  65.     ED_ELEMENT_ROW,             /* May not need these. Currently returning ED_ELEMENT_CELL instead */
  66.     ED_ELEMENT_COL
  67. } ED_ElementType;
  68.  
  69. typedef enum {
  70.     ED_CARET_BEFORE = 0,
  71.     ED_CARET_AFTER  = 1
  72. } ED_CaretObjectPosition;
  73.  
  74. #define TF_NONE         0
  75. #define TF_BOLD         1
  76. #define TF_ITALIC       2
  77. #define TF_FIXED        4
  78. #define TF_SUPER        8
  79. #define TF_SUB          0x10
  80. #define TF_STRIKEOUT    0x20
  81. #define TF_BLINK        0x40
  82. #define TF_FONT_COLOR   0x80     /* set if font has color */
  83. #define TF_FONT_SIZE    0x100    /* set if font has size */
  84. #define TF_HREF         0x200
  85. #define TF_SERVER       0x400
  86. #define TF_SCRIPT       0x800
  87. #define TF_STYLE        0x1000
  88. #define TF_UNDERLINE    0x2000
  89. #define TF_FONT_FACE    0x4000
  90. #define TF_NOBREAK      0x8000
  91. #define TF_SPELL        0x10000
  92. #define TF_INLINEINPUT  0x20000
  93. #define TF_INLINEINPUTTHICK  0x40000
  94. #define TF_INLINEINPUTDOTTED  0x80000
  95. #define TF_FONT_WEIGHT 0x100000
  96. #define TF_FONT_POINT_SIZE 0x200000
  97.  
  98. typedef int32 ED_TextFormat; /* Prefered type for the editor text format. */
  99. typedef ED_TextFormat ED_ETextFormat; /* Alias for old code. Remove when possible. */
  100.  
  101. /* Similar to ED_TextFormat. Used when multiple cells are represented in EDT_TableCellData */
  102.  
  103. #define CF_NONE         0
  104. #define CF_ALIGN        1
  105. #define CF_VALIGN       2
  106. #define CF_COLSPAN      4     
  107. #define CF_ROWSPAN      8    
  108. #define CF_HEADER       0x10 
  109. #define CF_NOWRAP       0x20 
  110. #define CF_WIDTH        0x40 
  111. #define CF_HEIGHT       0x80 
  112. #define CF_BACK_COLOR   0x100
  113. #define CF_BACK_IMAGE   0x200
  114. #define CF_BACK_NOSAVE  0x400
  115. #define CF_EXTRA_HTML   0x800
  116.  
  117. typedef int32 ED_CellFormat; /* Prefered type for the editor cell format. */
  118.  
  119. /*
  120.  * The names here are confusing, and have a historical basis that is
  121.  * lost in the mists of time. The trouble is that the "ED_ALIGN_CENTER"
  122.  * tag is really "abscenter", while the ED_ALIGN_ABSCENTER tag is
  123.  * really "center". (and the same for the TOP and BOTTOM tags.)
  124.  *
  125.  * Someday, if we have a lot of spare time we could switch the names. 
  126.  */
  127.  
  128. /* CLM: Swapped bottom and center tags -- should match latest extensions now?
  129.  *      Note: BASELINE is not written out (this is default display mode)
  130. */
  131. typedef enum {
  132.     ED_ALIGN_DEFAULT        = -1,
  133.     ED_ALIGN_CENTER         = 0,    /* abscenter    */
  134.     ED_ALIGN_LEFT           = 1,    /* left         */
  135.     ED_ALIGN_RIGHT          = 2,    /* right        */
  136.     ED_ALIGN_TOP            = 3,    /* texttop      */
  137.     ED_ALIGN_BOTTOM         = 4,    /* absbottom    */
  138.     ED_ALIGN_BASELINE       = 5,    /* baseline     */
  139.     ED_ALIGN_ABSCENTER      = 6,    /* center       */
  140.     ED_ALIGN_ABSBOTTOM      = 7,    /* bottom       */
  141.     ED_ALIGN_ABSTOP         = 8     /* top          */
  142. } ED_Alignment;
  143.  
  144.  
  145. /*------------------- TABLE SIZING AND SELECTION --------------------*/
  146.  
  147. /*  SizeStyle defines */
  148. #define  ED_SIZE_NONE           0
  149. #define  ED_SIZE_TOP            0x0001
  150. #define  ED_SIZE_RIGHT          0x0002
  151. #define  ED_SIZE_BOTTOM         0x0004
  152. #define  ED_SIZE_LEFT           0x0008
  153. #define  ED_SIZE_ADD_ROWS       0x0010
  154. #define  ED_SIZE_ADD_COLS       0x0020
  155.  
  156. /*  Hotspot at corners */
  157. #define  ED_SIZE_TOP_RIGHT      (ED_SIZE_TOP | ED_SIZE_RIGHT)
  158. #define  ED_SIZE_BOTTOM_RIGHT   (ED_SIZE_BOTTOM | ED_SIZE_RIGHT)
  159. #define  ED_SIZE_TOP_LEFT       (ED_SIZE_TOP | ED_SIZE_LEFT)
  160. #define  ED_SIZE_BOTTOM_LEFT    (ED_SIZE_BOTTOM | ED_SIZE_LEFT)
  161.  
  162. typedef intn ED_SizeStyle;
  163.  
  164. typedef enum {                /* Return value for EDT_GetTableHitRegion) */
  165.     ED_HIT_NONE,
  166.     ED_HIT_SEL_TABLE,         /* Upper left corner */
  167.     ED_HIT_SEL_COL,           /* Near top table border */
  168.     ED_HIT_SEL_ROW,           /* Near left table border */
  169.     ED_HIT_SEL_CELL,          /* Near top cell border */
  170.     ED_HIT_SEL_ALL_CELLS,     /* Upper left corner when Ctrl is pressed */
  171.     ED_HIT_SIZE_TABLE_WIDTH,  /* Near right table border */
  172.     ED_HIT_SIZE_TABLE_HEIGHT, /* Near bottom table border */
  173.     ED_HIT_SIZE_COL,          /* Near right border of a cell and between columns */
  174.     ED_HIT_SIZE_ROW,          /* Near bottom border of a cell and between columns */
  175.     ED_HIT_ADD_ROWS,          /* Lower left corner */
  176.     ED_HIT_ADD_COLS,          /* Lower right corner */
  177.     ED_HIT_DRAG_TABLE,        /* Near bottom border and between rows when table or cell is already selected */
  178.     ED_HIT_CHANGE_COLSPAN,    /* Near Right border of cell having COLSPAN (Not used yet) */
  179.     ED_HIT_CHANGE_ROWSPAN     /* Bottom edge of cell having ROWSPAN (Not used yet) */
  180. } ED_HitType;
  181.  
  182. typedef enum {             /* Return types for EDT_GetTableDragDropRegion */
  183.     ED_DROP_NONE,               /* Don't allow drop - when pasting wouldn't change anything */
  184.     ED_DROP_NORMAL,             /* No special table behavior - do the same as any HTML drop */
  185.     ED_DROP_INSERT_BEFORE,      /* Between columns - near left border of cell when source = column */
  186.     ED_DROP_INSERT_AFTER,       /* Between columns - near right border of cell when source = column */
  187.     ED_DROP_INSERT_ABOVE,       /* Between rows - near top border of cell when source = row */
  188.     ED_DROP_INSERT_BELOW,       /* Between rows - near bottom border of cell when source = row */
  189.     ED_DROP_REPLACE_CELL,       /* Inside cell - when we want to replace cell contents */
  190.     ED_DROP_APPEND_CONTENTS     /* Inside cell - when we append to existing contents */
  191. } ED_DropType;
  192.  
  193. struct _EDT_DragTableData {
  194.     ED_HitType  iSourceType;         /* One of the ED_HIT_SEL_... enums */
  195.     ED_DropType iDropType;           /* One of above enum values */
  196.     LO_Element  *pFirstSelectedCell; /* First cell in source being dragged */
  197.     LO_Element  *pDragOverCell;      /* Cell being dragged over */
  198.     intn         iRows;              /* Number of rows */
  199.     intn         iColumns;           /*  and columns in selection */
  200.     int32        X;                  /* Location to place highlighting or make caret */
  201.     int32        Y;                  /*  to show where to drop cells */
  202.     int32        iWidth;
  203.     int32        iHeight;
  204. };
  205. typedef struct _EDT_DragTableData EDT_DragTableData;
  206.  
  207.  
  208. typedef enum {             /* Return values from EDT_GetMergeCellsType */
  209.     ED_MERGE_NONE,
  210.     ED_MERGE_NEXT_CELL,
  211.     ED_MERGE_SELECTED_CELLS
  212. } ED_MergeType;
  213.  
  214. /* Used with EDT_ChangeTableSelection to tell if we should move
  215.  *   to next Cell, Row, or Columns along with changing the selected cells
  216. */
  217. typedef enum {             
  218.     ED_MOVE_NONE,
  219.     ED_MOVE_PREV,
  220.     ED_MOVE_NEXT
  221. } ED_MoveSelType;
  222.  
  223. /*--------------------------- HREF --------------------------------*/
  224.  
  225. struct _EDT_HREFData {
  226.     char *pURL;
  227.     char *pExtra;
  228. };
  229.  
  230. typedef struct _EDT_HREFData EDT_HREFData;
  231.  
  232. /*--------------------------- Image --------------------------------*/
  233.  
  234. struct _EDT_ImageData {
  235.     XP_Bool bIsMap;        
  236. /*    char *pUseMap;  created with XP_ALLOC()    Now in pExtra, hardts */
  237.     ED_Alignment align;
  238.     char *pSrc;         
  239.     char *pLowSrc;
  240.     char *pName;
  241.     char *pAlt;
  242.     int32  iWidth;
  243.     int32  iHeight;
  244.     XP_Bool bWidthPercent;         /* Range: 1 - 100 if TRUE, else = pixels (default) */
  245.     XP_Bool bHeightPercent;
  246.     int32 iHSpace;
  247.     int32 iVSpace;
  248.     int32 iBorder;
  249. /* Added hardts */
  250.     XP_Bool bNoSave;
  251. /* Added by CLM: */
  252.     int32  iOriginalWidth;        /* Width and Height we got on initial loading */
  253.     int32  iOriginalHeight;
  254.     EDT_HREFData *pHREFData;
  255.     char *pExtra;
  256. };
  257.  
  258. typedef struct _EDT_ImageData EDT_ImageData;
  259.  
  260. /*--------------------------- Target --------------------------------*/
  261.  
  262. struct _EDT_TargetData {
  263.     char *pName;
  264.     char *pExtra;
  265. };
  266.  
  267. typedef struct _EDT_TargetData EDT_TargetData;
  268.  
  269. /*--------------------------- Character  --------------------------------*/
  270. #define ED_FONT_POINT_SIZE_DEFAULT 0
  271. #define ED_FONT_POINT_SIZE_MIN 1
  272. #define ED_FONT_POINT_SIZE_MAX 1000
  273.  
  274. #define ED_FONT_WEIGHT_MIN 100
  275. #define ED_FONT_WEIGHT_NORMAL 400
  276. #define ED_FONT_WEIGHT_BOLD 700
  277. #define ED_FONT_WEIGHT_MAX 900
  278.  
  279. enum {
  280.     ED_FONT_VARIABLE,
  281.     ED_FONT_FIXED,
  282.     ED_FONT_LOCAL
  283. };
  284.  
  285. struct _EDT_CharacterData {
  286.     ED_TextFormat mask;             /* bits to set or get */
  287.     ED_TextFormat values;           /* values of the bits in the mask */
  288.     LO_Color *pColor;               /* color if mask bit is set */
  289.     int32 iSize;                    /* size if mask bit is set */
  290.     EDT_HREFData *pHREFData;        /* href if mask bit is set */
  291.     ED_LinkId linkId;               /* internal use only */
  292.     char* pFontFace;                /* FontFace name */
  293.     int16  iWeight;                 /* font weight range = 100-900, 400=Normal, 700=Bold*/
  294.     int16  iPointSize;              /* not sure what default is! Use 0 to mean "default" */
  295. };
  296.  
  297. typedef struct _EDT_CharacterData EDT_CharacterData;
  298.  
  299. /*--------------------------- Horizonal Rule --------------------------------*/
  300.  
  301. struct _EDT_HorizRuleData {
  302.     ED_Alignment align;         /* only allows left and right alignment */
  303.     int32  size;                  /* value 1 to 100 indicates line thickness */     
  304.     int32  iWidth;                /* CM: default = 100% */
  305.     XP_Bool bWidthPercent;         /* Range: 1 - 100 if TRUE(default), else = pixels */
  306.     XP_Bool bNoShade;              
  307.     char *pExtra;
  308. };
  309.  
  310. typedef struct _EDT_HorizRuleData EDT_HorizRuleData;
  311.  
  312. /*--------------------------- ContainerData --------------------------------*/
  313.  
  314. struct _EDT_ContainerData {
  315.     ED_Alignment align;         /* only allows left and right alignment */
  316.     char *pExtra;
  317. };
  318.  
  319. typedef struct _EDT_ContainerData EDT_ContainerData;
  320.  
  321. /*--------------------------- TableData --------------------------------*/
  322.  
  323. struct _EDT_TableData {
  324.     ED_Alignment align; /* ED_ALIGN_LEFT, ED_ALIGN_ABSCENTER, ED_ALIGN_RIGHT */
  325.     ED_Alignment malign; /* margin alignment: ED_ALIGN_DEFAULT, ED_ALIGN_LEFT, ED_ALIGN_RIGHT */
  326.     XP_Bool bUseCols; /* TRUE means COLS= will be output, which speeds up layout in 4.0 */
  327.     int32 iRows;
  328.     int32 iColumns;
  329.     XP_Bool bBorderWidthDefined;
  330.     int32 iBorderWidth;
  331.     int32 iCellSpacing;
  332.     int32 iCellPadding;
  333.     int32 iInterCellSpace;
  334.     XP_Bool bWidthDefined;
  335.     XP_Bool bWidthPercent;
  336.     int32 iWidth;
  337.     int32 iWidthPixels;
  338.     XP_Bool bHeightDefined;
  339.     XP_Bool bHeightPercent;
  340.     int32 iHeight;
  341.     int32 iHeightPixels;
  342.     LO_Color *pColorBackground;     /* null in the default case */
  343.     char *pBackgroundImage; /* null in the default case */
  344.     XP_Bool bBackgroundNoSave;
  345.     char *pExtra;
  346. };
  347.  
  348. typedef struct _EDT_TableData EDT_TableData;
  349.  
  350. /* iTableMode param for SetTableMode() */
  351. #define ED_TABLE_PERCENT           0x0001   /* Convert table and all cells to use % of parent width */
  352. #define ED_TABLE_PIXELS            0x0002   /* Convert table and all cells to use absolute pixels */
  353. #define ED_TABLE_USE_CELL_WIDTH    0x0004   /* Set WIDTH param for all cells (facilitates table resizing) */
  354. #define ED_TABLE_NO_CELL_WIDTH     0x0008   /* Remove WIDTH param for all cells */
  355. #define ED_TABLE_USE_COLS          0x0010   /* Set COLS param for table (use only 1st row for column widths) */
  356. #define ED_TABLE_NO_COLS           0x0020   /* Remove COLS param for table (all cell widths used) */
  357.  
  358. /*--------------------------- TableCaptionData --------------------------------*/
  359.  
  360. struct _EDT_TableCaptionData {
  361.     ED_Alignment align;
  362.     char *pExtra;
  363. };
  364.  
  365. typedef struct _EDT_TableCaptionData EDT_TableCaptionData;
  366.  
  367. /*--------------------------- TableRowData --------------------------------*/
  368.  
  369. struct _EDT_TableRowData {
  370.     ED_Alignment align;
  371.     ED_Alignment valign;
  372.     LO_Color *pColorBackground;     /* null in the default case */
  373.     char *pBackgroundImage; /* null in the default case */
  374.     XP_Bool bBackgroundNoSave;
  375.     char *pExtra;
  376. };
  377.  
  378. typedef struct _EDT_TableRowData EDT_TableRowData;
  379.  
  380. /*--------------------------- TableCellData --------------------------------*/
  381.  
  382. struct _EDT_TableCellData {
  383.     ED_CellFormat mask;             /* bits to tell us what we know for all cells */
  384.     ED_HitType iSelectionType;      /* Either: ED_HIT_SEL_CELL, ED_HIT_SEL_COL, ED_HIT_SEL_ROW, or ED_HIT_NONE */
  385.     intn iSelectedCount;            /* Number of cells selected. Usually >= 1 */
  386.     ED_Alignment align;
  387.     ED_Alignment valign;
  388.     int32 iColSpan;
  389.     int32 iRowSpan;
  390.     XP_Bool bHeader; /* TRUE == th, FALSE == td */
  391.     XP_Bool bNoWrap;
  392.     int32 X;
  393.     int32 Y;
  394.     intn  iRow;
  395.     XP_Bool bWidthDefined;
  396.     XP_Bool bWidthPercent;
  397.     int32 iWidth;
  398.     int32 iWidthPixels;
  399.     XP_Bool bHeightDefined;
  400.     XP_Bool bHeightPercent;
  401.     int32 iHeight;
  402.     int32 iHeightPixels;
  403.     LO_Color *pColorBackground;     /* null in the default case */
  404.     char *pBackgroundImage; /* null in the default case */
  405.     XP_Bool bBackgroundNoSave;
  406.     char *pExtra;
  407. };
  408.  
  409. typedef struct _EDT_TableCellData EDT_TableCellData;
  410.  
  411. /*--------------------------- LayerData --------------------------------*/
  412.  
  413. struct _EDT_LayerData {
  414.     char *pExtra;
  415. };
  416.  
  417. typedef struct _EDT_LayerData EDT_LayerData;
  418.  
  419. /*--------------------------- DivisionData --------------------------------*/
  420.  
  421. struct _EDT_DivisionData {
  422.     ED_Alignment align;
  423.     char *pExtra;
  424. };
  425.  
  426. typedef struct _EDT_DivisionData EDT_DivisionData;
  427.  
  428. /*--------------------------- Page Properties --------------------------------*/
  429. struct _EDT_MetaData {
  430.     XP_Bool bHttpEquiv;        /* true, http-equiv="fdsfds", false name="fdsfds" */
  431.     char *pName;            /* http-equiv's or name's value */
  432.     char *pContent;
  433. };
  434.  
  435. typedef struct _EDT_MetaData EDT_MetaData;
  436.  
  437. struct _EDT_PageData {
  438.     LO_Color *pColorBackground;     /* null in the default case */
  439.     LO_Color *pColorLink;
  440.     LO_Color *pColorText;
  441.     LO_Color *pColorFollowedLink;
  442.     LO_Color *pColorActiveLink;
  443.     char *pBackgroundImage;
  444.     XP_Bool bBackgroundNoSave;
  445.     char *pFontDefURL; /* For Web Fonts. */
  446.     XP_Bool bFontDefNoSave;
  447.     char *pTitle;
  448.     XP_Bool bKeepImagesWithDoc;
  449. };
  450.  
  451. typedef struct _EDT_PageData EDT_PageData;
  452.  
  453. typedef enum {
  454.     ED_COLOR_BACKGROUND,
  455.     ED_COLOR_LINK,
  456.     ED_COLOR_TEXT,
  457.     ED_COLOR_FOLLOWED_LINK
  458. } ED_EColor;
  459.  
  460. /*
  461.  * CLM: Java and PlugIn data structures
  462. */
  463.  struct _EDT_ParamData {
  464.     char *pName;
  465.     char *pValue;
  466. };
  467. typedef struct _EDT_ParamData EDT_ParamData;
  468.  
  469. typedef int32 EDT_ParamID;
  470.  
  471. struct _EDT_PlugInData {
  472.     EDT_ParamID   ParamID;               /* Identifies which Param list is associated */
  473.     char          *pSrc;
  474.     XP_Bool          bHidden;
  475.     ED_Alignment  align;
  476.     int32           iWidth;
  477.     int32           iHeight;
  478.     XP_Bool          bWidthPercent;         /* Range: 1 - 100 if TRUE, else = pixels default) */
  479.     XP_Bool          bHeightPercent;
  480.     XP_Bool          bForegroundPalette;    /* PC systems only. For controling 256-color palette wars */
  481.     int32           iHSpace;
  482.     int32           iVSpace;
  483.     int32           iBorder;
  484. };
  485. typedef struct _EDT_PlugInData EDT_PlugInData;
  486.  
  487. struct _EDT_JavaData {
  488.     EDT_ParamID   ParamID;
  489.     char          *pCode;
  490.     char          *pCodebase;
  491.     char          *pName;
  492.     ED_Alignment  align;
  493.     char          *pSrc;
  494.     int32           iWidth;
  495.     int32           iHeight;
  496.     XP_Bool          bWidthPercent;         /* Range: 1 - 100 if TRUE, else = pixels default) */
  497.     XP_Bool          bHeightPercent;
  498.     int32           iHSpace;
  499.     int32           iVSpace;
  500.     int32           iBorder;
  501. };
  502. typedef struct _EDT_JavaData EDT_JavaData;
  503.  
  504. /* CLM: Error codes for file writing
  505.  *      Return 0 if no error
  506.  */
  507. typedef enum {
  508.     ED_ERROR_NONE,
  509.     ED_ERROR_READ_ONLY,           /* File is marked read-only */
  510.     ED_ERROR_BLOCKED,             /* Can't write at this time, edit buffer blocked */
  511.     ED_ERROR_BAD_URL,             /* URL was not a "file:" type or no string */
  512.     ED_ERROR_FILE_OPEN,
  513.     ED_ERROR_FILE_WRITE,
  514.     ED_ERROR_CREATE_BAKNAME,
  515.     ED_ERROR_DELETE_BAKFILE,
  516.     ED_ERROR_FILE_RENAME_TO_BAK,
  517.     ED_ERROR_CANCEL,
  518.     ED_ERROR_FILE_EXISTS,         /* We really didn't save -- file existed and no overwrite */
  519.     ED_ERROR_SRC_NOT_FOUND,
  520.     ED_ERROR_FILE_READ,
  521.  
  522.     /* The following are used internally by the editor and will not be passed to the front end. */
  523.     ED_ERROR_PUBLISHING,          /* When netlib encounters an error http or ftp publishing. */
  524.     ED_ERROR_TAPEFS_COMPLETION    /* The tape file system for saving encountered an error when
  525.                                      the Complete() method was called.  E.g. an error sending a 
  526.                                      mail message. */          
  527. } ED_FileError;
  528.  
  529. typedef enum {
  530.     ED_TAG_OK,
  531.     ED_TAG_UNOPENED,
  532.     ED_TAG_UNCLOSED,
  533.     ED_TAG_UNTERMINATED_STRING,
  534.     ED_TAG_PREMATURE_CLOSE,
  535.     ED_TAG_TAGNAME_EXPECTED
  536. } ED_TagValidateResult;
  537.  
  538. typedef enum {
  539.     ED_LIST_TYPE_DEFAULT,
  540.     ED_LIST_TYPE_DIGIT,         
  541.     ED_LIST_TYPE_BIG_ROMAN,
  542.     ED_LIST_TYPE_SMALL_ROMAN,
  543.     ED_LIST_TYPE_BIG_LETTERS,
  544.     ED_LIST_TYPE_SMALL_LETTERS,
  545.     ED_LIST_TYPE_CIRCLE,
  546.     ED_LIST_TYPE_SQUARE,
  547.     ED_LIST_TYPE_DISC,
  548.     ED_LIST_TYPE_CITE /* For Mail Quoting */
  549. } ED_ListType;
  550.  
  551.  
  552. struct _EDT_ListData {
  553.     /* This should be TagType, but there are problems with the include file dependencies. */
  554.     int8 iTagType;              /* P_UNUM_LIST, P_NUM_LIST, P_BLOCKQUOTE, */
  555.                                 /* P_DIRECTOR, P_MENU, P_DESC_LIST */
  556.     XP_Bool bCompact;
  557.     ED_ListType eType;
  558.     int32 iStart;                /* automatically maps, start is one */
  559.     char *pBaseURL;              /* If an ED_LIST_TYPE_CITE, this is the URL from the enclosing <BASE> tag. 
  560.                                     Don't expose this to users because not actually written out in the HTML. */
  561.     char *pExtra;
  562. };
  563.  
  564. typedef struct _EDT_ListData EDT_ListData;
  565.  
  566. typedef enum {
  567.     ED_BREAK_NORMAL,            /* just break the line, ignore images */
  568.     ED_BREAK_LEFT,              /* break so it passes the image on the left */
  569.     ED_BREAK_RIGHT,             /* break past the right image */
  570.     ED_BREAK_BOTH               /* break past both images */
  571. } ED_BreakType;
  572.  
  573. typedef enum {
  574.     ED_SAVE_OVERWRITE_THIS,
  575.     ED_SAVE_OVERWRITE_ALL,
  576.     ED_SAVE_DONT_OVERWRITE_THIS,
  577.     ED_SAVE_DONT_OVERWRITE_ALL,
  578.     ED_SAVE_CANCEL
  579. } ED_SaveOption;
  580.  
  581. /* After saving, what to do with the editor buffer. */
  582. typedef enum {
  583.     ED_FINISHED_GOTO_NEW,       /* Point the editor to the location of the 
  584.                                    newly saved document. */
  585.     ED_FINISHED_REVERT_BUFFER,  /* Revert the buffer to the state before
  586.                                    the save operation began. */
  587.     ED_FINISHED_SAVE_DRAFT,     /* Like ED_FINISHED_REVERT_BUFFER, except clears the dirty flag
  588.                                    on success. */
  589.     ED_FINISHED_MAIL_SEND      /*  If we succeed we're going to throw the buffer
  590.                                    away, so don't revert it.  If failure, revert the buffer.
  591.                                    Used for mail compose, we don't 
  592.                                    want the editor to start any operation that 
  593.                                    causes problems when libmsg destroys the editor
  594.                                    context. */
  595. } ED_SaveFinishedOption;
  596.  
  597.  
  598. /* For FE_SaveDialogCreate */
  599. typedef enum {
  600.   ED_SAVE_DLG_SAVE_LOCAL,  /* "saving files to local disk" */
  601.   ED_SAVE_DLG_PUBLISH,     /* "uploading files to remote server" */
  602.   ED_SAVE_DLG_PREPARE_PUBLISH /* "preparing files to publish" */
  603. } ED_SaveDialogType;
  604.  
  605. typedef int32 EDT_ClipboardResult;
  606. #define EDT_COP_OK 0
  607. #define EDT_COP_DOCUMENT_BUSY 1
  608. #define EDT_COP_SELECTION_EMPTY 2
  609. #define EDT_COP_SELECTION_CROSSES_TABLE_DATA_CELL 3
  610. /* For the result EDT_COP_CLIPBOARD_BAD the XP code has already
  611.  * given the user an error dialog. So FE code should not
  612.  * give an additional error dialog. (Only occurs on
  613.  * paste and paste-like operations.)
  614.  */
  615. #define EDT_COP_CLIPBOARD_BAD 4
  616.  
  617.  
  618. #ifdef FIND_REPLACE
  619.  
  620. #define ED_FIND_FIND_ALL_WORDS  1       /* used to enumerate all words in a */
  621.                                         /*  buffer */
  622. #define ED_FIND_MATCH_CASE      2       /* default is to ignore case */
  623. #define ED_FIND_REPLACE         4       /* call back the replace routine */
  624. #define ED_FIND_WHOLE_BUFFER    8       /* start search from the top */
  625. #define ED_FIND_REVERSE         0x10    /* reverse search from this point */
  626.  
  627. typedef intn ED_FindFlags;
  628.  
  629. typedef void (*EDT_PFReplaceFunc)( void *pMWContext, 
  630.                                   char *pFoundWord, 
  631.                                   char **pReplaceWord );
  632.  
  633. struct _EDT_FindAndReplaceData {
  634.     char* pSearchString;
  635.     ED_FindFlags fflags;
  636.     EDT_PFReplaceFunc pfReplace;
  637. };
  638.  
  639. typedef struct _EDT_FindAndReplaceData EDT_FindAndReplaceData;
  640.  
  641. #endif /* FIND_REPLACE */
  642.  
  643. /* Callback function for image encoder */
  644.  
  645. typedef int32 EDT_ImageEncoderReference;
  646. typedef unsigned char EDT_ImageEncoderStatus;
  647. #define ED_IMAGE_ENCODER_OK 0
  648. #define ED_IMAGE_ENCODER_USER_CANCELED 1
  649. #define ED_IMAGE_ENCODER_EXCEPTION 2
  650.  
  651. typedef void (*EDT_ImageEncoderCallbackFn)(EDT_ImageEncoderStatus status, void* hook);
  652.  
  653. #endif
  654.