SophiaFramework UNIVERSE 5.3 |
#include <SFYWebBrowserWidget.h.hpp>
class SFYWebBrowserWidget : public SFYWidget;
SFMTYPEDEFRESPONDER(SFYWebBrowserWidget)
The following functions are available in the SFYWebBrowserWidget class:
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.
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. |
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; }
SFBHTMLViewer | SFYWebBrowserWidget::SetRequestHeader | SFYWebBrowserWidget::SetTimeoutCallback | SFYWebBrowserWidget::SetTimeoutMillisecond | BREW API IHtmlViewer | BREW API IWeb
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.
|
[ protected, explicit ] SFYWebBrowserWidget(Void);
This constructor creates an instance of the IHTMLViewer interface.
[ protected, virtual ] ~SFYWebBrowserWidget(Void);
This destructor stops rendering of HTML data, terminates the HTTP/HTTPS connection, and releases the IHTMLViewer instance.
[ public ] Bool AdjustViewer(Void);
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.
[ public ] Void Cancel(Void);
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.
SFYWebBrowserWidget::Close | SFYWebBrowserWidget::SetTimeoutMillisecond | SFYWebBrowserWidget::SetTimeoutCallback
[ public ] Void ClearHistory(Void);
This function clears the history list.
[ public ] Void Close(Void);
This function closes the HTTP connection.
This HTTP connection transits into the SFXHTTPConnection::STATE_CLOSE state.
Concretely, the following processings will be performed.
Note | |
---|---|
This function is called in the SFYWebBrowserWidget::~SFYWebBrowserWidget destructor. This function calls the SFYWebBrowserWidget::Cancel function internally. |
SFYWebBrowserWidget::~SFYWebBrowserWidget | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Cancel | SFYWebBrowserWidget::GetSFBWeb | SFYWebBrowserWidget::GetSFBWebResp
[ public, const ] SInt32 FindElement( ACharConstPtr element // name of the element SInt32 no // number of the element );
Specify the name of the element to find.
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 the index of specified element when found. Return a minus value when not found.
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.
[ public, const ] SFXAnsiStringConstRef GetBaseUrl(Void);
Base URL of HTTP basic authentication
Get the base URL of HTTP basic authentication.
The value which is set by the SFYWebBrowserWidget::SetAuthorizeData function is gotten.
[ public, const ] SFXAnsiStringConstRef GetContentEncoding(Void);
Value of the Content-Encoding field of the HTTP response header
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.
[ public, const ] SInt32 GetContentLength(Void);
Value of the Content-Length field of the HTTP response header
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.
[ public, const ] SFXAnsiStringConstRef GetContentType(Void);
Value of the Content-Type field of the HTTP response header
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.
[ public, const ] SFXAnsiStringConstRef GetCurrentTitle(Void);
Tite of the current page
This function gets the title of the current page.
[ public, const ] SFXAnsiStringConstRef GetCurrentURL(Void);
URL of the current page
This function gets the URL of the current page.
[ public, const ] SFXDate GetDate(Void);
Value of the Date field of the HTTP response header as the SFXDate) instance
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.
[ public, const ] SFXAnsiString GetElementText( SInt32 elementIndex // index of the element );
Specify the index of the element returned by the SFYWebBrowserWidget::FindElement function.
Content of the element. If the specified element is empty, an empty string is returned.
Get the text of the specified element in the current page.
[ public, const ] SFXDate GetExpires(Void);
Value of the Expires field of the HTTP response header as the SFXDate) instance
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.
[ public, const ] SInt32 GetIndent(Void);
Width of specified indent in pixels.
[ public, const ] SFXDate GetLastModified(Void);
Value of the Last-Modified field of the HTTP response header as the SFXDate) instance
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.
[ public, const ] SFXRGBColor GetLinkColor(Void);
Color of the link text.
[ public, const ] SFXAnsiStringConstRef GetMethod(Void);
HTTP request method of this HTTP connection
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.
[ public, const ] SInt32 GetParagraphSpacing(Void);
Space between paragraphs in pixels.
[ public, const ] SFXAnsiStringConstRef GetPassword(Void);
Password of HTTP basic authentication
Get the password of HTTP basic authentication.
The value which is set by the SFYWebBrowserWidget::SetAuthorizeData function is gotten.
[ public, const ] SFXSocketAddressConstRef GetProxyServer(Void);
Proxy server of this HTTP connection
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.
[ public, const ] SFBSourceSmpConstRef GetRequestContent(Void);
SFBSource instance that manages the HTTP request body of the HTTP connection
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.
[ public, const ] UInt32 GetRequestFlag(Void);
HTTP request flag of this HTTP connection
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.
SFYWebBrowserWidget::SetRequestFlag | SFYWebBrowserWidget::Open | BREW API IWEB_GetResponse
[ public, const ] SFXAnsiStringConstRef GetRequestHeader( SFXAnsiStringConstRef key // field name );
[ public, const ] SFXPropertyConstRef GetRequestHeader(Void);
HTTP request header of this HTTP connection
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.
SFYWebBrowserWidget::SetRequestHeader | SFXProperty | SFXAnsiString
[ public, const ] SFBSourceSmpConstRef GetResponseContent(Void);
SFBSource instance that manages the HTTP response body
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 | |
---|---|
After the HTTP connection is established, the HTTP response body can be obtained using this function. |
Note | |
---|---|
The SFYWebBrowserWidget::GetStreamReader function gets the stream from the SFBSource instance, return value of the SFYWebBrowserWidget::GetResponseContent function. |
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. |
[ public, const ] UInt32 GetResponseFlag(Void);
HTTP response flag of this HTTP connection
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:
If this HTTP connection is not in the STATE_OPEN_ESTABLISHED state, 0 will be returned.
[ public, const ] SFXAnsiStringConstRef GetResponseHeader( SFXAnsiStringConstRef key // field name );
[ public, const ] SFXPropertyConstRef GetResponseHeader(Void);
HTTP response header of this HTTP connection
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.
[ public, const ] SInt32 GetResultCode(Void);
HTTP status code of this HTTP connection.
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 | |
---|---|
For more details on WEB_ERROR, see AEEError.h. |
[ public, const ] SFBWebSmpConstRef GetSFBWeb(Void);
SFBWeb instance managed internally by the HTTP connection.
This function gets the SFBWeb instance managed internally by the HTTP connection.
[ public, const ] SFBWebRespSmpConstRef GetSFBWebResp(Void);
SFBWebResp instance managed internally by the HTTP connection.
This function gets the SFBWebResp instance managed internally by the HTTP connection.
[ public, const ] SInt32 GetScrollbarWidth(Void);
Width of scroll bar in pixels.
[ public ] SFCError GetStreamReader( UInt32 size // buffer size SFXStreamReaderPtr result // pointer to the input stream );
[ public ] SFCError GetStreamReader( SFXStreamReaderPtr result // pointer to the input stream );
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 | |
---|---|
You have to use the SFXBinaryStreamReader, SFXAnsiStringStreamReader, or SFXWideStringStreamReader class for the input stream properly depending on the type of data to be read. |
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 | |
---|---|
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state. |
SFYWebBrowserWidget::GetResponseContent | SFXBinaryStreamReader | SFXAnsiStringStreamReader | SFXWideStringStreamReader | Stream Buffer
[ public ] SFCError GetStreamWriter( UInt32 size // buffer size SFXStreamWriterPtr result // pointer to the output stream );
[ public ] SFCError GetStreamWriter( SFXStreamWriterPtr result // pointer to the output stream );
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 | |
---|---|
You have to use the SFXBinaryStreamWriter, SFXAnsiStringStreamWriter, or SFXWideStringStreamWriter class for the output stream properly depending on the type of data to write. |
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 | |
---|---|
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state. |
SFYWebBrowserWidget::GetStreamReader | SFYWebBrowserWidget::SetRequestContent | SFYWebBrowserWidget::Open | SFXBinaryStreamWriter | SFXAnsiStringStreamWriter | SFXWideStringStreamWriter | Stream Buffer
[ public, const ] SFXRGBColor GetTextColor(Void);
Text color of HTML.
[ public, const ] UInt32 GetTimeoutMillisecond(Void);
Connection timeout period [in milliseconds]
This function gets the connection timeout period. [in milliseconds]
[ public, const ] UInt32 GetTrustMode(Void);
SSL trust mode
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.
[ public, const ] SFXAnsiStringConstRef GetUser(Void);
User name of HTTP basic authentication
Get the user name of HTTP basic authentication.
The value which is set by the SFYWebBrowserWidget::SetAuthorizeData function is gotten.
[ public, const ] SFXAnsiStringConstRef GetUserAgent(Void);
User agent of this HTTP connection
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.
[ public, const ] AEECLSID GetWebClassId(Void);
Web class ID
This function gets the web class ID to open the HTTP/HTTPS connection.
Default value is AEECLSID_WEB.
[ protected, virtual ] Void HandleBoundReal(Void);
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.
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. |
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 of the SFYWebBrowserWidget::HandleBoundReal function is as follows:
/*protected virtual */Void SFYWebBrowserWidget::HandleBoundReal(Void) { SetVirtualBound(SFXRectangle(SFXGrid::ZeroInstance(), GetRealBound().GetSize())); return; }// SFYWebBrowserWidget::HandleBoundReal //
SFYResponder::SetRealBound | Real Region | Virtual Region | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND]
[ protected, virtual ] Void HandleBoundVirtual(Void);
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.
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. |
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 of the SFYWebBrowserWidget::HandleBoundVirtual function is as follows:
/*protected virtual */Void SFYWebBrowserWidget::HandleBoundVirtual(Void) { AdjustViewer(); return; }// SFYWebBrowserWidget::HandleBoundVirtual //
SFYResponder::SetRealBound | SFYResponder::SetVirtualBound | Real Region | Virtual Region | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND]
[ protected, virtual, const ] Void HandleRenderRequest( SFXGraphicsPtr graphics // graphic object );
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.
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. |
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:
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 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 //
SFYResponder::Invalidate | SFYResponder::Render | SFYResponder::InvokeBackward | Drawing Event[SFEVT_RESPONDER_RENDER] | Handler for the Drawing Event[XANDLER_DECLARE_VOIDRENDER] | Rendering | Event Loop | Responder Tree
[ public, const ] Bool IsBusy(Void);
[ public, const ] Bool IsInlineEditEnable(Void);
[ public, const ] Bool IsScrollbarEnable(Void);
[ 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 );
the source in the HTML format
the stream in the HTML format
the string in the HTML format
URL ( All the URLs in the HTML data are relative URLs from this "url" argument.)
Immediately after the inline image is received, it is displayed.
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. |
[ 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 );
kind of certificate: any one of WEBOPT_X509_ROOT_CERT, WEBOPT_X509_LEAF_CERT, and WEBOPT_X509_BRANCH_CERT
file path of ASN.1/DER form certificate
buffer of ASN.1/DER form certificate
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.
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)); } }
[ public ] SFCError Open( SFXAnsiStringConstRef url // URL to open );
Specify the URL to access. Render the HTML data of specified URL.
The schemes of http, https, file, and res are supported.
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.
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. |
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/"); } } }
[ public, static ] SFYWebBrowserWidgetSmp NewInstance( SFCErrorPtr exception = null // error value );
Return the error value generated inside the function.
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.
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) { // ... }
Specify the number of history list to move ahead. If not specified, move one history entry ahead.
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.
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. |
SFYWebBrowserWidget::Navigate | SFYWebBrowserWidget::Previous | SFYWebBrowserWidget::Reload
This function opens this HTTP connection.
This HTTP connection transits into the SFXHTTPConnection::STATE_OPEN state.
Concretely, the following processings will be performed.
Specify the number of history to move back. If it is elided, move to 1 history previous.
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.
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. |
[ public ] Void Reload(Void);
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.
[ public ] SFCError SetAuthorizeData( SFXAnsiStringConstRef user // user name SFXAnsiStringConstRef passwd // password SFXAnsiStringConstRef url // base URL of HTTP basic authentication );
Specify a user name.
Specify a password.
Specify a base URL. Pages which start with this URL will be authenticated.
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 | |
---|---|
If a return value is not SFERR_NO_ERROR, the basic authentication is not performed. |
Specify the width of indent in pixels.
[ public ] SFCError SetLinkColor( SFXRGBColorConstRef color // link color );
Specify the color of link text.
[ public ] SFCError SetMethod( SFXAnsiStringConstRef param // method (character string) );
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 | |
---|---|
This function is valid if and only if this HTTP connection is in the STATE_OPEN state. |
SFYWebBrowserWidget::GetMethod | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close | SFXAnsiString | BREW API IWeb
Set the spacing between paragraphs in pixels.
[ public ] SFCError SetProxyServer( SFXSocketAddressConstRef param // proxy server );
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 | |
---|---|
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state. |
SFYWebBrowserWidget::GetProxyServer | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close SFXSocketAddress
[ 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 );
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 | |
---|---|
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. |
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 | |
---|---|
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state. |
Note | |
---|---|
The SFYWebBrowserWidget::SetRequestContent function is effective in SophiaFramework UNIVERSE 5.1.11 or above. |
SFYWebBrowserWidget::GetRequestContent | SFYWebBrowserWidget::GetStreamWriter | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close | SFBSource | SFXStorage
This function sets the HTTP request flag of the HTTP connection to the specified value.
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.
The value set by the this function will be effective until the SFYWebBrowserWidget::Close function is called.
Note | |
---|---|
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state. |
SFYWebBrowserWidget::GetRequestFlag | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close | BREW API IWEB_GetResponse
[ public ] SFCError SetRequestHeader( SFXAnsiStringConstRef key // header name SFXAnsiStringConstRef value // header value );
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 | |
---|---|
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state. |
SFYWebBrowserWidget::GetRequestHeader | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close
The scroll bar here is not of SophiaFramework UNIVERSE, but of the standard BREW.
Specify the width of the scroll bar in pixels.
[ public ] SFCError SetTextColor( SFXRGBColorConstRef color // color );
Specify the color of HTML text.
[ public ] Void SetTimeoutCallback( SFXCallback::CallbackSPP spp // callback VoidPtr reference // data passed to callback );
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 | |
---|---|
The connection timeout period is set by using the SFYWebBrowserWidget::SetTimeoutMillisecond function. |
SFYWebBrowserWidget::SetTimeoutMillisecond | SFYWebBrowserWidget::Cancel | SFXHTTPConnection::Cancel
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 | |
---|---|
If the connection timeout period is set to 0, timeout processing will not be performed. |
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:
Note | |
---|---|
For more details, see BREW API ISSL_NegotiateV in the BREW API Reference |
Note | |
---|---|
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state. |
SFYWebBrowserWidget::GetTrustMode | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close | BREW API ISSL_NegotiateV
[ public ] SFCError SetUserAgent( SFXAnsiStringConstRef param // user agent );
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 | |
---|---|
This function is valid if and only if the HTTP connection is in the SFXHTTPConnection::STATE_OPEN state. |
SFYWebBrowserWidget::GetUserAgent | SFYWebBrowserWidget::Open | SFYWebBrowserWidget::Close | SFXAnsiString
This function sets the web class ID to open the HTTP/HTTPS connection.
Default value is AEECLSID_WEB.
[ public ] Void Stop(Void);
Nothing happens except under rendering. The content that has already been displayed takes no influence by calling the SFYWebBrowserWidget::Stop function.
enum CodeEnum { CODE_TYPE = four_char_code('+', 'w', 'b', 'r') }; SFMTYPEDEFTYPE(CodeEnum)
[ 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
SFYWebBrowserWidget::NotifyEnum | BREW API HViewNotify | BREW API WEB_ERROR_SUCCEEDED | BREW API WEB_ERROR_MAP
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)
Notifications except NOTIFY_RESPONSE and NOTIFY_FATAL_ERROR come from IHTMLViewer.
If NOTIFY_FATAL_ERROR is notified, it is recommended to terminate this instance.
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; }
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |