Annotation of Amaya/amaya/amaya.h, revision 1.82

1.8       cvs         1: /*
                      2:  *
                      3:  *  (c) COPYRIGHT MIT and INRIA, 1996.
                      4:  *  Please first read the full copyright statement in file COPYRIGHT.
                      5:  *
                      6:  */
                      7: 
1.59      cvs         8: #ifndef AMAYA_H 
1.1       cvs         9: #define AMAYA_H
                     10: 
1.10      cvs        11: /* Thot interface */
1.81      cvs        12: #include "ustring.h"
1.10      cvs        13: #include "thot_gui.h"
                     14: #include "thot_sys.h"
1.79      cvs        15: #include "appstruct.h"
1.10      cvs        16: #include "application.h"
                     17: #include "attribute.h"
                     18: #include "browser.h"
                     19: #include "content.h"
                     20: #include "dialog.h"
                     21: #include "interface.h"
                     22: #include "libmsg.h"
                     23: #include "message.h"
                     24: #include "presentation.h"
                     25: #include "selection.h"
                     26: #include "reference.h"
                     27: #include "tree.h"
                     28: #include "view.h"
1.82    ! cvs        29: #include "undo.h"
1.10      cvs        30: 
1.1       cvs        31: /* Included headerfiles */
1.10      cvs        32: #include "EDITOR.h"
1.1       cvs        33: #include "HTML.h"
                     34: #include "amayamsg.h"
                     35: 
1.25      cvs        36: #define MAX_LENGTH     512
                     37: #define NAME_LENGTH     32
                     38: #define HTAppName "amaya"
1.77      cvs        39: #define HTAppVersion "V1.5"
1.25      cvs        40: 
1.36      cvs        41: #define URL_SEP '/'
                     42: #define URL_STR "/"
                     43: 
1.50      cvs        44: /* The structures used for request callbacks */
                     45: 
                     46: typedef void   TIcbf (Document doc, int status, char *urlName,
                     47:                      char *outputfile, const char *content_type,
                     48:                      const char *data_block, int data_block_size,
                     49:                      void *context);
                     50: 
                     51: typedef void  TTcbf (Document doc, int status, char *urlName,
                     52:                      char *outputfile, const char *content_type,
                     53:                      void *context);
                     54: 
1.25      cvs        55: /* How are Network accesses provided ? */
                     56: #ifdef AMAYA_JAVA
                     57: #include "libjava.h"
                     58: #else
1.39      cvs        59: #ifdef AMAYA_ILU
                     60: #include "libilu.h"
                     61: #else
1.25      cvs        62: #include "libwww.h"
                     63: #endif
1.39      cvs        64: #endif
1.1       cvs        65: 
1.66      cvs        66: /* The different events to open a new document */
1.41      cvs        67: typedef enum _ClickEvent {
1.73      cvs        68:   CE_ABSOLUTE, CE_RELATIVE, CE_FORM_POST, CE_FORM_GET,
                     69:   CE_HELP, CE_MAKEBOOK, CE_LOG
1.41      cvs        70: } ClickEvent;
1.20      cvs        71: 
                     72: #define NO               0
                     73: #define YES              1
                     74: 
                     75: /* dialogue */
                     76: #define URLForm          1
1.29      cvs        77: #define OpenForm         2
                     78: #define URLName          3
                     79: #define LocalName        4
                     80: #define DirSelect        5
                     81: #define DocSelect        6
1.20      cvs        82: #define StopCommand      7
1.29      cvs        83: #define SaveForm         8
1.20      cvs        84: #define DirSave          9
                     85: #define DocSave         10
                     86: #define ToggleSave      11
1.29      cvs        87: #define NameSave        12
1.30      cvs        88: #define ImgDirSave      13
                     89: #define Label1          14
                     90: #define Label2          15
                     91: #define Label3          16
                     92: #define Label4          17
1.29      cvs        93: #define ConfirmForm     18
                     94: #define ConfirmText     19
1.20      cvs        95: #define AttrHREFForm    20
                     96: #define AttrHREFText    21
                     97: #define FormAnswer      22
                     98: #define AnswerText      24
                     99: #define NameText        25
                    100: #define PasswordText    26
1.30      cvs       101: #define FilterText      27
                    102: #define ClassForm       28
1.20      cvs       103: #define ClassSelect     29
                    104: #define AClassForm      30
