PrevNextUpHome SophiaFramework UNIVERSE 5.1
SFZWebBrowserControl
Responder which represents a simple web browser control.
#include <SFZWebBrowserControl.hpp>
class SFZWebBrowserControl : public SFYControl;
SFMTYPEDEFRESPONDER(SFZWebBrowserControl)

Inheritance diagram

 Inheritance diagram of SFZWebBrowserControlClass

Collaboration diagram

 Collaboration diagram of SFZWebBrowserControlClass

Description

How to use

The following functions are available in the SFZWebBrowserControl class:

  • HTTP Communication
  • rendering HTML document
  • displaying an inline image
  • hyper-link
  • logging

A simple Web Browser can be created easily by only pasting a SFZWebBrowserControl object.

The SFZWebBrowserControl class is implemented base on the IHtmlViewer of BREW API. The limitations of SFZWebBrowserControl class on rendering the HTML data are almost the same as that of IHtmlViewer.

Error Value

Several member functions of SFZWebBrowserControl class record its status internally when an error occurs.

The latest error of member function can be gotten by the static_catch function.

SFERR_NO_ERROR is returned if no error occurs.

The code below is to use the SFZWebBrowserControl class:

SFMTYPEDEFRESPONDER(MyWindow)
class MyWindow : public SFZWindow{
    SFMSEALRESPONDER(MyWindow)
    SFMRESPONDERINSTANTIATEFOUR(MyWindow, SFZWindow, SFYContainer, SFYWidget, SFYResponder)
public:
    static MyWindowSmp NewInstance(SFCErrorPtr exception = null);
protected:
    explicit MyWindow(Void) static_throws;
    virtual ~MyWindow(Void);

    // define the simple Web Browser as a member function of smart pointer type
    SFZWebBrowserControlSmp _browser;      // simple Web Browser

};

// constructor(error processing is omitted)
MyWindow::MyWindow(Void) static_throws
{
    if (static_try()) {

    // input the browser by string
 SFXAnsiString buffer(
             "BrowserControl<br /><br />"
         "<a href=\"http://www.s-cradle.com/example/tabbrowser/\">Sophia Cradle</a><br /><br />"
        );

    // create a simple Web Browser
        _browser = SFZWebBrowserControl::NewInstance();
        _browser->SetParent(GetThis());
        _browser->SetRealBound(GetLocalBound());
        _browser->SetState(true, true, true, true);

    // start rendering the string as HTML
       _browser->Load(buffer);
   }
}

Reference

SFYControl | SFBHTMLViewer | SFBWeb | BREW API IHtmlViewer

Member

