Annotation of Amaya/amaya/amaya.h, revision 1.111
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"
1.103 cvs 20: #include "fileaccess.h"
1.10 cvs 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.105 cvs 29: #include "uconvert.h"
1.82 cvs 30: #include "undo.h"
1.1 cvs 31: /* Included headerfiles */
1.10 cvs 32: #include "EDITOR.h"
1.1 cvs 33: #include "HTML.h"
1.84 cvs 34: #include "TextFile.h"
1.1 cvs 35: #include "amayamsg.h"
36:
1.25 cvs 37: #define MAX_LENGTH 512
38: #define NAME_LENGTH 32
39:
1.108 cvs 40: #define HTAppName TEXT ("amaya")
1.111 ! cvs 41: #define HTAppVersion TEXT ("V2.2")
1.108 cvs 42: #define URL_STR TEXT ("/")
43: #define URL_SEP TEXT ('/')
1.105 cvs 44:
1.36 cvs 45:
1.94 cvs 46: /* Number of views used in Amaya */
47: #define AMAYA_MAX_VIEW_DOC 7
48:
1.50 cvs 49: /* The structures used for request callbacks */
50:
51: typedef void TIcbf (Document doc, int status, char *urlName,
52: char *outputfile, const char *content_type,
53: const char *data_block, int data_block_size,
54: void *context);
55:
1.105 cvs 56: typedef void TTcbf (Document doc, int status, STRING urlName,
57: STRING outputfile, const STRING content_type,
1.50 cvs 58: void *context);
59:
1.25 cvs 60: /* How are Network accesses provided ? */
61: #ifdef AMAYA_JAVA
62: #include "libjava.h"
63: #else
1.39 cvs 64: #ifdef AMAYA_ILU
65: #include "libilu.h"
66: #else
1.25 cvs 67: #include "libwww.h"
68: #endif
1.39 cvs 69: #endif
1.1 cvs 70:
1.66 cvs 71: /* The different events to open a new document */
1.41 cvs 72: typedef enum _ClickEvent {
1.73 cvs 73: CE_ABSOLUTE, CE_RELATIVE, CE_FORM_POST, CE_FORM_GET,
1.107 cvs 74: CE_HELP, CE_MAKEBOOK, CE_LOG , CE_TEMPLATE, CE_INIT,
1.41 cvs 75: } ClickEvent;
1.20 cvs 76:
77: #define NO 0
78: #define YES 1
79:
80: /* dialogue */
81: #define URLForm 1
1.29 cvs 82: #define OpenForm 2
83: #define URLName 3
84: #define LocalName 4
85: #define DirSelect 5
86: #define DocSelect 6
1.20 cvs 87: #define StopCommand 7
1.29 cvs 88: #define SaveForm 8
1.20 cvs 89: #define DirSave 9
90: #define DocSave 10
91: #define ToggleSave 11
1.29 cvs 92: #define NameSave 12
1.30 cvs 93: #define ImgDirSave 13
94: #define Label1 14
95: #define Label2 15
96: #define Label3 16
97: #define Label4 17
1.29 cvs 98: #define ConfirmForm 18
99: #define ConfirmText 19
1.20 cvs 100: #define AttrHREFForm 20
101: #define AttrHREFText 21
102: #define FormAnswer 22
103: #define AnswerText 24
104: #define NameText 25
105: #define PasswordText 26
1.30 cvs 106: #define FilterText 27
107: #define ClassForm 28
1.20 cvs 108: #define ClassSelect 29
109: #define AClassForm 30
1.30 cvs 110: #define AClassSelect 31
111: #define ConfirmSave 32
112: #define ConfirmSaveList 33
113: #define OptionMenu 34
1.91 cvs 114: #define MAX_SUBMENUS 400
1.69 cvs 115: /* MAX_SUBMENUS references reserved for submenus of Option menu */
1.91 cvs 116: #define About1 435
117: #define About2 436
118: #define About3 437
119: #define Version 438
120: #define AboutForm 439
1.92 cvs 121: #define TableForm 440
122: #define TableRows 441
123: #define TableCols 442
124: #define TableBorder 443
125: #define MAX_REF 444
1.20 cvs 126:
1.11 cvs 127: /* The possible GET/POST/PUT request modes */
1.1 cvs 128:
1.11 cvs 129: /*synchronous request*/
130: #define AMAYA_SYNC 1 /*0x000001 */
131: /*synchronous request with incremental callbacks */
132: #define AMAYA_ISYNC 2 /*0x000010 */
133: /*asynchronous request */
1.5 cvs 134: #define AMAYA_ASYNC 4 /*0x000100 */
1.11 cvs 135: /*asynchronous request with incremental callbacks */
1.5 cvs 136: #define AMAYA_IASYNC 8 /*0x001000 */
1.11 cvs 137: /* send the form using the POST HTTP method */
1.5 cvs 138: #define AMAYA_FORM_POST 16 /*0x010000 */
1.11 cvs 139: /* send the form using the GET HTTP method */
1.5 cvs 140: #define AMAYA_FORM_GET 32 /*0x100000 */
1.23 cvs 141: /* bypass caching */
142: #define AMAYA_NOCACHE 64
143: /* don't follow redirections */
144: #define AMAYA_NOREDIR 128
1.48 cvs 145: #ifndef AMAYA_JAVA
146: /* Prevents a stop race condition in ASYNC transfers */
147: #define AMAYA_ASYNC_SAFE_STOP 256
1.60 cvs 148: #define AMAYA_LOAD_CSS 512
1.67 cvs 149: #define AMAYA_FLUSH_REQUEST 1024
1.80 cvs 150: #define AMAYA_USE_PRECONDITIONS 2048
1.63 cvs 151: #else
152: #define AMAYA_ASYNC_SAFE_STOP 0
153: #define AMAYA_LOAD_CSS 0
1.80 cvs 154: #define AMAYA_USE_PRECONDITIONS 0
1.48 cvs 155: #endif /* ! AMAYA_JAVA */
1.87 cvs 156:
157: /*
158: * Flags to indicate the action to take when the network options
159: * are modified
160: */
161: #define AMAYA_CACHE_RESTART 1
162: #define AMAYA_PROXY_RESTART 2
1.99 cvs 163: #define AMAYA_LANNEG_RESTART 3
1.87 cvs 164:
1.26 cvs 165: /*
166: * Flags to indicate the status of the network requests associated
167: * to a document.
168: */
169:
170: #define AMAYA_NET_INACTIVE 1
171: #define AMAYA_NET_ERROR 2
172: #define AMAYA_NET_ACTIVE 4
173:
1.25 cvs 174: /*
175: * Flags for HTParse, specifying which parts of the URL are needed
176: */
177: #define AMAYA_PARSE_ACCESS 16 /* Access scheme, e.g. "HTTP" */
178: #define AMAYA_PARSE_HOST 8 /* Host name, e.g. "www.w3.org" */
179: #define AMAYA_PARSE_PATH 4 /* URL Path, e.g. "pub/WWW/TheProject.html" */
180: #define AMAYA_PARSE_ANCHOR 2 /* Fragment identifier, e.g. "news" */
181: #define AMAYA_PARSE_PUNCTUATION 1 /* Include delimiters, e.g, "/" and ":" */
182: #define AMAYA_PARSE_ALL 31 /* All the parts */
1.1 cvs 183:
1.14 cvs 184: THOT_EXPORT int appArgc;
1.105 cvs 185: THOT_EXPORT STRING *appArgv;
186: THOT_EXPORT CHAR_T TempFileDirectory[MAX_LENGTH];
187: THOT_EXPORT CHAR_T Answer_text[MAX_LENGTH];
188: THOT_EXPORT CHAR_T Answer_name[NAME_LENGTH];
189: THOT_EXPORT CHAR_T Answer_password[NAME_LENGTH];
190: THOT_EXPORT CHAR_T Display_password[NAME_LENGTH];
191: THOT_EXPORT CHAR_T ScanFilter[NAME_LENGTH]; /* to scan directories */
192: THOT_EXPORT STRING LastURLName; /* last URL requested */
193: THOT_EXPORT STRING DirectoryName; /* local path of the document */
194: THOT_EXPORT STRING DocumentName; /* document name */
195: THOT_EXPORT STRING SavePath; /* saving path */
196: THOT_EXPORT STRING SaveName; /* saving name of the document */
197: THOT_EXPORT STRING ObjectName; /* document name */
198: THOT_EXPORT STRING SaveImgsURL; /* where to save remote Images */
199: THOT_EXPORT STRING TargetName;
200: THOT_EXPORT STRING SavingFile; /* complete path or URL of the document */
1.45 cvs 201: THOT_EXPORT int Lg_password;
202: THOT_EXPORT int BaseDialog;
1.14 cvs 203: THOT_EXPORT int ReturnOption;
1.70 cvs 204: THOT_EXPORT int NumberRows;
205: THOT_EXPORT int NumberCols;
206: THOT_EXPORT int TBorder;
1.69 cvs 207: THOT_EXPORT int ReturnOptionMenu;
1.14 cvs 208: THOT_EXPORT Document CurrentDocument;
209: THOT_EXPORT Document SavingDocument;
210: THOT_EXPORT Document SavingObject;
211: THOT_EXPORT Document AttrHREFdocument;
1.45 cvs 212: THOT_EXPORT Document DocBook;
213: THOT_EXPORT Document IncludedDocument;
1.14 cvs 214: THOT_EXPORT Element AttrHREFelement;
1.95 cvs 215: THOT_EXPORT STRING AttrHREFvalue;
1.14 cvs 216: THOT_EXPORT Document SelectionDoc;
1.98 cvs 217: THOT_EXPORT ThotBool SaveAsHTML;
218: THOT_EXPORT ThotBool SaveAsXHTML;
219: THOT_EXPORT ThotBool SaveAsText;
220: THOT_EXPORT ThotBool CopyImages; /* should we copy images in Save As */
221: THOT_EXPORT ThotBool UpdateURLs; /* should we update URLs in Save As */
222: THOT_EXPORT ThotBool UserAnswer;
223: THOT_EXPORT ThotBool InNewWindow;
224: THOT_EXPORT ThotBool SelectionInPRE;
225: THOT_EXPORT ThotBool SelectionInComment;
226: THOT_EXPORT ThotBool SelectionInEM;
227: THOT_EXPORT ThotBool SelectionInSTRONG;
228: THOT_EXPORT ThotBool SelectionInCITE;
229: THOT_EXPORT ThotBool SelectionInABBR;
230: THOT_EXPORT ThotBool SelectionInACRONYM;
231: THOT_EXPORT ThotBool SelectionInINS;
232: THOT_EXPORT ThotBool SelectionInDEL;
233: THOT_EXPORT ThotBool SelectionInDFN;
234: THOT_EXPORT ThotBool SelectionInCODE;
235: THOT_EXPORT ThotBool SelectionInVAR;
236: THOT_EXPORT ThotBool SelectionInSAMP;
237: THOT_EXPORT ThotBool SelectionInKBD;
238: THOT_EXPORT ThotBool SelectionInI;
239: THOT_EXPORT ThotBool SelectionInB;
240: THOT_EXPORT ThotBool SelectionInTT;
241: THOT_EXPORT ThotBool SelectionInBIG;
242: THOT_EXPORT ThotBool SelectionInSMALL;
1.100 cvs 243: THOT_EXPORT ThotBool SelectionInSub;
244: THOT_EXPORT ThotBool SelectionInSup;
245: THOT_EXPORT ThotBool SelectionInQuote;
246: THOT_EXPORT ThotBool SelectionInBDO;
1.108 cvs 247: THOT_EXPORT ThotBool HTMLErrorsFound;
1.100 cvs 248:
1.53 cvs 249: typedef enum
250: {
251: docHTML,
1.110 cvs 252: docHTMLRO,
1.74 cvs 253: docText,
1.84 cvs 254: docTextRO,
1.75 cvs 255: docImage,
1.85 cvs 256: docImageRO,
257: docCSS,
1.110 cvs 258: docCSSRO,
259: docSource,
260: docSourceRO
1.53 cvs 261: } DocumentType;
1.64 cvs 262:
263:
264: /* a record for data associated with a request */
265: typedef struct _DocumentMetaDataElement
266: {
1.105 cvs 267: STRING form_data; /* form data associated with a URL */
1.64 cvs 268: ClickEvent method; /* method used to send this data */
269: } DocumentMetaDataElement;
270:
1.1 cvs 271: #define DocumentTableLength 10
1.110 cvs 272: /* URL of each loaded document */
1.105 cvs 273: THOT_EXPORT STRING DocumentURLs[DocumentTableLength];
1.64 cvs 274: /* Any formdata associated with a URL */
275: THOT_EXPORT DocumentMetaDataElement *DocumentMeta[DocumentTableLength];
1.110 cvs 276: /* Type of document */
1.53 cvs 277: THOT_EXPORT DocumentType DocumentTypes[DocumentTableLength];
1.110 cvs 278: /* identifier of the document displaying the source code */
279: THOT_EXPORT Document DocumentSource[DocumentTableLength];
280: /* The whole document is loaded when the corresponding entry in FilesLoading is 0 */
1.14 cvs 281: THOT_EXPORT int FilesLoading[DocumentTableLength];
1.110 cvs 282: /* Status (error, success) of the download of the objects of a document */
283: THOT_EXPORT int DocNetworkStatus[DocumentTableLength];
1.42 cvs 284:
1.14 cvs 285: THOT_EXPORT Document W3Loading; /* the document being loaded */
1.65 cvs 286: THOT_EXPORT Document BackupDocument; /* the current backup */
1.104 cvs 287:
288: /* button indexes */
289: THOT_EXPORT int iStop;
290: THOT_EXPORT int iBack;
291: THOT_EXPORT int iForward;
292: THOT_EXPORT int iReload;
293: THOT_EXPORT int iHome;
294: THOT_EXPORT int iEditor;
295: THOT_EXPORT int iSave;
296: THOT_EXPORT int iPrint;
297: THOT_EXPORT int iFind;
298: THOT_EXPORT int iI;
299: THOT_EXPORT int iB;
300: THOT_EXPORT int iT;
301: THOT_EXPORT int iImage;
302: THOT_EXPORT int iH1;
303: THOT_EXPORT int iH2;
304: THOT_EXPORT int iH3;
305: THOT_EXPORT int iBullet;
306: THOT_EXPORT int iNum;
307: THOT_EXPORT int iDL;
308: THOT_EXPORT int iLink;
309: THOT_EXPORT int iTable;
1.5 cvs 310:
1.64 cvs 311: #define IMAGE_NOT_LOADED 0
1.1 cvs 312: #define IMAGE_LOCAL 1
313: #define IMAGE_LOADED 2
314: #define IMAGE_MODIFIED 3
315:
1.109 cvs 316:
1.27 cvs 317: #ifdef __STDC__
1.109 cvs 318: typedef void (*LoadedImageCallback)(Document doc, Element el, char *file, void *extra);
1.27 cvs 319: #else
320: typedef void (*LoadedImageCallback)();
321: #endif
1.109 cvs 322:
1.5 cvs 323: typedef struct _ElemImage
324: {
1.27 cvs 325: Element currentElement;/* first element using this image */
1.5 cvs 326: struct _ElemImage *nextElement;
1.27 cvs 327: LoadedImageCallback callback; /* Callback for non-standard handling */
328: void *extra; /* any extra info for the CallBack */
1.5 cvs 329: }
330: ElemImage;
331:
332: typedef struct _LoadedImageDesc
333: {
1.105 cvs 334: STRING originalName; /* complete URL of the image */
335: STRING localName; /* local name (without path) of the image */
1.58 cvs 336: struct _LoadedImageDesc *prevImage;/* double linked list */
337: struct _LoadedImageDesc *nextImage;/* easier to unchain */
338: Document document; /* document concerned */
339: struct _ElemImage *elImage; /* first element using this image */
340: int imageType; /* the type of the image */
341: int status; /* the status of the image loading */
1.5 cvs 342: }
343: LoadedImageDesc;
1.109 cvs 344:
345: /* the structure used for storing the context of the
346: FetchAndDisplayImages_callback function */
347: typedef struct _FetchImage_context {
348: STRING base_url;
349: LoadedImageDesc *desc;
350: } FetchImage_context;
351:
1.5 cvs 352:
1.14 cvs 353: THOT_EXPORT LoadedImageDesc *ImageURLs;
1.31 cvs 354: THOT_EXPORT LoadedImageDesc *ImageLocal;
1.1 cvs 355:
1.72 cvs 356: #define BROWSING 0
357: #define SELECTING 1
358: #define SEARCHING 2
359: #define VIEWS 3
360: #define CREATING 4
361: #define LINKS 5
362: #define CHANGING 6
363: #define TABLES 7
364: #define MATH 8
365: #define IMAGEMAPS 9
366: #define CSS 10
367: #define ATTRIBUTES 11
368: #define SPELLCHECKING 12
369: #define PUBLISHING 13
370: #define PRINTING 14
371: #define NUMBERING 15
372: #define MAKEBOOK 16
373: #define CONFIGURE 17
374:
1.88 cvs 375: /* The default Amaya HOME pages (page shown at boot time */
376:
1.105 cvs 377: #if defined(_I18N_) || defined(__JIS__)
378: # ifdef _WINDOWS
379: # define AMAYA_PAGE L"\\amaya\\AmayaPage.html"
380: # else /* _WINDOWS */
381: # define AMAYA_PAGE L"/amaya/AmayaPage.html"
382: # endif /* _WINDOWS */
383: # define AMAYA_PAGE_DOC L"http://www.w3.org/Amaya/User/"
384: #else /* !_I18N_ */
385: # ifdef _WINDOWS
386: # define AMAYA_PAGE "\\amaya\\AmayaPage.html"
387: # else /* _WINDOWS */
388: # define AMAYA_PAGE "/amaya/AmayaPage.html"
389: # endif /* _WINDOWS */
390: # define AMAYA_PAGE_DOC "http://www.w3.org/Amaya/User/"
391: #endif /* !_I18N_ */
1.88 cvs 392:
1.25 cvs 393: #endif /* AMAYA_H */
1.48 cvs 394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
1.1 cvs 404:
Webmaster