Important: The HTML Rendering Library is deprecated as of Mac OS X v10.4. A much more complete solution for displaying HTML and web content in your application is provided by the Web Kit. See WebKit Objective-C Programming Guide for guidelines on using the Web Kit.
Framework | Carbon/Carbon.h |
Declared in | HTMLRendering.h |
Important: The HTML Rendering Library is deprecated as of Mac OS X v10.4. A much more complete solution for displaying HTML and web content in your application is provided by the Web Kit. See WebKit Objective-C Programming Guide for guidelines on using the Web Kit.
Whereas the HTML Rendering Library takes a specified HTML file and draws text and images in a window, the Web Kit inserts a browser window into your document. The user can specify any URL and follow links in the Web Kit view window. Because the Web Kit takes a completely different approach to displaying HTML and web content from that used by the HTML Rendering Library, you cannot make a one-to-one substitution of Web Kit methods for HTML Rendering Library functions. However, the basic features of the Web Kit can be implemented very quickly, and Web Kit offers much greater capability than the HTML Rendering Library. With the Web Kit, your application can include anything from an HTML viewing window to a full-featured web browser.
Although the Web Kit is an Objective-C interface, you can call it from a Carbon application. See Accessing the Web Kit From Carbon Applications for details.
The HTML Rendering Library gives your application the ability to draw text and images in a window, as specified by HTML data. Note that this API does not include other features of HTML browsers, such as history tracking or plug-in support. The kinds of tasks you can perform with the HTML Rendering Library include
formatting and updating the rendering area with such elements as borders, scroll bars, and size boxes in scroll bars
setting such graphics and display options as screen depth and graphics ports
working with events
drawing pages from HTML data
obtaining information about pages
converting URL and file system specification data
HRHTMLRenderingLibAvailable
HRGetHTMLRenderingLibVersion
Deprecated in Mac OS X v10.4
DisposeHRNewURLUPP
Deprecated in Mac OS X v10.4
HRRegisterNewURLUPP
Deprecated in Mac OS X v10.4
HRUnregisterNewURLUPP
Deprecated in Mac OS X v10.4
NewHRNewURLUPP
Deprecated in Mac OS X v10.4
DisposeHRWasURLVisitedUPP
Deprecated in Mac OS X v10.4
HRRegisterWasURLVisitedUPP
Deprecated in Mac OS X v10.4
HRUnregisterWasURLVisitedUPP
Deprecated in Mac OS X v10.4
NewHRWasURLVisitedUPP
Deprecated in Mac OS X v10.4
HRDisposeReference
Deprecated in Mac OS X v10.4
HRNewReference
Deprecated in Mac OS X v10.4
HRNewReferenceInWindow
Deprecated in Mac OS X v10.4
HRSetDrawBorder
Deprecated in Mac OS X v10.4
HRSetGrowboxCutout
Deprecated in Mac OS X v10.4
HRSetScrollbarState
Deprecated in Mac OS X v10.4
DisposeHRURLToFSSpecUPP
Deprecated in Mac OS X v10.4
HRRegisterURLToFSSpecUPP
Deprecated in Mac OS X v10.4
HRUnregisterURLToFSSpecUPP
Deprecated in Mac OS X v10.4
NewHRURLToFSSpecUPP
Deprecated in Mac OS X v10.4
HRDraw
Deprecated in Mac OS X v10.4
HRDrawInPort
Deprecated in Mac OS X v10.4
HRGetRenderedImageSize
Deprecated in Mac OS X v10.4
HRGetRenderedImageSize32
Deprecated in Mac OS X v10.4
HRScrollToImageLocation32
Deprecated in Mac OS X v10.4
HRScrollToLocation
Deprecated in Mac OS X v10.4
HRSetRenderingRect
Deprecated in Mac OS X v10.4
HRForceQuickdraw
Deprecated in Mac OS X v10.4
HRFreeMemory
Deprecated in Mac OS X v10.4
HRScreenConfigurationChanged
Deprecated in Mac OS X v10.4
HRSetGrafPtr
Deprecated in Mac OS X v10.4
HRActivate
Deprecated in Mac OS X v10.4
HRDeactivate
Deprecated in Mac OS X v10.4
HRIsHREvent
Deprecated in Mac OS X v10.4
HRGoToAnchor
Deprecated in Mac OS X v10.4
HRGoToAnchorCFString
Deprecated in Mac OS X v10.4
HRGoToCFURL
Deprecated in Mac OS X v10.4
HRGoToData
Deprecated in Mac OS X v10.4
HRGoToFile
Deprecated in Mac OS X v10.4
HRGoToFSRef
Deprecated in Mac OS X v10.4
HRGoToPtr
Deprecated in Mac OS X v10.4
HRGoToURL
Deprecated in Mac OS X v10.4
HRGetBaseURL
Deprecated in Mac OS X v10.4
HRGetBaseURLAsCFString
Deprecated in Mac OS X v10.4
HRGetHTMLFile
Deprecated in Mac OS X v10.4
HRGetHTMLFileAsFSRef
Deprecated in Mac OS X v10.4
HRGetHTMLURL
Deprecated in Mac OS X v10.4
HRGetHTMLURLAsCFURL
Deprecated in Mac OS X v10.4
HRGetRootURL
Deprecated in Mac OS X v10.4
HRGetRootURLAsCFString
Deprecated in Mac OS X v10.4
HRGetTitle
Deprecated in Mac OS X v10.4
HRGetTitleAsCFString
Deprecated in Mac OS X v10.4
HRUtilCreateFullCFURL
Deprecated in Mac OS X v10.4
HRUtilCreateFullURL
Deprecated in Mac OS X v10.4
HRUtilGetFSRefFromURL
Deprecated in Mac OS X v10.4
HRUtilGetFSSpecFromURL
Deprecated in Mac OS X v10.4
HRUtilGetURLFromFSRef
Deprecated in Mac OS X v10.4
HRUtilGetURLFromFSSpec
Deprecated in Mac OS X v10.4
DisposeHRNewCFURLUPP
Deprecated in Mac OS X v10.4
DisposeHRURLToFSRefUPP
Deprecated in Mac OS X v10.4
DisposeHRWasCFURLVisitedUPP
Deprecated in Mac OS X v10.4
HRRegisterNewCFURLUPP
Deprecated in Mac OS X v10.4
HRRegisterURLToFSRefUPP
Deprecated in Mac OS X v10.4
HRRegisterWasCFURLVisitedUPP
Deprecated in Mac OS X v10.4
HRUnregisterNewCFURLUPP
Deprecated in Mac OS X v10.4
HRUnregisterURLToFSRefUPP
Deprecated in Mac OS X v10.4
HRUnregisterWasCFURLVisitedUPP
Deprecated in Mac OS X v10.4
InvokeHRNewCFURLUPP
Deprecated in Mac OS X v10.4
InvokeHRNewURLUPP
Deprecated in Mac OS X v10.4
InvokeHRURLToFSRefUPP
Deprecated in Mac OS X v10.4
InvokeHRURLToFSSpecUPP
Deprecated in Mac OS X v10.4
InvokeHRWasCFURLVisitedUPP
Deprecated in Mac OS X v10.4
InvokeHRWasURLVisitedUPP
Deprecated in Mac OS X v10.4
NewHRNewCFURLUPP
Deprecated in Mac OS X v10.4
NewHRURLToFSRefUPP
Deprecated in Mac OS X v10.4
NewHRWasCFURLVisitedUPP
Deprecated in Mac OS X v10.4
HRSetEmbeddingControl
Deprecated in Mac OS X v10.4
HRSetWindowRef
Deprecated in Mac OS X v10.4
Reports whether the HTML Rendering Library is available. (Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
pascal Boolean HRHTMLRenderingLibAvailable
Returns true
if the HTML Rendering Library is available; returns false
otherwise.
Because the Web Kit takes a completely different approach to displaying HTML and web content from that used by the HTML Rendering Library, you cannot make a one-to-one substitution of Web Kit methods for HTML Rendering Library functions. However, the basic features of the Web Kit can be implemented very quickly, and Web Kit offers much greater capability than the HTML Rendering Library. Although the Web Kit is an Objective-C interface, you can call it from a Carbon application. See Accessing the Web Kit From Carbon Applications for details.
HTMLRendering.h
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef OSStatus (*HRNewCFURLProcPtr) ( CFURLRef url, CFStringRef targetString, Boolean addToHistory, void * refCon );
If you name your function MyHRNewCFURLProc
, you would declare it like this:
OSStatus MyHRNewCFURLProc ( CFURLRef url, CFStringRef targetString, Boolean addToHistory, void * refCon );
HTMLRendering.h
An application-defined function that tracks newly visited links. (Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef OSStatus (*HRNewURLProcPtr) ( const char * url, const char * targetFrame, Boolean addToHistory, void * refCon );
If you name your function MyHRNewURLProc
, you would declare it like this:
OSStatus MyHRNewURLProc ( const char * url, const char * targetFrame, Boolean addToHistory, void * refCon );
A pointer to a C string containing the URL of the link.
A pointer to a C string containing the name of the target frame.
The HTML Rendering Library passes true
in this parameter to indicate that you should add this link to a link-tracking history. It is up to your application to do any link-tracking.
An arbitrary value set by your application. This value is passed by your application when you call the function HRRegisterNewURLUPP
and passed back when the HTML Rendering Library calls your MyNewURLProc
function. You may find this value useful for referring to an object instance or a structure, for example.
A result code. See “HTML Rendering Library Result Codes.”
You may find this function useful for maintaining a history list, for example. The sequence of steps required to implement an application-defined function to track visited links is as follows:
Obtain a UPP for your application-defined function by calling the function NewHRNewURLUPP
.
Register your application-defined function by passing the UPP to the function HRRegisterNewURLUPP
.
When the HTML Rendering Library calls your application-defined function, take note of the URL being visited.
When you are done using your application-defined function:
Unregister your application-defined function by calling the function HRUnregisterNewURLUPP
.
Dispose of the UPP by calling the function DisposeHRNewURLUPP
.
HTMLRendering.h
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef OSStatus (*HRURLToFSRefProcPtr) ( CFStringRef rootString, CFStringRef linkString, FSRef * fref, URLSourceType urlSourceType, void * refCon );
If you name your function MyHRURLToFSRefProc
, you would declare it like this:
OSStatus MyHRURLToFSRefProc ( CFStringRef rootString, CFStringRef linkString, FSRef * fref, URLSourceType urlSourceType, void * refCon );
HTMLRendering.h
Converts URL data to a file system specification. (Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef OSStatus (*HRURLToFSSpecProcPtr) ( const char * rootURL, const char * linkURL, FSSpec * fsspec, URLSourceType urlSourceType, void * refCon );
If you name your function MyHRURLToFSSpecProc
, you would declare it like this:
OSStatus MyHRURLToFSSpecProc ( const char * rootURL, const char * linkURL, FSSpec * fsspec, URLSourceType urlSourceType, void * refCon );
A pointer to a C string containing the root URL of the file to be loaded.
A pointer to a C string containing the link URL of the file to be loaded.
A pointer to a file system specification record (FSSpec
) that you use to specify the file to which the HTML Rendering Library redirects the user.
The HTML Rendering Library passes one of the following constants to indicate the type of file being searched for:
kHRLookingForHTMLSource
indicates that the file is an HTML source document.
kHRLookingForImage
indicates that the file is an image.
kHRLookingForEmbedded
indicates that the file is an embedded object, such as a QuickTime movie.
kHRLookingForImageMap
indicates that the file is an HTML image map.
kHRLookingForFrame
indicates that the file is an HTML frameset.
An arbitrary value set by your application. This value is passed by your application when you call the function and passed back when the HTML Rendering Library calls your MyHRURLToFSSpecProc
function. You may find this value useful for referring to an object instance or a structure, for example.
A result code. See “HTML Rendering Library Result Codes.”
This function may be useful if you want to redirect certain URL’s to application-specific files, for example. The sequence of steps required to implement an application-defined function to intercept URL’s is as follows:
Obtain a UPP for your application-defined function by calling the function NewHRURLToFSSpecUPP
.
Register your application-defined function by passing the UPP to the function HRRegisterURLToFSSpecUPP
.
Respond when the HTML Rendering Library calls your application-defined function.
When you are done with your application-defined function:
Unregister your application-defined function by calling the function HRUnregisterURLToFSSpecUPP
.
Dispose of the UPP by calling the function DisposeHRURLToFSSpecUPP
.
HTMLRendering.h
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef Boolean (*HRWasCFURLVisitedProcPtr) ( CFURLRef url, void * refCon );
If you name your function MyHRWasCFURLVisitedProc
, you would declare it like this:
Boolean MyHRWasCFURLVisitedProc ( CFURLRef url, void * refCon );
HTMLRendering.h
Keeps track of whether a given URL has been previously visited. (Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef Boolean (*HRWasURLVisitedProcPtr) ( const char * url, void * refCon );
If you name your function MyHRWasURLVisitedProc
, you would declare it like this:
Boolean MyHRWasURLVisitedProc ( const char * url, void * refCon );
A pointer to a C string containing the URL of the link.
An arbitrary value set by your application. This value is passed by your application when you call the function and passed back when the HTML Rendering Library calls your MyHRWasURLVisitedProc
function. You may find this value useful for referring to an object instance or a structure, for example.
If the given URL was previously visited, your application-defined function should return true
. If the given URL was not previously visited, your application-defined function should return false
.
The sequence of steps required to implement an application-defined function to handle previously visited links is as follows:
Obtain a UPP for your application-defined function by calling the function NewHRWasURLVisitedUPP
.
Register your application-defined function by passing the UPP to the function HRRegisterWasURLVisitedUPP
.
Respond when the HTML Rendering Library calls your application-defined function.
When you are done using your application-defined function:
Unregister your application-defined function by calling the function HRUnregisterWasURLVisitedUPP
.
Dispose of the UPP by calling the function DisposeHRWasURLVisitedUPP
.
HTMLRendering.h
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef HRNewCFURLProcPtr HRNewCFURLUPP;
HTMLRendering.h
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef HRNewURLProcPtr HRNewURLUPP;
HTMLRendering.h
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef struct OpaqueHRReference * HRReference;
HTMLRendering.h
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef HRURLToFSRefProcPtr HRURLToFSRefUPP;
HTMLRendering.h
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef HRURLToFSSpecProcPtr HRURLToFSSpecUPP;
HTMLRendering.h
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef HRWasCFURLVisitedProcPtr HRWasCFURLVisitedUPP;
HTMLRendering.h
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef HRWasURLVisitedProcPtr HRWasURLVisitedUPP;
HTMLRendering.h
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef SInt16 HRScrollbarState; enum { eHRScrollbarOn = 0, eHRScrollbarOff = 1, eHRScrollbarAuto = 2 };
eHRScrollbarOn
Tells the HTML Rendering Library to draw scrollbars at all times. If the data does not fill the current view, the scroll bars are inactive.
Available in Mac OS X v10.0 and later.
Declared in HTMLRendering.h
.
eHRScrollbarOff
Tells the HTML Rendering Library never to draw scrollbars. You may find this option useful if the HTML rendering area you specify does not extend to the edge of a window.
Available in Mac OS X v10.0 and later.
Declared in HTMLRendering.h
.
eHRScrollbarAuto
Tells the HTML Rendering Library to draw scrollbars as needed. This is the default setting.
Available in Mac OS X v10.0 and later.
Declared in HTMLRendering.h
.
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.)
enum { kHRRendererHTML32Type = 'ht32' };
(Deprecated. Use Web Kit instead; see WebKit Objective-C Programming Guide.Use Web Kit instead; see WebKit Objective-C Programming Guide.)
typedef UInt16 URLSourceType; enum { kHRLookingForHTMLSource = 1, kHRLookingForImage = 2, kHRLookingForEmbedded = 3, kHRLookingForImageMap = 4, kHRLookingForFrame = 5 };
kHRLookingForHTMLSource
Indicates that the file is an HTML source document.
Available in Mac OS X v10.0 and later.
Declared in HTMLRendering.h
.
kHRLookingForImage
Indicates that the file is an image.
Available in Mac OS X v10.0 and later.
Declared in HTMLRendering.h
.
kHRLookingForEmbedded
Indicates that the file is an embedded object, such as a QuickTime movie.
Available in Mac OS X v10.0 and later.
Declared in HTMLRendering.h
.
kHRLookingForImageMap
Indicates that the file is an HTML image map.
Available in Mac OS X v10.0 and later.
Declared in HTMLRendering.h
.
kHRLookingForFrame
Indicates that the file is an HTML frameset.
Available in Mac OS X v10.0 and later.
Declared in HTMLRendering.h
.
The most common result codes returned by HTML Rendering Library are listed in the table below. HTML Rendering Library may also return codes noErr
(0), and paramErr
(-50).
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-07-13)