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

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

Webmaster