PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFYWebBrowserWidget
Responder which represents a simple web browser widget.
#include <SFYWebBrowserWidget.h.hpp>
class SFYWebBrowserWidget : public SFYWidget;
SFMTYPEDEFRESPONDER(SFYWebBrowserWidget)
        

Inheritance diagram

 Inheritance diagram of SFYWebBrowserWidgetClass

Collaboration diagram

 Collaboration diagram of SFYWebBrowserWidgetClass

Description

The following functions are available in the SFYWebBrowserWidget class:

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

A simple web browser can be created easily by only pasting a SFYWebBrowserWidget object.

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

[Note] Fatal Error

The (SFEVT_RESPONDER_BROWSER_NOTIFY, NOTIFY_FATAL_ERROR) event is sent when an fatal error occurs. If you receive this event, you need to terminate the SFYWebBrowserWidget instance.

[Caution] Privilege setting of mif file

To use the SFYWebBrowserWidget class, "Web Access" privilege must be checked by mif editor. To load an own root certificate file for SSL connection, "File" privilege must be also checked.

Sample Code

The following code displays a HTML document in a window by using the simple browser (the SFYWebBrowserWidget class).

SFMTYPEDEFRESPONDER(MyWindow)
class MyWindow : public SFZWindow{
    SFMSEALRESPONDER(MyWindow)
    SFMRESPONDERINSTANTIATEFOUR(MyWindow, SFZWindow, SFYContainer, SFYWidget, SFYResponder)
public:
    // Type of MyWindow
    enum CodeEnum {
        CODE_TYPE = four_char_code('M', 'W', 'N', 'D')
    };
    SFMTYPEDEFTYPE(CodeEnum)
public:
    static MyWindowSmp NewInstance(SFCErrorPtr exception = null);
    // Create and initialize a simple browser
    SFCError Make(Void);

protected:
    explicit MyWindow(Void) static_throws;
    virtual ~MyWindow(Void);

    // Simple browser
    SFYWebBrowserWidgetSmp _browser;

};

// Constructor
MyWindow::MyWindow(Void) static_throws
{
    if (static_try()) {
        // Set the responder type
        SetType(CODE_TYPE);
   }
}

// Destructor
MyWindow::~MyWindow(Void)
{
}

// Create and initialize a simple browser
SFCError MyWindow::Make(Void)
{
    SFCError error;

    // A HTML document to display
    SFXAnsiString buffer(
         "BrowserControl<br /><br />"
         "<a href=\"/example/tabbrowser/\">Sophia Craedle</a><br /><br />"
    );

    // Create an instance of the simple browser
    if ((_browser = SFYWebBrowserWidget::NewInstance(&error)) != null) {

        if ((error = _browser->SetParent(GetThis())) == SFERR_NO_ERROR) {

            _browser->SetRealBound(GetLocalBound());

            _browser->SetState(true, true, true, true);

            // Open browser
            _browser->Open();

            // Load a HTML document
            _browser->Load(buffer, "file://localhost/");

            _browser->ToFront();
        }
    }
    return error;
}

Figure 304. Execution result

Execution result

Reference

SFBHTMLViewer | SFYWebBrowserWidget::SetRequestHeader | SFYWebBrowserWidget::SetTimeoutCallback | SFYWebBrowserWidget::SetTimeoutMillisecond | BREW API IHtmlViewer | BREW API IWeb

Member

Constructor/Destructor
SFYWebBrowserWidget( Void )
Constructor of the SFYWebBrowserWidget class.
~SFYWebBrowserWidget( Void )
Destructor of the SFYWebBrowserWidget class.
Public Functions
Bool AdjustViewer( Void )
Adjust the region of the internal IHTMLViewer instance.
Void Cancel( Void )
Cancel to connect to the Web server.
Void ClearHistory( Void )
Clear the history list.
Void Close( Void )
Close the HTTP connection.
SInt32 FindElement( ACharConstPtr element , SInt32 no )
Find the specified element in the current page.
SFXAnsiStringConstRef GetBaseUrl( Void )
Get the base URL of HTTP basic authentication.
SFXAnsiStringConstRef GetContentEncoding( Void )
Get the value of the Content-Encoding field of the HTTP response header.
SInt32 GetContentLength( Void )
Get the value of the Content-Length field of the HTTP response header.
SFXAnsiStringConstRef GetContentType( Void )
Get the value of the Content-Type field of the HTTP response header.
SFXAnsiStringConstRef GetCurrentTitle( Void )
Get the title of the current page.
SFXAnsiStringConstRef GetCurrentURL( Void )
Get the URL of the current page.
SFXDate GetDate( Void )
Get the value of the Date field of the HTTP response header.
SFXAnsiString GetElementText( SInt32 elementIndex )
Get the text of the specified element.
SFXDate GetExpires( Void )
Get the value of the Expires field of the HTTP response header.
SInt32 GetIndent( Void )
Get the width of indent.
SFXDate GetLastModified( Void )
Get the value of the Last-Modified field of the HTTP response header.
SFXRGBColor GetLinkColor( Void )
Get the color of link text.
SFXAnsiStringConstRef GetMethod( Void )
Get the HTTP request method.
SInt32 GetParagraphSpacing( Void )
Get the spacing between paragraphs.
SFXAnsiStringConstRef GetPassword( Void )
Get the password of HTTP basic authentication.
SFXSocketAddressConstRef GetProxyServer( Void )
Get the proxy server.
SFBSourceSmpConstRef GetRequestContent( Void )
Get the SFBSource instance that manages the HTTP request body.
UInt32 GetRequestFlag( Void )
Get the HTTP request flag.
SFXAnsiStringConstRef GetRequestHeader( SFXAnsiStringConstRef key )
Get the HTTP request header.
SFXPropertyConstRef GetRequestHeader( Void )
Get the HTTP request header.
SFBSourceSmpConstRef GetResponseContent( Void )
Get the SFBSource instance that manages the HTTP response body.
UInt32 GetResponseFlag( Void )
Get the HTTP response flag.
SFXAnsiStringConstRef GetResponseHeader( SFXAnsiStringConstRef key )
Get the HTTP response header.
SFXPropertyConstRef GetResponseHeader( Void )
Get the HTTP response header.
SInt32 GetResultCode( Void )
Get the HTTP status code.
SFBWebSmpConstRef GetSFBWeb( Void )
Get the SFBWeb instance managed internally by the HTTP connection.
SFBWebRespSmpConstRef GetSFBWebResp( Void )
Get the SFBWebResp instance managed internally by the HTTP connection.
SInt32 GetScrollbarWidth( Void )
Get the width of scroll bar.
SFCError GetStreamReader( UInt32 size , SFXStreamReaderPtr result )
Get the input stream for reading data from the HTTP response body.
SFCError GetStreamReader( SFXStreamReaderPtr result )
Get the input stream for reading data from the HTTP response body.
SFCError GetStreamWriter( UInt32 size , SFXStreamWriterPtr result )
Get the output stream for writing data onto the HTTP request body.
SFCError GetStreamWriter( SFXStreamWriterPtr result )
Get the output stream for writing data onto the HTTP request body.
SFXRGBColor GetTextColor( Void )
Get the text color.
UInt32 GetTimeoutMillisecond( Void )
Get the connection timeout period. [in milliseconds]
UInt32 GetTrustMode( Void )
Get the SSL trust mode.
SFXAnsiStringConstRef GetUser( Void )
Get the user name of HTTP basic authentication.
SFXAnsiStringConstRef GetUserAgent( Void )
Get the user agent of the HTTP request header.
AEECLSID GetWebClassId( Void )
Get the web class ID to open the HTTP/HTTPS connection.
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( SFBSourceSmpConstRef source , SFXAnsiStringConstRef url )
Start to render the data in the HTML format.
SFCError Load( SFBAStreamSmpConstRef stream , SFXAnsiStringConstRef url )
Start to render the data in the HTML format.
SFCError Load( SFXAnsiStringConstRef data , SFXAnsiStringConstRef url )
Start to render the data in the HTML format.
SFCError LoadCertificate( SInt32 kind , SFXPathConstRef path )
Load a ASN.1/DER form certificate file or buffer.
SFCError LoadCertificate( SInt32 kind , SFXBufferConstRef buffer )
Load a ASN.1/DER form certificate file or buffer.
SFCError Navigate( SFXAnsiStringConstRef url )
Get a page which is specified as url, and start to render the page.
static
SFYWebBrowserWidgetSmp
NewInstance( SFCErrorPtr exception = null )
Create a new instance of this responder class.
SFCError Next( SInt32 n = 1 )
Move to the next page in specified history, get and render the page again.
SFCError Open( AEECLSID id = AEECLSID_WEB )
Open the HTTP connection.
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 the information of HTTP basic authentication.
SFCError SetIndent( SInt32 pixel )
Set the width of indent in pixels.
Void 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 SetMethod( SFXAnsiStringConstRef param )
Set the HTTP request method.
SFCError SetParagraphSpacing( SInt32 pixel )
Set the spacing between paragraphs in pixels.
SFCError SetProxyServer( SFXSocketAddressConstRef param )
Set the proxy server.
SFCError SetRequestContent( SFXFileConstRef file )
Set the HTTP request body of the HTTP connection to the specified storage or source.
SFCError SetRequestContent( SFXMemoryConstRef memory )
Set the HTTP request body of the HTTP connection to the specified storage or source.
SFCError SetRequestContent( SFXStorageConstRef storage , SInt32 length )
Set the HTTP request body of the HTTP connection to the specified storage or source.
SFCError SetRequestContent( SFBSourceSmpConstRef source , SInt32 length )
Set the HTTP request body of the HTTP connection to the specified storage or source.
SFCError SetRequestFlag( UInt32 param )
Set the HTTP request flag.
SFCError SetRequestHeader( SFXAnsiStringConstRef key , SFXAnsiStringConstRef value )
Set the HTTP request header.
Void 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 SetTimeoutCallback( SFXCallback::CallbackSPP spp , VoidPtr reference )
Set the connection timeout callback.
Void SetTimeoutMillisecond( UInt32 msec )
Set the connection timeout period to the specified value. [in milliseconds]
SFCError SetTrustMode( UInt32 param )
Set the SSL trust mode.
SFCError SetUserAgent( SFXAnsiStringConstRef param )
Set the user agent.
Void SetWebClassId( AEECLSID id )
Set the web class ID to open the HTTP/HTTPS connection.
Void Stop( Void )
Stop rendering.
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)
Distribute the specified event.
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.
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 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 Recover( Void ) (inherits from SFYResponder)
Recover the intersection region between this responder and the responder space by using the saved bitmap to restore the device bitmap.
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 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.
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.
SFCError Snapshot( SFBBitmapSmpConstRef bitmap ) (inherits from SFYResponder)
Get a snapshot image of the intersection region between this responder and the responder space by using the saved bitmap.
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 HandleBoundReal( Void )
This function will be called when the real region is changed.
Void HandleBoundVirtual( Void )
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 )
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw this responder.]
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 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 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
CodeEnum
Constant that represents the SFYWebBrowserWidget class.
Notify
Browser notification struct.
NotifyEnum
Enumerator which represents a notification from IHTMLViewer or connection callback.
HorizontalEnum (inherits from SFYResponder)
Constants that represent the horizontal alignment.
VerticalEnum (inherits from SFYResponder)
Constants that represent the vertical alignment.

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

