PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBHTMLViewer
Wrapper Class for the IHtmlViewer interface.
#include <SFBHTMLViewer.h.hpp>
class SFBHTMLViewer : public SFBControl;
SFMTYPEDEFWRAPPER(SFBHTMLViewer)

Inheritance diagram

 Inheritance diagram of SFBHTMLViewerClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API IHtmlViewer

Member

Public Functions
SInt32 FindElem( ACharConstPtr element , SInt32 index )
Find an element, given the element name and the number of the occurrence.
SInt32 FindElem( SFXAnsiStringConstRef element , SInt32 index )
Find an element, given the element name and the number of the occurrence.
SInt32 GetAttrValue( SInt32 pos , ACharConstPtr attribute , ACharPtr buf , SInt32 bufSize )
Obtain the value of an attribute of an element.
SInt32 GetAttrValue( SInt32 pos , SFXAnsiStringConstRef attribute , ACharPtr buf , SInt32 bufSize )
Obtain the value of an attribute of an element.
SInt32 GetAttrValue( SInt32 pos , ACharConstPtr attribute , SFXAnsiStringPtr string )
Obtain the value of an attribute of an element.
SInt32 GetAttrValue( SInt32 pos , SFXAnsiStringConstRef attribute , SFXAnsiStringPtr string )
Obtain the value of an attribute of an element.
SInt32 GetElemText( SInt32 pos , ACharPtr buf , SInt32 bufSize )
Obtain the text content of an element.
SInt32 GetElemText( SInt32 pos , SFXAnsiStringPtr string )
Obtain the text content of an element.
SFCError GetOption( SInt32 id , HVOpt* state )
Retrieve one of a number of values that describe the state of the viewer. Note that this does not retrieve the values that have been set through SFBHTMLViewer::SetOption().
SInt32 GetViewState( ACharPtr buf , SInt32 bufSize )
Return a string that represents the current viewer state. This string may be passed to SFBHTMLViewer::SetViewState() to restore the viewer state.
SInt32 GetViewState( SFXAnsiStringPtr string )
Return a string that represents the current viewer state. This string may be passed to SFBHTMLViewer::SetViewState() to restore the viewer state.
SFXAnsiString GetViewState( Void )
Return a string that represents the current viewer state. This string may be passed to SFBHTMLViewer::SetViewState() to restore the viewer state.
Bool IsBusy( Void )
Return true if the viewer is in the process of loading HTML from a SFBAStream or SFBSource.
Void LoadSource( SFBSourceSmpConstRef source )
Load the contents of a SFBSource into the document, parsing the data as HTML.
Void LoadStream( SFBAStreamSmpConstRef stream )
Load the contents of a SFBAStream into the document, parsing the data as HTML.
static
SFBHTMLViewerSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBHTMLViewer instance.
static
SFBHTMLViewerSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBHTMLViewer instance.
Void ParseBuffer( ACharConstPtr string )
Load the viewer with the contents of a zero-terminated string.
Void ParseBuffer( SFXAnsiStringConstRef string )
Load the viewer with the contents of a zero-terminated string.
Void SetData( ACharConstPtr buf , SInt32 bufSize = -1 )
Provide a buffer of HTML to the viewer. All of the buffer is parsed into the viewer synchronously.
Void SetData( SFXAnsiStringConstRef string )
Provide a buffer of HTML to the viewer. All of the buffer is parsed into the viewer synchronously.
SFCError SetIWeb( SFBWebSmpConstRef web )
Set the SFBWeb interface with which the viewer will use to obtain sub-objects. A shorthand function for SFBHTMLViewer::SetOption (HVOPT_PTR_IWEB).
SFCError SetIndent( SInt32 indent )
Set the basic indent amount. A shorthand function for SFBHTMLViewer::SetOption (HVOPT_N_INDENT).
Void SetLinkColor( RGBVAL color )
Set the default text color. A Shorthand function for SFBHTMLViewer::SetOption (HVOPT_RGB_LINK).
Void SetLinkColor( SFXRGBColorConstRef color )
Set the default text color. A Shorthand function for SFBHTMLViewer::SetOption (HVOPT_RGB_LINK).
Void SetNotifyFn( PFNHVIEWNOTIFY notify , VoidPtr data = null )
Specify the information in a notification callback, which consists of a function pointer and a void context pointer to be passed to the function when it is called.
SFCError SetOption( SInt32 id , HVOpt state )
Set one of a number of options that control the behavior of the viewer. Callers typically do not call this function directly; there are macros defined for each individual option.
SFCError SetSBWidth( SInt32 width )
Set the width of the vertical scroll bar. A shorthand function for SFBHTMLViewer::SetOption (HVOPT_N_SBWIDTH).
SFCError SetTextColor( RGBVAL color )
Set the default text color. A shorthand function for SFBHTMLViewer::SetOption ( HVOPT_RGB_TEXT ).
SFCError SetTextColor( SFXRGBColorConstRef color )
Set the default text color. A shorthand function for SFBHTMLViewer::SetOption ( HVOPT_RGB_TEXT ).
SFCError SetType( ACharConstPtr type )
Set the MIME type and/or character set for the viewer. A shorthand function for SFBHTMLViewer::SetOption (HVOPT_SZ_TYPE).
SFCError SetType( SFXAnsiStringConstRef type )
Set the MIME type and/or character set for the viewer. A shorthand function for SFBHTMLViewer::SetOption (HVOPT_SZ_TYPE).
SFCError SetURL( ACharConstPtr url )
Specify the URL address of the document that is to be loaded into the viewer. This should be called before HTML is loaded into a document.
SFCError SetURL( SFXAnsiStringConstRef url )
Specify the URL address of the document that is to be loaded into the viewer. This should be called before HTML is loaded into a document.
SFCError SetVSpace( SInt32 vSpace )
Set the vertical paragraph spacing. A shorthand function for SFBHTMLViewer::SetOption (HVOPT_N_VSPACE).
Void SetViewState( ACharConstPtr state )
Restore the HTML viewer state (such as scroll position) to a state represented by a string returned by SFBHTMLViewer::GetViewState().
Void SetViewState( SFXAnsiStringConstRef state )
Restore the HTML viewer state (such as scroll position) to a state represented by a string returned by SFBHTMLViewer::GetViewState().
Void Stop( Void )
Cause the viewer to stop loading HTML from a SFBAStream or SFBSource, if the viewer is busy. If this stops loading of the document, an HVN_DONE notification is triggered.
UInt32 GetProperties( Void ) (inherits from SFBControl)
Return the control-specific properties or flags.
Void GetRect( SFXRectanglePtr rect ) (inherits from SFBControl)
Get the rectangle of the control.
SFXRectangle GetRect( Void ) (inherits from SFBControl)
Get the rectangle of the control.
Bool HandleEvent( AEEEvent event , UInt16 wParam , UInt32 dwParam ) (inherits from SFBControl)
Pass events to a control. The BREW controls process various events to allow a device user to enter a text, time, or date value or choose an item from a menu. Refer to the descriptions of each control for the events it handles. Your applet must pass a control all of the events, unless the control is part of a dialog. Below is an example of an application passing all of the events to the controls of the application.
Bool HandleEvent( SFXEventConstRef event ) (inherits from SFBControl)
Pass events to a control. The BREW controls process various events to allow a device user to enter a text, time, or date value or choose an item from a menu. Refer to the descriptions of each control for the events it handles. Your applet must pass a control all of the events, unless the control is part of a dialog. Below is an example of an application passing all of the events to the controls of the application.
Bool IsActive( Void ) (inherits from SFBControl)
Return the active or focus state of the control.
Bool Redraw( Void ) (inherits from SFBControl)
Instruct the control to redraw its contents.
Void Reset( Void ) (inherits from SFBControl)
Instruct the control to reset (free/delete) its contents and to immediately leave active/focus mode.
Void SetActive( Bool active = true ) (inherits from SFBControl)
Instruct the control to enter/leave focus or selected mode.
Void SetProperties( UInt32 properties ) (inherits from SFBControl)
Set control-specific properties or flags.
Void SetRect( SFXRectangleConstRef rect ) (inherits from SFBControl)
Set the active screen coordinates of the control. This may result in the control redrawing its contents.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBHTMLViewer::FindElem
Find an element, given the element name and the number of the occurrence.
[ public ]
SInt32 FindElem(
    ACharConstPtr element   // name of the element to find,
                            // which is a zero-terminated ASCII string (case insensitive)
    SInt32 index            // which occurrence (0 => first element, 1=> second element, and so on)
);
[ public ]
SInt32 FindElem(
    SFXAnsiStringConstRef element   // name of the element to find,
                                    // which is a zero-terminated ASCII string (case insensitive)
    SInt32 index                    // which occurrence (0 => first element, 1=> second element, and so on)
);

