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

1.8       cvs         1: /*
                      2:  *
1.315   ! vatton      3:  *  (c) COPYRIGHT INRIA and W3C, 1996-2007
1.8       cvs         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.197     kahan      34: #include "MathML.h"
1.217     vatton     35: #include "SVG.h"
1.84      cvs        36: #include "TextFile.h"
1.224     cvs        37: #include "XML.h"
1.1       cvs        38: #include "amayamsg.h"
1.156     cvs        39: #include "parser.h"
1.1       cvs        40: 
1.25      cvs        41: #define NAME_LENGTH     32
                     42: 
1.130     cvs        43: #define URL_STR       "/"
                     44: #define URL_SEP       '/'
1.245     cheyroul   45: 
1.36      cvs        46: 
1.94      cvs        47: /* Number of views used in Amaya */
                     48: #define AMAYA_MAX_VIEW_DOC  7
                     49: 
1.141     cvs        50: /* the type of character convertion we want to make on local URLs */
                     51: typedef enum _ConvertionType
                     52: {
                     53:   AM_CONV_NONE = 0,
                     54:   AM_CONV_URL_SEP = 0x1, /* converts URL_SEPs into DIR_SEPs */
                     55:   AM_CONV_PERCENT = 0x2, /* converts %xx into the equiv. char */
                     56:   AM_CONV_ALL = 0xFFFF   /* do everything */
                     57: }
                     58: ConvertionType;
                     59: 
1.139     cvs        60: /* the HTTP header name we want to make visible to the application */
                     61: typedef enum _AHTHeaderName
                     62:   {
                     63:     AM_HTTP_CONTENT_TYPE = 0,
1.175     kahan      64:     AM_HTTP_CHARSET = 1,
1.196     kahan      65:     AM_HTTP_CONTENT_LENGTH = 2,
1.214     kahan      66:     AM_HTTP_REASON = 3,
1.238     kahan      67:     AM_HTTP_CONTENT_LOCATION = 4,
                     68:     AM_HTTP_FULL_CONTENT_LOCATION = 5
1.139     cvs        69:   } 
                     70: AHTHeaderName;
                     71: 
                     72: /* the structure used for exchanging HTTP header info between the net library
                     73:    and amaya */
                     74: typedef struct _AHTHeaders
                     75:   {
1.198     cvs        76:     char *content_type;
                     77:     char *charset;
                     78:     char *content_length;
                     79:     char *reason;
1.214     kahan      80:     char *content_location;
1.238     kahan      81:     char *full_content_location;
1.246     vatton     82:     int   status;
1.139     cvs        83:   }
                     84: AHTHeaders;
                     85: 
1.50      cvs        86: /* The structures used for request callbacks */
                     87: typedef void   TIcbf (Document doc, int status, char *urlName,
1.139     cvs        88:                      char *outputfile, const AHTHeaders *http_headers,
1.50      cvs        89:                      const char *data_block, int data_block_size,
                     90:                      void *context);
                     91: 
1.198     cvs        92: typedef void  TTcbf (Document doc, int status, char *urlName,
1.312     cvs        93:                      char *outputfile, char *proxyName,
                     94:                      const AHTHeaders *http_headers, void *context);
1.50      cvs        95: 
1.25      cvs        96: /* How are Network accesses provided ? */
                     97: #include "libwww.h"
1.1       cvs        98: 
1.66      cvs        99: /* The different events to open a new document */
1.41      cvs       100: typedef enum _ClickEvent {
1.73      cvs       101:   CE_ABSOLUTE, CE_RELATIVE, CE_FORM_POST, CE_FORM_GET,
1.153     cvs       102:   CE_HELP, CE_MAKEBOOK, CE_LOG , CE_TEMPLATE, CE_INIT,
1.190     cvs       103:   CE_CSS, CE_ANNOT
1.41      cvs       104: } ClickEvent;
1.20      cvs       105: 
                    106: #define NO               0
                    107: #define YES              1
                    108: 
1.165     cvs       109: /* dialogues */
1.20      cvs       110: #define URLForm          1
1.29      cvs       111: #define OpenForm         2
                    112: #define URLName          3
                    113: #define LocalName        4
                    114: #define DirSelect        5
                    115: #define DocSelect        6
1.20      cvs       116: #define StopCommand      7
1.29      cvs       117: #define SaveForm         8
1.20      cvs       118: #define DirSave          9
                    119: #define DocSave         10
                    120: #define ToggleSave      11