Description

This constructor creates an instance of the IHTMLViewer interface.


SFYWebBrowserWidget::~SFYWebBrowserWidget
Destructor of the SFYWebBrowserWidget class.
[ protected, virtual ]
~SFYWebBrowserWidget(Void);

Description

This destructor stops rendering of HTML data, terminates the HTTP/HTTPS connection, and releases the IHTMLViewer instance.

Reference

SFZWebBrowserControl::Stop | SFZWebBrowserControl::Close


SFYWebBrowserWidget::AdjustViewer
Adjust the region of the internal IHTMLViewer instance.
[ public ]
Bool AdjustViewer(Void);

Return value

  • If the region is changed: true
  • Otherwise: false

Description

This function adjusts the region of the internal IHTMLViewer instance.

This function is automatically called when the real region or the virtual region of this responder is changed.

When the global region of this responder is changed by other factors, explicit calling is necessary.


SFYWebBrowserWidget::Cancel
Cancel to connect to the Web server.
[ public ]
Void Cancel(Void);

Description

This function cancels to connect to the Web server.

The registered callback and the connection timeout timer will be canceled, and the state of the HTTP connection will be restored before connecting, if called.

In general, this function is effective in the SFXHTTPConnection::STATE_CONNECT state.

This function is called in the SFYWebBrowserWidget::Close function.

Reference

SFYWebBrowserWidget::Close | SFYWebBrowserWidget::SetTimeoutMillisecond | SFYWebBrowserWidget::SetTimeoutCallback


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

Description

This function clears the history list.


SFYWebBrowserWidget::Close
Close the HTTP connection.
[ public ]
Void Close(Void);

Description

This function closes the HTTP connection.

This HTTP connection transits into the SFXHTTPConnection::STATE_CLOSE state.

Concretely, the following processings will be performed.

  1. Initialize the content of the HTTP request.
  2. Release the SFBWeb / SFBWebResp instance that this HTTP connection contains internally.
  3. Cancel the callback registered into this HTTP connection.
  4. Initialize the content of the HTTP response.
  5. Transit into the SFXHTTPConnection::STATE_CLOSE state.
[Note] Note

This function is called in the SFYWebBrowserWidget::~SFYWebBrowserWidget destructor.

This function calls the SFYWebBrowserWidget::Cancel function internally.

Reference

SFYWebBrowserWidget::~SFYWebBrowserWidget | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Cancel | SFYWebBrowserWidget::GetSFBWeb | SFYWebBrowserWidget::GetSFBWebResp


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

Argument

element

Specify the name of the element to find.

no

Specify the index of the 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 SFYWebBrowserWidget::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 SFYWebBrowserWidget::GetElementText function.

Reference

SFYWebBrowserWidget::GetElementText


SFYWebBrowserWidget::GetBaseUrl
Get the base URL of HTTP basic authentication.
[ public, const ]
SFXAnsiStringConstRef GetBaseUrl(Void);

Return value

Base URL of HTTP basic authentication

Description

Get the base URL of HTTP basic authentication.

The value which is set by the SFYWebBrowserWidget::SetAuthorizeData function is gotten.

Reference

SFYWebBrowserWidget::SetAuthorizeData


SFYWebBrowserWidget::GetContentEncoding
Get the value of the Content-Encoding field of the HTTP response header.
[ public, const ]
SFXAnsiStringConstRef GetContentEncoding(Void);

Return value

Value of the Content-Encoding field of the HTTP response header

Description

This function gets the value of the Content-Encoding field of the HTTP response header.

If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, the empty string(SFXAnsiString::EmptyInstance()) will be returned.

