Return to amaya.h CVS log | Up to [Public] / Amaya / amaya |
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.22 cvs 11: 1.10 cvs 12: /* Thot interface */ 13: #include "thot_gui.h" 14: #include "thot_sys.h" 15: #include "app.h" 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" 29: 1.22 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: 36: /* libwww interface */ 1.2 cvs 37: #include "WWWLib.h" 38: #include "WWWApp.h" 39: #include "WWWHTTP.h" 40: #include "WWWInit.h" 41: #include "HTReqMan.h" 1.10 cvs 42: #include "HTReq.h" 1.2 cvs 43: #include "HTAncMan.h" 44: #include "HTAccess.h" 45: #include "HTEvntrg.h" 46: #include "HTAlert.h" 47: #include "HTNetMan.h" 48: #include "HTBInit.h" 1.5 cvs 49: #include "WWWHTTP.h" /* HTTP access module */ 1.2 cvs 50: #include "HTProxy.h" 1.1 cvs 51: 1.5 cvs 52: typedef char PathBuffer[MAX_PATH]; 1.1 cvs 53: 1.20 cvs 54: /* The different events for a DoubleClick */ 55: 56: typedef enum _DoubleClickEvent 57: { 58: DC_FALSE = 0, 59: DC_TRUE = 1, 60: DC_FORM_POST = 2, 61: DC_FORM_GET = 4 62: } 63: DoubleClickEvent; 64: 65: typedef char AmayaReadChar (); 66: 67: /*typedef void *PresentationTarget; */ 68: 69: #define NO 0 70: #define YES 1 71: 72: /* dialogue */ 73: #define URLForm 1 74: #define OpenForm 2 75: #define URLName 3 76: #define LocalName 4 77: #define DirSelect 5 78: #define DocSelect 6 79: #define StopCommand 7 80: #define SaveForm 8 81: #define DirSave 9 82: #define DocSave 10 83: #define ToggleSave 11 84: #define NameSave 12 85: #define Lbl1Save 13 86: #define Lbl2Save 14 87: #define ImgDirSave 14 88: #define Lbl3Save 15 89: #define Lbl4Save 16 90: #define Lbl5Save 17 91: #define ConfirmForm 18 92: #define ConfirmText 19 93: #define AttrHREFForm 20 94: #define AttrHREFText 21 95: #define FormAnswer 22 96: #define TextLabel 23 97: #define AnswerText 24 98: #define NameText 25 99: #define PasswordText 26 100: #define ClassForm 27 101: #define ClassLabel 28 102: #define ClassSelect 29 103: #define AClassForm 30 104: #define AClassLabel 31 105: #define AClassSelect 32 106: #define ConfirmSave 33 107: #define ConfirmSaveLbl 34 108: #define ConfirmSaveList 35 109: #define OptionMenu 36 110: #define MAX_REF 40 111: 112: #define MAX_LENGTH 512 113: #define NAME_LENGTH 32 114: #define HTAppName "amaya" 1.21 cvs 115: #define HTAppVersion "V1.0 Beta" 1.20 cvs 116: 1.5 cvs 117: typedef struct _AHTDocIdStatus 118: { 119: int docid; /* a docid */ 120: int counter; /* number of open requests associated with dicid */ 121: } 122: AHTDocId_Status; 123: 124: 125: typedef struct __AmayaContext 126: { 127: HTList *reqlist; /* List of current requests */ 128: HTList *docid_status; /* Status for each active docid */ 129: int open_requests; /* number of open requests */ 130: } 131: AmayaContext; 1.1 cvs 132: 1.11 cvs 133: /* The possible GET/POST/PUT request modes */ 1.1 cvs 134: 1.11 cvs 135: /*synchronous request*/ 136: #define AMAYA_SYNC 1 /*0x000001 */ 137: /*synchronous request with incremental callbacks */ 138: #define AMAYA_ISYNC 2 /*0x000010 */ 139: /*asynchronous request */ 1.5 cvs 140: #define AMAYA_ASYNC 4 /*0x000100 */ 1.11 cvs 141: /*asynchronous request with incremental callbacks */ 1.5 cvs 142: #define AMAYA_IASYNC 8 /*0x001000 */ 1.11 cvs 143: /* send the form using the POST HTTP method */ 1.5 cvs 144: #define AMAYA_FORM_POST 16 /*0x010000 */ 1.11 cvs 145: /* send the form using the GET HTTP method */ 1.5 cvs 146: #define AMAYA_FORM_GET 32 /*0x100000 */ 1.23 cvs 147: /* bypass caching */ 148: #define AMAYA_NOCACHE 64 149: /* don't follow redirections */ 150: #define AMAYA_NOREDIR 128 1.1 cvs 151: 1.11 cvs 152: /* the possible states for a request */ 1.5 cvs 153: 154: typedef enum _AHTReqStatus 155: { 1.11 cvs 156: HT_NEW = 0, /* new request */ 157: HT_NEW_PENDING = 1, /* new request, waiting for a socket */ 158: HT_WAITING = 2, /* active request, waiting for socket events */ 159: HT_BUSY = 4, /* the request is currently being processed */ 160: HT_END = 8, /* the request has ended */ 161: HT_ABORT = 16, /* user aborted the request */ 162: HT_ERR = 32 /* an error happened during the request */ 1.5 cvs 163: } 164: AHTReqStatus; 165: 1.22 cvs 166: #ifdef _WINDOWS 167: typedef int XtInputId; 168: #endif 169: 1.11 cvs 170: /* The structure used for requests */ 171: 1.5 cvs 172: typedef void TIcbf (void *request_context, const char *data_block, int data_block_size, int request_status); 173: 174: typedef void TTcbf (void *request_context, int request_status); 175: 176: typedef struct _AHTReqContext 177: { 178: HTRequest *request; /* Pointer to the associated request object */ 179: HTParentAnchor *anchor; 180: HTMethod method; /* What method are we envoking */ 1.11 cvs 181: int docid; /* docid to which this request belongs */ 1.5 cvs 182: AHTReqStatus reqStatus; /* status of the request */ 183: SockOps read_ops; /* The ops operation which must be used during 184: ** an Xt read callback */ 1.1 cvs 185: 1.5 cvs 186: SockOps write_ops; /* The ops operation which must be used during 187: ** an Xt write callback */ 1.1 cvs 188: 1.5 cvs 189: SockOps except_ops; /* The ops operation which must be used during 190: ** an Xt exception callback */ 1.1 cvs 191: 192: #ifdef WWW_XWINDOWS 1.5 cvs 193: XtInputId read_xtinput_id; /* The read xt event id assocciated with 194: the request */ 195: XtInputId write_xtinput_id; /* The write xt event id assocciated with 196: the request */ 197: XtInputId except_xtinput_id; /* The except xt event id assocciated with 198: the request */ 199: #endif /* WWW_XWINDOWS */ 1.20 cvs 200: 201: /*** Experimental ****/ 1.19 cvs 202: SOCKET read_sock; /* read socket associated with the request */ 203: SOCKET write_sock; /* write socket associated with the request */ 204: SOCKET except_sock; /* except socket associated with the request */ 1.20 cvs 205: /*** End of experimental stuff ****/ 206: 1.5 cvs 207: char *outputfile; /* file to receive incoming data */ 208: FILE *output; /* file pointer to outputfile */ 1.11 cvs 209: int mode; /* Mode of request: SYNC/ASYNC/IASYNC/FORM POST/FORM GET */ 1.5 cvs 210: char *urlName; /* url to retrieve/or that was retrieved */ 1.20 cvs 211: char status_urlName [MAX_LENGTH]; /* url name to be displayed on the status bar */ 1.5 cvs 212: TIcbf *incremental_cbf; /* For IASYNC mode, @ of callback function */ 213: /* It'll be called each time a new data package */ 214: /* is received */ 215: void *context_icbf; /* Context for the above cbf */ 216: TTcbf *terminate_cbf; /* optional CBF which will be invoked after */ 217: /* a file has been received */ 218: void *context_tcbf; /* Context for the above cbf */ 219: 220: /* The following elements are used for the PUT and POST */ 221: 222: HTParentAnchor *dest; /* Destination for PUT etc. */ 223: unsigned long block_size; /* size in bytes of the file to put */ 224: int put_counter; /* number of bytes already put */ 225: char *mem_ptr; /* ptr to a struct in mem which contains a copy */ 226: /* of the file to put */ 1.11 cvs 227: char *error_stream; /* pointer to an error message associated with the 228: request */ 229: int error_stream_size; /* size of the above message */ 230: boolean error_html; /* If TRUE, means the applications wants to display 231: error_stream. If false, error_stream is not 232: displayed at all */ 1.5 cvs 233: } 234: AHTReqContext; 1.1 cvs 235: 236: 1.14 cvs 237: THOT_EXPORT int appArgc; 238: THOT_EXPORT char **appArgv; 239: THOT_EXPORT char TempFileDirectory[MAX_LENGTH]; 240: THOT_EXPORT char Answer_text[MAX_LENGTH]; 241: THOT_EXPORT char Answer_name[NAME_LENGTH]; 242: THOT_EXPORT char Answer_password[NAME_LENGTH]; 243: THOT_EXPORT char Display_password[NAME_LENGTH]; 244: THOT_EXPORT int Lg_password; 245: THOT_EXPORT int BaseDialog; 246: THOT_EXPORT char *LastURLName; /* last URL requested */ 247: THOT_EXPORT char *DirectoryName; /* local path of the document */ 248: THOT_EXPORT char *DocumentName; /* document name */ 249: THOT_EXPORT char *ObjectName; /* document name */ 250: THOT_EXPORT char *SaveImgsURL; /* where to save remote Images */ 251: THOT_EXPORT char *TargetName; 1.24 ! cvs 252: THOT_EXPORT boolean SaveAsHTML; ! 253: THOT_EXPORT boolean SaveAsText; 1.14 cvs 254: THOT_EXPORT int CopyImages; /* should we copy images in Save As */ 255: THOT_EXPORT int UpdateURLs; /* should we update URLs in Save As */ 256: THOT_EXPORT boolean UserAnswer; 257: THOT_EXPORT int ReturnOption; 258: THOT_EXPORT boolean InNewWindow; 259: THOT_EXPORT Document CurrentDocument; 260: THOT_EXPORT Document SavingDocument; 261: THOT_EXPORT Document SavingObject; 262: THOT_EXPORT char *SavingFile; /* complete path or URL of the document */ 263: THOT_EXPORT Document AttrHREFdocument; 264: THOT_EXPORT Element AttrHREFelement; 265: THOT_EXPORT char *AttrHREFvalue; 266: THOT_EXPORT Document SelectionDoc; 267: THOT_EXPORT boolean SelectionInPRE; 268: THOT_EXPORT boolean SelectionInComment; 269: THOT_EXPORT boolean SelectionInEM; 270: THOT_EXPORT boolean SelectionInSTRONG; 271: THOT_EXPORT boolean SelectionInCITE; 272: THOT_EXPORT boolean SelectionInDFN; 273: THOT_EXPORT boolean SelectionInCODE; 274: THOT_EXPORT boolean SelectionInVAR; 275: THOT_EXPORT boolean SelectionInSAMP; 276: THOT_EXPORT boolean SelectionInKBD; 277: THOT_EXPORT boolean SelectionInI; 278: THOT_EXPORT boolean SelectionInB; 279: THOT_EXPORT boolean SelectionInTT; 1.15 cvs 280: THOT_EXPORT boolean SelectionInU; 1.14 cvs 281: THOT_EXPORT boolean SelectionInSTRIKE; 282: THOT_EXPORT boolean SelectionInBIG; 283: THOT_EXPORT boolean SelectionInSMALL; 1.1 cvs 284: 285: #define DocumentTableLength 10 1.14 cvs 286: THOT_EXPORT char *DocumentURLs[DocumentTableLength]; 1.5 cvs 287: 1.1 cvs 288: /* The whole document is loaded when the corresponding value 289: in FilesLoading is equal to 0 */ 1.14 cvs 290: THOT_EXPORT int FilesLoading[DocumentTableLength]; 291: THOT_EXPORT Document W3Loading; /* the document being loaded */ 292: THOT_EXPORT int IButton; 293: THOT_EXPORT int BButton; 294: THOT_EXPORT int TTButton; 1.5 cvs 295: 1.18 cvs 296: THOT_EXPORT char AmayaLastHTTPErrorMsg []; 297: 1.1 cvs 298: #define IMAGE_NOT_LOADED 0 299: #define IMAGE_LOCAL 1 300: #define IMAGE_LOADED 2 301: #define IMAGE_MODIFIED 3 302: 1.5 cvs 303: typedef struct _ElemImage 304: { 305: Element currentElement; /* first element using this image */ 306: struct _ElemImage *nextElement; 307: } 308: ElemImage; 309: 310: typedef struct _LoadedImageDesc 311: { 312: char *originalName; /* complete URL of the image */ 313: char *localName; /* local name (without path) of the image */ 314: struct _LoadedImageDesc *prevImage; 315: struct _LoadedImageDesc *nextImage; 316: Document document; /* document concerned */ 317: struct _ElemImage *elImage; /* first element using this image */ 318: int status; 319: } 320: LoadedImageDesc; 321: 1.14 cvs 322: THOT_EXPORT LoadedImageDesc *ImageURLs; 1.1 cvs 323: 1.14 cvs 324: THOT_EXPORT HTList *conv; /* List of global converters */ 325: THOT_EXPORT AmayaContext *Amaya; /* Amaya's request global context */ 1.1 cvs 326: 327: #define EOS '\0' 328: #define EOL '\n' 329: #define TAB '\t' 330: #define SPACE ' ' 1.22 cvs 331: 1.1 cvs 332: 333: #endif /* AMAYA_H */