Reference

BREW API IHTMLVIEWER_FindElem


SFBHTMLViewer::GetAttrValue
Obtain the value of an attribute of an element.
[ public ]
SInt32 GetAttrValue(
    SInt32 pos                // location of the element in the document 
    ACharConstPtr attribute   // name of attribute 
    ACharPtr buf              // pointer to the start of a buffer to hold the result
    SInt32 bufSize            // size of the buffer, in bytes 
);
[ public ]
SInt32 GetAttrValue(
    SInt32 pos                        // location of the element in the document 
    SFXAnsiStringConstRef attribute   // name of attribute
    ACharPtr buf                      // pointer to the start of a buffer to hold the result
    SInt32 bufSize                    // size of the buffer, in bytes 
);
[ public ]
SInt32 GetAttrValue(
    SInt32 pos                // location of the element in the document
    ACharConstPtr attribute   // name of attribute
    SFXAnsiStringPtr string   // string to hold the result
);
[ public ]
SInt32 GetAttrValue(
    SInt32 pos                        // location of the element in the document
    SFXAnsiStringConstRef attribute   // name of attribute
    SFXAnsiStringPtr string           // string to hold the result
);

Reference

BREW API IHTMLVIEWER_GetAttrValue


SFBHTMLViewer::GetElemText
Obtain the text content of an element.
[ public ]
SInt32 GetElemText(
    SInt32 pos       // the location of the element in the document. 
                     // this can be obtained from  SFBHTMLViewer::FindElem()
    ACharPtr buf     // pointer to the start of a buffer to hold the result (which is a zero-terminated string)
    SInt32 bufSize   // size of the buffer, in bytes 
);
[ public ]
SInt32 GetElemText(
    SInt32 pos                // the location of the element in the document. 
                              // this can be obtained from  SFBHTMLViewer::FindElem()
    SFXAnsiStringPtr string   // pointer to the start of a buffer to hold the result (which is a zero-terminated string)
);

