Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
docs/userdefined.html
<HTML> |
<HEAD> |
<TITLE>HTMLRenderingLib - User Defined Routines</TITLE> |
</HEAD> |
<BODY BGCOLOR="#FFFFFF"> |
<H4> </H4> |
<H3>HTMLRenderingLib - user defined routines</H3> |
<H4><A NAME=MyHRWasURLVisitedProc></A></H4> |
<P> </P> |
<H4><FONT COLOR="#FF0000">MyHRWasURLVisitedProc</FONT></H4> |
<BLOCKQUOTE><PRE>Boolean MyHRWasURLVisitedProc( |
const char *url, |
void *refCon);</PRE> |
<P><B>url</B> - a pointer to a C-style string containing the |
URL.</P> |
<P><B>refCon</B> - an application defined value you provided when |
calling HRRegisterWasURLVisitedUPP to associate your visited proc |
with a HTML rendering object.</P> |
<P>function result - an error code.</P></BLOCKQUOTE> |
<P>Your visited procedure will be called whenever the HTML rendering |
library would like to determine if a link has been visited. If you |
are maintaining your own database of visited links, you can use this |
routine to report visited links back to the HTML rendering library. |
If a link has been visited, your routine should return true. If not, |
then your routine should return false. </P> |
<P>To set the visited links routine for a particular rendering |
object, call the HRRegisterWasURLVisitedUPP routine. The inRefCon |
parameter provided to this routine will be passed to your visited |
routine whenever it is called.</P> |
<BLOCKQUOTE><PRE>void HRRegisterWasURLVisitedUPP( |
HRWasURLVisitedUPP inWasURLVisitedUPP, |
<A HREF="types.html#HRReference">HRReference</A> hrRef, |
void * inRefCon);</PRE></BLOCKQUOTE> |
<P><A HREF="index.html">return to index</A></P> |
<H4><A NAME=MyHRNewURLProc></A></H4> |
<P> </P> |
<H4><FONT COLOR="#FF0000">MyHRNewURLProc</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus MyHRNewURLProc( |
const char *url, |
const char *targetFrame, |
Boolean addToHistory, |
void *refCon); |
</PRE> |
<P><B>url</B> - a pointer to a C-style string containing the |
URL.</P> |
<P><B>targetFrame</B> - a pointer to a C-style string containing |
the destination frame for the URL.</P> |
<P><B>addToHistory</B> - a boolean value.</P> |
<P><B>refCon</B> - an application defined value you provided when |
calling HRRegisterNewURLUPP to associate your visited proc with a |
HTML rendering object.</P> |
<P>function result - an error code.</P></BLOCKQUOTE> |
<P>Your new url procedure will be called whenever the HTML rendering |
library replaces the HTML image being shown in the display. This |
routine provides an opportunity for your application to update the |
windows title and add the url to a history of visited links. </P> |
<P>To set the new url routine for a particular rendering object, call |
the HRRegisterNewURLUPP routine. The inRefCon parameter provided to |
this routine will be passed to your new url routine whenever it is |
called.</P> |
<BLOCKQUOTE><PRE>void HRRegisterNewURLUPP( |
HRNewURLUPP inNewURLUPP, |
HRReference hrRef, |
void *inRefCon);</PRE></BLOCKQUOTE> |
<P><A HREF="index.html">return to index</A></P> |
<P><A NAME=MyHRURLToFSSpecProc></A></P> |
<P> </P> |
<H4><FONT COLOR="#FF0000">MyHRURLToFSSpecProc</FONT></H4> |
<BLOCKQUOTE><PRE>OSStatus MyHRURLToFSSpecProc( |
const char *rootURL, |
const char *linkURL, |
FSSpec *fsspec, |
<A HREF="types.html#URLSourceType">URLSourceType</A> urlSourceType, |
void *refCon);</PRE> |
<P><B>rootURL</B> - can be NULL. a pointer to a C-style string |
containing the root URL.</P> |
<P><B>linkURL</B> - can be NULL. a pointer to a C-style string |
containing the link URL.</P> |
<P><B>fsspec</B> - a pointer to a file system specification record |
where your routine should store the location of the file to be |
displayed.</P> |
<P><B>urlSourceType</B> - a value of type <A HREF="types.html#URLSourceType">URLSourceType</A> |
describing the type of file the HTML rendering library is looking |
for.</P> |
<P><B>refCon</B> - an application defined value you provided when |
calling HRRegisterURLToFSSpecUPP to associate your visited proc |
with a HTML rendering object.</P></BLOCKQUOTE> |
<P>Your new url procedure will be called whenever the HTML rendering |
library is trying to find a file associated with a particular link or |
URL. This routine provides an opportunity for your application to |
intercept URLs re-direct them to refer to different files on disk. |
</P> |
<P>To set the url to FSSpec routine for a particular rendering |
object, call the HRRegisterURLToFSSpecUPP routine. The inRefCon |
parameter provided to this routine will be passed to your url to |
FSSpec routine whenever it is called.</P> |
<BLOCKQUOTE><PRE>void HRRegisterURLToFSSpecUPP( |
HRURLToFSSpecUPP inURLToFSSpecUPP, |
HRReference hrRef, |
void *inRefCon);</PRE></BLOCKQUOTE> |
<P> </P> |
<P><A HREF="index.html">return to index</A></P> |
<P></P> |
</BODY> |
</HTML> |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-30