Reference

SFXAnsiString


SFYWebBrowserWidget::GetContentLength
Get the value of the Content-Length field of the HTTP response header.
[ public, const ]
SInt32 GetContentLength(Void);

Return value

Value of the Content-Length field of the HTTP response header

Description

This function gets the value of the Content-Length field of the HTTP response header.

If the Content-Length field of the HTTP response header does not exist or the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, -1 will be returned.


SFYWebBrowserWidget::GetContentType
Get the value of the Content-Type field of the HTTP response header.
[ public, const ]
SFXAnsiStringConstRef GetContentType(Void);

Return value

Value of the Content-Type field of the HTTP response header

Description

This function gets the value of the Content-Type field of the HTTP response header of the HTTP connection.

If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, the empty string(SFXAnsiString::EmptyInstance()) will be returned.

Reference

SFXAnsiString


SFYWebBrowserWidget::GetCurrentTitle
Get the title of the current page.
[ public, const ]
SFXAnsiStringConstRef GetCurrentTitle(Void);

Return value

Tite of the current page

Description

This function gets the title of the current page.

Reference

SFYWebBrowserWidget::GetCurrentURL


SFYWebBrowserWidget::GetCurrentURL
Get the URL of the current page.
[ public, const ]
SFXAnsiStringConstRef GetCurrentURL(Void);

Return value

URL of the current page

Description

This function gets the URL of the current page.

Reference

SFYWebBrowserWidget::GetCurrentTitle


SFYWebBrowserWidget::GetDate
Get the value of the Date field of the HTTP response header.
[ public, const ]
SFXDate GetDate(Void);

Return value

Value of the Date field of the HTTP response header as the SFXDate) instance

Description

This function gets the value of the Date field of the HTTP response header as the SFXDate) instance.

If the Date field of the HTTP response header does not exist or the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, SFXDate(0) will be returned.

Reference

SFXDate


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

Argument

elementIndex

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

Return value

Content of the 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

SFYWebBrowserWidget::FindElement


SFYWebBrowserWidget::GetExpires
Get the value of the Expires field of the HTTP response header.
[ public, const ]
SFXDate GetExpires(Void);

Return value

Value of the Expires field of the HTTP response header as the SFXDate) instance

Description

This function gets the value of the Expires field of the HTTP response header as the SFXDate) instance.

If the Expires field of the HTTP response header does not exist or the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, SFXDate(0) will be returned.

Reference

SFXDate


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

Return value

Width of specified indent in pixels.

Reference

SFYWebBrowserWidget::SetIndent


SFYWebBrowserWidget::GetLastModified
Get the value of the Last-Modified field of the HTTP response header.
[ public, const ]
SFXDate GetLastModified(Void);

Return value

Value of the Last-Modified field of the HTTP response header as the SFXDate) instance

Description

This function gets the value of the Last-Modified field of the HTTP response header as the SFXDate) instance.

If the Last-Modified field of the HTTP response header does not exist or the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, SFXDate(0) will be returned.

Reference

SFXDate


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

Return value

Color of the link text.

Reference

SFYWebBrowserWidget::SetLinkColor | SFYWebBrowserWidget::GetTextColor


SFYWebBrowserWidget::GetMethod
Get the HTTP request method.
[ public, const ]
SFXAnsiStringConstRef GetMethod(Void);

Return value

HTTP request method of this HTTP connection

Description

This function gets the HTTP request method of this HTTP connection set with the SFYWebBrowserWidget::SetMethod function.

If this HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, the empty string(SFXAnsiString::EmptyInstance()) will be returned.

Reference

SFYWebBrowserWidget::SetMethod | SFYWebBrowserWidget::Open | SFXAnsiString


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

Return value

Space between paragraphs in pixels.

Reference

SFYWebBrowserWidget::SetParagraphSpacing


SFYWebBrowserWidget::GetPassword
Get the password of HTTP basic authentication.
[ public, const ]
SFXAnsiStringConstRef GetPassword(Void);

Return value

Password of HTTP basic authentication

Description

Get the password of HTTP basic authentication.

The value which is set by the SFYWebBrowserWidget::SetAuthorizeData function is gotten.

Reference

SFYWebBrowserWidget::SetAuthorizeData


SFYWebBrowserWidget::GetProxyServer
Get the proxy server.
[ public, const ]
SFXSocketAddressConstRef GetProxyServer(Void);

Return value

Proxy server of this HTTP connection

Description

This function gets the proxy server of this HTTP connection set with the SFYWebBrowserWidget::SetProxyServer function.

If this HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, or the proxy server of the HTTP connection has not been set, SFXSocketAddress::EmptyInstance() will be returned.

Reference

SFYWebBrowserWidget::SetProxyServer | SFXSocketAddress


SFYWebBrowserWidget::GetRequestContent
Get the SFBSource instance that manages the HTTP request body.
[ public, const ]
SFBSourceSmpConstRef GetRequestContent(Void);

Return value

SFBSource instance that manages the HTTP request body of the HTTP connection

Description

This function gets the SFBSource instance that manages the HTTP request body of the HTTP connection, which is set with the SFYWebBrowserWidget::SetRequestContent function.

If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, or the SFBSource instance has not been set, &SFBSourceSmp::EmptyInstance() will be returned.

Reference

SFYWebBrowserWidget::SetRequestContent | SFBSource


SFYWebBrowserWidget::GetRequestFlag
Get the HTTP request flag.
[ public, const ]
UInt32 GetRequestFlag(Void);

Return value

HTTP request flag of this HTTP connection

Description

This function gets the HTTP request flag set with the SFYWebBrowserWidget::SetRequestFlag function.

If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, 0 will be returned.

Reference

SFYWebBrowserWidget::SetRequestFlag | SFYWebBrowserWidget::Open | BREW API IWEB_GetResponse


SFYWebBrowserWidget::GetRequestHeader
Get the HTTP request header.
[ public, const ]
SFXAnsiStringConstRef GetRequestHeader(
    SFXAnsiStringConstRef key   // field name
);
[ public, const ]
SFXPropertyConstRef GetRequestHeader(Void);

Return value

HTTP request header of this HTTP connection

Description

This function gets the HTTP request header of the HTTP connection set with the SFYWebBrowserWidget::SetRequestHeader function. It is possible to get the value of the field specified in the argument. If nothing is specified, all of the HTTP request header will be obtained.

If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, or the specified field of the HTTP request header or itself has not been set, the empty string(SFXAnsiString::EmptyInstance()) or the empty property(SFXProperty::EmptyInstance()) will be returned.

Reference

SFYWebBrowserWidget::SetRequestHeader | SFXProperty | SFXAnsiString


SFYWebBrowserWidget::GetResponseContent
Get the SFBSource instance that manages the HTTP response body.
[ public, const ]
SFBSourceSmpConstRef GetResponseContent(Void);

Return value

SFBSource instance that manages the HTTP response body

Description

This function gets the SFBSource instance that manages the HTTP response body of the HTTP connection.

If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, SFBSourceSmp::EmptyInstance() will be returned.

[Tip] Tip
After the HTTP connection is established, the HTTP response body can be obtained using this function.
[Note] Note

The SFYWebBrowserWidget::GetStreamReader function gets the stream from the SFBSource instance, return value of the SFYWebBrowserWidget::GetResponseContent function.

[Caution] Reading the HTTP response body

If the HTTP response body is read by using the SFYWebBrowserWidget::GetResponseContent function, the SFYWebBrowserWidget::GetStreamReader function cannot be used.