1.29      cvs       121: #define NameSave        12
1.30      cvs       122: #define ImgDirSave      13
1.208     vatton    123: #define ConfirmForm     14
                    124: #define ConfirmText     15
                    125: #define AttrHREFForm    16
                    126: #define AttrHREFText    17
                    127: #define FormAnswer      18
                    128: #define RealmText       19
                    129: #define AnswerText      20
                    130: #define NameText        21
                    131: #define PasswordText    22
                    132: #define FilterText      23
                    133: #define ClassForm       24
                    134: #define ClassSelect     25
                    135: #define AClassForm      26
                    136: #define AClassSelect    27
                    137: #define ConfirmSave     28
                    138: #define ConfirmSaveList 29
                    139: #define BrowserDirSelect   30
                    140: #define BrowserDocSelect   31
                    141: #define BrowserFilterText  32
                    142: #define HREFLocalName   33
                    143: #define MakeIdMenu      34
                    144: #define mElemName       35
                    145: #define mAddId          36
                    146: #define mRemoveId       37
                    147: #define mIdUseSelection 38
                    148: #define mIdStatus       39
                    149: #define FileBrowserForm 40
                    150: #define FileBrowserText 41
                    151: #define FileBrowserFilter 42
                    152: #define FileBrowserLocalName 43
                    153: #define MimeTypeForm    44
                    154: #define MimeTypeSel     45
                    155: #define MimeTypeSave    46
                    156: #define CharsetForm     47
                    157: #define CharsetSave     48
                    158: #define CharsetSel      49
                    159: #define RadioSave       50
                    160: #define MimeFormStatus  51
                    161: #define SaveFormStatus  52
1.293     gully     162: #define OpenLocation    53
1.208     vatton    163: /* do not add items before this entry */
1.293     gully     164: #define OptionMenu     54
1.296     tollenae  165: #define OpenTemplate    55
1.205     kahan     166: 
1.134     cvs       167: /* MAX_SUBMENUS references reserved for submenus of Option menu */
                    168: /* Do not insert new entries here */
1.91      cvs       169: #define MAX_SUBMENUS    400
1.208     vatton    170: #define Label1          54 /* no callback */
                    171: #define Label2          55 /* no callback */
                    172: #define Label3          56 /* no callback */
                    173: #define Label4          57 /* no callback */
                    174: #define About1         58 /* no callback */
                    175: #define About2         59 /* no callback */
                    176: #define About3         60 /* no callback */
                    177: #define Version                61 /* no callback */
                    178: #define CharsetSaveL    62 /* no callback */
                    179: #define MimeTypeSaveL   63 /* no callback */
                    180: /* first callback available: 454 */
1.177     cvs       181: #define AboutForm              454
                    182: #define TableForm       455
                    183: #define TableRows       456
                    184: #define TableCols       457
                    185: #define TableBorder     458
                    186: #define MathEntityForm  459
                    187: #define MathEntityText  460
                    188: #define TitleForm       461
                    189: #define TitleText       462
1.192     cvs       190: #define DocInfoForm           463
                    191: #define DocInfoMimeTypeTitle  464
                    192: #define DocInfoMimeType       465
                    193: #define DocInfoCharsetTitle   466
                    194: #define DocInfoCharset        467
                    195: #define DocInfoContentTitle   468
                    196: #define DocInfoContent        469
1.215     kahan     197: #define DocInfoURLTitle       470
                    198: #define DocInfoURL            471
1.194     cvs       199: #define DocInfoTitle1         472
                    200: #define DocInfoTitle2         473
                    201: #define DocInfoContent1       474
                    202: #define DocInfoContent2       475
1.215     kahan     203: #define DocInfoLocationTitle  476
                    204: #define DocInfoLocation       477
1.222     kahan     205: #define DocInfoDocTypeTitle   478
                    206: #define DocInfoDocType        479
                    207: #define MAX_REF         480
1.20      cvs       208: 
1.150     cvs       209: #define FormPrint        1
                    210: #define PrintOptions     2
                    211: #define PaperFormat      3
                    212: #define PrintSupport     4
                    213: #define PPrinterName     5
                    214: #define PaperOrientation 6
                    215: #define PPagesPerSheet   7
                    216: #define PRINT_MAX_REF   8
1.147     cvs       217: 
1.234     cvs       218: #define FormLibrary              1
                    219: #define CopySVGLibSelection      2
                    220: #define ReferToSVGLibSelection   3
                    221: #define AddSVGModel              4
                    222: #define NewSVGFileURL            5
                    223: #define SVGLibCatalogueTitle     6
                    224: #define SVGLibraryLabel          7
                    225: #define SVGLibraryLabel1         8
                    226: #define SVGLibraryLabel2         9
                    227: #define SVGLibraryLabel3        10
1.240     cvs       228: #define SVGLibraryLabel4        11
                    229: #define NewSVGLibraryTitle      12
                    230: #define NewSVGLibrary           13
                    231: #define SVGLibraryURL           14
1.242     cvs       232: #define SVGLibraryDir           15
                    233: #define SVGLibrarySel           16
                    234: #define LibraryFilter           17
                    235: #define SVGLibFileBrowser       18
                    236: #define SVGLibFileBrowserText   19
                    237: #define LibraryCopyOption       20
                    238: #define LIBRARY_MAX_REF         21
