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

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.1       cvs         8: #ifndef AMAYA_H
                      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.38      cvs        37: #define HTAppVersion "V1.1a Beta"
1.25      cvs        38: 
1.36      cvs        39: #define URL_SEP '/'
                     40: #define URL_STR "/"
                     41: 
1.25      cvs        42: /* How are Network accesses provided ? */
                     43: #ifdef AMAYA_JAVA
                     44: #include "libjava.h"
                     45: #else
1.39      cvs        46: #ifdef AMAYA_ILU
                     47: #include "libilu.h"
                     48: #else
1.25      cvs        49: #include "libwww.h"
                     50: #endif
1.39      cvs        51: #endif
1.1       cvs        52: 
1.20      cvs        53: /* The different events for a DoubleClick */
                     54: typedef enum _DoubleClickEvent
                     55:   {
                     56:      DC_FALSE = 0,
                     57:      DC_TRUE = 1,
                     58:      DC_FORM_POST = 2,
1.37      cvs        59:      DC_FORM_GET = 4,
                     60:      DC_MAKEBOOK = 8
1.20      cvs        61:   }
                     62: DoubleClickEvent;
                     63: 
                     64: typedef char        AmayaReadChar ();
                     65: 
                     66: /*typedef void        *PresentationTarget; */
                     67: 
                     68: #define NO               0
                     69: #define YES              1
                     70: 
                     71: /* dialogue */
                     72: #define URLForm          1
1.29      cvs        73: #define OpenForm         2
                     74: #define URLName          3
                     75: #define LocalName        4
                     76: #define DirSelect        5
                     77: #define DocSelect        6
1.20      cvs        78: #define StopCommand      7
1.29      cvs        79: #define SaveForm         8
1.20      cvs        80: #define DirSave          9
                     81: #define DocSave         10
                     82: #define ToggleSave      11
1.29      cvs        83: #define NameSave        12
1.30      cvs        84: #define ImgDirSave      13
                     85: #define Label1          14
                     86: #define Label2          15
                     87: #define Label3          16
                     88: #define Label4          17
1.29      cvs        89: #define ConfirmForm     18
                     90: #define ConfirmText     19
1.20      cvs        91: #define AttrHREFForm    20
                     92: #define AttrHREFText    21
                     93: #define FormAnswer      22
                     94: #define AnswerText      24
                     95: #define NameText        25
                     96: #define PasswordText    26
1.30      cvs        97: #define FilterText      27
                     98: #define ClassForm       28
1.20      cvs        99: #define ClassSelect     29
                    100: #define AClassForm      30
1.30      cvs       101: #define AClassSelect    31
                    102: #define ConfirmSave     32
                    103: #define ConfirmSaveList 33
                    104: #define OptionMenu     34
1.33      cvs       105: #define About1         35
                    106: #define About2         36
                    107: #define About3         37
                    108: #define Version                38
                    109: #define FormAbout              39    
1.20      cvs       110: #define MAX_REF         40
                    111: 
1.11      cvs       112: /* The possible GET/POST/PUT request modes */
1.1       cvs       113: 
1.11      cvs       114: /*synchronous request*/
                    115: #define AMAYA_SYNC     1       /*0x000001 */  
                    116: /*synchronous request with incremental callbacks */
                    117: #define AMAYA_ISYNC    2       /*0x000010 */  
                    118: /*asynchronous request */
1.5       cvs       119: #define AMAYA_ASYNC    4       /*0x000100 */
1.11      cvs       120: /*asynchronous request with incremental callbacks */
1.5       cvs       121: #define AMAYA_IASYNC   8       /*0x001000 */
1.11      cvs       122: /* send the form using the POST HTTP method */
1.5       cvs       123: #define AMAYA_FORM_POST 16     /*0x010000 */
1.11      cvs       124: /* send the form using the GET HTTP method */
1.5       cvs       125: #define AMAYA_FORM_GET  32     /*0x100000 */
1.23      cvs       126: /* bypass caching */
                    127: #define AMAYA_NOCACHE  64
                    128: /* don't follow redirections */
                    129: #define AMAYA_NOREDIR  128
