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

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

Webmaster