1.234     cvs       239: 
1.147     cvs       240: #define ImageURL       1
                    241: #define ImageLabel     2
                    242: #define ImageLabel2    3
                    243: #define ImageLabel3    4
                    244: #define ImageLabel4    5
                    245: #define ImageDir       6
                    246: #define ImageSel       7
                    247: #define ImageFilter     8
                    248: #define FormImage      9
                    249: #define RepeatImage    10
                    250: #define FormBackground 11
                    251: #define ImageAlt       12
                    252: #define FormAlt        13
1.289     vatton    253: #define FormObject     14
                    254: #define ImageType      15
                    255: #define IMAGE_MAX_REF  16
1.147     cvs       256: 
                    257: #define CSSForm         0
                    258: #define CSSSelect       1
1.291     vatton    259: #define CSSEntry        2
1.303     vatton    260: #define CSSValue        3
                    261: #define MAX_CSS_REF     4
1.290     vatton    262: 
1.147     cvs       263: #define FormMaths 0
1.313     vatton    264: #define FormMathOperator 1
1.314     vatton    265: #define FormMathFenceAttributes 2
                    266: #define MathAttributeOpen 3
                    267: #define MathAttributeSeparators 4
                    268: #define MathAttributeClose 5
                    269: 
                    270: #define MenuMaths 6
                    271: #define MenuMaths1 7
                    272: #define MAX_MATHS  8
1.147     cvs       273: 
1.165     cvs       274: #define FormGraph 0
                    275: #define MenuGraph 1
1.225     vatton    276: #define MenuGraph1 2
                    277: #define MAX_GRAPH 3
1.165     cvs       278: 
1.11      cvs       279: /* The possible GET/POST/PUT request modes */
                    280: /*synchronous request*/
                    281: #define AMAYA_SYNC     1       /*0x000001 */  
                    282: /*synchronous request with incremental callbacks */
                    283: #define AMAYA_ISYNC    2       /*0x000010 */  
                    284: /*asynchronous request */
1.5       cvs       285: #define AMAYA_ASYNC    4       /*0x000100 */
1.11      cvs       286: /*asynchronous request with incremental callbacks */
1.5       cvs       287: #define AMAYA_IASYNC   8       /*0x001000 */
1.11      cvs       288: /* send the form using the POST HTTP method */
1.5       cvs       289: #define AMAYA_FORM_POST 16     /*0x010000 */
1.11      cvs       290: /* send the form using the GET HTTP method */
1.5       cvs       291: #define AMAYA_FORM_GET  32     /*0x100000 */
1.23      cvs       292: /* bypass caching */
1.265     vatton    293: #define AMAYA_NOCACHE  64 /* 2^6 */
1.23      cvs       294: /* don't follow redirections */
1.265     vatton    295: #define AMAYA_NOREDIR  128 /* 2^7 */
1.48      cvs       296: /* Prevents a stop race condition in ASYNC transfers */
1.265     vatton    297: #define AMAYA_ASYNC_SAFE_STOP  256 /* 2^8 */
                    298: #define AMAYA_LOAD_CSS   512 /* 2^9 */
                    299: #define AMAYA_FLUSH_REQUEST 1024 /* 2^10 */
                    300: #define AMAYA_USE_PRECONDITIONS 2048 /* 2^11 */
                    301: #define AMAYA_LOAD_IMAGE 4096 /* 2^12 */
1.167     kahan     302: /* post an annonation */
1.265     vatton    303: #define AMAYA_FILE_POST 8192 /* 2^13 */
1.167     kahan     304: /* delete an annotation */
1.265     vatton    305: #define AMAYA_DELETE    16384 /* 2^14 */
                    306: #define AMAYA_MBOOK_IMAGE 32768 /* 2^15 */
1.252     kahan     307: /* post an annotation using PUT */
1.265     vatton    308: #define AMAYA_SIMPLE_PUT 65536 /* 2^16 */
1.252     kahan     309: 
1.87      cvs       310: /*
                    311:  * Flags to indicate the action to take when the network options
                    312:  * are modified
                    313:  */
                    314: #define AMAYA_CACHE_RESTART 1
                    315: #define AMAYA_PROXY_RESTART 2
1.114     cvs       316: #define AMAYA_LANNEG_RESTART 4
                    317: #define AMAYA_SAFEPUT_RESTART 8
1.87      cvs       318: 
1.26      cvs       319: /*
                    320:  * Flags to indicate the status of the network requests associated
                    321:  * to a document.
                    322:  */
                    323: 
                    324: #define AMAYA_NET_INACTIVE 1
                    325: #define AMAYA_NET_ERROR    2
                    326: #define AMAYA_NET_ACTIVE   4
                    327: 