Reference

BREW API IHTMLVIEWER_GetElemText | SFBHTMLViewer::FindElem | SFBHTMLViewer::GetAttrValue


SFBHTMLViewer::GetOption
Retrieve one of a number of values that describe the state of the viewer. Note that this does not retrieve the values that have been set through SFBHTMLViewer::SetOption().
[ public ]
SFCError GetOption(
    SInt32 id      // id of the value being retrieved
    HVOpt* state   // address of variable or memory location to hold the result
);

Reference

BREW API IHTMLVIEWER_GetOption | SFBHTMLViewer::SetOption


SFBHTMLViewer::GetViewState
Return a string that represents the current viewer state. This string may be passed to SFBHTMLViewer::SetViewState() to restore the viewer state.
[ public ]
SInt32 GetViewState(
    ACharPtr buf     // pointer to start of a buffer to hold the result (which will be a zero-terminated string)
    SInt32 bufSize   // size of the buffer, in bytes 
);
[ public ]
SInt32 GetViewState(
    SFXAnsiStringPtr string   // pointer to start of a buffer to hold the result (which will be a zero-terminated string)
);
[ public ]
SFXAnsiString GetViewState(Void);

Reference

BREW API IHTMLVIEWER_GetViewState | SFBHTMLViewer::SetViewState


