Annotation of Amaya/amaya/amaya.h, revision 1.97
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"
1.79 cvs 14: #include "appstruct.h"
1.10 cvs 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"
1.82 cvs 28: #include "undo.h"
1.1 cvs 29: /* Included headerfiles */
1.10 cvs 30: #include "EDITOR.h"
1.1 cvs 31: #include "HTML.h"
1.84 cvs 32: #include "TextFile.h"
1.1 cvs 33: #include "amayamsg.h"
34:
1.25 cvs 35: #define MAX_LENGTH 512
36: #define NAME_LENGTH 32
37: #define HTAppName "amaya"
1.97 ! cvs 38: #define HTAppVersion "V2.0a"
1.25 cvs 39:
1.36 cvs 40: #define URL_SEP '/'
41: #define URL_STR "/"
42:
1.94 cvs 43: /* Number of views used in Amaya */
44: #define AMAYA_MAX_VIEW_DOC 7
45:
1.50 cvs 46: /* The structures used for request callbacks */
47:
48: typedef void TIcbf (Document doc, int status, char *urlName,
49: char *outputfile, const char *content_type,
50: const char *data_block, int data_block_size,
51: void *context);
52:
53: typedef void TTcbf (Document doc, int status, char *urlName,
54: char *outputfile, const char *content_type,
55: void *context);
56:
1.25 cvs 57: /* How are Network accesses provided ? */
58: #ifdef AMAYA_JAVA
59: #include "libjava.h"
60: #else
1.39 cvs 61: #ifdef AMAYA_ILU
62: #include "libilu.h"
63: #else
1.25 cvs 64: #include "libwww.h"
65: #endif
1.39 cvs 66: #endif
1.1 cvs 67:
1.66 cvs 68: /* The different events to open a new document */
1.41 cvs 69: typedef enum _ClickEvent {
1.73 cvs 70: CE_ABSOLUTE, CE_RELATIVE, CE_FORM_POST, CE_FORM_GET,
71: CE_HELP, CE_MAKEBOOK, CE_LOG
1.41 cvs 72: } ClickEvent;
1.20 cvs 73:
74: #define NO 0
75: #define YES 1
76:
77: /* dialogue */
78: #define URLForm 1
1.29 cvs 79: #define OpenForm 2
80: #define URLName 3
81: #define LocalName 4
82: #define DirSelect 5
83: #define DocSelect 6
1.20 cvs 84: #define StopCommand 7
1.29 cvs 85: #define SaveForm 8
1.20 cvs 86: #define DirSave 9
87: #define DocSave 10
88: #define ToggleSave 11
1.29 cvs 89: #define NameSave 12
1.30 cvs 90: #define ImgDirSave 13
91: #define Label1 14
92: #define Label2 15
93: #define Label3 16
94: #define Label4 17
1.29 cvs 95: #define ConfirmForm 18
96: #define ConfirmText 19
1.20 cvs 97: #define AttrHREFForm 20
98: #define AttrHREFText 21
99: #define FormAnswer 22
100: #define AnswerText 24
101: #define NameText 25
102: #define PasswordText 26
1.30 cvs 103: #define FilterText 27
104: #define ClassForm 28
1.20 cvs 105: #define ClassSelect 29
106: #define AClassForm 30
1.30 cvs 107: #define AClassSelect 31
108: #define ConfirmSave 32
109: #define ConfirmSaveList 33
110: #define OptionMenu 34
1.91 cvs 111: #define MAX_SUBMENUS 400
1.69 cvs 112: /* MAX_SUBMENUS references reserved for submenus of Option menu */
1.91 cvs 113: #define About1 435
114: #define About2 436
115: #define About3 437
116: #define Version 438
117: #define AboutForm 439
1.92 cvs 118: #define TableForm 440
119: #define TableRows 441
120: #define TableCols 442
121: #define TableBorder 443
122: #define MAX_REF 444
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.87 cvs 153:
154: /*
155: * Flags to indicate the action to take when the network options
156: * are modified
157: */
158: #define AMAYA_CACHE_RESTART 1
159: #define AMAYA_PROXY_RESTART 2
160:
1.26 cvs 161: /*
162: * Flags to indicate the status of the network requests associated
163: * to a document.
164: */
165:
166: #define AMAYA_NET_INACTIVE 1
167: #define AMAYA_NET_ERROR 2
168: #define AMAYA_NET_ACTIVE 4
169:
1.25 cvs 170: /*
171: * Flags for HTParse, specifying which parts of the URL are needed
172: */
173: #define AMAYA_PARSE_ACCESS 16 /* Access scheme, e.g. "HTTP" */
174: #define AMAYA_PARSE_HOST 8 /* Host name, e.g. "www.w3.org" */
175: #define AMAYA_PARSE_PATH 4 /* URL Path, e.g. "pub/WWW/TheProject.html" */
176: #define AMAYA_PARSE_ANCHOR 2 /* Fragment identifier, e.g. "news" */
177: #define AMAYA_PARSE_PUNCTUATION 1 /* Include delimiters, e.g, "/" and ":" */
178: #define AMAYA_PARSE_ALL 31 /* All the parts */
1.1 cvs 179:
1.14 cvs 180: THOT_EXPORT int appArgc;
181: THOT_EXPORT char **appArgv;
182: THOT_EXPORT char TempFileDirectory[MAX_LENGTH];
183: THOT_EXPORT char Answer_text[MAX_LENGTH];
184: THOT_EXPORT char Answer_name[NAME_LENGTH];
185: THOT_EXPORT char Answer_password[NAME_LENGTH];
186: THOT_EXPORT char Display_password[NAME_LENGTH];
1.30 cvs 187: THOT_EXPORT char ScanFilter[NAME_LENGTH]; /* to scan directories */
1.14 cvs 188: THOT_EXPORT char *LastURLName; /* last URL requested */
189: THOT_EXPORT char *DirectoryName; /* local path of the document */
190: THOT_EXPORT char *DocumentName; /* document name */
1.43 cvs 191: THOT_EXPORT char *SavePath; /* saving path */
192: THOT_EXPORT char *SaveName; /* saving name of the document */
1.30 cvs 193: THOT_EXPORT char *ObjectName; /* document name */
1.14 cvs 194: THOT_EXPORT char *SaveImgsURL; /* where to save remote Images */
195: THOT_EXPORT char *TargetName;
1.45 cvs 196: THOT_EXPORT char *SavingFile; /* complete path or URL of the document */
197: THOT_EXPORT int Lg_password;
198: THOT_EXPORT int BaseDialog;
1.14 cvs 199: THOT_EXPORT int ReturnOption;
1.70 cvs 200: THOT_EXPORT int NumberRows;
201: THOT_EXPORT int NumberCols;
202: THOT_EXPORT int TBorder;
1.69 cvs 203: THOT_EXPORT int ReturnOptionMenu;
1.14 cvs 204: THOT_EXPORT Document CurrentDocument;
205: THOT_EXPORT Document SavingDocument;
206: THOT_EXPORT Document SavingObject;
207: THOT_EXPORT Document AttrHREFdocument;
1.45 cvs 208: THOT_EXPORT Document DocBook;
209: THOT_EXPORT Document IncludedDocument;
1.14 cvs 210: THOT_EXPORT Element AttrHREFelement;
1.95 cvs 211: THOT_EXPORT STRING AttrHREFvalue;
1.14 cvs 212: THOT_EXPORT Document SelectionDoc;
1.45 cvs 213: THOT_EXPORT boolean SaveAsHTML;
1.86 cvs 214: THOT_EXPORT boolean SaveAsXHTML;
1.45 cvs 215: THOT_EXPORT boolean SaveAsText;
216: THOT_EXPORT boolean CopyImages; /* should we copy images in Save As */
217: THOT_EXPORT boolean UpdateURLs; /* should we update URLs in Save As */
218: THOT_EXPORT boolean UserAnswer;
219: THOT_EXPORT boolean InNewWindow;
1.14 cvs 220: THOT_EXPORT boolean SelectionInPRE;
221: THOT_EXPORT boolean SelectionInComment;
222: THOT_EXPORT boolean SelectionInEM;
223: THOT_EXPORT boolean SelectionInSTRONG;
224: THOT_EXPORT boolean SelectionInCITE;
1.56 cvs 225: THOT_EXPORT boolean SelectionInABBR;
226: THOT_EXPORT boolean SelectionInACRONYM;
1.57 cvs 227: THOT_EXPORT boolean SelectionInINS;
228: THOT_EXPORT boolean SelectionInDEL;
1.14 cvs 229: THOT_EXPORT boolean SelectionInDFN;
230: THOT_EXPORT boolean SelectionInCODE;
231: THOT_EXPORT boolean SelectionInVAR;
232: THOT_EXPORT boolean SelectionInSAMP;
233: THOT_EXPORT boolean SelectionInKBD;
234: THOT_EXPORT boolean SelectionInI;
235: THOT_EXPORT boolean SelectionInB;
236: THOT_EXPORT boolean SelectionInTT;
237: THOT_EXPORT boolean SelectionInBIG;
238: THOT_EXPORT boolean SelectionInSMALL;
1.53 cvs 239: typedef enum
240: {
241: docHTML,
1.75 cvs 242: docReadOnly,
1.74 cvs 243: docText,
1.84 cvs 244: docTextRO,
1.75 cvs 245: docImage,
1.85 cvs 246: docImageRO,
247: docCSS,
248: docCSSRO
1.53 cvs 249: } DocumentType;
1.64 cvs 250:
251:
252: /* a record for data associated with a request */
253: typedef struct _DocumentMetaDataElement
254: {
255: char *form_data; /* form data associated with a URL */
256: ClickEvent method; /* method used to send this data */
257: } DocumentMetaDataElement;
258:
1.1 cvs 259: #define DocumentTableLength 10
1.14 cvs 260: THOT_EXPORT char *DocumentURLs[DocumentTableLength];
1.64 cvs 261: /* Any formdata associated with a URL */
262: THOT_EXPORT DocumentMetaDataElement *DocumentMeta[DocumentTableLength];
1.41 cvs 263: /* TRUE if the document is displayed by help commands */
1.53 cvs 264: THOT_EXPORT DocumentType DocumentTypes[DocumentTableLength];
1.1 cvs 265: /* The whole document is loaded when the corresponding value
266: in FilesLoading is equal to 0 */
1.14 cvs 267: THOT_EXPORT int FilesLoading[DocumentTableLength];
1.26 cvs 268: /* Gives the status (error, success) of the download of the objects of
269: a document */
1.42 cvs 270:
1.26 cvs 271: THOT_EXPORT int DocNetworkStatus[DocumentTableLength];
1.14 cvs 272: THOT_EXPORT Document W3Loading; /* the document being loaded */
1.65 cvs 273: THOT_EXPORT Document BackupDocument; /* the current backup */
1.14 cvs 274: THOT_EXPORT int IButton;
275: THOT_EXPORT int BButton;
276: THOT_EXPORT int TTButton;
1.5 cvs 277:
1.64 cvs 278: #define IMAGE_NOT_LOADED 0
1.1 cvs 279: #define IMAGE_LOCAL 1
280: #define IMAGE_LOADED 2
281: #define IMAGE_MODIFIED 3
282:
1.27 cvs 283: #ifdef __STDC__
1.41 cvs 284: typedef void (*LoadedImageCallback)(Document doc, Element el, char *file, void *extra);
1.27 cvs 285: #else
286: typedef void (*LoadedImageCallback)();
287: #endif
1.5 cvs 288: typedef struct _ElemImage
289: {
1.27 cvs 290: Element currentElement;/* first element using this image */
1.5 cvs 291: struct _ElemImage *nextElement;
1.27 cvs 292: LoadedImageCallback callback; /* Callback for non-standard handling */
293: void *extra; /* any extra info for the CallBack */
1.5 cvs 294: }
295: ElemImage;
296:
297: typedef struct _LoadedImageDesc
298: {
1.58 cvs 299: char *originalName; /* complete URL of the image */
1.5 cvs 300: char *localName; /* local name (without path) of the image */
1.58 cvs 301: struct _LoadedImageDesc *prevImage;/* double linked list */
302: struct _LoadedImageDesc *nextImage;/* easier to unchain */
303: Document document; /* document concerned */
304: struct _ElemImage *elImage; /* first element using this image */
305: int imageType; /* the type of the image */
306: int status; /* the status of the image loading */
1.5 cvs 307: }
308: LoadedImageDesc;
309:
1.14 cvs 310: THOT_EXPORT LoadedImageDesc *ImageURLs;
1.31 cvs 311: THOT_EXPORT LoadedImageDesc *ImageLocal;
1.1 cvs 312:
1.72 cvs 313: #define BROWSING 0
314: #define SELECTING 1
315: #define SEARCHING 2
316: #define VIEWS 3
317: #define CREATING 4
318: #define LINKS 5
319: #define CHANGING 6
320: #define TABLES 7
321: #define MATH 8
322: #define IMAGEMAPS 9
323: #define CSS 10
324: #define ATTRIBUTES 11
325: #define SPELLCHECKING 12
326: #define PUBLISHING 13
327: #define PRINTING 14
328: #define NUMBERING 15
329: #define MAKEBOOK 16
330: #define CONFIGURE 17
331:
1.88 cvs 332: /* The default Amaya HOME pages (page shown at boot time */
333:
334: #ifdef _WINDOWS
335: #define AMAYA_PAGE "\\amaya\\AmayaPage.html"
336: #else /* _WINDOWS */
337: #define AMAYA_PAGE "/amaya/AmayaPage.html"
338: #endif /* _WINDOWS */
339:
340: #define AMAYA_PAGE_DOC "http://www.w3.org/Amaya/User/"
341:
1.25 cvs 342: #endif /* AMAYA_H */
1.48 cvs 343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
1.1 cvs 353:
Webmaster