1.25      cvs       328: /*
                    329:  * Flags for HTParse, specifying which parts of the URL are needed
                    330:  */
                    331: #define AMAYA_PARSE_ACCESS      16  /* Access scheme, e.g. "HTTP" */
                    332: #define AMAYA_PARSE_HOST        8   /* Host name, e.g. "www.w3.org" */
                    333: #define AMAYA_PARSE_PATH        4   /* URL Path, e.g. "pub/WWW/TheProject.html" */
                    334: #define AMAYA_PARSE_ANCHOR      2   /* Fragment identifier, e.g. "news" */
                    335: #define AMAYA_PARSE_PUNCTUATION 1   /* Include delimiters, e.g, "/" and ":" */
                    336: #define AMAYA_PARSE_ALL         31  /* All the parts */
1.1       cvs       337: 
1.198     cvs       338: THOT_EXPORT int        AMAYA;     /* Index of amaya message table */
1.273     gully     339: extern      int        appArgc;          /* defined in EDITORAPP.c */
                    340: extern      char     **appArgv;   /* defined in EDITORAPP.c */
1.198     cvs       341: THOT_EXPORT char       TempFileDirectory[MAX_LENGTH];
                    342: THOT_EXPORT char       Answer_text[MAX_LENGTH];
                    343: THOT_EXPORT char       Answer_name[NAME_LENGTH];
                    344: THOT_EXPORT char       Answer_password[NAME_LENGTH];
                    345: THOT_EXPORT char       Display_password[NAME_LENGTH];
                    346: THOT_EXPORT char       ScanFilter[NAME_LENGTH]; /* to scan directories    */
                    347: THOT_EXPORT char       MathMLEntityName[MAX_LENGTH]; /* entity name typed by the user for a MathML expression */
                    348: THOT_EXPORT char       IdElemName[MAX_LENGTH]; /* element name typed by the user from the MakeID menu */
                    349: THOT_EXPORT char       IdStatus[50]; /* element name typed by the user from the MakeID menu */
                    350: THOT_EXPORT char       ImgFilter[NAME_LENGTH];
1.279     cvs       351: THOT_EXPORT char       DirectoryImage[MAX_LENGTH];
                    352: THOT_EXPORT char       LastURLImage[MAX_LENGTH];
                    353: THOT_EXPORT char       ImageName[MAX_LENGTH];
                    354: THOT_EXPORT char       ImgAlt[MAX_LENGTH];
1.198     cvs       355: THOT_EXPORT char      *LastURLName;    /* last URL requested               */
1.306     vatton    356: THOT_EXPORT char      *Error_DocURL; /* The parsed file */
1.198     cvs       357: THOT_EXPORT char      *DirectoryName;  /* local path of the document       */
                    358: THOT_EXPORT char      *DocumentName;   /* document name                    */
                    359: THOT_EXPORT char      *SavePath;       /* saving path                      */
                    360: THOT_EXPORT char      *SaveName;       /* saving name of the document      */
1.299     gully     361: THOT_EXPORT char       SaveFileName[MAX_LENGTH];       /* concatenation of SavePath+SaveName */
1.198     cvs       362: THOT_EXPORT char      *ObjectName;     /* document name                    */
                    363: THOT_EXPORT char      *SaveImgsURL;    /* where to save remote Images      */
                    364: THOT_EXPORT char      *TargetName;
                    365: THOT_EXPORT char      *SavingFile;     /* complete path or URL of the document */
1.202     cvs       366: THOT_EXPORT char      *SavedDocumentURL;/* URL of the document that contained
                    367:                                           the elements that are now in the
                    368:                                           Cut and Paste buffer */
1.205     kahan     369: THOT_EXPORT char      UserMimeType[MAX_LENGTH];
                    370:                                         /* Used to pass the user's MIME type 
                    371:                                           choice when doing a Save As of a
                    372:                                           local object to a server */
                    373: THOT_EXPORT char      UserCharset[MAX_LENGTH];
                    374:                                         /* Used to pass the user's charset
                    375:                                           choice when doing a Save As of a
                    376:                                           local object to a server */
1.207     kahan     377: THOT_EXPORT char      SaveFormTmp[MAX_LENGTH];
                    378:                                         /* Used for storing the temporary
                    379:                                           changes in the ChangeCharset and
                    380:                                           ChangeMimetype forms */
1.198     cvs       381: THOT_EXPORT int        Lg_password;
                    382: THOT_EXPORT int        BaseDialog;
                    383: THOT_EXPORT int        BasePrint;
                    384: THOT_EXPORT int        BaseImage;
                    385: THOT_EXPORT int               MathsDialogue;
                    386: THOT_EXPORT int               GraphDialogue;
                    387: THOT_EXPORT int               BaseCSS;
                    388: THOT_EXPORT int        ReturnOption;
                    389: THOT_EXPORT int        NumberRows;
                    390: THOT_EXPORT int        NumberCols;
                    391: THOT_EXPORT int        TBorder;
                    392: THOT_EXPORT int        ReturnOptionMenu;
                    393: THOT_EXPORT int        IdDoc;