Constructor/Destructor
SFZWebBrowserControl( Void )
Constructor of the SFZWebBrowserControl class.
~SFZWebBrowserControl( Void )
Destructor of the SFZWebBrowserControl class.
Public Functions
SFCError ClearHistory( Void )
Clear the history list.
SInt32 FindElement( ACharConstPtr element , SInt32 no )
Find the specified element in the current page.
HistoryEntry GetCurrentHistory( Void )
Get the history of the current page.
UInt32 GetCurrentHistoryIndex( Void )
Get the index of current history.
SFXAnsiString GetElementAttribute( SInt32 elementIndex , ACharConstPtr attr )
Get the attribute of specified element.
SFXAnsiString GetElementText( SInt32 elementIndex )
Get the text of the specified element.
HistoryEntry GetHistory( UInt32 historyIndex = 0 )
Get the history content by the specified index.
HistoryEntryConstPtr GetHistoryList( Void )
Get the history list.
UInt32 GetHistorySize( Void )
Get the number of entries in history list.
SInt32 GetIndent( Void )
Get the width of indent.
SFXRGBColor GetLinkColor( Void )
Get the color of link text.
SInt32 GetParagraphSpacing( Void )
Get the spacing between paragraphs.
SInt32 GetScrollbarWidth( Void )
Get the width of scroll bar.
SFXRGBColor GetTextColor( Void )
Get the text color.
SFBWebSmpConstRef GetWeb( Void )
Get the IWeb instance for communication.
Bool IsBusy( Void )
Check whether or not the browser control is busy in accessing the network, or rendering.
Bool IsInlineEditEnable( Void )
Check whether the text is edited in some part of screen or not.
Bool IsScrollbarEnable( Void )
Check whether the scroll bar is enabled or not.
SFCError Load( SFXAnsiStringConstRef data )
Start to render the string in the HTML format.
SFCError Load( SFXAnsiStringConstRef data , SFXAnsiStringConstRef url )
Start to render the string in the HTML format.
SFCError Move( UInt32 historyIndex = 0 )
Move to the specified page in history list and render it again.
SFCError Navigate( SFXAnsiStringConstRef url )
Start to render the page of specified URL.
SFCError Navigate( SFXAnsiStringConstRef url , SFXAnsiStringConstRef method )
Start to render the page of specified URL.
SFCError Navigate( SFXAnsiStringConstRef url , SFXAnsiStringConstRef method , SFXAnsiStringConstRef data )
Start to render the page of specified URL.
SFCError Navigate( SFXAnsiStringConstRef url , SFXAnsiStringConstRef method , SFXBufferConstRef data )
Start to render the page of specified URL.
SFCError Navigate( SFBSourceSmpConstRef source )
Start to render the page of specified URL.
SFCError Navigate( SFBSourceSmpConstRef source , SFXAnsiStringConstRef basdUrl )
Start to render the page of specified URL.
SFCError Navigate( SFBAStreamSmpConstRef stream )
Start to render the page of specified URL.
SFCError Navigate( SFBAStreamSmpConstRef src , SFXAnsiStringConstRef baseUrl )
Start to render the page of specified URL.
SFCError Next( SInt32 n = 1 )
Move to the next page in specified history, get and render the page again.
SFCError Previous( SInt32 n = 1 )
Move to the previous page in specified history, get and render the page again.
Void Reload( Void )
Reload and render the current page.
SFCError SetAuthorizeData( SFXAnsiStringConstRef user , SFXAnsiStringConstRef passwd , SFXAnsiStringConstRef url )
Set information on the Basic HTTP authorization.
SFCError SetHistorySize( UInt32 size )
Set the size of history list.
SFCError SetIndent( SInt32 pixel )
Set the width of indent in pixels.
SFCError SetInlineEditEnable( Bool enable )
Set whether the text is edited in some part of screen or not.
SFCError SetLinkColor( SFXRGBColorConstRef color )
Set the color of link text.
SFCError SetParagraphSpacing( SInt32 pixel )
Set the spacing between paragraphs in pixels.
SFCError SetScrollbarEnable( Bool enable )
Enable or disable the scroll bar.
SFCError SetScrollbarWidth( SInt32 pixel )
Set the width of scroll bar in pixels.
SFCError SetTextColor( SFXRGBColorConstRef color )
Set the text color.
Void SetWeb( SFBWebSmpConstRef web )
Set the IWeb interface for communication.
Void Stop( Void )
Stop accessing the network and rendering.
SFCError UnsetAuthorizeData( Void )
Cancel the settings for Basic HTTP authorization.
Void UnsetWeb( Void )
Cancel the settings set by the SFZWebBrowserControl::SetWeb function.
Void ClearHandler( Void ) (inherits from SFYResponder)
Unregister all handlers from this responder.
Void ClearTracer( Void ) (inherits from SFYResponder)
Unregister all dispatching rules from the tracer of this responder.
SFCError Distribute( SFXEventConstRef event , BoolPtr result = null ) (inherits from SFYResponder)
[Type 1] Distribute the specified event. [Type 2] Wrap and call the specified callback function which includes sending events.
SFCError Distribute( VoidPtr context , SFYDistributer::CallbackSPP spp , VoidPtr reference , BoolPtr result = null ) (inherits from SFYResponder)
[Type 1] Distribute the specified event. [Type 2] Wrap and call the specified callback function which includes sending events.
SFXRGBColorConstRef GetBackgroundColor( Void ) (inherits from SFYWidget)
Get the background color.
SFYResponderSmp GetChildBack( Void ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBack( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBack( UInt32 id ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SInt32 GetChildCount( Void ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SInt32 GetChildCount( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SInt32 GetChildCount( UInt32 id ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SInt32 GetChildCount( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildFront( Void ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildFront( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildFront( UInt32 id ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SInt32 GetCurrentValue( Void ) (inherits from SFYControl)
Get the current value of this control.
SFYDistributerPtr GetDistributer( Void ) (inherits from SFYResponder)
Get the distributer bound with this responder.
SFYResponderSmp GetFrame( Void ) (inherits from SFYResponder)
Get the frame which has been attached to this responder.
SFXRectangle GetGlobalBound( Void ) (inherits from SFYResponder)
Get the globle region of this responder.
UInt32 GetID( Void ) (inherits from SFYResponder)
Get the ID of this responder instance.
SFXRectangle GetLocalBound( Void ) (inherits from SFYResponder)
Get the local region of this responder.
SInt32 GetMaximumValue( Void ) (inherits from SFYControl)
Get the maximum value of this control.
SInt32 GetMinimumValue( Void ) (inherits from SFYControl)
Get the minimum value of this control.
SInt32 GetNthBackward( Void ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( UInt32 id ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( Void ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( UInt32 id ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SFYResponderSmp GetParent( Void ) (inherits from SFYResponder)
Get the parent responder of this responder.
Bool GetPropertyTransparent( Void ) (inherits from SFYResponder)
Get the transparency attribute of this responder.
SFXRectangleConstRef GetRealBound( Void ) (inherits from SFYResponder)
Get the real region of this responder.
VoidPtr GetReference( Void ) (inherits from SFYResponder)
Get the reference of this responder.
SFYRendererPtr GetRenderer( Void ) (inherits from SFYResponder)
Get the renderer bound with this responder.
SFYResponderSmp GetRoot( Void ) (inherits from SFYResponder)
Get the root responder.
Bool GetStateActive( Bool inherit = false ) (inherits from SFYResponder)
Get the active state of this responder.
Bool GetStateEnable( Bool inherit = false ) (inherits from SFYResponder)
Get the enable state of this responder.
Bool GetStateFocus( Bool inherit = false ) (inherits from SFYResponder)
Get the focus state of this responder.
Bool GetStateValid( Bool inherit = false ) (inherits from SFYResponder)
Get the valid state of this responder.
Bool GetStateVisible( Bool inherit = false ) (inherits from SFYResponder)
Get the visible state of this responder.
SFXRectangle GetSuitableBound( Void ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXRectangle GetSuitableBound( SFXRectangleConstRef rectangle ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXRectangle GetSuitableBound( SFXRectangleConstRef param , HorizontalEnum horizontal , VerticalEnum vertical ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXMargin GetSuitableMargin( Void ) (inherits from SFYResponder)
Get the suitable frame margin region of this responder.
SFCType GetType( Void ) (inherits from SFYResponder)
Get the type of this responder class.
SFXRectangleConstRef GetVirtualBound( Void ) (inherits from SFYResponder)
Get the virtual region of this responder.
Bool HasFrame( Void ) (inherits from SFYResponder)
Check whether or not this responder is a content-responder.
Void Initialize( Void ) (inherits from SFYResponder)
Initialize this responder.
Bool IsBack( Void ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsFrame( Void ) (inherits from SFYResponder)
Check whether or not this responder is an attachment-frame.
Bool IsFront( Void ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsRoot( Void ) (inherits from SFYResponder)
Check whether or not this responder is the root responder.
SFCError RegisterHandler( SFXEventRangeConstRef range , SFYHandler::RuleRecConstRef rule ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterTracer( SFXEventRangeConstRef range , SFYTracer::RuleRecConstRef rule ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstRef range , SFYTracer::OrderEnum order , SFYTracer::StateEnum state , Bool overload ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::OrderEnumConstPtr order , SFYTracer::StateEnumConstPtr state , BoolConstPtr overload , SInt32 length ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError Render( Bool force = false ) (inherits from SFYResponder)
Boot up the renderer for redrawing this responder and its descendant responders.
Void SetBackgroundColor( SFXRGBColorConstRef param ) (inherits from SFYWidget)
Set the background color to the specified value.
Void SetCurrentValue( SInt32 param ) (inherits from SFYControl)
Set the current value of this control to the specified value.
Void SetDistributer( SFYDistributerPtr param ) (inherits from SFYResponder)
Bind this responder with the specified distributer.
SFCError SetFrame( SFYResponderSmpConstRef param ) (inherits from SFYResponder)
Attach the specified frame to this frame.
Void SetID( UInt32 param ) (inherits from SFYResponder)
Set the ID value of this responder to the specified value.
Void SetMaximumValue( SInt32 param ) (inherits from SFYControl)
Set the maximum value of the control to the specified value.
Void SetMinimumValue( SInt32 param ) (inherits from SFYControl)
Set the minimum value of the control to the specified value.
SFCError SetParent( SFYResponderSmpConstRef param ) (inherits from SFYResponder)
Set the parent responder of this responder to the specified responder.
Void SetProperty( Bool transparent ) (inherits from SFYResponder)
Set the property of this responder to the specified value.
Void SetPropertyTransparent( Bool param ) (inherits from SFYResponder)
Set the transparency attribute of this responder to the specified value.
Void SetRealBound( SFXRectangleConstRef param ) (inherits from SFYResponder)
Set the real region of this responder to the specified region.
Void SetReference( VoidPtr param ) (inherits from SFYResponder)
Set the reference value of this responder to the specified value.
Void SetRenderer( SFYRendererPtr param ) (inherits from SFYResponder)
Bind this responder with the specified renderer.
Void SetState( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Set all states of this responder to specified values together.
Void SetStateActive( Bool param ) (inherits from SFYResponder)
Set the active state of this responder to the specified value.
Void SetStateEnable( Bool param ) (inherits from SFYResponder)
Set the enable state of this responder to the specified value.
Void SetStateFocus( Bool param ) (inherits from SFYResponder)
Set the focus state of this responder to the specified value.
Void SetStateVisible( Bool param ) (inherits from SFYResponder)
Set the visible state of this responder to the specified value.
Void SetVirtualBound( SFXRectangleConstRef param ) (inherits from SFYResponder)
Set the virtual region of this responder to the specified value.
Void Terminate( Void ) (inherits from SFYResponder)
Terminate this responder.
Void ToBack( Void ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( UInt32 id ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToFront( Void ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( UInt32 id ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::RuleRecConstRef rule ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterTracer( SFXEventRangeConstRef range ) (inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
Void UnregisterTracer( SFXEventRangeConstPtr range , SInt32 length ) (inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
T const & static_catch( Void ) (inherits from static_exception)
Get the current exception.
Protected Functions
Void DoneNotifyHandler( DoneNotifyConstRef notify )
[Handler] Notify the end of rendering.
Void FocusNotifyHandler( FocusNotifyConstRef notify )
[Handler] Notify the movement of the cursor.
Void JumpNotifyHandler( JumpNotifyConstRef notify )
[Handler] Notify when the link is pressed.
Bool ResponseNotifyHandler( ResponseNotifyConstRef notify )
[Handler] Notify that the server connection completes.
static
SFYResponderSmp
Factory( SFYResponderPtr responder , SFCErrorPtr exception = null ) (inherits from SFYResponder)
This function is used to implement the NewInstance function.
SFYResponderSmp GetThis( Void ) (inherits from SFYResponder)
Get the smart pointer of this responder.
Void HandleBoundGlobal( SFXRectangleConstRef rectangle ) (inherits from SFYWidget)
This function will be called when the global region is changed.
Void HandleBoundOptimize( SFXRectanglePtr rectangle ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event is received. [Calculate the suitable rectangle size of this responder within the specified hint rectangle.]
Void HandleBoundReal( Void ) (inherits from SFYControl)
This function will be called when the real region is changed.
Void HandleBoundRequest( SFXRectanglePtr rectangle ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event is received. [Calculate the suitable rectangle size of this responder.]
Void HandleBoundVirtual( Void ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received. [Perform the processing when the virtual region is changed.]
Void HandleRenderRequest( SFXGraphicsPtr graphics ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw this responder.]
Void Invalidate( Void ) (inherits from SFYResponder)
Register the specified redraw region of this responder.
Void Invalidate( SFXRectangleConstRef param ) (inherits from SFYResponder)
Register the specified redraw region of this responder.
Void InvokeBackward( SFXEventConstRef event , Bool overload , BoolPtr result = null ) (inherits from SFYResponder)
Call the handlers for the specified event from the end of the handler list registered into this responder.
Void InvokeForward( SFXEventConstRef event , Bool overload , BoolPtr result = null ) (inherits from SFYResponder)
Call the handlers for the specified event from the head of the handler list registered into this responder.
Void SetType( SFCType param ) (inherits from SFYResponder)
Set the Type value of this responder to the specified 4-character value.
Void static_throw( static_exception< T > const & param ) (inherits from static_exception)
Set an exception.
Void static_throw( T const & param ) (inherits from static_exception)
Set an exception.
Bool static_try( Void ) (inherits from static_exception)
Confirm whether or not the exception is retained.
Types
DEFAULT
Enumerated type for the initial value of SFZWebBrowserControl parameter.
DoneNotify
The class to preserve the information on the timing when rendering is finished.
FocusNotify
The class to preserve the information on the focus movement of browser.
HistoryEntry
The structure for history entries.
JumpNotify
The class to preserve the information on the url links pressed in the browser by user.
ResponseNotify
The class to preserve the information on the timing when rendering is finished.
CodeEnum (inherits from SFYControl)
Constant that represents the SFYControl class.
HorizontalEnum (inherits from SFYResponder)
Constants that represent the horizontal alignment.
VerticalEnum (inherits from SFYResponder)
Constants that represent the vertical alignment.

SFZWebBrowserControl::SFZWebBrowserControl
Constructor of the SFZWebBrowserControl class.
[ protected, explicit ]
SFZTabControl(Void);

SFZWebBrowserControl::~SFZWebBrowserControl
Destructor of the SFZWebBrowserControl class.
[ public, virtual ]
~SFZWebBrowserControl(Void);

Description

This function terminates communication and rendering of HTML data and releases all the resources internally.


SFZWebBrowserControl::ClearHistory
Clear the history list.
[ public ]
SFCError ClearHistory(Void);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If failed : error value except SFERR_NO_ERROR

Description

Return the current history number as 0.

Reference

SFZWebBrowserControl::GetCurrentHistoryIndex


SFZWebBrowserControl::DoneNotifyHandler
[Handler] Notify the end of rendering.
[ protected, virtual ]
Void DoneNotifyHandler(
    DoneNotifyConstRef notify   // the notify
);

Argument

notify

The information to be notified is set in the "notify" argument. The HTTP response code or the BREW error code can be gotten through this argument.

Description

By default nothing happens when the SFZWebBrowserControl::DoneNotifyHandler function is called.

To do something through this function, it is necessary to override the SFZWebBrowserControl::DoneNotifyHandler function.

The timing when the SFZWebBrowserControl::DoneNotifyHandler function is called is different from that of the SFRBrowserControl::ResponseNotifyHandler function.

Example

The code below is to override this function.

#include <SFZResponder/SFZControl/SFZWebBrowserControl.hpp>

SFMTYPEDEFRESPONDER(MyBrowserControl)
class MyBrowserControl : public SFZWebBrowserControl {
    SFBSEALRESPONDER(MyBrowserControl)
    SFMRESPONDERINSTANTIATEFOUR(MyBrowserControl, SFZWebBrowserControl, SFYControl, SFYWidget, SFYResponder)
public:
    static MyBrowserControlSmp NewInstance(SFCErrorPtr exception = null);
protected:
    explicit MyBrowserControl(Void) static_throws;
    virtual ~MyBrowserControl(Void);
    virtual Void DoneNotifyHandler(DoneNotifyConstRef notify) {
        if (notify.GetErrorCode() != SFERR_NO_ERROR) {
            // if communication error occored, show the error dialog
            ErrorDialog(notify.GetErrorCode());
        }
        else if (WEB_SUCCEEDED(notify.GetDoneCode())) {
            // if HTTP error occored, show the warning dialog
            WarningDialog(notify.GetResposenCode());
        }
    }
};

Reference

SFZWebBrowserControl::DoneNotify | SFZWebBrowserControl::FocusNotifyHandler | SFZWebBrowserControl::JumpNotifyHandler | SFZWebBrowserControl::ResponseNotifyHandler


SFZWebBrowserControl::FindElement
Find the specified element in the current page.
[ public, const ]
SInt32 FindElement(
    ACharConstPtr element   // name of element
    SInt32 no               // number of element
);

Argument

element

Specify the name of element to find.

no

Specify the index of element to find.

If set to 0, the first matching element is returned. If set to n, the (n+1)th matching element is returned.

Return value

Return the index of specified element when found. Return a minus value when not found.

Description

The SFZWebBrowserControl::FindElement function is used to search the specified element in the current page. The index of specified element that is found can be used in the SFZWebBrowserControl::GetElementText or SFZWebBrowserControl::GetElementAttribute function.

Reference

SFZWebBrowserControl::GetElementText | SFZWebBrowserControl::GetElementAttribute


SFZWebBrowserControl::FocusNotifyHandler
[Handler] Notify the movement of the cursor.
[ protected, virtual ]
Void FocusNotifyHandler(
    FocusNotifyConstRef notify   // notification
);

Argument

notify

This argument is the notification. It gets the current position, type and status of the tag that the cursor is pointing to.

Description

It do nothing in a standard implement.

If do something outside the standard, users need to override the SFZWebBrowserControl::FocusNotifyHandler function.

Reference

SFZWebBrowserControl::FocusNotify | SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::JumpNotifyHandler | SFZWebBrowserControl::ResponseNotifyHandler


SFZWebBrowserControl::GetCurrentHistory
Get the history of the current page.
[ public, const ]
HistoryEntry GetCurrentHistory(Void);

Return value

History of the current page.

Reference

SFZWebBrowserControl::GetCurrentHistoryIndex | SFZWebBrowserControl::GetHistory


SFZWebBrowserControl::GetCurrentHistoryIndex
Get the index of current history.
[ public, const ]
UInt32 GetCurrentHistoryIndex(Void);

Return value

Current history index of the current page.

Description

It can be modified by Move function, Previous function, and Next function. And can be initialized to 0 by ClearHistory function.

Reference

SFZWebBrowserControl::Move | SFZWebBrowserControl::Previous | SFZWebBrowserControl::Next | SFZWebBrowserControl::ClearHistory


SFZWebBrowserControl::GetElementAttribute
Get the attribute of specified element.
[ public, const ]
SFXAnsiString GetElementAttribute(
    SInt32 elementIndex   // index of element
    ACharConstPtr attr    // attribute
);

Argument

elementIndex

Specify the index of element returned by the SFZWebBrowserControl::FindElement function. function.

attr

Specify the attribute name.

Return value

Content of attribute. If the specified attribute is not found, an empty string is returned.

Description

Get the attribute of specified element in the current page. if the specified element is not found, an empty string is returned.

[Important] About the attribute without value.

As for an element such as <HR NOSHADE> which has an attribute without value, when trying to get its attribute, "NOSHADE" which is the same as the name of attribute is returned.

Reference

SFZWebBrowserControl::FindElement | SFZWebBrowserControl::GetElementText


SFZWebBrowserControl::GetElementText
Get the text of the specified element.
[ public, const ]
SFXAnsiString GetElementText(
    SInt32 elementIndex   // index of element
);

Argument

elementIndex

Specify the index of element returned by the SFZWebBrowserControl::FindElement function. function

Return value

Content of element. If the specified element is empty, an empty string is returned.

Description

Get the text of the specified element in the current page.

Reference

SFZWebBrowserControl::FindElement | SFZWebBrowserControl::GetElementAttribute


SFZWebBrowserControl::GetHistory
Get the history content by the specified index.
[ public, const ]
HistoryEntry GetHistory(
    UInt32 historyIndex = 0   // history index
);

Argument

historyIndex

Specify the history index. If not specified, index is set to 0, and the last history content visited is returned.

Return value

History content. If there is no history content, or the historyIndex argument is invalid, an empty string is set to the "url" member of SFZWebBrowserControl::HistoryEntry structure.

Reference

SFZWebBrowserControl::GetHistoryList | SFZWebBrowserControl::GetCurrentHistory


SFZWebBrowserControl::GetHistoryList
Get the history list.
[ public, const ]
HistoryEntryConstPtr GetHistoryList(Void);

Return value

Pointer to the history list: an array of SFZWebBrowserControl::HistoryEntry structure, which size is the return value by the SFZWebBrowserControl::GetHistorySize function.

Description

The top entry of history list is the latest history, and the history number matches the index of entry of history list.

If no information is set to a history entry, its "url" member of SFZWebBrowserControl::HistoryEntry structure is set to an empty string.

[Warning] Warning

The history list returned by the SFZWebBrowserControl::GetHistoryList function must not be modified.

Example

Display all the titles and URLs in the history list for debugging.

void PrintHistoryList(SFBrowserControlConstRef browser)
{
    int i;
    SFBrowserControl::HistoryEntryConstPtr historyList = browser.GetHistoryList();
    for (i=0; i < browser.GetHistorySize(); i++) {
        DBGPRINTF("title '%s' url %s",
                  (ACharConstPtr)historyList[i].title, (ConstACharPtr)historyList[i].url); 
    }
}

Reference

SFZWebBrowserControl::GetHistorySize


SFZWebBrowserControl::GetHistorySize
Get the number of entries in history list.
[ public, const ]
UInt32 GetHistorySize(Void);

Return value

Number of entries in the current history list.

Description

The history number used by the SFZWebBrowserControl::Move or SFZWebBrowserControl::GetHistory function must be less than the number of entries in history list returned by the SFZWebBrowserControl::GetHistorySize function.

* The size of history list returned by the SFZWebBrowserControl::GetHistoryList function equals the return value of SFZWebBrowserControl::GetHistorySize function.

Reference

SFZWebBrowserControl::GetHistory | SFZWebBrowserControl::GetHistoryList | SFZWebBrowserControl::Move | SFZWebBrowserControl::SetHistorySize


SFZWebBrowserControl::GetIndent
Get the width of indent.
[ public, const ]
SInt32 GetIndent(Void);

Return value

Width of specified indent in pixels.

Reference

SFZWebBrowserControl::SetIndent


SFZWebBrowserControl::GetLinkColor
Get the color of link text.
[ public, const ]
SFXRGBColor GetLinkColor(Void);

Return value

Color of the link text.

Reference

SFZWebBrowserControl::SetLinkColor | SFZWebBrowserControl::GetTextColor


SFZWebBrowserControl::GetParagraphSpacing
Get the spacing between paragraphs.
[ public, const ]
SInt32 GetParagraphSpacing(Void);

Return value

Space between paragraphs in pixels.

Reference

SFZWebBrowserControl::SetParagraphSpacing


SFZWebBrowserControl::GetScrollbarWidth
Get the width of scroll bar.
[ public, const ]
SInt32 GetScrollbarWidth(Void);

Return value

Width of scroll bar in pixels.

Reference

SFZWebBrowserControl::SetScrollbarWidth


SFZWebBrowserControl::GetTextColor
Get the text color.
[ public, const ]
SFXRGBColor GetTextColor(Void);

Return value

Text color of HTML.

Reference

SFZWebBrowserControl::SetTextColor | SFZWebBrowserControl::GetLinkColor


SFZWebBrowserControl::GetWeb
Get the IWeb instance for communication.
[ public, const ]
SFBWebSmpConstRef GetWeb(Void);

Return value

IWeb instance for communication. If the IWeb instance is not set by the SFZWebBrowserControl::SetWeb function and the IWeb instance is not created internally, return null.

Description

[Important] Caution when specifying the WebOpt.

Though any WebOpt can be set to the IWeb instance, the user setting of WebOpt must be preserved until another IWeb instance is used.

Please see the "Instructions about the life-time of WEBOPT" in the BREW API Reference.

[Important] The behavior when suspended.

When suspended, the IWeb instance is set to be created internally by default settings.

At this time, the information on WebOpt settings is also reset.

To continue to use your own IWeb instance, set it by the resume handler again.

Reference

SFBWeb | SFZWebBrowserControl::UnsetWeb | SFZWebBrowserControl::SetWeb


SFZWebBrowserControl::IsBusy
Check whether or not the browser control is busy in accessing the network, or rendering.
[ public, const ]
Bool IsBusy(Void);

Return value

  • If the browser control is busy in accessing the network, or rendering: true
  • Otherwise: false

SFZWebBrowserControl::IsInlineEditEnable
Check whether the text is edited in some part of screen or not.
[ public, const ]
Bool IsInlineEditEnable(Void);

Return value

  • If the text is edited in some part of screen: true
  • Otherwise ( i.e., the text is edited in the full screen ): false

Reference

SFZWebBrowserControl::SetInlineEditEnable


SFZWebBrowserControl::IsScrollbarEnable
Check whether the scroll bar is enabled or not.
[ public, const ]
Bool IsScrollbarEnable(Void);

Return value

  • If the scroll bar is enabled: true
  • Otherwise: false

Reference

SFZWebBrowserControl::SetScrollbarEnable


SFZWebBrowserControl::JumpNotifyHandler
[Handler] Notify when the link is pressed.
[ protected, virtual ]
Void JumpNotifyHandler(
    JumpNotifyConstRef notify   // notification
);

Argument

notify

The information to be notified is set in the "notify" argument. The URL, HTTP method, POST data of pressed link are preserved.

Description

Open the linked URL automatically.

The SFZWebBrowserControl::JumpNotifyHandler function do nothing except the http://, https://, file://, and res:// streams.

To do something other than default settings, it is necessary to override the SFZWebBrowserControl::JumpNotifyHandler function.

Example

The code below is to override the SFZWebBrowserControl::JumpNotifyHandler function.

#include <SFZResponder/SFZControl/SFZWebBrowserControl.hpp>

SFMTYPEDEFRESPONDER(MyBrowserControl)
class MyBrowserControl : public SFZWebBrowserControl {
    SFBSEALRESPONDER(MyBrowserControl)
    SFMRESPONDERINSTANTIATEFOUR(MyBrowserControl, SFZWebBrowserControl, SFYControl, SFYWidget, SFYResponder)
public:
    static MyBrowserControlSmp NewInstance(SFCErrorPtr exception = null);
protected:
    explicit MyBrowserControl(Void) static_throws;
    virtual ~MyBrowserControl(Void);
    virtual Void JumpNotifyHandler(JumpNotifyConstRef notify) {
        if (notify.GetUrl().StartWith("mailto:")) {
            // if it's "mailto:", call the mailer
            Mailer(notify.GetUrl());
        }
        else {
            // or just call the standard handler
     SFZWebBrowserControl::JumpNotifyHandler(notify);
        }
    }
};

Reference

SFZWebBrowserControl::JumpNotify | SFZWebBrowserControl::Navigate | SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::FocusNotifyHandler | SFZWebBrowserControl::ResponseNotifyHandler


SFZWebBrowserControl::Load
Start to render the string in the HTML format.
[ public ]
SFCError Load(
    SFXAnsiStringConstRef data   // HTML data
);
[ public ]
SFCError Load(
    SFXAnsiStringConstRef data   // HTML data
    SFXAnsiStringConstRef url    // URL
);

Argument

data

the string in the HTML format

url

URL ( All the URLs in the HTML data are relative URLs from this "url" argument.)

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMORY
  • If the argument is invalid: SFERR_INVALID_PARAM
  • If failed: SFERR_FAILED

Description

Immediately after the inline image is received, it is displayed.

[Important] About communication error:

The communication errors cannot be gotten from the return value of SFZWebBrowserControl::Load function.

To get the communication errors or the event that rendering is finished, it is necessary to create a new class inheriting from the SFZWebBrowserControl class with overrided SFZWebBrowserControl::DoneNotifyHandler function.

Reference

SFZWebBrowserControl::Navigate | SFZWebBrowserControl::DoneNotifyHandler


SFZWebBrowserControl::Move
Move to the specified page in history list and render it again.
[ public ]
SFCError Move(
    UInt32 historyIndex = 0   // history index
);

Argument

historyIndex

index of history list about the page to move to. If not specified, move to the page of entry in history list (the value of index is 0), i.e., move to the latest page of history list.

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY
  • If the argument is invalid: SFERR_INVALID_PARAM
  • If failed: SFERR_FAILED

Description

If the specified index is greater than the size of history list, or there is no history entry of specified index, SFERR_INVALID_PARAM is returned as an error.

[Important] About communication error:

The communication errors cannot be gotten from the return value of SFZWebBrowserControl::Move function.

To get the communication errors or the event that rendering is finished, it is necessary to create a new class inheriting from the SFZWebBrowserControl class with overrided SFZWebBrowserControl::DoneNotifyHandler function.

Reference

SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::Navigate | SFZWebBrowserControl::Previous | SFZWebBrowserControl::Next | SFZWebBrowserControl::Reload


SFZWebBrowserControl::Navigate
Start to render the page of specified URL.
[ public ]
SFCError Open(
    SFXAnsiStringConstRef url   // URL to open
);
[ public ]
SFCError Open(
    SFXAnsiStringConstRef url      // URL to open
    SFXAnsiStringConstRef method   // HTTP method
);
[ public ]
SFCError Open(
    SFXAnsiStringConstRef url      // URL to open
    SFXAnsiStringConstRef method   // HTTP method
    SFXAnsiStringConstRef data     // data to send to the server by POST method
);
[ public ]
SFCError Open(
    SFXAnsiStringConstRef url      // URL to open
    SFXAnsiStringConstRef method   // HTTP method
    SFXBufferConstRef data         // data to send to the server by POST method
);
[ public ]
SFCError Open(
    SFBSourceSmpConstRef source   // HTML source
);
[ public ]
SFCError Open(
    SFBSourceSmpConstRef source     // HTML souce
    SFXAnsiStringConstRef basdUrl   // base URL
);
[ public ]
SFCError Open(
    SFBAStreamSmpConstRef stream   // HTML stream
);
[ public ]
SFCError Open(
    SFBAStreamSmpConstRef src       // HTML stream
    SFXAnsiStringConstRef baseUrl   // base URL
);

Argument

url

Specify the URL to access. Render the HTML data of specified URL.

The schemes of http, https, file, and res are supported.

method

Specify the HTTP method to access the page.

GET and POST methods are supported.(GET is a default method)

data

In case of POST method, specify data to send to the server.

baseUrl

URL ( All the URLs in the HTML data are relative URLs from this "url" argument.)

source

ISource interface that preserves the HTML data

stream

IAStream interface that preserves the HTML data

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY
  • If the argument is invalid: SFERR_INVALID_PARAM
  • If failed: SFERR_FAILED

Description

Immediately after the inline image is received, it is displayed.

[Important] The Errors about communication.

The Errors about communication cannot be gotten by return values.

While finishing rendering and getting the errors about communication, It is necessary to inherit from the SFZWebBrowserControl class, create a new class with overrided DoneNotifyHandler function.

Reference

SFZWebBrowserControl::Load | SFZWebBrowserControl::DoneNotifyHandler


SFZWebBrowserControl::Next
Move to the next page in specified history, get and render the page again.
[ public ]
SFCError Next(
    SInt32 n = 1   // number of history to move ahead
);

Argument

n

Specify the number of history list to move ahead. If not specified, move one history entry ahead.

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY
  • If the specified number is out of the history list: SFERR_INVALID_PARAM
  • If failed: SFERR_FAILED

Description

If the specified index number is negative, the history entry go back by its absolute value is displayed. If it is out of the history list, SFERR_INVALID_PARAM is returned as an error.

[Important] About communication error:

The communication errors cannot be gotten from the return value of SFZWebBrowserControl::Next function.

To get the communication errors or the event that rendering is finished, it is necessary to create a new class inheriting from the SFZWebBrowserControl class with overrided SFZWebBrowserControl::DoneNotifyHandler function.

Reference

SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::Navigate | SFZWebBrowserControl::Move | SFZWebBrowserControl::Previous | SFZWebBrowserControl::Reload


SFZWebBrowserControl::Previous
Move to the previous page in specified history, get and render the page again.
[ public ]
SFCError Previous(
    SInt32 n = 1   // number of history to move back
);

Argument

n

Specify the number of history to move back. If it is elided, move to 1 history previous.

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY
  • If the specified number is out of the history list: SFERR_INVALID_PARAM
  • If failed: SFERR_FAILED

Description

If the specified index number is negative, the history entry go back by its absolute value is displayed. If it is out of the history list, SFERR_INVALID_PARAM is returned as an error.

[Important] About communication error:

The communication errors cannot be gotten from the return value of SFZWebBrowserControl::Previous function.

To get the communication errors or the event that rendering is finished, it is necessary to create a new class inheriting from the SFZWebBrowserControl class with overrided SFZWebBrowserControl::DoneNotifyHandler function.

Reference

SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::Navigate | SFZWebBrowserControl::Move | SFZWebBrowserControl::Next | SFZWebBrowserControl::Reload


SFZWebBrowserControl::Reload
Reload and render the current page.
[ public ]
Void Reload(Void);

Description

When the current page is displayed by the SFZWebBrowserControl::Load function or by the SFZWebBrowserControl::Navigate function with the argument of IAStream or ISource, the redrawing fails if its "url" is not set validlly.

Reference

SFZWebBrowserControl::Load | SFZWebBrowserControl::Navigate


SFZWebBrowserControl::ResponseNotifyHandler
[Handler] Notify that the server connection completes.
[ protected, virtual ]
Bool ResponseNotifyHandler(
    ResponseNotifyConstRef notify   // notification
);

Argument

notify

The information to be notified is set in the "notify" argument. The HTTP response code or the BREW error code can be gotten through this argument.

Return value

  • Finished without HTML rendering: true
  • Continue HTML rendering: false

Description

This function is called before rendering.

The standard implement is to do nathing and return a false. To do any other process, it is necessary to overrice the ResponseNotifyHandler() function.

This function is different with SFZWebBrowserControl::DoneNotifyHandler in the timing being called.

Example

The code below is to override this function.

#include <SFZResponder/SFZControl/SFZWebBrowserControl.hpp>

SFMTYPEDEFRESPONDER(MyBrowserControl)
class MyBrowserControl : public SFZWebBrowserControl {
    SFBSEALRESPONDER(MyBrowserControl)
    SFMRESPONDERINSTANTIATEFOUR(MyBrowserControl, SFZWebBrowserControl, SFYControl, SFYWidget, SFYResponder)
public:
    static MyBrowserControlSmp NewInstance(SFCErrorPtr exception = null);
protected:
    explicit MyBrowserControl(Void) static_throws;
    virtual ~MyBrowserControl(Void);
    virtual Void ResponseNotifyHandler(ResponseNotifyConstRef notify) {
        if (notify.GetErrorCode() != SFERR_NO_ERROR) {
            // if there is a communication error, show the error dialog, stop rendering
            ErrorDialog(notify.GetErrorCode());
            return true;
        }
        else if (WEB_SUCCEEDED(notify.GetDoneCode())) {
            // if there is a HTTP error, show the warning dialog
            WarningDialog(notify.GetResposenCode());
        }
        return false;  // if there is normal or warning, render the HTML page
    }
};

Reference

SFZWebBrowserControl::ResponseNotify | SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::FocusNotifyHandler | SFZWebBrowserControl::JumpNotifyHandler


SFZWebBrowserControl::SetAuthorizeData
Set information on the Basic HTTP authorization.
[ public ]
SFCError SetAuthorizeData(
    SFXAnsiStringConstRef user     // user name for the Basic HTTP authorization
    SFXAnsiStringConstRef passwd   // password for the Basic HTTP authorization
    SFXAnsiStringConstRef url      // URL  for the Basic HTTP authorization
);

Argument

user

Specify the user name for the Basic HTTP authorization.

passwd

Specify the password for the Basic HTTP authorization.

url

Specify the URL for the Basic HTTP authorization. The web pages reachable from this URL link are protected for the Basic HTTP authorization.

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY

The Basic HTTP authorization is not processed when an error code other than SFERR_NO_ERROR is returned.

Description

After this setting, all the http request headers are included with this authorization information when accessing the web pages .

When accessing the web pages not reachable from the specified URL link, this authorization settings are canceled.

To cancel the authorization settings, use the UnsetAuthorizeData function.

Reference

SFZWebBrowserControl::UnsetAuthorizeData


SFZWebBrowserControl::SetHistorySize
Set the size of history list.
[ public ]
SFCError SetHistorySize(
    UInt32 size   // the size of history list
);

Argument

size

The new size of history list. It cannot be set to 0 or a value smaller than the current value.

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY
  • The argument is 0, or smaller than the current value: SFERR_INVALID_PARAM

The size of history list is not modified when an error code other than SFERR_NO_ERROR is returned.

Description

If the value less than the size of current history list is set, old history entries outside the specified size are removed.

The value less than the size returned by SFZWebBrowserControl::GetCurrentHistoryIndex function cannot be set.

Reference

SFZWebBrowserControl::GetCurrentHistoryIndex | SFZWebBrowserControl::GetHistory | SFZWebBrowserControl::GetHistoryList | SFZWebBrowserControl::Move | SFZWebBrowserControl::SetHistorySize


SFZWebBrowserControl::SetIndent
Set the width of indent in pixels.
[ public ]
SFCError SetIndent(
    SInt32 pixel   // width of indent
);

Argument

pixel

Specify the width of indent in pixels.

Return value

  • If succeeds: SFERR_NO_ERROR
  • If failed : some error code other than SFERR_NO_ERROR

Reference

SFZWebBrowserControl::GetIndent


SFZWebBrowserControl::SetInlineEditEnable
Set whether the text is edited in some part of screen or not.
[ public ]
SFCError SetInlineEditEnable(
    Bool enable   // inline editable
);

Argument

enable
  • the text is edited in some part of screen: true
  • the text is edited in the full screen: false

Return value

Return SFERR_NO_ERROR.

Reference

SFZWebBrowserControl::IsInlineEditEnable


SFZWebBrowserControl::SetLinkColor
Set the color of link text.
[ public ]
SFCError SetLinkColor(
    SFXRGBColorConstRef color   // link color
);

Argument

color

Specify the color of link text.

Return value

  • If succeeds: SFERR_NO_ERROR
  • If failed: SFERR_UNSUPPORTED

Reference

SFZWebBrowserControl::GetLinkColor | SFZWebBrowserControl::SetTextColor


SFZWebBrowserControl::SetParagraphSpacing
Set the spacing between paragraphs in pixels.
[ public ]
SFCError SetParagraphSpacing(
    SInt32 pixel   // paragraph spacing
);

Argument

pixel

Set the spacing between paragraphs in pixels.

Return value

  • If succeeds: SFERR_NO_ERROR
  • If failed: SFERR_UNSUPPORTED

Reference

SFZWebBrowserControl::GetParagraphSpacing


SFZWebBrowserControl::SetScrollbarEnable
Enable or disable the scroll bar.
[ public ]
SFCError SetScrollbarEnable(
    Bool enable   // enable the scroll bar
);

Argument

enable
  • If enabled: true
  • Otherwise: false

Return value

Return SFERR_NO_ERROR.

Description

The scroll bar here is not of SophiaFramework UNIVERSE, but of the standard BREW.

Reference

SFZWebBrowserControl::IsScrollbarEnable


SFZWebBrowserControl::SetScrollbarWidth
Set the width of scroll bar in pixels.
[ public ]
SFCError SetScrollbarWidth(
    SInt32 pixel   // width of the scroll bar
);

Argument

pixel

Specify the width of the scroll bar in pixels.

Return value

  • If succeeds: SFERR_NO_ERROR
  • If failed: SFERR_UNSUPPORTED

Reference

SFZWebBrowserControl::GetScrollbarWidth


SFZWebBrowserControl::SetTextColor
Set the text color.
[ public ]
SFCError SetTextColor(
    SFXRGBColorConstRef color   // color
);

Argument

color

Specify the color of HTML text.

Return value

  • If succeeds: SFERR_NO_ERROR
  • If failed: SFERR_UNSUPPORTED

Reference

SFZWebBrowserControl::GetTextColor | SFZWebBrowserControl::SetLinkColor


SFZWebBrowserControl::SetWeb
Set the IWeb interface for communication.
[ public ]
Void SetWeb(
    SFBWebSmpConstRef web   // iWeb interface
);

Argument

web

The IWeb interface for communication.

Description

Use the specified IWeb interface for HTTP accessing.

If it is under rendering, or communicating, interrupt it.

[Important] Caution when specify the WebOpt.

Though any WebOpt can be set for gotten IWeb instance, the user-set data of WebOpt should be kept by user till it is useable by another IWeb instance.

Please see the "Instructions about the life-time of WEBOPT" in BREW API Reference.

[Important] The behavior when suspend.

When suspend, the IWeb instance is set to be created internally as default.

At this time, the information of specified WebOpt will be reset, too.

When continue to use user-original IWeb instance, Please reset it by resume handler.

The specified value can be gotten by GetWeb function.

Example

Set the user agent name.

The setting will be abandoned if the device suspends. It is necessary to set in the resume handler again.

SCError SetUserAgent(SFZWebBrowserControlRef browser) {
    SFBWebSmp web;
    web = browser.GetWeb();
    if (web == null) {
        web = SFBWeb::Instance();
    }
    
    WebOpt opts[2];
    opts[0].nId = WEB_HEADER;
    // do not release the setting string if it is in effective until you secure the heap of it
    opts[0].pVal = "User-Agent: ibROWSE/0.1 (SophiaFramework; I; BREW 3.1)\r\n";
    opts[1].nId = WEBOPT_END;
    opts[1].pVal = null;

    int s = web->AddOpt(opts);
    if (s != SFERR_NO_ERROR) {
        return s;
    }
    browser.SetWeb(web);
    return SFERR_NO_ERROR;
}

Reference

SFBWeb | SFZWebBrowserControl::UnsetWeb | SFZWebBrowserControl::GetWeb


SFZWebBrowserControl::Stop
Stop accessing the network and rendering.
[ public ]
Void Stop(Void);

Description

Nothing happens except under accessing the network or rendering. The content that has already been displayed takes no influence by calling the SFZWebBrowserControl::Stop function.


SFZWebBrowserControl::UnsetAuthorizeData
Cancel the settings for Basic HTTP authorization.
[ public ]
SFCError UnsetAuthorizeData(Void);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY

Description

The SFZWebBrowserControl::UnsetAuthorizeData function used to cancel the settings for Basic HTTP authorization set by the SFZWebBrowserControl::SetAuthorizeData function.

After calling this function, information on the Basic HTTP authorization is not included with the http request header.

Reference

SFZWebBrowserControl::SetAuthorizeData


SFZWebBrowserControl::UnsetWeb
Cancel the settings set by the SFZWebBrowserControl::SetWeb function.
[ public ]
Void UnsetWeb(Void);

Description

The SFZWebBrowserControl::UnsetWeb function is used to have the IWeb interface for communication to be created inside the control.

In case of rendering or communicating, its process is interrupted.

Reference

SFBWeb | SFZWebBrowserControl::SetWeb | SFZWebBrowserControl::GetWeb


SFZWebBrowserControl::DEFAULT
Enumerated type for the initial value of SFZWebBrowserControl parameter.
enum DEFAULT {
    HISTORY_SIZE = 30
};

Description

Only HISTORY_SIZE is defined to represent the size of history list.

Reference

SFZWebBrowserControl::GetHistorySize | SFZWebBrowserControl::SetHistorySize


SFZWebBrowserControl::DoneNotify
The class to preserve the information on the timing when rendering is finished.
[ public ]

SFMTYPEDEFCLASS(DoneNotify)
class DoneNotify : public Notify {
public:
                       DoneNotify     (SFBHTMLViewerPtr hv, int done_code);
    SInt32             GetDoneCode    (Void) const;
    SFCError           GetErrorCode   (Void) const;
    UInt32             GetResponseCode(Void) const;
};

Description

The DoneNotify class is derived from the HVNotify of BREW API.

The DoneNotify class is mainly used as the argument of SFZWebBrowserControl::DoneNotifyHandler function.

The member functions of DoneNotify class are as below:

GetDoneCode Get the result code of communication or rendering. To check whether the communication succeeded or not, pass the result code to the WEB_ERROR_SUCCEEDED function. If communication succeeded, the response code from server is returned. Otherwise, a negative value is returned. And the result code can be converted into the BREW error code to send it to the WEB_ERROR_MAP function.
GetErrorCode Get the error code of communication or rendering. If no error, SFERR_NO_ERROR is returned.
GetResponseCode Get the response code from server. 0 is returned if the HTTP session failed because of communication error etc.

Reference

SFZWebBrowserControl::DoneNotifyHandler


SFZWebBrowserControl::FocusNotify
The class to preserve the information on the focus movement of browser.
[ public ]

SFMTYPEDEFCLASS(FocusNotify)
class FocusNotify : public Notify {
public:
                       FocusNotify  (SFBHTMLViewerPtr hv, SInt32 elementNo, HVFocusType type, SInt32 state);
    SInt32             GetElementNo(Void) const;
    HVFocusType        GetFocusType(Void) const;
    SInt32             GetState    (Void) const;
};

Description

The FocusNotify class is derived from the HVNotify of BREW API.

The FocusNotify class is mainly used as the argument of SFZWebBrowserControl::FocusNotifyHandler function.

The member functions of FocusNotify class are as below:

GetState Get the status of focused element. This value is meaningful only when the return value of GetFocusType function is HVFOCUS_CHECKBOX or HVFOCUS_RADIO. If the checkbox or radiobutton focused is not selected, 0 is returned. Otherwise a value other than 0 is returned.
GetElementNo Get the position of focused element. The return value is of the same type as the element position by the SFZWebBrowserControl::FindElement function.
GetFocusType Get the type of focused element. The return value is one of the following:
  • HVFOCUS_NONE
  • HVFOCUS_LINK
  • HVFOCUS_EDIT
  • HVFOCUS_CHECKBOX
  • HVFOCUS_RADIO
  • HVFOCUS_SUBMIT
  • HVFOCUS_RESET
  • HVFOCUS_LIST
Please refer to the [HVFocusType] in the BREW API for detailed information.

Reference

SFZWebBrowserControl::FocusNotifyHandler


SFZWebBrowserControl::HistoryEntry
The structure for history entries.
[ public ]
struct HistoryEntry {
    SFXAnsiString url;
    SFXAnsiString title;
};

Reference

SFZWebBrowserControl::GetHistory | SFZWebBrowserControl::GetHistoryList


SFZWebBrowserControl::JumpNotify
The class to preserve the information on the url links pressed in the browser by user.
[ public ]

SFMTYPEDEFCLASS(JumpNotify)
class JumpNotify : public Notify {
public:
                       JumpNotify  (SFBHTMLViewerPtr hv, SInt32 elementNo, ACharConstPtr url, ACharConstPtr method = null, ACharConstPtr data = null);
                       JumpNotify  (SFBHTMLViewerPtr hv, ACharConstPtr url, ACharConstPtr method = null, ACharConstPtr data = null);
    SInt32             GetElementNo(Void) const;
    SFXAnsiStringConst GetUrl      (Void) const;
    SFXAnsiStringConst GetMethod   (Void) const;
    SFXAnsiStringConst GetData     (Void) const;
};

Description

The JumpNotify class is derived from the HVNotify of BREW API.

The JumpNotify class is mainly used as the argument of SFZWebBrowserControl::JumpNotifyHandler function.

The member functions of JumpNotify class are as below:

GetElementNo Get the position of link element selected. The return value is of the same type as the element position by the SFZWebBrowserControl::FindElement function.
GetUrl Get the URL of link selected by user.
GetMethod Get the access method to the server of selected URL link. Get and POST are supported.
GetData Get data to be sent to the server by POST method. If there is no data to be sent, or the method is not POST, an empty string is returned.

Reference

SFZWebBrowserControl::JumpNotifyHandler


SFZWebBrowserControl::ResponseNotify
The class to preserve the information on the timing when rendering is finished.
[ public ]

SFMTYPEDEFCLASS(ResponseNotify)
class ResponseNotify : public Notify {
public:
                       ResponseNotify (SFBHTMLViewerPtr hv, int error_code);
    SFCError           GetErrorCode   (Void) const;
    UInt32             GetResponseCode(Void) const;
};

Description

The ResponseNotify class is derived from the HVNotify of BREW API.

The ResponseNotify class is mainly used as the argument of SFZWebBrowserControl::ResponseNotifyHandler function.

The member functions of ResponseNotify class are as below:

GetErrorCode Return the error code in communicating or rendering. If no error, SFERR_NO_ERRO is returned.
GetResponseCode Return the response code from the server. 0 is returned if the HTTP session failed because of communication error etc.

Reference

SFZWebBrowserControl::ResponseNotifyHandler