1.30      cvs       105: #define AClassSelect    31
                    106: #define ConfirmSave     32
                    107: #define ConfirmSaveList 33
                    108: #define OptionMenu     34
1.69      cvs       109: #define MAX_SUBMENUS    20
                    110: /* MAX_SUBMENUS references reserved for submenus of Option menu */
                    111: #define About1         55
                    112: #define About2         56
                    113: #define About3         57
                    114: #define Version                58
1.70      cvs       115: #define AboutForm              59
                    116: #define CSSForm         60
1.69      cvs       117: #define CSSSelect       61
1.70      cvs       118: #define TableForm       62
                    119: #define TableRows       63
                    120: #define TableCols       64
                    121: #define TableBorder     65
                    122: #define MAX_REF         66
1.20      cvs       123: 
1.11      cvs       124: /* The possible GET/POST/PUT request modes */
1.1       cvs       125: 
1.11      cvs       126: /*synchronous request*/
                    127: #define AMAYA_SYNC     1       /*0x000001 */  
                    128: /*synchronous request with incremental callbacks */
                    129: #define AMAYA_ISYNC    2       /*0x000010 */  
                    130: /*asynchronous request */
1.5       cvs       131: #define AMAYA_ASYNC    4       /*0x000100 */
1.11      cvs       132: /*asynchronous request with incremental callbacks */
1.5       cvs       133: #define AMAYA_IASYNC   8       /*0x001000 */
1.11      cvs       134: /* send the form using the POST HTTP method */
1.5       cvs       135: #define AMAYA_FORM_POST 16     /*0x010000 */
1.11      cvs       136: /* send the form using the GET HTTP method */
1.5       cvs       137: #define AMAYA_FORM_GET  32     /*0x100000 */
1.23      cvs       138: /* bypass caching */
                    139: #define AMAYA_NOCACHE  64
                    140: /* don't follow redirections */
                    141: #define AMAYA_NOREDIR  128
1.48      cvs       142: #ifndef AMAYA_JAVA
                    143: /* Prevents a stop race condition in ASYNC transfers */
                    144: #define AMAYA_ASYNC_SAFE_STOP  256
1.60      cvs       145: #define AMAYA_LOAD_CSS   512
1.67      cvs       146: #define AMAYA_FLUSH_REQUEST 1024
1.80      cvs       147: #define AMAYA_USE_PRECONDITIONS 2048
1.63      cvs       148: #else
                    149: #define AMAYA_ASYNC_SAFE_STOP  0
                    150: #define AMAYA_LOAD_CSS   0
1.80      cvs       151: #define AMAYA_USE_PRECONDITIONS 0
1.48      cvs       152: #endif /* ! AMAYA_JAVA */
1.26      cvs       153: /*
                    154:  * Flags to indicate the status of the network requests associated
                    155:  * to a document.
                    156:  */
                    157: 
                    158: #define AMAYA_NET_INACTIVE 1
                    159: #define AMAYA_NET_ERROR    2
                    160: #define AMAYA_NET_ACTIVE   4
                    161: 
1.25      cvs       162: /*
                    163:  * Flags for HTParse, specifying which parts of the URL are needed
                    164:  */
                    165: #define AMAYA_PARSE_ACCESS      16  /* Access scheme, e.g. "HTTP" */
                    166: #define AMAYA_PARSE_HOST        8   /* Host name, e.g. "www.w3.org" */
                    167: #define AMAYA_PARSE_PATH        4   /* URL Path, e.g. "pub/WWW/TheProject.html" */
                    168: #define AMAYA_PARSE_ANCHOR      2   /* Fragment identifier, e.g. "news" */
                    169: #define AMAYA_PARSE_PUNCTUATION 1   /* Include delimiters, e.g, "/" and ":" */
                    170: #define AMAYA_PARSE_ALL         31  /* All the parts */
1.1       cvs       171: 
1.14      cvs       172: THOT_EXPORT int          appArgc;
                    173: THOT_EXPORT char       **appArgv;
                    174: THOT_EXPORT char         TempFileDirectory[MAX_LENGTH];
                    175: THOT_EXPORT char         Answer_text[MAX_LENGTH];
                    176: THOT_EXPORT char         Answer_name[NAME_LENGTH];
                    177: THOT_EXPORT char         Answer_password[NAME_LENGTH];
                    178: THOT_EXPORT char         Display_password[NAME_LENGTH];