1.234     cvs       394: THOT_EXPORT int        BaseLibrary;
1.198     cvs       395: THOT_EXPORT Document   CurrentDocument;
                    396: THOT_EXPORT Document   SavingDocument;
                    397: THOT_EXPORT Document   SavingObject;
                    398: THOT_EXPORT Document   AttrHREFdocument;
                    399: THOT_EXPORT Document   DocBook;
                    400: THOT_EXPORT Document   IncludedDocument;
1.294     vatton    401: THOT_EXPORT Document   ParsedDoc; /* The document to which CSS are applied */
                    402: THOT_EXPORT Document   ParsedCSS; /* The CSS document currently parsed */
1.198     cvs       403: THOT_EXPORT Element    AttrHREFelement;
                    404: THOT_EXPORT char      *AttrHREFvalue;
                    405: THOT_EXPORT Document   SelectionDoc;
1.281     vatton    406: THOT_EXPORT ThotBool   AttrHREFundoable;
                    407: THOT_EXPORT ThotBool   IsNewAnchor;
                    408: THOT_EXPORT ThotBool   UseLastTarget;
                    409: THOT_EXPORT ThotBool   LinkAsCSS;
                    410: THOT_EXPORT ThotBool   LinkAsXmlCSS;
1.198     cvs       411: THOT_EXPORT ThotBool   SaveAsHTML;
                    412: THOT_EXPORT ThotBool   SaveAsXML;
                    413: THOT_EXPORT ThotBool   SaveAsText;
                    414: THOT_EXPORT ThotBool   CopyImages;     /* should we copy images in Save As */
                    415: THOT_EXPORT ThotBool   UpdateURLs;     /* should we update URLs in Save As */
                    416: THOT_EXPORT ThotBool   UserAnswer;
1.280     vatton    417: THOT_EXPORT ThotBool   ExtraChoice;
1.281     vatton    418: THOT_EXPORT ThotBool   TableMenuActive;
                    419: THOT_EXPORT ThotBool   MTableMenuActive;
1.287     gully     420: THOT_EXPORT ThotBool   DontReplaceOldDoc;
1.198     cvs       421: THOT_EXPORT ThotBool   InNewWindow;
                    422: THOT_EXPORT ThotBool   SelectionInPRE;
                    423: THOT_EXPORT ThotBool   SelectionInComment;
                    424: THOT_EXPORT ThotBool   SelectionInEM;
                    425: THOT_EXPORT ThotBool   SelectionInSTRONG;
                    426: THOT_EXPORT ThotBool   SelectionInCITE;
                    427: THOT_EXPORT ThotBool   SelectionInABBR;
                    428: THOT_EXPORT ThotBool   SelectionInACRONYM;
                    429: THOT_EXPORT ThotBool   SelectionInINS;
                    430: THOT_EXPORT ThotBool   SelectionInDEL;
                    431: THOT_EXPORT ThotBool   SelectionInDFN;
                    432: THOT_EXPORT ThotBool   SelectionInCODE;
                    433: THOT_EXPORT ThotBool   SelectionInVAR;
                    434: THOT_EXPORT ThotBool   SelectionInSAMP;
                    435: THOT_EXPORT ThotBool   SelectionInKBD;
                    436: THOT_EXPORT ThotBool   SelectionInI;
                    437: THOT_EXPORT ThotBool   SelectionInB;
                    438: THOT_EXPORT ThotBool   SelectionInTT;
                    439: THOT_EXPORT ThotBool   SelectionInBIG;
                    440: THOT_EXPORT ThotBool   SelectionInSMALL;
                    441: THOT_EXPORT ThotBool   SelectionInSub;
                    442: THOT_EXPORT ThotBool   SelectionInSup;
                    443: THOT_EXPORT ThotBool   SelectionInQuote;
                    444: THOT_EXPORT ThotBool   SelectionInBDO;
                    445: THOT_EXPORT ThotBool   HTMLErrorsFound;
                    446: THOT_EXPORT ThotBool   XMLErrorsFound;
1.203     cvs       447: THOT_EXPORT ThotBool   CSSErrorsFound;
1.198     cvs       448: THOT_EXPORT ThotBool   XMLErrorsFoundInProfile;
                    449: THOT_EXPORT ThotBool   XMLNotWellFormed;
1.283     vatton    450: THOT_EXPORT ThotBool   XMLInvalidToken;
1.204     cvs       451: THOT_EXPORT ThotBool   XMLCharacterNotSupported;
                    452: THOT_EXPORT ThotBool   XMLUnknownEncoding;
1.261     vatton    453: /*  enabling/disabling DAVLib */
                    454: THOT_EXPORT ThotBool   DAVLibEnable;