On the contrary, if the HTTP response body is read by using the SFYWebBrowserWidget::GetStreamReader function, the SFYWebBrowserWidget::GetResponseContent function cannot be used.

Reference

SFYWebBrowserWidget::GetStreamReader | SFBSource


SFYWebBrowserWidget::GetResponseFlag
Get the HTTP response flag.
[ public, const ]
UInt32 GetResponseFlag(Void);

Return value

HTTP response flag of this HTTP connection

Description

This function gets the HTTP response flag of the HTTP connection.

The HTTP response flag can be represented as logical sum of the following flags:

  • WEBRESPONSE_REDIRECTED: redirection was handled by IWeb (Unimplemented by BREW's HTTP protocol engine)
  • WEBRESPONSE_COOKIES:cookies were sent in the request (Unimplemented by BREW's HTTP protocol engine)
  • WEBRESPONSE_CACHED: retrieved from local cache (no network activity)
  • WEBRESPONSE_KEEPALIVE: connection kept alive
  • WEBRESPONSE_HTTP09: got an HTTP0.9 response (so there were no HTTP headers; and the WebRespInfo. nCode == 200 was fabricated
  • WEBRESPONSE_LOCAL: locally-generated content (no network activity)
  • WEBRESPONSE_PROXIED: gotten through a proxy
  • WEBRESPONSE_AUTHBASIC: basic authentication info was sent. (Unimplemented by BREW's HTTP protocol engine)

If this HTTP connection is not in the STATE_OPEN_ESTABLISHED state, 0 will be returned.

Reference

SFYWebBrowserWidget::SetRequestFlag | SFBWebResp | BREW API IWEBRESP_GetOpt


SFYWebBrowserWidget::GetResponseHeader
Get the HTTP response header.
[ public, const ]
SFXAnsiStringConstRef GetResponseHeader(
    SFXAnsiStringConstRef key   // field name
);
[ public, const ]
SFXPropertyConstRef GetResponseHeader(Void);

Return value

HTTP response header of this HTTP connection

Description

This function gets the HTTP response header of the HTTP connection set with the SFYWebBrowserWidget::SetRequestHeader function. It is possible to get the value of the field specified in the argument. If nothing is specified, all of the HTTP response header will be obtained.

If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, or the specified field of the HTTP response header or itself has not been set, the empty string(SFXAnsiString::EmptyInstance()) or the empty property(SFXProperty::EmptyInstance()) will be returned.

Reference

SFXProperty | SFXAnsiString


SFYWebBrowserWidget::GetResultCode
Get the HTTP status code.
[ public, const ]
SInt32 GetResultCode(Void);

Return value

HTTP status code of this HTTP connection.

Description

This function gets the HTTP status code of the HTTP connection.

If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, -1 will be returned.

If the HTTP connection has been established, the return value of this function is same as the nCode field of BREW API's WebRespInfo.

nCode represents either a protocol error code or a *negative* WEB_ERROR (see AEEError.h for codes), use WEB_ERROR_MAP(nCode) to map to AEE error, and WEB_ERROR_SUCCEEDED(nCode) to test for success. A positive number is one that was returned by the server, negative error codes are system errors.

[Note] Note
For more details on WEB_ERROR, see AEEError.h.

Reference

BREW API WebRespInfo | BREW API WEB_ERROR_MAP | BREW API WEB_ERROR_SUCCEEDED


SFYWebBrowserWidget::GetSFBWeb
Get the SFBWeb instance managed internally by the HTTP connection.
[ public, const ]
SFBWebSmpConstRef GetSFBWeb(Void);

Return value

SFBWeb instance managed internally by the HTTP connection.

Description

This function gets the SFBWeb instance managed internally by the HTTP connection.

Reference

SFBWeb | BREW API IWeb


SFYWebBrowserWidget::GetSFBWebResp
Get the SFBWebResp instance managed internally by the HTTP connection.
[ public, const ]
SFBWebRespSmpConstRef GetSFBWebResp(Void);

Return value

SFBWebResp instance managed internally by the HTTP connection.

Description

This function gets the SFBWebResp instance managed internally by the HTTP connection.

Reference

SFBWebResp | BREW API IWebResp


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

Return value

Width of scroll bar in pixels.

Reference

SFYWebBrowserWidget::SetScrollbarWidth


SFYWebBrowserWidget::GetStreamReader
Get the input stream for reading data from the HTTP response body.
[ public ]
SFCError GetStreamReader(
    UInt32 size                 // buffer size
    SFXStreamReaderPtr result   // pointer to the input stream
);
[ public ]
SFCError GetStreamReader(
    SFXStreamReaderPtr result   // pointer to the input stream
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the result argument is null: SFERR_INVALID_PARAM
  • If this HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function gets the input stream for reading data from the HTTP response body of this HTTP connection.

If the size argument is specified, the buffer size of the input stream will be fixed with the specified value. Otherwise, the buffer size will be variable and the SFXElasticStreamReader class will be used internally.

[Tip] Tip
You have to use the SFXBinaryStreamReader, SFXAnsiStringStreamReader, or SFXWideStringStreamReader class for the input stream properly depending on the type of data to be read.
[Caution] Reading the HTTP response body

If the HTTP response body is read by using the SFYWebBrowserWidget::GetResponseContent function, the SFYWebBrowserWidget::GetStreamReader function cannot be used.

On the contrary, if the HTTP response body is read by using the SFYWebBrowserWidget::GetStreamReader function, the SFYWebBrowserWidget::GetResponseContent function cannot be used.

[Note] Note
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state.

Reference

SFYWebBrowserWidget::GetResponseContent | SFXBinaryStreamReader | SFXAnsiStringStreamReader | SFXWideStringStreamReader | Stream Buffer


SFYWebBrowserWidget::GetStreamWriter
Get the output stream for writing data onto the HTTP request body.
[ public ]
SFCError GetStreamWriter(
    UInt32 size                 // buffer size
    SFXStreamWriterPtr result   // pointer to the output stream
);
[ public ]
SFCError GetStreamWriter(
    SFXStreamWriterPtr result   // pointer to the output stream
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the result argument is null: SFERR_INVALID_PARAM
  • If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function gets the output stream for writing data onto the HTTP request body of the HTTP connection.

If the size argument is specified, the buffer size of the output stream will be fixed with the specified value. Otherwise, the buffer size will be variable and the SFXElasticStreamWriter class will be used internally.

[Tip] Tip
You have to use the SFXBinaryStreamWriter, SFXAnsiStringStreamWriter, or SFXWideStringStreamWriter class for the output stream properly depending on the type of data to write.
[Caution] Writing the HTTP response body

If the HTTP response body is set with the SFYWebBrowserWidget::SetRequestContent function, the SFYWebBrowserWidget::GetStreamWriter function cannot be used.

On the contrary, if the HTTP response body is written by using the SFYWebBrowserWidget::GetStreamWriter function, the SFYWebBrowserWidget::SetRequestContent function cannot be used.

[Note] Note
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state.

Reference

SFYWebBrowserWidget::GetStreamReader | SFYWebBrowserWidget::SetRequestContent | SFYWebBrowserWidget::Open | SFXBinaryStreamWriter | SFXAnsiStringStreamWriter | SFXWideStringStreamWriter | Stream Buffer


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

Return value

Text color of HTML.

Reference

SFYWebBrowserWidget::SetTextColor | SFYWebBrowserWidget::GetLinkColor


SFYWebBrowserWidget::GetTimeoutMillisecond
Get the connection timeout period. [in milliseconds]
[ public, const ]
UInt32 GetTimeoutMillisecond(Void);

Return value

Connection timeout period [in milliseconds]

Description

This function gets the connection timeout period. [in milliseconds]

Reference

SFYWebBrowserWidget::SetTimeoutMillisecond | SFYWebBrowserWidget::SetTimeoutCallback


SFYWebBrowserWidget::GetTrustMode
Get the SSL trust mode.
[ public, const ]
UInt32 GetTrustMode(Void);

Return value

SSL trust mode

Description

This function gets the SSL trust mode of this HTTP connection set with the SFYWebBrowserWidget::SetTrustMode function.

If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, 0 will be returned.

Reference

SFYWebBrowserWidget::SetTrustMode | SFYWebBrowserWidget::Open | BREW API ISSL_NegotiateV


SFYWebBrowserWidget::GetUser
Get the user name of HTTP basic authentication.
[ public, const ]
SFXAnsiStringConstRef GetUser(Void);

Return value

User name of HTTP basic authentication

Description

Get the user name of HTTP basic authentication.

The value which is set by the SFYWebBrowserWidget::SetAuthorizeData function is gotten.

Reference

SFYWebBrowserWidget::SetAuthorizeData


SFYWebBrowserWidget::GetUserAgent
Get the user agent of the HTTP request header.
[ public, const ]
SFXAnsiStringConstRef GetUserAgent(Void);

Return value

User agent of this HTTP connection

Description

This function gets the user agent of the HTTP request header of this HTTP connection set with the SFYWebBrowserWidget::SetUserAgent function.

If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state, the empty string(SFXAnsiString::EmptyInstance()) will be returned.

Reference

SFYWebBrowserWidget::SetUserAgent | SFYWebBrowserWidget::Open | SFXAnsiString


SFYWebBrowserWidget::GetWebClassId
Get the web class ID to open the HTTP/HTTPS connection.
[ public, const ]
AEECLSID GetWebClassId(Void);

Return value

Web class ID

Description

This function gets the web class ID to open the HTTP/HTTPS connection.

Default value is AEECLSID_WEB.

Reference

SFYWebBrowserWidget::SetWebClassId


SFYWebBrowserWidget::HandleBoundReal
This function will be called when the real region is changed.
[ protected, virtual ]
Void HandleBoundReal(Void);

Description

This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event is received.

In case you want to perform your own processing when the real region is updated, override this function.

The default implementation is to equalize the virtual region with the real region.

[Note] Sending the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event

The (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event will occur when the real region is changed by calling the SFYResponder::SetRealBound function.

[Note] Processing when the real region is changed

Other than overriding this virtual function, there is another method to define and implement the handler for the region event[XANDLER_DECLARE_VOIDBOUND], and register it into the responder.

In the processing when the real region is updated, this virtual function is executed first, and next the handlers for the region event are executed in the registered order.

In almost all cases, the method to override this virtual function is adopted since defining, implementing and registering the handler for the region event can be omitted.

Internal Implementation

Internal implementation of the SFYWebBrowserWidget::HandleBoundReal function is as follows:

/*protected virtual */Void SFYWebBrowserWidget::HandleBoundReal(Void)
{
    SetVirtualBound(SFXRectangle(SFXGrid::ZeroInstance(), GetRealBound().GetSize()));
    return;
}// SFYWebBrowserWidget::HandleBoundReal //

Reference

SFYResponder::SetRealBound | Real Region | Virtual Region | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND]


SFYWebBrowserWidget::HandleBoundVirtual
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.]
[ protected, virtual ]
Void HandleBoundVirtual(Void);

Description

This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received.

In case you want to perform your own processing when the virtual region is changed, override this virtual function.

The default implementation calls the SFYWebBrowserWidget::AdjustViewer function.

[Note] Sending the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event

The (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event will occur when the virtual region is changed by calling the SFYResponder::SetRealBound or SFYResponder::SetVirtualBound function.

[Note] Another method when the virtual region is changed

Other than overriding this virtual function, it is possible to define and implement the handler for region event[XANDLER_DECLARE_VOIDBOUND], and register it into the responder.

In the processing when the virtual region is updated, this virtual function is executed first, and next the handlers for region event are executed in the registered order.

In almost all cases, the method to override this virtual function is adopted since defining, implementing and registering the handler for region event can be omitted.

Internal Implementation

Internal implementation of the SFYWebBrowserWidget::HandleBoundVirtual function is as follows:

/*protected virtual */Void SFYWebBrowserWidget::HandleBoundVirtual(Void)
{
    AdjustViewer();
    return;
}// SFYWebBrowserWidget::HandleBoundVirtual //

Reference

SFYResponder::SetRealBound | SFYResponder::SetVirtualBound | Real Region | Virtual Region | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND]


SFYWebBrowserWidget::HandleRenderRequest
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw this responder.]
[ protected, virtual, const ]
Void HandleRenderRequest(
    SFXGraphicsPtr graphics   // graphic object
);

Description

This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received.

In case you want to perform your own drawing of this responder, override this function.

The default implementation calls the IHTMLViewer_Redraw function if active. Otherwise, draws snapshot image.

[Note] The method to darw a responder

In addition to overriding this virtual function, it is possible to define and implement the handler for drawing event(drawing handler)[XANDLER_DECLARE_VOIDRENDER], and register it into the responder.

Then, the overridden virtual function will be called first, and next the drawing handlers registered into the responder will be booted up in the registered order.

In almost all cases, the method to override this function is used to draw the responder since there is no need to declare and register the drawing handler.

[Note] Procedure of drawing a responder

The drawing handler will be booted up when the drawing event(SFEVT_RESPONDER_RENDER) occurs. And then the drawing handler draw the responder actually.

The drawing event will be sent to only the responders including the region to be redrawn out of the redraw regions registered into the renderer using the SFYResponder::InvokeBackward function after the SFYResponder::Render function boots up the renderer.

Here, the SFYResponder::Render function will be called at the following situations:

  1. At the end of the event loop
  2. At the applet start / resume or the end of a highest priority event handler
  3. In the callback, which is outside the event loop.

If calling the SFYResponder::Render function with specifying "true" as an argument, the drawing event will be sent to all the responders to be actually displayed on the screen which are located below the responder in the responder tree, regardless of the registration of redraw region.

Internal Implementation

Internal implementation of the SFYWebBrowserWidget::HandleRenderRequest function is as follows:

/*protected virtual */Void SFYWebBrowserWidget::HandleRenderRequest(SFXGraphicsPtr /*graphics*/) const
{
    if (_viewer != null) {
        if (_viewer->IsActive()) {
            _redrawing = true;
            _viewer->Redraw();
            if (_bitmap != null) {
                Snapshot(_bitmap);
            }
            _redrawing = false;
        }
        else {
            if (_bitmap != null) {
                graphics->DrawBitmap(_bitmap, GetLocalBound());
            }
        }
    }
    return;
}// SFYWebBrowserWidget::HandleRenderRequest //

Reference

SFYResponder::Invalidate | SFYResponder::Render | SFYResponder::InvokeBackward | Drawing Event[SFEVT_RESPONDER_RENDER] | Handler for the Drawing Event[XANDLER_DECLARE_VOIDRENDER] | Rendering | Event Loop | Responder Tree


SFYWebBrowserWidget::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

SFYWebBrowserWidget::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

SFYWebBrowserWidget::SetInlineEditEnable


SFYWebBrowserWidget::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

SFYWebBrowserWidget::SetScrollbarEnable


SFYWebBrowserWidget::Load
Start to render the data in the HTML format.
[ public ]
SFCError Load(
    SFBSourceSmpConstRef source   // HTML source
    SFXAnsiStringConstRef url     // URL
);
[ public ]
SFCError Load(
    SFBAStreamSmpConstRef stream   // HTML stream
    SFXAnsiStringConstRef url      // URL
);
[ public ]
SFCError Load(
    SFXAnsiStringConstRef data   // HTML data
    SFXAnsiStringConstRef url    // URL
);

Argument

source

the source in the HTML format

stream

the stream in the HTML format

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 the HTTP/HTTPS connection is not in the SFXHTTPConnection::STATE_OPEN state: SFERR_INVALID_STATE
  • 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 SFYWebBrowserWidget::Load function.

To get the communication errors, it is necessary to handle the (SFEVT_RESPONDER_BROWSER_NOTIFY, NOTIFY_RESPONSE) event.

Reference

SFYWebBrowserWidget::Navigate


SFYWebBrowserWidget::LoadCertificate
Load a ASN.1/DER form certificate file or buffer.
[ public ]
SFCError LoadCertificate(
    SInt32 kind            // kind of certificate
    SFXPathConstRef path   // file path of certificate
);
[ public ]
SFCError LoadCertificate(
    SInt32 kind                // kind of certificate
    SFXBufferConstRef buffer   // buffer of certificate
);

Argument

kind

kind of certificate: any one of WEBOPT_X509_ROOT_CERT, WEBOPT_X509_LEAF_CERT, and WEBOPT_X509_BRANCH_CERT

path

file path of ASN.1/DER form certificate

buffer

buffer of ASN.1/DER form certificate

Return value

  • If succeed: SFERR_NO_ERROR
  • If the HTTP connection is not in the STATE_CLOSE: SFERR_INVALID_STATE
  • If insuffcient memory: SFERR_NO_MEMORY
  • If unsupported: SFERR_UNSUPPORTED
  • Otherwise: SFERR_FAILED

Description

This function loads a file or buffer of ASN.1/DER form certificate.

This function is valid if and only if the HTTP connection is in the STATE_CLOSE.

Example

Load a root certificate file

SFYWebBrowserWidget http;
SFCError error;

// Load a root certificate before open.
if ((error = http.LoadCertificate(WEBOPT_X509_ROOT_CERT, SFXPath("scradle.der"))) == SFERR_NO_ERROR) {
    if ((error = http.Open()) == SFERR_NO_ERROR) {
        error = http.Connect("https://www.s-cradle.com/example/tabbrowser/", XALLBACK_INTERNAL(OnConnect));
    }
}

Reference

SFBX509Chain::AddCert


SFYWebBrowserWidget::Navigate
Get a page which is specified as url, and start to render the page.
[ public ]
SFCError Open(
    SFXAnsiStringConstRef url   // URL to open
);

Argument

url

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

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

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY
  • If the argument is invalid: SFERR_INVALID_PARAM
  • If the HTTP/HTTPS connection is not in the SFXHTTPConnection::STATE_OPEN state: SFERR_INVALID_STATE
  • If failed: SFERR_FAILED

Description

This function gets a page which is specified by the argument, and starts to render it.

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

Before calling this function, the connection must be opened by the SFYWebBrowserWidget::Open function, and the HTML method must be set by the SFYWebBrowserWidget::SetMethod function.

[Important] Abount communication error:

The communication errors cannot be gotten from the return value of SFYWebBrowserWidget::Navigate function.

To get the communication errors, it is necessary to handle the (SFEVT_RESPONDER_BROWSER_NOTIFY, NOTIFY_RESPONSE) event.

Example

SFYWebBrowserWidgetSmp browser;
SFCError error;

if ((browser = SFYWebBrowserWidget::NewInstance(&error)) != null) {
    if ((error = browser->Open()) == SFERR_NO_ERROR) {
        if ((error = browser->SetMethod("GET")) == SFERR_NO_ERRROR) {
            error = browser->Navigate("/example/tabbrowser/");
        }
    }
}

Reference

SFYWebBrowserWidget::Load | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::SetMethod


SFYWebBrowserWidget::NewInstance
Create a new instance of this responder class.
[ public, static ]
SFYWebBrowserWidgetSmp NewInstance(
    SFCErrorPtr exception = null   // error value
);

Argument

exception

Return the error value generated inside the function.

Return value

  • If succeeds: not null pointer
  • Otherwise: null pointer

Description

This function creates a new instance of this responder class.

If succeeds, a not null pointer will be returned, and the "exception" argument is SFERR_NO_ERROR. If fails such as insufficient memory, a null pointer will be returned, and the "exception" argument holds the error value.

Example

The code to create a new instance of this responder class is as follows:

// create a new instance of web browser widget.
SFYWebBrowserWidgetSmp _browser;
SFCError error;

if ((_browser = SFYWebBrowserWidget::NewInstance(&error)) != null) {
    // ...
}

SFYWebBrowserWidget::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 SFYWebBrowserWidget::Next function.

To get the communication errors, it is necessary to handle the (SFEVT_RESPONDER_BROWSER_NOTIFY, NOTIFY_RESPONSE) event.

Reference

SFYWebBrowserWidget::Navigate | SFYWebBrowserWidget::Previous | SFYWebBrowserWidget::Reload


SFYWebBrowserWidget::Open
Open the HTTP connection.
[ public ]
SFCError Open(
    AEECLSID id = AEECLSID_WEB   // ClassID
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the HTTP connection is not in the SFXHTTPConnection::STATE_CLOSE or SFXTHTTPConnection::STATE_OPEN: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function opens this HTTP connection.

This HTTP connection transits into the SFXHTTPConnection::STATE_OPEN state.

Concretely, the following processings will be performed.

  1. Create the SFBWeb instance to be managed internally by this HTTP connection.
  2. Initialize the content of the HTTP request.
  3. Set the HTTP request method to "GET".
  4. Open the internal storage for the HTTP request body to be written.
  5. Initialize the content of the HTTP response.
  6. Transit into the STATE_OPEN state.

SFYWebBrowserWidget::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 SFYWebBrowserWidget::Previous function.

To get the communication errors, it is necessary to handle the (SFEVT_RESPONDER_BROWSER_NOTIFY, NOTIFY_RESPONSE) event.

Reference

SFYWebBrowserWidget::Navigate | SFYWebBrowserWidget::Next | SFYWebBrowserWidget::Reload


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

Description

When the current page is displayed by the SFYWebBrowserWidget::Load function or by the SFYWebBrowserWidget::Navigate function with the argument of IAStream or ISource, the redrawing fails.

Reference

SFYWebBrowserWidget::Load | SFYWebBrowserWidget::Navigate


SFYWebBrowserWidget::SetAuthorizeData
Set the information of HTTP basic authentication.
[ public ]
SFCError SetAuthorizeData(
    SFXAnsiStringConstRef user     // user name
    SFXAnsiStringConstRef passwd   // password
    SFXAnsiStringConstRef url      // base URL of HTTP basic authentication
);

Argument

user

Specify a user name.

passwd

Specify a password.

url

Specify a base URL. Pages which start with this URL will be authenticated.

Return value

  • If succeed: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY
  • If the HTTP connection is not in the STATE_OPEN: SFERR_INVALID_STATE

Description

This function sets the information of HTTP basic authentication.

After calling this fuction, pages whose URL starts with specified url argument will be accessed with basic authentication header.

This function is valid if and only if the HTTP connection is in the STATE_OPEN.

To unset the basic authentication information, call this function with specifying empty strings.

[Note] Note

If a return value is not SFERR_NO_ERROR, the basic authentication is not performed.

Reference

SFYWebBrowserWidget::Open


SFYWebBrowserWidget::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

SFYWebBrowserWidget::GetIndent


SFYWebBrowserWidget::SetInlineEditEnable
Set whether the text is edited in some part of screen or not.
[ public ]
Void 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

Reference

SFYWebBrowserWidget::IsInlineEditEnable


SFYWebBrowserWidget::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

SFYWebBrowserWidget::GetLinkColor | SFYWebBrowserWidget::SetTextColor


SFYWebBrowserWidget::SetMethod
Set the HTTP request method.
[ public ]
SFCError SetMethod(
    SFXAnsiStringConstRef param   // method (character string)
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the HTTP connection is not in the SFXHTTPConnection:STATE_OPEN state: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function sets he HTTP request method of the HTTP connection.

As the method argument, the methods supported by the BREW IWeb interface such as "GET", "POST", "HEAD" can be specified.

Default: "GET"

The value set by the this function will be effective until the SFYWebBrowserWidget::Close function is called.

[Note] Note
This function is valid if and only if this HTTP connection is in the STATE_OPEN state.

Reference

SFYWebBrowserWidget::GetMethod | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close | SFXAnsiString | BREW API IWeb


SFYWebBrowserWidget::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

SFYWebBrowserWidget::GetParagraphSpacing


SFYWebBrowserWidget::SetProxyServer
Set the proxy server.
[ public ]
SFCError SetProxyServer(
    SFXSocketAddressConstRef param   // proxy server
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function sets the proxy server (SFXSocketAddress) of the HTTP connection to the specified value.

The value set by the this function will be effective until the SFYWebBrowserWidget::Close function is called.

[Note] Note
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state.

Reference

SFYWebBrowserWidget::GetProxyServer | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close SFXSocketAddress


SFYWebBrowserWidget::SetRequestContent
Set the HTTP request body of the HTTP connection to the specified storage or source.
[ public ]
SFCError SetRequestContent(
    SFXFileConstRef file   // file storage to set to the HTTP request body
);
[ public ]
SFCError SetRequestContent(
    SFXMemoryConstRef memory   // memory storage to set to the HTTP request body
);
[ public ]
SFCError SetRequestContent(
    SFXStorageConstRef storage   // storage to set to the HTTP request body
    SInt32 length                // length of the storage
);
[ public ]
SFCError SetRequestContent(
    SFBSourceSmpConstRef source   // source to set to the HTTP request body
    SInt32 length                 // length of the source
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is null: SFERR_INVALID_PARAM
  • If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state or the specified storage or SFBSource instance has not been opened: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function sets the HTTP request body of the HTTP connection to the specified storage or source.

If only the file or memory storage is specified in the argument, its total storage length will be automatically set.

When the length argument is specified, data of the specified length from the current read / write pointer of the storage or source will be set to the HTTP request body of the HTTP connection.

[Tip] Tip

If a file storage(SFXFile) is set with the SFYWebBrowserWidget::SetRequestContent function, data will be sent directly to the network from the file storage. As a result, big data can be sent.

When data is sent with the SFYWebBrowserWidget::GetStreamWriter function, the HTTP request body is made in the heap befre sent. As a result, the data size that can be sent will depends on the memory size equipped with the handset device.

[Caution] Writing the HTTP response body

If the HTTP response body is set with the SFYWebBrowserWidget::SetRequestContent function, the SFYWebBrowserWidget::GetStreamWriter function cannot be used.

On the contrary, if the HTTP response body is written by using the SFYWebBrowserWidget::GetStreamWriter function, the SFYWebBrowserWidget::SetRequestContent function cannot be used.

The value set by the this function will be effective until the SFYWebBrowserWidget::Close function is called.

[Note] Note
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state.
[Note] Note

The SFYWebBrowserWidget::SetRequestContent function is effective in SophiaFramework UNIVERSE 5.1.11 or above.

Reference

SFYWebBrowserWidget::GetRequestContent | SFYWebBrowserWidget::GetStreamWriter | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close | SFBSource | SFXStorage


SFYWebBrowserWidget::SetRequestFlag
Set the HTTP request flag.
[ public ]
SFCError SetRequestFlag(
    UInt32 param   // flag
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If this HTTP connection is not in the STATE_OPEN state: SFERR_INVALID_STATE

Description

This function sets the HTTP request flag of the HTTP connection to the specified value.

[Note] Note
This HTTP request flag will be internally passed to the IWEB_GetResponse function.

Concretely, the logical sum of the following flags are set as the flag argument.

  • WEBREQUEST_REDIRECT: handle redirection invisibly, if possible (Unimplemented by BREW's HTTP protocol engine)
  • WEBREQUEST_NOCOOKIES: do not process cookies; pass headers through to caller (Unimplemented by BREW's HTTP protocol engine, but it this behaviour is the default)
  • WEBREQUEST_NOCACHE: send "Pragma: no-cache" to proxy (if proxying) (Unimplemented by BREW's HTTP protocol engine)
  • WEBREQUEST_NOKEEPALIVE: disable keep-alives; By default, the HTTP engine sends a "Connection: Keep-Alive" header. If this flag is set, the header is not sent, nor will the HTTP engine keep the socket open even if the server sends Keep-Alive. Specifying a "Connection: " header of your own may have unpredictable results, since the HTTP engine does not parse headers passed in the request.
  • WEBREQUEST_FORCENEWCONN: force a new connection
  • WEBREQUEST_NOWAITCONN: don't wait for reusable connection, force new
  • WEBREQUEST_HTTPBOGUSCRLF: append an extra CRLF to HTTP request bodies to work around a CERN webserver bug

The value set by the this function will be effective until the SFYWebBrowserWidget::Close function is called.

[Note] Note
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state.

Reference

SFYWebBrowserWidget::GetRequestFlag | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close | BREW API IWEB_GetResponse


SFYWebBrowserWidget::SetRequestHeader
Set the HTTP request header.
[ public ]
SFCError SetRequestHeader(
    SFXAnsiStringConstRef key     // header name
    SFXAnsiStringConstRef value   // header value
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If header name is User-Agent, or Content-Length, or Connection: SFERR_INVALID_PARAM
  • If the HTTP connection is not in the SFXHTTPConection::STATE_OPEN state: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function sets the HTTP request header to the specified (key, value) pair.

If this function is called several times with the same key, all the requests are stored together and then will be sent at a time.

The values set by the SFYWebBrowserWidget::SetRequestHeader function will be destroyed when the SFYWebBrowserWidget::Close function is called or the connection to the Web server is established.

The value set by the this function will be effective until the SFYWebBrowserWidget::Close function is called.

[Note] Note
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state.

Reference

SFYWebBrowserWidget::GetRequestHeader | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close


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

Argument

enable
  • If enabled: true
  • Otherwise: false

Description

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

Reference

SFYWebBrowserWidget::IsScrollbarEnable


SFYWebBrowserWidget::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

SFYWebBrowserWidget::GetScrollbarWidth


SFYWebBrowserWidget::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

SFYWebBrowserWidget::GetTextColor | SFYWebBrowserWidget::SetLinkColor


SFYWebBrowserWidget::SetTimeoutCallback
Set the connection timeout callback.
[ public ]
Void SetTimeoutCallback(
    SFXCallback::CallbackSPP spp   // callback
    VoidPtr reference              // data passed to callback
);

Description

This function sets the connection timeout callback, which will be called in case there is no response from the server when the connection timeout period elapses from the communication startup.

If no callback is set, by default, the SFXHTTPConnection::OnTimeoutDefault function will be registered as a connection timeout callback.

The SFXHTTPConnection::OnTimeoutDefault function cancels the communication by calling the SFXHTTPConnection::Cancel function as in the internal implementation code below.

/*private */XALLBACK_IMPLEMENT_SFXTIMER(SFXHTTPConnection, OnTimeoutDefault)
{
    Cancel();
    return;
}// XALLBACK_IMPLEMENT_SFXTIMER(SFXHTTPConnection, OnTimeoutDefault)
[Note] Note

The connection timeout period is set by using the SFYWebBrowserWidget::SetTimeoutMillisecond function.

Reference

SFYWebBrowserWidget::SetTimeoutMillisecond | SFYWebBrowserWidget::Cancel | SFXHTTPConnection::Cancel


SFYWebBrowserWidget::SetTimeoutMillisecond
Set the connection timeout period to the specified value. [in milliseconds]
[ public ]
Void SetTimeoutMillisecond(
    UInt32 msec   // value to set
);

Description

This function sets the connection timeout period to the specified value. [in milliseconds]

Defualt: 0 (Timeout processing will not be performed.)

In case there is no response from the server when the connection timeout period elapses from the communication startup, the connection timeout callback registered by calling the SFYWebBrowserWidget::SetTimeoutCallback function will be called.

[Note] Note

If the connection timeout period is set to 0, timeout processing will not be performed.

Reference

SFYWebBrowserWidget::GetTimeoutMillisecond | SFYWebBrowserWidget::SetTimeoutCallback


SFYWebBrowserWidget::SetTrustMode
Set the SSL trust mode.
[ public ]
SFCError SetTrustMode(
    UInt32 param   // SSL trust mode
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state: SFERR_INVALID_STATE

Description

This function sets the SSL trust mode of the HTTP connection to the specified value (effective only if this HTTP connection is HTTPS).

The value set by this function is effective until the SFYWebBrowserWidget::Close function is called.

The SSL_RESULT_SERV_VERS error might occur on the handset device when calling the connecting function immediately after this value is changed.

To avoid this error, call the SFYWebBrowserWidget::Close function once, set the SSL trust mode, and then call the connecting function.

One of the following values are available for the SSL trust mode:

  • SSL_TRUST_MODE_FAIL: Default, fail on trust errors.
  • SSL_TRUST_MODE_CHECK: Suspend on trust errors so they can be checked and ignored.
  • SSL_TRUST_MODE_IGNORE: Ignore all trust errors.
  • SSL_TRUST_MODE_ALWAYS: Always suspend so trust can always be checked.
[Note] Note
For more details, see BREW API ISSL_NegotiateV in the BREW API Reference
[Note] Note
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state.

Reference

SFYWebBrowserWidget::GetTrustMode | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close | BREW API ISSL_NegotiateV


SFYWebBrowserWidget::SetUserAgent
Set the user agent.
[ public ]
SFCError SetUserAgent(
    SFXAnsiStringConstRef param   // user agent
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the HTTP connection is not in the SFXHTTPConnection::STATE_OPEN state: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function sets the user agent of the HTTP connection to the specified value.

The value set by the this function will be effective until the SFYWebBrowserWidget::Close function is called.

[Note] Note
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state.

Reference

SFYWebBrowserWidget::GetUserAgent | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close | SFXAnsiString


SFYWebBrowserWidget::SetWebClassId
Set the web class ID to open the HTTP/HTTPS connection.
[ public ]
Void SetWebClassId(
    AEECLSID id   // web class ID
);

Description

This function sets the web class ID to open the HTTP/HTTPS connection.

Default value is AEECLSID_WEB.

Reference

SFYWebBrowserWidget::GetWebClassId


SFYWebBrowserWidget::Stop
Stop rendering.
[ public ]
Void Stop(Void);

Description

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


SFYWebBrowserWidget::CodeEnum
Constant that represents the SFYWebBrowserWidget class.
enum CodeEnum {
    CODE_TYPE = four_char_code('+', 'w', 'b', 'r')
};
SFMTYPEDEFTYPE(CodeEnum)

Reference

SFYResponder::GetType | SFYResponder::SetType


SFYWebBrowserWidget::Notify
Browser notification struct.
[ public ]
SFMTYPEDEFSTRUCT(Extension)
struct Extension {
    SFXAnsiString       absoluteURL;
};

SFMTYPEDEFSTRUCT(Notify)
class Notify : public HViewNotify {
public:
    Extension           ex;
                        Notify          (HViewNotify const& hvNotify);
                        Notify          (NotifyConstRef notify);
};

// HViewNotify:  notification data
//
typedef struct {
    HVNotifyCode        code;           // notification code
    IHtmlViewer*        phv;            // identifies IHtmlViewer that sent the notification

    union {
      HViewJump         jump;           // HVN_JUMP
      HViewJump         submit;         // HVN_SUBMIT
      int               nDone;          // HVN_DONE
      HViewFocus        focus;          // HVN_FOCUS
    } u;
} HViewNotify;

#ifdef _WIN32
typedef unsigned HVNotifyCode;
#else
typedef int8 HVNotifyCode;
#endif

Description

Reference

SFYWebBrowserWidget::NotifyEnum | BREW API HViewNotify | BREW API WEB_ERROR_SUCCEEDED | BREW API WEB_ERROR_MAP


SFYWebBrowserWidget::NotifyEnum
Enumerator which represents a notification from IHTMLViewer or connection callback.
enum NotifyEnum {
    NOTIFY_RESPONSE = 0,    // notification from connection callback
    NOTIFY_DONE,            // notification of completed rendering
    NOTIFY_JUMP_SUBMIT,     // notification for jumping or submitting to link
    NOTIFY_FOCUS,           // notification of focus move
    NOTIFY_PAGE_DONE,       // notification of completed page loading
    NOTIFY_CONTENT_DONE,    // notification of completed content loading
    NOTIFY_FATAL_ERROR      // notification of a fatal error
};
SFMTYPEDEFTYPE(NotifyEnum)

Description

Notifications except NOTIFY_RESPONSE and NOTIFY_FATAL_ERROR come from IHTMLViewer.

If NOTIFY_FATAL_ERROR is notified, it is recommended to terminate this instance.

Example

SFYWebBrowserWidgetSmp browser;

browser = SFYWebBrowserWidget::NewInstance();
browser->SetParent(GetThis());
browser->RegisterHandler(
    SFXEventRange(SFEVT_RESPONDER_BROWSER_NOTIFY, SFEVT_RESPONDER_BROWSER_NOTIFY, SFP16_BEGIN, SFP16_END),
    XANDLER_INTERAL(OnBrowserNotify)
);
browser->SetState(true, true, true, true);

XANDLER_IMPLEMENT_VOIDBROWSERNOTIFY(UserWindow, OnBrowserNotify, invoker, reason, notify)
{
    switch(reason) {
        case SFYWebBrowserWidget::NOTIFY_RESPONSE:
            // notification from connection callback
            break;
        case SFYWebBrowserWidget::NOTIFY_DONE:
            // notification of completed page loading
            break;
        case SFYWebBrowserWidget::NOTIFY_JUMP_SUBMIT:
            // notification for jumping or submitting to link
            break;

        // .. (omitted) ..

    }
    return;
}