1.1       cvs       130: 
1.39      cvs       131: #if !defined(AMAYA_JAVA) && !defined(AMAYA_ILU)
1.26      cvs       132: /*
                    133:  * Flags to indicate the status of the network requests associated
                    134:  * to a document.
                    135:  */
                    136: 
                    137: #define AMAYA_NET_INACTIVE 1
                    138: #define AMAYA_NET_ERROR    2
                    139: #define AMAYA_NET_ACTIVE   4
                    140: #endif
                    141: 
1.25      cvs       142: /*
                    143:  * Flags for HTParse, specifying which parts of the URL are needed
                    144:  */
                    145: #define AMAYA_PARSE_ACCESS      16  /* Access scheme, e.g. "HTTP" */
                    146: #define AMAYA_PARSE_HOST        8   /* Host name, e.g. "www.w3.org" */
                    147: #define AMAYA_PARSE_PATH        4   /* URL Path, e.g. "pub/WWW/TheProject.html" */
                    148: #define AMAYA_PARSE_ANCHOR      2   /* Fragment identifier, e.g. "news" */
                    149: #define AMAYA_PARSE_PUNCTUATION 1   /* Include delimiters, e.g, "/" and ":" */
                    150: #define AMAYA_PARSE_ALL         31  /* All the parts */
1.1       cvs       151: 
1.14      cvs       152: THOT_EXPORT int          appArgc;
                    153: THOT_EXPORT char       **appArgv;
                    154: THOT_EXPORT char         TempFileDirectory[MAX_LENGTH];
                    155: THOT_EXPORT char         Answer_text[MAX_LENGTH];
                    156: THOT_EXPORT char         Answer_name[NAME_LENGTH];
                    157: THOT_EXPORT char         Answer_password[NAME_LENGTH];
                    158: THOT_EXPORT char         Display_password[NAME_LENGTH];
1.30      cvs       159: THOT_EXPORT char         ScanFilter[NAME_LENGTH]; /* to scan directories    */
1.14      cvs       160: THOT_EXPORT int          Lg_password;
                    161: THOT_EXPORT int          BaseDialog;
                    162: THOT_EXPORT char        *LastURLName;  /* last URL requested               */
                    163: THOT_EXPORT char        *DirectoryName;        /* local path of the document       */
                    164: THOT_EXPORT char        *DocumentName; /* document name                    */
1.30      cvs       165: THOT_EXPORT char        *ObjectName;   /* document name                    */
1.14      cvs       166: THOT_EXPORT char        *SaveImgsURL;  /* where to save remote Images      */
                    167: THOT_EXPORT char        *TargetName;
1.24      cvs       168: THOT_EXPORT boolean     SaveAsHTML;
                    169: THOT_EXPORT boolean     SaveAsText;
1.34      cvs       170: THOT_EXPORT boolean      CopyImages;   /* should we copy images in Save As */
                    171: THOT_EXPORT boolean      UpdateURLs;   /* should we update URLs in Save As */
1.14      cvs       172: THOT_EXPORT boolean      UserAnswer;
                    173: THOT_EXPORT int          ReturnOption;
                    174: THOT_EXPORT boolean      InNewWindow;
                    175: THOT_EXPORT Document     CurrentDocument;
                    176: THOT_EXPORT Document     SavingDocument;
                    177: THOT_EXPORT Document     SavingObject;
1.30      cvs       178: THOT_EXPORT char        *SavingFile;   /* complete path or URL of the document */
1.14      cvs       179: THOT_EXPORT Document     AttrHREFdocument;
                    180: THOT_EXPORT Element      AttrHREFelement;
                    181: THOT_EXPORT char        *AttrHREFvalue;
                    182: THOT_EXPORT Document     SelectionDoc;
                    183: THOT_EXPORT boolean      SelectionInPRE;
                    184: THOT_EXPORT boolean      SelectionInComment;
                    185: THOT_EXPORT boolean      SelectionInEM;
                    186: THOT_EXPORT boolean      SelectionInSTRONG;
                    187: THOT_EXPORT boolean      SelectionInCITE;
                    188: THOT_EXPORT boolean      SelectionInDFN;
                    189: THOT_EXPORT boolean      SelectionInCODE;
                    190: THOT_EXPORT boolean      SelectionInVAR;
                    191: THOT_EXPORT boolean      SelectionInSAMP;
                    192: THOT_EXPORT boolean      SelectionInKBD;
                    193: THOT_EXPORT boolean      SelectionInI;
                    194: THOT_EXPORT boolean      SelectionInB;
                    195: THOT_EXPORT boolean      SelectionInTT;