1.267     vatton    455: THOT_EXPORT ThotBool   Synchronizing;
1.272     vatton    456: THOT_EXPORT ThotBool   AmayaUniqueInstance;
1.198     cvs       457: THOT_EXPORT ThotBool   IdApplyToSelection; /* used in the Make ID menu */
1.310     vatton    458: THOT_EXPORT ThotBool   Check_read_ids; /* check all parsed IDs */
1.198     cvs       459: THOT_EXPORT FILE      *ErrFile;
1.294     vatton    460: THOT_EXPORT FILE      *CSSErrFile;
1.53      cvs       461: typedef enum
                    462: {
1.285     vatton    463:   docFree,
1.53      cvs       464:   docHTML,
1.74      cvs       465:   docText,
1.75      cvs       466:   docImage,
1.85      cvs       467:   docCSS,
1.110     cvs       468:   docSource,
1.127     cvs       469:   docAnnot,
1.164     cvs       470:   docLog,
                    471:   docSVG,
                    472:   docMath,
1.234     cvs       473:   docXml,
1.311     vatton    474:   docTemplate,
1.256     kahan     475:   docLibrary,
1.297     gully     476:   docBookmark,
                    477:   docTypeMax
1.53      cvs       478: } DocumentType;
1.64      cvs       479: 
1.297     gully     480: THOT_EXPORT const char *DocumentTypeNames[docTypeMax]
                    481: #ifdef THOT_INITGLOBALVAR
                    482: = 
                    483: {
                    484:   "free",    /* docFree */
                    485:   "html",    /* docHTML */
                    486:   "text",    /* docText */
                    487:   "image",   /* docImage */
                    488:   "css",     /* docCSS */
                    489:   "source",  /* docSource */
                    490:   "annot",   /* docAnnot */
                    491:   "log",     /* docLog */
                    492:   "svg",     /* docSVG */
                    493:   "math",    /* docMath */
                    494:   "xml",     /* docXml */
                    495:   "library", /* docLibrary */
                    496:   "bookmark",/* docBookmark */
                    497: }
                    498: #endif /* THOT_INITGLOBALVAR */
                    499: ; /* do not remove this ; */
1.64      cvs       500: 
                    501: /* a record for data associated with a request */
                    502: typedef struct _DocumentMetaDataElement
                    503: {
1.244     vatton    504:   char      *initial_url;      /* if the server returns a different URL name
                    505:                                  after a redirection, we store here the one
                    506:                                  that the browser first asked */
                    507:   char      *form_data;        /* form data associated with a URL */
                    508:   char      *content_type;     /* content type returned by the server */
                    509:   char      *charset;          /* charset returned by the server */
                    510:   char      *content_length;   /* content length returned by the server */
                    511:   char      *content_location; /* simplified content location returned by the server */
                    512:   char      *full_content_location; /* full content location returned by the server */
1.307     vatton    513:   char      *reason;           /* http_headers reason*/
1.300     tollenae  514: 
1.308     vatton    515:   int        method;           /* method used to send this data */
1.135     cvs       516:   ThotBool   xmlformat;        /* the document should be exported in xml format */
1.304     vatton    517:   ThotBool   compound;        /* the document is a compound document */
1.144     kahan     518: #ifdef ANNOTATIONS
                    519:   Document   source_doc;       /* if the document is an annotation,
                    520:                                  this variable giveso the annoted document
                    521:                                  docid */
                    522: #endif /* ANNOTATIONS */
1.300     tollenae  523: 
                    524: #ifdef TEMPLATES
1.309     francesc  525:   char      *template_url;       /* the url of the original template (or null if not an instance) */
1.301     tollenae  526:   char      *template_version;   /* if this document is derived from a template,
                    527:                                     The name and the version of the template used to create the document 
1.300     tollenae  528:                                     is stored in this variable */
                    529: #endif /* TEMPLATES */
                    530:   
1.64      cvs       531: } DocumentMetaDataElement;
1.202     cvs       532: 
1.64      cvs       533: 
1.200     cvs       534: #define DocumentTableLength MAX_DOCUMENTS
1.110     cvs       535: /* URL of each loaded document */
1.198     cvs       536: THOT_EXPORT char                    *DocumentURLs[DocumentTableLength];
1.64      cvs       537: /* Any formdata associated with a URL */
                    538: THOT_EXPORT DocumentMetaDataElement *DocumentMeta[DocumentTableLength];
1.110     cvs       539: /* Type of document */
1.198     cvs       540: THOT_EXPORT DocumentType             DocumentTypes[DocumentTableLength];
1.236     vatton    541: /* Document that shows buttons */
                    542: THOT_EXPORT ThotBool                 SButtons[DocumentTableLength];
                    543: /* Document that shows address */
                    544: THOT_EXPORT ThotBool                 SAddress[DocumentTableLength];
1.213     vatton    545: /* Document that shows map areas */
                    546: THOT_EXPORT ThotBool                 MapAreas[DocumentTableLength];
