/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the C interface to the Objective-C (or whatever) Style-oriented HyperText class. It is used when a style-oriented text object is available or craeted in order to display hypertext.
This module is a part of the Library of Common Code. However, it is NOT implemented anywhere in the library, as it is client (and often platform) specific code. Hence these functions must be implemented in the client. The Line Mode Browser has the implementation in the GridText module.
#ifndef HTEXT_H #define HTEXT_H #include "HTAnchor.h" #include "HTStyle.h" #include "HTStream.h" #include "SGML.h" #ifndef THINK_C #ifndef HyperText /* Objective C version defined HyperText */ typedef struct _HText HText; /* Normal Library */ #else @class HText; /* Objective C version for NeXTStep */ #endif #else class CHyperText; /* Mac Think-C browser hook */ typedef CHyperText HText; #endif extern HText * HTMainText; /* Pointer to current main text */ extern HTParentAnchor * HTMainAnchor; /* Pointer to current text's anchor */
extern HText * HText_new PARAMS((HTParentAnchor * anchor)); extern HText * HText_new2 PARAMS((HTParentAnchor * anchor, HTStream * output_stream)); extern HText * HText_new3 PARAMS((HTRequest * request, HTStream * output_stream, HTStructured * structure));
extern void HText_free PARAMS((HText * me));
extern void HText_beginAppend PARAMS((HText * text)); extern void HText_endAppend PARAMS((HText * text));
extern void HText_setStyle PARAMS((HText * text, HTStyle * style));
extern void HText_appendCharacter PARAMS((HText * text, char ch));
extern void HText_appendText PARAMS((HText * text, CONST char * str));
extern void HText_appendParagraph PARAMS((HText * text)); extern void HText_appendLineBreak PARAMS((HText * text)); extern void HText_appendHorizontalRule PARAMS((HText * text));
The anchor object is created and passed to HText_beginAnchor. The senstive text is added to the text object, and then HText_endAnchor is called. Anchors may not be nested.
extern void HText_beginAnchor PARAMS((HText * text, HTChildAnchor * anc)); extern void HText_endAnchor PARAMS((HText * text));
extern void HText_setNextId PARAMS(( HText * text, CONST char * s));
An alternative implementation could be, for example, to begin an anchor, append the alternative text or "IMAGE", then end the anchor. This would simply generate some text linked to the image itself as a separate document.
extern void HText_appendImage PARAMS(( HText * text, HTChildAnchor * anc, CONST char * alternative_text, CONST char * alignment, BOOL isMap));
extern void HText_appendObject PARAMS(( HText * text, int element_number, CONST BOOL * present, CONST char * CONST * value));
extern void HText_unimplemented PARAMS(( HText * text));
extern void HText_dump PARAMS((HText * me));
extern HTParentAnchor * HText_nodeAnchor PARAMS((HText * me));
extern BOOL HText_select PARAMS((HText * text)); extern BOOL HText_selectAnchor PARAMS((HText * text, HTChildAnchor* anchor));
/* Style handling: */ /* Apply this style to the selection */ extern void HText_applyStyle PARAMS((HText * me, HTStyle *style)); /* Update all text with changed style. */ extern void HText_updateStyle PARAMS((HText * me, HTStyle *style)); /* Return style of selection */ extern HTStyle * HText_selectionStyle PARAMS(( HText * me, HTStyleSheet* sheet)); /* Paste in styled text */ extern void HText_replaceSel PARAMS((HText * me, CONST char *aString, HTStyle* aStyle)); /* Apply this style to the selection and all similarly formatted text ** (style recovery only) */ extern void HTextApplyToSimilar PARAMS((HText * me, HTStyle *style)); /* Select the first unstyled run. ** (style recovery only) */ extern void HTextSelectUnstyled PARAMS((HText * me, HTStyleSheet *sheet)); /* Anchor handling: */ extern void HText_unlinkSelection PARAMS((HText * me)); extern HTAnchor * HText_referenceSelected PARAMS((HText * me)); extern HTAnchor * HText_linkSelTo PARAMS((HText * me, HTAnchor* anchor)); #endif /* HTEXT_H */end