1.15      cvs       196: THOT_EXPORT boolean      SelectionInU;
1.14      cvs       197: THOT_EXPORT boolean      SelectionInSTRIKE;
                    198: THOT_EXPORT boolean      SelectionInBIG;
                    199: THOT_EXPORT boolean      SelectionInSMALL;
1.1       cvs       200: 
1.40    ! cvs       201: #define DOC_HISTORY_SIZE 50
        !           202: typedef char*           anHistory[DOC_HISTORY_SIZE];
        !           203: 
1.1       cvs       204: #define DocumentTableLength 10
1.14      cvs       205: THOT_EXPORT char        *DocumentURLs[DocumentTableLength];
1.5       cvs       206: 
1.1       cvs       207: /* The whole document is loaded when the corresponding value
                    208:    in FilesLoading is equal to 0 */
1.14      cvs       209: THOT_EXPORT int          FilesLoading[DocumentTableLength];
1.26      cvs       210: /* Gives the status (error, success) of the download of the objects of
                    211:    a document */
1.40    ! cvs       212: 
        !           213: THOT_EXPORT anHistory   DocHistory[DocumentTableLength];
        !           214: THOT_EXPORT int                 DocHistoryIndex[DocumentTableLength];
        !           215: 
1.39      cvs       216: #if !defined(AMAYA_JAVA) && !defined(AMAYA_ILU)
1.26      cvs       217: THOT_EXPORT int          DocNetworkStatus[DocumentTableLength];
                    218: #endif
1.14      cvs       219: THOT_EXPORT Document     W3Loading;    /* the document being loaded */
                    220: THOT_EXPORT int          IButton;
                    221: THOT_EXPORT int          BButton;
                    222: THOT_EXPORT int          TTButton;
1.5       cvs       223: 
1.1       cvs       224: #define IMAGE_NOT_LOADED       0
                    225: #define IMAGE_LOCAL            1
                    226: #define IMAGE_LOADED           2
                    227: #define IMAGE_MODIFIED         3
                    228: 
1.27      cvs       229: #ifdef __STDC__
                    230: typedef void (*LoadedImageCallback)(Document doc, Element el, char *file,
                    231:                                   void *extra);
                    232: #else
                    233: typedef void (*LoadedImageCallback)();
                    234: #endif
                    235: 
1.5       cvs       236: typedef struct _ElemImage
                    237:   {
1.27      cvs       238:      Element             currentElement;/* first element using this image */
1.5       cvs       239:      struct _ElemImage  *nextElement;
1.27      cvs       240:      LoadedImageCallback callback;     /* Callback for non-standard handling */
                    241:      void              *extra;         /* any extra info for the CallBack */
1.5       cvs       242:   }
                    243: ElemImage;
                    244: 
                    245: typedef struct _LoadedImageDesc
                    246:   {
                    247:      char               *originalName; /* complete URL of the image             */
                    248:      char               *localName;    /* local name (without path) of the image   */
1.27      cvs       249:      struct _LoadedImageDesc *prevImage;/* double linked list */
                    250:      struct _LoadedImageDesc *nextImage;/* easier to unchain */
1.5       cvs       251:      Document            document;     /* document concerned                        */
                    252:      struct _ElemImage  *elImage;      /* first element using this image          */
1.27      cvs       253:      int                 status;       /* the status of the Image loading */
1.5       cvs       254:   }
                    255: LoadedImageDesc;
                    256: 
1.14      cvs       257: THOT_EXPORT LoadedImageDesc *ImageURLs;
1.31      cvs       258: THOT_EXPORT LoadedImageDesc *ImageLocal;
1.1       cvs       259: 
                    260: #define EOS     '\0'
                    261: #define EOL     '\n'
                    262: #define TAB     '\t'
                    263: #define SPACE    ' '
1.22      cvs       264: 
1.25      cvs       265: #endif /* AMAYA_H */
1.1       cvs       266: 

Webmaster