1.305     cvs       547: /* Document splitted horizontally */
                    548: THOT_EXPORT ThotBool                 HSplit[DocumentTableLength];
                    549: /* Document splitted vertically */
                    550: THOT_EXPORT ThotBool                 VSplit[DocumentTableLength];
1.110     cvs       551: /* identifier of the document displaying the source code */
1.198     cvs       552: THOT_EXPORT Document                 DocumentSource[DocumentTableLength];
1.110     cvs       553: /* The whole document is loaded when the corresponding entry in FilesLoading is 0 */
1.198     cvs       554: THOT_EXPORT int                      FilesLoading[DocumentTableLength];
1.110     cvs       555: /* Status (error, success) of the download of the objects of a document */
1.198     cvs       556: THOT_EXPORT int                      DocNetworkStatus[DocumentTableLength];
1.42      cvs       557: 
1.198     cvs       558: THOT_EXPORT Document                 W3Loading; /* the document being loaded */
                    559: THOT_EXPORT Document                 BackupDocument; /* the current backup */
1.298     gully     560: 
1.243     vatton    561: /* list of previous open URLs */
                    562: THOT_EXPORT char                    *URL_list;
                    563: THOT_EXPORT int                      URL_list_len;
1.244     vatton    564: THOT_EXPORT ThotBool                 URL_list_keep;
1.296     tollenae  565: 
                    566: /* list of templates */
                    567: THOT_EXPORT char                    *Template_list;
                    568: THOT_EXPORT int                      Template_list_len;
                    569: 
1.268     vatton    570: #ifdef _SVG
1.244     vatton    571: THOT_EXPORT char                    *SVGlib_list;
1.268     vatton    572: #endif /* _SVG */
1.104     cvs       573: 
1.269     cvs       574: /* list of auto-saved files */
                    575: #define MAX_AutoSave_list 20
                    576: THOT_EXPORT char                    *AutoSave_list;
                    577: THOT_EXPORT int                      AutoSave_list_len;
                    578: THOT_EXPORT int                      AutoSave_Interval;
                    579: 
1.104     cvs       580: /* button indexes */
                    581: THOT_EXPORT int iStop;
                    582: THOT_EXPORT int iBack;
                    583: THOT_EXPORT int iForward;
                    584: THOT_EXPORT int iReload;
                    585: THOT_EXPORT int iHome;
                    586: THOT_EXPORT int iEditor;
                    587: THOT_EXPORT int iSave;
                    588: THOT_EXPORT int iPrint;
                    589: THOT_EXPORT int iFind;
                    590: THOT_EXPORT int iI;
                    591: THOT_EXPORT int iB;
                    592: THOT_EXPORT int iT;
                    593: THOT_EXPORT int iImage;
                    594: THOT_EXPORT int iH1;
                    595: THOT_EXPORT int iH2;
                    596: THOT_EXPORT int iH3;
                    597: THOT_EXPORT int iBullet;
                    598: THOT_EXPORT int iNum;
                    599: THOT_EXPORT int iDL;
                    600: THOT_EXPORT int iLink;
                    601: THOT_EXPORT int iTable;
1.284     gully     602: THOT_EXPORT int iLogo;
1.5       cvs       603: 
1.64      cvs       604: #define IMAGE_NOT_LOADED        0
1.1       cvs       605: #define IMAGE_LOCAL            1
                    606: #define IMAGE_LOADED           2
                    607: #define IMAGE_MODIFIED         3
                    608: 
1.109     cvs       609: 
1.262     vatton    610: typedef void (*LoadedImageCallback)(Document doc, Element el, char *file,
                    611:                                    void *extra, ThotBool isnew);
1.5       cvs       612: typedef struct _ElemImage
                    613:   {
1.27      cvs       614:      Element             currentElement;/* first element using this image */
1.5       cvs       615:      struct _ElemImage  *nextElement;
1.27      cvs       616:      LoadedImageCallback callback;     /* Callback for non-standard handling */
                    617:      void              *extra;         /* any extra info for the CallBack */
1.5       cvs       618:   }
                    619: ElemImage;
                    620: 
                    621: typedef struct _LoadedImageDesc
                    622:   {
1.198     cvs       623:      char               *originalName;  /* complete URL of the image                */
1.262     vatton    624:      char               *localName;     /* relative name (without path) of the image*/
                    625:      char               *tempfile;      /* name of the file that stores the image   */ 
1.205     kahan     626:      char               *content_type;  /* the MIME type as sent by the server      */
1.58      cvs       627:      struct _LoadedImageDesc *prevImage;/* double linked list                       */
                    628:      struct _LoadedImageDesc *nextImage;/* easier to unchain                        */
                    629:      Document            document;     /* document concerned                       */
                    630:      struct _ElemImage  *elImage;      /* first element using this image           */
                    631:      int                 imageType;     /* the type of the image                    */
                    632:      int                 status;       /* the status of the image loading          */
1.5       cvs       633:   }
                    634: LoadedImageDesc;