1.30      cvs       179: THOT_EXPORT char         ScanFilter[NAME_LENGTH]; /* to scan directories    */
1.14      cvs       180: THOT_EXPORT char        *LastURLName;  /* last URL requested               */
                    181: THOT_EXPORT char        *DirectoryName;        /* local path of the document       */
                    182: THOT_EXPORT char        *DocumentName; /* document name                    */
1.43      cvs       183: THOT_EXPORT char        *SavePath;     /* saving path                      */
                    184: THOT_EXPORT char        *SaveName;     /* saving name of the document      */
1.30      cvs       185: THOT_EXPORT char        *ObjectName;   /* document name                    */
1.14      cvs       186: THOT_EXPORT char        *SaveImgsURL;  /* where to save remote Images      */
                    187: THOT_EXPORT char        *TargetName;
1.45      cvs       188: THOT_EXPORT char        *SavingFile;   /* complete path or URL of the document */
                    189: THOT_EXPORT int          Lg_password;
                    190: THOT_EXPORT int          BaseDialog;
1.14      cvs       191: THOT_EXPORT int          ReturnOption;
1.70      cvs       192: THOT_EXPORT int          NumberRows;
                    193: THOT_EXPORT int          NumberCols;
                    194: THOT_EXPORT int          TBorder;
1.69      cvs       195: THOT_EXPORT int          ReturnOptionMenu;
1.14      cvs       196: THOT_EXPORT Document     CurrentDocument;
                    197: THOT_EXPORT Document     SavingDocument;
                    198: THOT_EXPORT Document     SavingObject;
                    199: THOT_EXPORT Document     AttrHREFdocument;
1.45      cvs       200: THOT_EXPORT Document     DocBook;
                    201: THOT_EXPORT Document     IncludedDocument;
1.14      cvs       202: THOT_EXPORT Element      AttrHREFelement;
                    203: THOT_EXPORT char        *AttrHREFvalue;
                    204: THOT_EXPORT Document     SelectionDoc;
1.45      cvs       205: THOT_EXPORT boolean     SaveAsHTML;
1.62      cvs       206: THOT_EXPORT boolean     SaveAsXML;
1.45      cvs       207: THOT_EXPORT boolean     SaveAsText;
                    208: THOT_EXPORT boolean      CopyImages;   /* should we copy images in Save As */
                    209: THOT_EXPORT boolean      UpdateURLs;   /* should we update URLs in Save As */
                    210: THOT_EXPORT boolean      UserAnswer;
                    211: THOT_EXPORT boolean      InNewWindow;
1.14      cvs       212: THOT_EXPORT boolean      SelectionInPRE;
                    213: THOT_EXPORT boolean      SelectionInComment;
                    214: THOT_EXPORT boolean      SelectionInEM;
                    215: THOT_EXPORT boolean      SelectionInSTRONG;
                    216: THOT_EXPORT boolean      SelectionInCITE;
1.56      cvs       217: THOT_EXPORT boolean      SelectionInABBR;
                    218: THOT_EXPORT boolean      SelectionInACRONYM;
1.57      cvs       219: THOT_EXPORT boolean      SelectionInINS;
                    220: THOT_EXPORT boolean      SelectionInDEL;
1.14      cvs       221: THOT_EXPORT boolean      SelectionInDFN;
                    222: THOT_EXPORT boolean      SelectionInCODE;
                    223: THOT_EXPORT boolean      SelectionInVAR;
                    224: THOT_EXPORT boolean      SelectionInSAMP;
                    225: THOT_EXPORT boolean      SelectionInKBD;
                    226: THOT_EXPORT boolean      SelectionInI;
                    227: THOT_EXPORT boolean      SelectionInB;
                    228: THOT_EXPORT boolean      SelectionInTT;
                    229: THOT_EXPORT boolean      SelectionInBIG;
                    230: THOT_EXPORT boolean      SelectionInSMALL;
1.53      cvs       231: typedef enum
                    232: {
                    233:   docHTML,
1.75      cvs       234:   docReadOnly,
1.74      cvs       235:   docText,
1.75      cvs       236:   docImage,
                    237:   docImageRO
1.53      cvs       238: } DocumentType;
1.64      cvs       239: 
                    240: 
                    241: /* a record for data associated with a request */
                    242: typedef struct _DocumentMetaDataElement
                    243: {
                    244:   char *form_data;  /* form data associated with a URL */
                    245:   ClickEvent method;  /* method used to send this data */
                    246: } DocumentMetaDataElement;
                    247: 
