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