1.109     cvs       635: 
                    636: /* the structure used for storing the context of the 
                    637:    FetchAndDisplayImages_callback function */
                    638: typedef struct _FetchImage_context {
1.198     cvs       639:   char               *base_url;
1.109     cvs       640:   LoadedImageDesc    *desc;
                    641: } FetchImage_context;
                    642: 
1.5       cvs       643: 
1.14      cvs       644: THOT_EXPORT LoadedImageDesc *ImageURLs;
1.31      cvs       645: THOT_EXPORT LoadedImageDesc *ImageLocal;
1.1       cvs       646: 
1.88      cvs       647: /* The default Amaya HOME pages (page shown at boot time */
1.292     vatton    648: #ifdef _WX
                    649: #define AMAYA_PAGE  "AmayaPage_WX.html"
                    650: #else /* _WX */
1.198     cvs       651: #define AMAYA_PAGE  "AmayaPage.html"
1.292     vatton    652: #endif /* _WX */
1.198     cvs       653: #define AMAYA_PAGE_DOC  "http://www.w3.org/Amaya/User/"
1.137     cvs       654: 
                    655: #ifndef MAX_TXT_LEN
                    656: #define MAX_TXT_LEN 1024       /* Max. length of strings */
                    657: #endif  /* MAX_TXT_LEN */
1.88      cvs       658: 
1.226     kahan     659: /* a collection of the XML MIME types that keep changing and that we use in Amaya */
                    660: #define AM_XHTML_MIME_TYPE        "application/xhtml+xml"
1.229     kahan     661: #define AM_SVG_MIME_TYPE          "image/svg+xml"
1.226     kahan     662: #define AM_MATHML_MIME_TYPE       "application/mathml+xml"
                    663: #define AM_GENERIC_XML_MIME_TYPE  "text/xml"
                    664: 
1.231     cvs       665: 
                    666: /* Doctype declarations used in Amaya */
1.275     cvs       667: /* first line of doctype declarations */
1.232     vatton    668: #define DOCTYPE1_HTML_STRICT          "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\""
                    669: #define DOCTYPE1_HTML_TRANSITIONAL    "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\""
                    670: #define DOCTYPE1_XHTML10_BASIC        "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\""
                    671: #define DOCTYPE1_XHTML10_STRICT       "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
                    672: #define DOCTYPE1_XHTML11              "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\""
                    673: #define DOCTYPE1_XHTML11_PLUS_MATHML  "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\""
1.235     quint     674: #define DOCTYPE1_XHTML11_PLUS_MATHML_PLUS_SVG  "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN\""
1.232     vatton    675: #define DOCTYPE1_XHTML10_TRANSITIONAL "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\""
                    676: #define DOCTYPE1_MATHML20             "<!DOCTYPE math PUBLIC \"-//W3C//DTD MathML 2.0//EN\""
                    677: #define DOCTYPE1_SVG10                "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\""
1.231     cvs       678: 
1.275     cvs       679: /* second line of doctype declarations */
1.232     vatton    680: #define DOCTYPE2_HTML_STRICT          "      \"http://www.w3.org/TR/html4/strict.dtd\">"
                    681: #define DOCTYPE2_HTML_TRANSITIONAL    "      \"http://www.w3.org/TR/html4/loose.dtd\">"
                    682: #define DOCTYPE2_XHTML10_BASIC        "      \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">"
                    683: #define DOCTYPE2_XHTML10_STRICT       "      \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
                    684: #define DOCTYPE2_XHTML11              "      \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"
1.277     quint     685: #define DOCTYPE2_XHTML11_PLUS_MATHML  "      \"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd\">"
1.232     vatton    686: #define DOCTYPE2_XHTML11_PLUS_MATHML_PLUS_SVG  "      \"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd\">"
                    687: #define DOCTYPE2_XHTML10_TRANSITIONAL "      \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
                    688: #define DOCTYPE2_MATHML20             "      \"http://www.w3.org/TR/MathML2/dtd/mathml2.dtd\">"
1.295     vatton    689: #define DOCTYPE2_SVG10                "      \"http://www.w3.org/TR/2001/REC-SVG-20050904/DTD/svg10.dtd\">"
1.232     vatton    690: 
                    691: #define MATHML_XSLT_NAME     "pmathml.xsl"
1.286     vatton    692: #define MATHML_XSLT_URI      "xml-stylesheet type=\"text/xsl\" href=\""
1.231     cvs       693: 
1.254     quint     694: #define SVG_VERSION "1.0" /* version of the SVG specificatrion implemented
                    695:                             by the Amaya SVG editor */
                    696: 
1.25      cvs       697: #endif /* AMAYA_H */

Webmaster