1.1       cvs       248: #define DocumentTableLength 10
1.14      cvs       249: THOT_EXPORT char        *DocumentURLs[DocumentTableLength];
1.64      cvs       250: /* Any formdata associated with a URL */
                    251: THOT_EXPORT DocumentMetaDataElement *DocumentMeta[DocumentTableLength];
1.41      cvs       252: /* TRUE if the document is displayed by help commands */
1.53      cvs       253: THOT_EXPORT DocumentType DocumentTypes[DocumentTableLength];
1.1       cvs       254: /* The whole document is loaded when the corresponding value
                    255:    in FilesLoading is equal to 0 */
1.14      cvs       256: THOT_EXPORT int          FilesLoading[DocumentTableLength];
1.26      cvs       257: /* Gives the status (error, success) of the download of the objects of
                    258:    a document */
1.42      cvs       259: 
1.26      cvs       260: THOT_EXPORT int          DocNetworkStatus[DocumentTableLength];
1.14      cvs       261: THOT_EXPORT Document     W3Loading;    /* the document being loaded */
1.65      cvs       262: THOT_EXPORT Document     BackupDocument;       /* the current backup */
1.14      cvs       263: THOT_EXPORT int          IButton;
                    264: THOT_EXPORT int          BButton;
                    265: THOT_EXPORT int          TTButton;
1.5       cvs       266: 
1.64      cvs       267: #define IMAGE_NOT_LOADED        0
1.1       cvs       268: #define IMAGE_LOCAL            1
                    269: #define IMAGE_LOADED           2
                    270: #define IMAGE_MODIFIED         3
                    271: 
1.27      cvs       272: #ifdef __STDC__
1.41      cvs       273: typedef void (*LoadedImageCallback)(Document doc, Element el, char *file, void *extra);
1.27      cvs       274: #else
                    275: typedef void (*LoadedImageCallback)();
                    276: #endif
1.5       cvs       277: typedef struct _ElemImage
                    278:   {
1.27      cvs       279:      Element             currentElement;/* first element using this image */
1.5       cvs       280:      struct _ElemImage  *nextElement;
1.27      cvs       281:      LoadedImageCallback callback;     /* Callback for non-standard handling */
                    282:      void              *extra;         /* any extra info for the CallBack */
1.5       cvs       283:   }
                    284: ElemImage;
                    285: 
                    286: typedef struct _LoadedImageDesc
                    287:   {
1.58      cvs       288:      char               *originalName; /* complete URL of the image                */
1.5       cvs       289:      char               *localName;    /* local name (without path) of the image   */
1.58      cvs       290:      struct _LoadedImageDesc *prevImage;/* double linked list                       */
                    291:      struct _LoadedImageDesc *nextImage;/* easier to unchain                        */
                    292:      Document            document;     /* document concerned                       */
                    293:      struct _ElemImage  *elImage;      /* first element using this image           */
                    294:      int                 imageType;     /* the type of the image                    */
                    295:      int                 status;       /* the status of the image loading          */
1.5       cvs       296:   }
                    297: LoadedImageDesc;
                    298: 
1.14      cvs       299: THOT_EXPORT LoadedImageDesc *ImageURLs;
1.31      cvs       300: THOT_EXPORT LoadedImageDesc *ImageLocal;
1.1       cvs       301: 
1.72      cvs       302: #define BROWSING       0
                    303: #define SELECTING      1
                    304: #define SEARCHING      2
                    305: #define VIEWS          3
                    306: #define CREATING       4
                    307: #define LINKS          5
                    308: #define CHANGING       6
                    309: #define TABLES         7
                    310: #define MATH           8
                    311: #define IMAGEMAPS      9
                    312: #define CSS           10
                    313: #define ATTRIBUTES    11
                    314: #define SPELLCHECKING 12
                    315: #define PUBLISHING    13
                    316: #define PRINTING      14
                    317: #define NUMBERING     15
                    318: #define MAKEBOOK      16
                    319: #define CONFIGURE     17
                    320: 
1.25      cvs       321: #endif /* AMAYA_H */
1.48      cvs       322: 
                    323: 
                    324: 
                    325: 
                    326: 
                    327: 
                    328: 
                    329: 
                    330: 
                    331: 
1.1       cvs       332: 

Webmaster