SFBHTMLViewer::IsBusy
Return true if the viewer is in the process of loading HTML from a SFBAStream or SFBSource.
[ public ]
Bool IsBusy(Void);

Reference

BREW API IHTMLVIEWER_IsBusy


SFBHTMLViewer::LoadSource
Load the contents of a SFBSource into the document, parsing the data as HTML.
[ public ]
Void LoadSource(
    SFBSourceSmpConstRef source   // SFBSource interface
);

Reference

BREW API IHTMLVIEWER_LoadSource


SFBHTMLViewer::LoadStream
Load the contents of a SFBAStream into the document, parsing the data as HTML.
[ public ]
Void LoadStream(
    SFBAStreamSmpConstRef stream   // SFBAStream interface
);

Reference

BREW API IHTMLVIEWER_LoadStream


SFBHTMLViewer::NewInstance
Create a new SFBHTMLViewer instance.
[ public, static ]
SFBHTMLViewerSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBHTMLViewerSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBHTMLViewer::ParseBuffer
Load the viewer with the contents of a zero-terminated string.
[ public ]
Void ParseBuffer(
    ACharConstPtr string   // pointer to the zero-terminated string containing HTML 
);
[ public ]
Void ParseBuffer(
    SFXAnsiStringConstRef string   // pointer to the zero-terminated string containing HTML 
);

Reference

BREW API IHTMLVIEWER_ParseBuffer


SFBHTMLViewer::SetData
Provide a buffer of HTML to the viewer. All of the buffer is parsed into the viewer synchronously.
[ public ]
Void SetData(
    ACharConstPtr buf     // pointer to the start of buffer (not necessarily zero-terminated) 
    SInt32 bufSize = -1   // pointer to the start of buffer (not necessarily zero-terminated) 
                          // size of buffer, or -1. -1 indicates that psz points to a zero-terminated string 
                          // and all of that string is to be loaded into the viewer
);
[ public ]
Void SetData(
    SFXAnsiStringConstRef string   // pointer to the buffer
);

Reference

BREW API IHTMLVIEWER_SetData | SFBHTMLViewer::ParseBuffer


SFBHTMLViewer::SetIWeb
Set the SFBWeb interface with which the viewer will use to obtain sub-objects. A shorthand function for SFBHTMLViewer::SetOption (HVOPT_PTR_IWEB).
[ public ]
SFCError SetIWeb(
    SFBWebSmpConstRef web   // SFBWeb interface
);

Reference

BREW API IHTMLVIEWER_SetIWeb


SFBHTMLViewer::SetIndent
Set the basic indent amount. A shorthand function for SFBHTMLViewer::SetOption (HVOPT_N_INDENT).
[ public ]
SFCError SetIndent(
    SInt32 indent   // default indentation, in pixels
);

Reference

BREW API IHTMLVIEWER_SetIndent | SFBHTMLViewer::SetOption


SFBHTMLViewer::SetLinkColor
Set the default text color. A Shorthand function for SFBHTMLViewer::SetOption (HVOPT_RGB_LINK).
[ public ]
Void SetLinkColor(
    RGBVAL color   // color for links 
);
[ public ]
Void SetLinkColor(
    SFXRGBColorConstRef color   // color for links 
);

Reference

BREW API IHTMLVIEWER_SetLinkColor | SFBHTMLViewer::SetOption


SFBHTMLViewer::SetNotifyFn
Specify the information in a notification callback, which consists of a function pointer and a void context pointer to be passed to the function when it is called.
[ public ]
Void SetNotifyFn(
    PFNHVIEWNOTIFY notify   // pointer to the function to be called with notifications, 
                            // or null if notifications are to be canceled
    VoidPtr data = null     // 32-bit value to be passed to pfnNotify when/if it is called
);

Reference

BREW API IHTMLVIEWER_SetNotifyFn | PFNHVIEWNOTIFY


SFBHTMLViewer::SetOption
Set one of a number of options that control the behavior of the viewer. Callers typically do not call this function directly; there are macros defined for each individual option.
[ public ]
SFCError SetOption(
    SInt32 id     // id of the option being set
    HVOpt state   // value to assign to the option
);

Reference

BREW API IHTMLVIEWER_SetOption | SFBHTMLViewer::SetType | SFBHTMLViewer::SetURL | SFBHTMLViewer::SetIndent | SFBHTMLViewer::SetVSpace | SFBHTMLViewer::SetSBWidth | SFBHTMLViewer::SetTextColor | SFBHTMLViewer::SetLinkColor | SFBHTMLViewer::GetOption


SFBHTMLViewer::SetSBWidth
Set the width of the vertical scroll bar. A shorthand function for SFBHTMLViewer::SetOption (HVOPT_N_SBWIDTH).
[ public ]
SFCError SetSBWidth(
    SInt32 width   // basic paragraph spacing
);

Reference

BREW API IHTMLVIEWER_SetSBWidth


SFBHTMLViewer::SetTextColor
Set the default text color. A shorthand function for SFBHTMLViewer::SetOption ( HVOPT_RGB_TEXT ).
[ public ]
SFCError SetTextColor(
    RGBVAL color   // color for text
);
[ public ]
SFCError SetTextColor(
    SFXRGBColorConstRef color   // color for text
);

Reference

BREW API IHTMLVIEWER_SetTextColor


SFBHTMLViewer::SetType
Set the MIME type and/or character set for the viewer. A shorthand function for SFBHTMLViewer::SetOption (HVOPT_SZ_TYPE).
[ public ]
SFCError SetType(
    ACharConstPtr type   // pointer to the MIME type string with the following format: 
                         // "text/html; charset=iso-8859-1" or "charset=iso-8859-1"
                         // note: The MIME type string follows the semantics
                         // of the Content-type field described in RFC2046
);
[ public ]
SFCError SetType(
    SFXAnsiStringConstRef type   // pointer to the MIME type string with the following format: 
                                 // "text/html; charset=iso-8859-1" or "charset=iso-8859-1"
                                 // note: The MIME type string follows the semantics
                                 // of the Content-type field described in RFC2046
);

Reference

BREW API IHTMLVIEWER_SetType | SFBHTMLViewer::SetOption


SFBHTMLViewer::SetURL
Specify the URL address of the document that is to be loaded into the viewer. This should be called before HTML is loaded into a document.
[ public ]
SFCError SetURL(
    ACharConstPtr url   // base URL string
);
[ public ]
SFCError SetURL(
    SFXAnsiStringConstRef url   // base URL string
);

Reference

BREW API IHTMLVIEWER_SetURL | SFBHTMLViewer::SetOption


SFBHTMLViewer::SetVSpace
Set the vertical paragraph spacing. A shorthand function for SFBHTMLViewer::SetOption (HVOPT_N_VSPACE).
[ public ]
SFCError SetVSpace(
    SInt32 vSpace   // basic paragraph spacing, in pixels
);

Reference

BREW API IHTMLVIEWER_SetVSpace | SFBHTMLViewer::GetViewState


SFBHTMLViewer::SetViewState
Restore the HTML viewer state (such as scroll position) to a state represented by a string returned by SFBHTMLViewer::GetViewState().
[ public ]
Void SetViewState(
    ACharConstPtr state   // string returned by SFBHTMLViewer::GetViewState()
                          // which represents a previous view state
);
[ public ]
Void SetViewState(
    SFXAnsiStringConstRef state   // string returned by SFBHTMLViewer::GetViewState()
                                  // which represents a previous view state
);

Reference

BREW API IHTMLVIEWER_SetViewState | SFBHTMLViewer::GetViewState


SFBHTMLViewer::Stop
Cause the viewer to stop loading HTML from a SFBAStream or SFBSource, if the viewer is busy. If this stops loading of the document, an HVN_DONE notification is triggered.
[ public ]
Void Stop(Void);

Reference

BREW API IHTMLVIEWER_Stop