![]() ![]() ![]()
|
SophiaFramework UNIVERSE 5.1 |
#include <SFZWebBrowserControl.hpp>
class SFZWebBrowserControl : public SFYControl;
SFMTYPEDEFRESPONDER(SFZWebBrowserControl)


How to use
The following functions are available in the SFZWebBrowserControl class:
A simple Web Browser can be created easily by only pasting a SFZWebBrowserControl object.
The SFZWebBrowserControl class is implemented base on the IHtmlViewer of BREW API. The limitations of SFZWebBrowserControl class on rendering the HTML data are almost the same as that of IHtmlViewer.
Error Value
Several member functions of SFZWebBrowserControl class record its status internally when an error occurs.
The latest error of member function can be gotten by the static_catch function.
SFERR_NO_ERROR is returned if no error occurs.

The code below is to use the SFZWebBrowserControl class:
SFMTYPEDEFRESPONDER(MyWindow)
class MyWindow : public SFZWindow{
SFMSEALRESPONDER(MyWindow)
SFMRESPONDERINSTANTIATEFOUR(MyWindow, SFZWindow, SFYContainer, SFYWidget, SFYResponder)
public:
static MyWindowSmp NewInstance(SFCErrorPtr exception = null);
protected:
explicit MyWindow(Void) static_throws;
virtual ~MyWindow(Void);
// define the simple Web Browser as a member function of smart pointer type
SFZWebBrowserControlSmp _browser; // simple Web Browser
};
// constructor(error processing is omitted)
MyWindow::MyWindow(Void) static_throws
{
if (static_try()) {
// input the browser by string
SFXAnsiString buffer(
"BrowserControl<br /><br />"
"<a href=\"http://www.s-cradle.com/example/tabbrowser/\">Sophia Cradle</a><br /><br />"
);
// create a simple Web Browser
_browser = SFZWebBrowserControl::NewInstance();
_browser->SetParent(GetThis());
_browser->SetRealBound(GetLocalBound());
_browser->SetState(true, true, true, true);
// start rendering the string as HTML
_browser->Load(buffer);
}
}
| Constructor/Destructor |
|---|
|
SFZWebBrowserControl( Void ) Constructor of the SFZWebBrowserControl class.
|
|
~SFZWebBrowserControl( Void ) Destructor of the SFZWebBrowserControl class.
|
| Public Functions | |
|---|---|
| SFCError |
ClearHistory( Void ) Clear the history list.
|
| SInt32 |
FindElement(
ACharConstPtr element
, SInt32 no
) Find the specified element in the current page.
|
| HistoryEntry |
GetCurrentHistory( Void ) Get the history of the current page.
|
| UInt32 |
GetCurrentHistoryIndex( Void ) Get the index of current history.
|
| SFXAnsiString |
GetElementAttribute(
SInt32 elementIndex
, ACharConstPtr attr
) Get the attribute of specified element.
|
| SFXAnsiString |
GetElementText(
SInt32 elementIndex
) Get the text of the specified element.
|
| HistoryEntry |
GetHistory(
UInt32 historyIndex = 0
) Get the history content by the specified index.
|
| HistoryEntryConstPtr |
GetHistoryList( Void ) Get the history list.
|
| UInt32 |
GetHistorySize( Void ) Get the number of entries in history list.
|
| SInt32 |
GetIndent( Void ) Get the width of indent.
|
| SFXRGBColor |
GetLinkColor( Void ) Get the color of link text.
|
| SInt32 |
GetParagraphSpacing( Void ) Get the spacing between paragraphs.
|
| SInt32 |
GetScrollbarWidth( Void ) Get the width of scroll bar.
|
| SFXRGBColor |
GetTextColor( Void ) Get the text color.
|
| SFBWebSmpConstRef |
GetWeb( Void ) Get the IWeb instance for communication.
|
| Bool |
IsBusy( Void ) Check whether or not the browser control is busy in accessing the network, or rendering.
|
| Bool |
IsInlineEditEnable( Void ) Check whether the text is edited in some part of screen or not.
|
| Bool |
IsScrollbarEnable( Void ) Check whether the scroll bar is enabled or not.
|
| SFCError |
Load(
SFXAnsiStringConstRef data
)
Start to render the string in the HTML format.
|
| SFCError |
Load(
SFXAnsiStringConstRef data
, SFXAnsiStringConstRef url
)
Start to render the string in the HTML format.
|
| SFCError |
Move(
UInt32 historyIndex = 0
)
Move to the specified page in history list and render it again.
|
| SFCError |
Navigate(
SFXAnsiStringConstRef url
) Start to render the page of specified URL.
|
| SFCError |
Navigate(
SFXAnsiStringConstRef url
, SFXAnsiStringConstRef method
) Start to render the page of specified URL.
|
| SFCError |
Navigate(
SFXAnsiStringConstRef url
, SFXAnsiStringConstRef method
, SFXAnsiStringConstRef data
) Start to render the page of specified URL.
|
| SFCError |
Navigate(
SFXAnsiStringConstRef url
, SFXAnsiStringConstRef method
, SFXBufferConstRef data
) Start to render the page of specified URL.
|
| SFCError |
Navigate(
SFBSourceSmpConstRef source
) Start to render the page of specified URL.
|
| SFCError |
Navigate(
SFBSourceSmpConstRef source
, SFXAnsiStringConstRef basdUrl
) Start to render the page of specified URL.
|
| SFCError |
Navigate(
SFBAStreamSmpConstRef stream
) Start to render the page of specified URL.
|
| SFCError |
Navigate(
SFBAStreamSmpConstRef src
, SFXAnsiStringConstRef baseUrl
) Start to render the page of specified URL.
|
| SFCError |
Next(
SInt32 n = 1
) Move to the next page in specified history, get and render the page again.
|
| SFCError |
Previous(
SInt32 n = 1
) Move to the previous page in specified history, get and render the page again.
|
| Void |
Reload( Void )
Reload and render the current page.
|
| SFCError |
SetAuthorizeData(
SFXAnsiStringConstRef user
, SFXAnsiStringConstRef passwd
, SFXAnsiStringConstRef url
) Set information on the Basic HTTP authorization.
|
| SFCError |
SetHistorySize(
UInt32 size
) Set the size of history list.
|
| SFCError |
SetIndent(
SInt32 pixel
) Set the width of indent in pixels.
|
| SFCError |
SetInlineEditEnable(
Bool enable
)
Set whether the text is edited in some part of screen or not.
|
| SFCError |
SetLinkColor(
SFXRGBColorConstRef color
) Set the color of link text.
|
| SFCError |
SetParagraphSpacing(
SInt32 pixel
) Set the spacing between paragraphs in pixels.
|
| SFCError |
SetScrollbarEnable(
Bool enable
) Enable or disable the scroll bar.
|
| SFCError |
SetScrollbarWidth(
SInt32 pixel
) Set the width of scroll bar in pixels.
|
| SFCError |
SetTextColor(
SFXRGBColorConstRef color
) Set the text color.
|
| Void |
SetWeb(
SFBWebSmpConstRef web
) Set the IWeb interface for communication.
|
| Void |
Stop( Void )
Stop accessing the network and rendering.
|
| SFCError |
UnsetAuthorizeData( Void ) Cancel the settings for Basic HTTP authorization.
|
| Void |
UnsetWeb( Void )
Cancel the settings set by the SFZWebBrowserControl::SetWeb function.
|
| Void |
ClearHandler( Void )
(inherits from SFYResponder)
Unregister all handlers from this responder.
|
| Void |
ClearTracer( Void )
(inherits from SFYResponder)
Unregister all dispatching rules from the tracer of this responder.
|
| SFCError |
Distribute(
SFXEventConstRef event
, BoolPtr result = null
)
(inherits from SFYResponder)
[Type 1] Distribute the specified event.
[Type 2] Wrap and call the specified callback function which includes sending events.
|
| SFCError |
Distribute(
VoidPtr context
, SFYDistributer::CallbackSPP spp
, VoidPtr reference
, BoolPtr result = null
)
(inherits from SFYResponder)
[Type 1] Distribute the specified event.
[Type 2] Wrap and call the specified callback function which includes sending events.
|
| SFXRGBColorConstRef |
GetBackgroundColor( Void )
(inherits from SFYWidget)
Get the background color.
|
| SFYResponderSmp |
GetChildBack( Void )
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildBack(
UInt32 id
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildBackward(
SInt32 index
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
| SInt32 |
GetChildCount( Void )
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
| SInt32 |
GetChildCount(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
| SInt32 |
GetChildCount(
UInt32 id
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
| SInt32 |
GetChildCount(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
| SFYResponderSmp |
GetChildForward(
SInt32 index
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildFront( Void )
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildFront(
UInt32 id
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
| SFYResponderSmp |
GetChildFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
| SInt32 |
GetCurrentValue( Void )
(inherits from SFYControl)
Get the current value of this control.
|
| SFYDistributerPtr |
GetDistributer( Void )
(inherits from SFYResponder)
Get the distributer bound with this responder.
|
| SFYResponderSmp |
GetFrame( Void )
(inherits from SFYResponder)
Get the frame which has been attached to this responder.
|
| SFXRectangle |
GetGlobalBound( Void )
(inherits from SFYResponder)
Get the globle region of this responder.
|
| UInt32 |
GetID( Void )
(inherits from SFYResponder)
Get the ID of this responder instance.
|
| SFXRectangle |
GetLocalBound( Void )
(inherits from SFYResponder)
Get the local region of this responder.
|
| SInt32 |
GetMaximumValue( Void )
(inherits from SFYControl)
Get the maximum value of this control.
|
| SInt32 |
GetMinimumValue( Void )
(inherits from SFYControl)
Get the minimum value of this control.
|
| SInt32 |
GetNthBackward( Void )
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
| SInt32 |
GetNthBackward(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
| SInt32 |
GetNthBackward(
UInt32 id
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
| SInt32 |
GetNthBackward(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
| SInt32 |
GetNthForward( Void )
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
| SInt32 |
GetNthForward(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
| SInt32 |
GetNthForward(
UInt32 id
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
| SInt32 |
GetNthForward(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
| SFYResponderSmp |
GetParent( Void )
(inherits from SFYResponder)
Get the parent responder of this responder.
|
| Bool |
GetPropertyTransparent( Void )
(inherits from SFYResponder)
Get the transparency attribute of this responder.
|
| SFXRectangleConstRef |
GetRealBound( Void )
(inherits from SFYResponder)
Get the real region of this responder.
|
| VoidPtr |
GetReference( Void )
(inherits from SFYResponder)
Get the reference of this responder.
|
| SFYRendererPtr |
GetRenderer( Void )
(inherits from SFYResponder)
Get the renderer bound with this responder.
|
| SFYResponderSmp |
GetRoot( Void )
(inherits from SFYResponder)
Get the root responder.
|
| Bool |
GetStateActive(
Bool inherit = false
)
(inherits from SFYResponder)
Get the active state of this responder.
|
| Bool |
GetStateEnable(
Bool inherit = false
)
(inherits from SFYResponder)
Get the enable state of this responder.
|
| Bool |
GetStateFocus(
Bool inherit = false
)
(inherits from SFYResponder)
Get the focus state of this responder.
|
| Bool |
GetStateValid(
Bool inherit = false
)
(inherits from SFYResponder)
Get the valid state of this responder.
|
| Bool |
GetStateVisible(
Bool inherit = false
)
(inherits from SFYResponder)
Get the visible state of this responder.
|
| SFXRectangle |
GetSuitableBound( Void )
(inherits from SFYResponder)
Get the suitable region of this responder.
|
| SFXRectangle |
GetSuitableBound(
SFXRectangleConstRef rectangle
)
(inherits from SFYResponder)
Get the suitable region of this responder.
|
| SFXRectangle |
GetSuitableBound(
SFXRectangleConstRef param
, HorizontalEnum horizontal
, VerticalEnum vertical
)
(inherits from SFYResponder)
Get the suitable region of this responder.
|
| SFXMargin |
GetSuitableMargin( Void )
(inherits from SFYResponder)
Get the suitable frame margin region of this responder.
|
| SFCType |
GetType( Void )
(inherits from SFYResponder)
Get the type of this responder class.
|
| SFXRectangleConstRef |
GetVirtualBound( Void )
(inherits from SFYResponder)
Get the virtual region of this responder.
|
| Bool |
HasFrame( Void )
(inherits from SFYResponder)
Check whether or not this responder is a content-responder.
|
| Void |
Initialize( Void )
(inherits from SFYResponder)
Initialize this responder.
|
| Bool |
IsBack( Void )
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsBack(
UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsFrame( Void )
(inherits from SFYResponder)
Check whether or not this responder is an attachment-frame.
|
| Bool |
IsFront( Void )
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsFront(
UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsNthBackward(
SInt32 index
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsNthBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsNthBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsNthBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsNthForward(
SInt32 index
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsNthForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsNthForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsNthForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
| Bool |
IsRoot( Void )
(inherits from SFYResponder)
Check whether or not this responder is the root responder.
|
| SFCError |
RegisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
| SFCError |
RegisterHandler(
SFXEventRangeConstRef range
, SFYHandler::HandlerSPP spp
, VoidPtr reference
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
| SFCError |
RegisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
| SFCError |
RegisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::HandlerSPPConstPtr spp
, VoidPtrConstPtr reference
, SInt32 length
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
| SFCError |
RegisterTracer(
SFXEventRangeConstRef range
, SFYTracer::RuleRecConstRef rule
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
| SFCError |
RegisterTracer(
SFXEventRangeConstRef range
, SFYTracer::OrderEnum order
, SFYTracer::StateEnum state
, Bool overload
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
| SFCError |
RegisterTracer(
SFXEventRangeConstPtr range
, SFYTracer::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
| SFCError |
RegisterTracer(
SFXEventRangeConstPtr range
, SFYTracer::OrderEnumConstPtr order
, SFYTracer::StateEnumConstPtr state
, BoolConstPtr overload
, SInt32 length
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
| SFCError |
Render(
Bool force = false
)
(inherits from SFYResponder)
Boot up the renderer for redrawing this responder and its descendant responders.
|
| Void |
SetBackgroundColor(
SFXRGBColorConstRef param
)
(inherits from SFYWidget)
Set the background color to the specified value.
|
| Void |
SetCurrentValue(
SInt32 param
)
(inherits from SFYControl)
Set the current value of this control to the specified value.
|
| Void |
SetDistributer(
SFYDistributerPtr param
)
(inherits from SFYResponder)
Bind this responder with the specified distributer.
|
| SFCError |
SetFrame(
SFYResponderSmpConstRef param
)
(inherits from SFYResponder)
Attach the specified frame to this frame.
|
| Void |
SetID(
UInt32 param
)
(inherits from SFYResponder)
Set the ID value of this responder to the specified value.
|
| Void |
SetMaximumValue(
SInt32 param
)
(inherits from SFYControl)
Set the maximum value of the control to the specified value.
|
| Void |
SetMinimumValue(
SInt32 param
)
(inherits from SFYControl)
Set the minimum value of the control to the specified value.
|
| SFCError |
SetParent(
SFYResponderSmpConstRef param
)
(inherits from SFYResponder)
Set the parent responder of this responder to the specified responder.
|
| Void |
SetProperty(
Bool transparent
)
(inherits from SFYResponder)
Set the property of this responder to the specified value.
|
| Void |
SetPropertyTransparent(
Bool param
)
(inherits from SFYResponder)
Set the transparency attribute of this responder to the specified value.
|
| Void |
SetRealBound(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Set the real region of this responder to the specified region.
|
| Void |
SetReference(
VoidPtr param
)
(inherits from SFYResponder)
Set the reference value of this responder to the specified value.
|
| Void |
SetRenderer(
SFYRendererPtr param
)
(inherits from SFYResponder)
Bind this responder with the specified renderer.
|
| Void |
SetState(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Set all states of this responder to specified values together.
|
| Void |
SetStateActive(
Bool param
)
(inherits from SFYResponder)
Set the active state of this responder to the specified value.
|
| Void |
SetStateEnable(
Bool param
)
(inherits from SFYResponder)
Set the enable state of this responder to the specified value.
|
| Void |
SetStateFocus(
Bool param
)
(inherits from SFYResponder)
Set the focus state of this responder to the specified value.
|
| Void |
SetStateVisible(
Bool param
)
(inherits from SFYResponder)
Set the visible state of this responder to the specified value.
|
| Void |
SetVirtualBound(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Set the virtual region of this responder to the specified value.
|
| Void |
Terminate( Void )
(inherits from SFYResponder)
Terminate this responder.
|
| Void |
ToBack( Void )
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToBack(
UInt32 id
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToFront( Void )
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToFront(
UInt32 id
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToNthBackward(
SInt32 index
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToNthBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToNthBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToNthBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToNthForward(
SInt32 index
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToNthForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToNthForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
| Void |
ToNthForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
| Void |
UnregisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
| Void |
UnregisterHandler(
SFXEventRangeConstRef range
, SFYHandler::HandlerSPP spp
, VoidPtr reference
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
| Void |
UnregisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
| Void |
UnregisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::HandlerSPPConstPtr spp
, VoidPtrConstPtr reference
, SInt32 length
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
| Void |
UnregisterTracer(
SFXEventRangeConstRef range
)
(inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
|
| Void |
UnregisterTracer(
SFXEventRangeConstPtr range
, SInt32 length
)
(inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
|
| T const & |
static_catch(
Void
)
(inherits from static_exception)
Get the current exception.
|
| Protected Functions | |
|---|---|
| Void |
DoneNotifyHandler(
DoneNotifyConstRef notify
) [Handler] Notify the end of rendering.
|
| Void |
FocusNotifyHandler(
FocusNotifyConstRef notify
) [Handler] Notify the movement of the cursor.
|
| Void |
JumpNotifyHandler(
JumpNotifyConstRef notify
) [Handler] Notify when the link is pressed.
|
| Bool |
ResponseNotifyHandler(
ResponseNotifyConstRef notify
) [Handler] Notify that the server connection completes.
|
| static SFYResponderSmp |
Factory(
SFYResponderPtr responder
, SFCErrorPtr exception = null
)
(inherits from SFYResponder)
This function is used to implement the NewInstance function.
|
| SFYResponderSmp |
GetThis( Void )
(inherits from SFYResponder)
Get the smart pointer of this responder.
|
| Void |
HandleBoundGlobal(
SFXRectangleConstRef rectangle
)
(inherits from SFYWidget)
This function will be called when the global region is changed.
|
| Void |
HandleBoundOptimize(
SFXRectanglePtr rectangle
)
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event is received.
[Calculate the suitable rectangle size of this responder within the specified hint rectangle.]
|
| Void |
HandleBoundReal( Void )
(inherits from SFYControl)
This function will be called when the real region is changed.
|
| Void |
HandleBoundRequest(
SFXRectanglePtr rectangle
)
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event is received.
[Calculate the suitable rectangle size of this responder.]
|
| Void |
HandleBoundVirtual( Void )
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received.
[Perform the processing when the virtual region is changed.]
|
| Void |
HandleRenderRequest(
SFXGraphicsPtr graphics
)
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received.
[Draw this responder.]
|
| Void |
Invalidate( Void )
(inherits from SFYResponder)
Register the specified redraw region of this responder.
|
| Void |
Invalidate(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Register the specified redraw region of this responder.
|
| Void |
InvokeBackward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(inherits from SFYResponder)
Call the handlers for the specified event from the end of the handler list registered into this responder.
|
| Void |
InvokeForward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(inherits from SFYResponder)
Call the handlers for the specified event from the head of the handler list registered into this responder.
|
| Void |
SetType(
SFCType param
)
(inherits from SFYResponder)
Set the Type value of this responder to the specified 4-character value.
|
| Void |
static_throw(
static_exception< T > const & param
)
(inherits from static_exception)
Set an exception.
|
| Void |
static_throw(
T const & param
)
(inherits from static_exception)
Set an exception.
|
| Bool |
static_try(
Void
)
(inherits from static_exception)
Confirm whether or not the exception is retained.
|
| Types |
|---|
|
DEFAULT
Enumerated type for the initial value of SFZWebBrowserControl parameter.
|
|
DoneNotify
The class to preserve the information on the timing when rendering is finished.
|
|
FocusNotify
The class to preserve the information on the focus movement of browser.
|
|
HistoryEntry
The structure for history entries.
|
|
JumpNotify
The class to preserve the information on the url links pressed in the browser by user.
|
|
ResponseNotify
The class to preserve the information on the timing when rendering is finished.
|
|
CodeEnum
(inherits from SFYControl)
Constant that represents the SFYControl class.
|
|
HorizontalEnum
(inherits from SFYResponder)
Constants that represent the horizontal alignment.
|
|
VerticalEnum
(inherits from SFYResponder)
Constants that represent the vertical alignment.
|
[ protected, explicit ] SFZTabControl(Void);
[ public, virtual ] ~SFZWebBrowserControl(Void);
This function terminates communication and rendering of HTML data and releases all the resources internally.
[ public ] SFCError ClearHistory(Void);
Return the current history number as 0.
[ protected, virtual ] Void DoneNotifyHandler( DoneNotifyConstRef notify // the notify );
The information to be notified is set in the "notify" argument. The HTTP response code or the BREW error code can be gotten through this argument.
By default nothing happens when the SFZWebBrowserControl::DoneNotifyHandler function is called.
To do something through this function, it is necessary to override the SFZWebBrowserControl::DoneNotifyHandler function.
The timing when the SFZWebBrowserControl::DoneNotifyHandler function is called is different from that of the SFRBrowserControl::ResponseNotifyHandler function.
The code below is to override this function.
#include <SFZResponder/SFZControl/SFZWebBrowserControl.hpp>
SFMTYPEDEFRESPONDER(MyBrowserControl)
class MyBrowserControl : public SFZWebBrowserControl {
SFBSEALRESPONDER(MyBrowserControl)
SFMRESPONDERINSTANTIATEFOUR(MyBrowserControl, SFZWebBrowserControl, SFYControl, SFYWidget, SFYResponder)
public:
static MyBrowserControlSmp NewInstance(SFCErrorPtr exception = null);
protected:
explicit MyBrowserControl(Void) static_throws;
virtual ~MyBrowserControl(Void);
virtual Void DoneNotifyHandler(DoneNotifyConstRef notify) {
if (notify.GetErrorCode() != SFERR_NO_ERROR) {
// if communication error occored, show the error dialog
ErrorDialog(notify.GetErrorCode());
}
else if (WEB_SUCCEEDED(notify.GetDoneCode())) {
// if HTTP error occored, show the warning dialog
WarningDialog(notify.GetResposenCode());
}
}
};
SFZWebBrowserControl::DoneNotify | SFZWebBrowserControl::FocusNotifyHandler | SFZWebBrowserControl::JumpNotifyHandler | SFZWebBrowserControl::ResponseNotifyHandler
[ public, const ] SInt32 FindElement( ACharConstPtr element // name of element SInt32 no // number of element );
Specify the name of element to find.
Specify the index of element to find.
If set to 0, the first matching element is returned. If set to n, the (n+1)th matching element is returned.
Return the index of specified element when found. Return a minus value when not found.
The SFZWebBrowserControl::FindElement function is used to search the specified element in the current page. The index of specified element that is found can be used in the SFZWebBrowserControl::GetElementText or SFZWebBrowserControl::GetElementAttribute function.
[ protected, virtual ] Void FocusNotifyHandler( FocusNotifyConstRef notify // notification );
This argument is the notification. It gets the current position, type and status of the tag that the cursor is pointing to.
It do nothing in a standard implement.
If do something outside the standard, users need to override the SFZWebBrowserControl::FocusNotifyHandler function.
SFZWebBrowserControl::FocusNotify | SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::JumpNotifyHandler | SFZWebBrowserControl::ResponseNotifyHandler
[ public, const ] HistoryEntry GetCurrentHistory(Void);
History of the current page.
[ public, const ] UInt32 GetCurrentHistoryIndex(Void);
Current history index of the current page.
It can be modified by Move function, Previous function, and Next function. And can be initialized to 0 by ClearHistory function.
SFZWebBrowserControl::Move | SFZWebBrowserControl::Previous | SFZWebBrowserControl::Next | SFZWebBrowserControl::ClearHistory
[ public, const ] SFXAnsiString GetElementAttribute( SInt32 elementIndex // index of element ACharConstPtr attr // attribute );
Specify the index of element returned by the SFZWebBrowserControl::FindElement function. function.
Specify the attribute name.
Content of attribute. If the specified attribute is not found, an empty string is returned.
Get the attribute of specified element in the current page. if the specified element is not found, an empty string is returned.
![]() |
About the attribute without value. |
|---|---|
As for an element such as <HR NOSHADE> which has an attribute without value, when trying to get its attribute, "NOSHADE" which is the same as the name of attribute is returned. | |
[ public, const ] SFXAnsiString GetElementText( SInt32 elementIndex // index of element );
Specify the index of element returned by the SFZWebBrowserControl::FindElement function. function
Content of 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 ]
HistoryEntry GetHistory(
UInt32 historyIndex = 0 // history index
);Specify the history index. If not specified, index is set to 0, and the last history content visited is returned.
History content. If there is no history content, or the historyIndex argument is invalid, an empty string is set to the "url" member of SFZWebBrowserControl::HistoryEntry structure.
[ public, const ] HistoryEntryConstPtr GetHistoryList(Void);
Pointer to the history list: an array of SFZWebBrowserControl::HistoryEntry structure, which size is the return value by the SFZWebBrowserControl::GetHistorySize function.
The top entry of history list is the latest history, and the history number matches the index of entry of history list.
If no information is set to a history entry, its "url" member of SFZWebBrowserControl::HistoryEntry structure is set to an empty string.
![]() |
Warning |
|---|---|
The history list returned by the SFZWebBrowserControl::GetHistoryList function must not be modified. | |
Display all the titles and URLs in the history list for debugging.
void PrintHistoryList(SFBrowserControlConstRef browser)
{
int i;
SFBrowserControl::HistoryEntryConstPtr historyList = browser.GetHistoryList();
for (i=0; i < browser.GetHistorySize(); i++) {
DBGPRINTF("title '%s' url %s",
(ACharConstPtr)historyList[i].title, (ConstACharPtr)historyList[i].url);
}
}
[ public, const ] UInt32 GetHistorySize(Void);
Number of entries in the current history list.
The history number used by the SFZWebBrowserControl::Move or SFZWebBrowserControl::GetHistory function must be less than the number of entries in history list returned by the SFZWebBrowserControl::GetHistorySize function.
* The size of history list returned by the SFZWebBrowserControl::GetHistoryList function equals the return value of SFZWebBrowserControl::GetHistorySize function.
SFZWebBrowserControl::GetHistory | SFZWebBrowserControl::GetHistoryList | SFZWebBrowserControl::Move | SFZWebBrowserControl::SetHistorySize
[ public, const ] SInt32 GetIndent(Void);
Width of specified indent in pixels.
[ public, const ] SFXRGBColor GetLinkColor(Void);
Color of the link text.
[ public, const ] SInt32 GetParagraphSpacing(Void);
Space between paragraphs in pixels.
[ public, const ] SInt32 GetScrollbarWidth(Void);
Width of scroll bar in pixels.
[ public, const ] SFXRGBColor GetTextColor(Void);
Text color of HTML.
[ public, const ] SFBWebSmpConstRef GetWeb(Void);
IWeb instance for communication. If the IWeb instance is not set by the SFZWebBrowserControl::SetWeb function and the IWeb instance is not created internally, return null.
![]() |
Caution when specifying the WebOpt. |
|---|---|
|
Though any WebOpt can be set to the IWeb instance, the user setting of WebOpt must be preserved until another IWeb instance is used. Please see the "Instructions about the life-time of WEBOPT" in the BREW API Reference. | |
![]() |
The behavior when suspended. |
|---|---|
|
When suspended, the IWeb instance is set to be created internally by default settings. At this time, the information on WebOpt settings is also reset. To continue to use your own IWeb instance, set it by the resume handler again. | |
SFBWeb | SFZWebBrowserControl::UnsetWeb | SFZWebBrowserControl::SetWeb
[ public, const ] Bool IsBusy(Void);
[ public, const ] Bool IsInlineEditEnable(Void);
[ public, const ] Bool IsScrollbarEnable(Void);
[ protected, virtual ] Void JumpNotifyHandler( JumpNotifyConstRef notify // notification );
The information to be notified is set in the "notify" argument. The URL, HTTP method, POST data of pressed link are preserved.
Open the linked URL automatically.
The SFZWebBrowserControl::JumpNotifyHandler function do nothing except the http://, https://, file://, and res:// streams.
To do something other than default settings, it is necessary to override the SFZWebBrowserControl::JumpNotifyHandler function.
The code below is to override the SFZWebBrowserControl::JumpNotifyHandler function.
#include <SFZResponder/SFZControl/SFZWebBrowserControl.hpp>
SFMTYPEDEFRESPONDER(MyBrowserControl)
class MyBrowserControl : public SFZWebBrowserControl {
SFBSEALRESPONDER(MyBrowserControl)
SFMRESPONDERINSTANTIATEFOUR(MyBrowserControl, SFZWebBrowserControl, SFYControl, SFYWidget, SFYResponder)
public:
static MyBrowserControlSmp NewInstance(SFCErrorPtr exception = null);
protected:
explicit MyBrowserControl(Void) static_throws;
virtual ~MyBrowserControl(Void);
virtual Void JumpNotifyHandler(JumpNotifyConstRef notify) {
if (notify.GetUrl().StartWith("mailto:")) {
// if it's "mailto:", call the mailer
Mailer(notify.GetUrl());
}
else {
// or just call the standard handler
SFZWebBrowserControl::JumpNotifyHandler(notify);
}
}
};
SFZWebBrowserControl::JumpNotify | SFZWebBrowserControl::Navigate | SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::FocusNotifyHandler | SFZWebBrowserControl::ResponseNotifyHandler
[ public ] SFCError Load( SFXAnsiStringConstRef data // HTML data );
[ public ] SFCError Load( SFXAnsiStringConstRef data // HTML data SFXAnsiStringConstRef url // URL );
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 SFZWebBrowserControl::Load function. To get the communication errors or the event that rendering is finished, it is necessary to create a new class inheriting from the SFZWebBrowserControl class with overrided SFZWebBrowserControl::DoneNotifyHandler function. | |
index of history list about the page to move to. If not specified, move to the page of entry in history list (the value of index is 0), i.e., move to the latest page of history list.
If the specified index is greater than the size of history list, or there is no history entry of specified index, SFERR_INVALID_PARAM is returned as an error.
![]() |
About communication error: |
|---|---|
|
The communication errors cannot be gotten from the return value of SFZWebBrowserControl::Move function. To get the communication errors or the event that rendering is finished, it is necessary to create a new class inheriting from the SFZWebBrowserControl class with overrided SFZWebBrowserControl::DoneNotifyHandler function. | |
SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::Navigate | SFZWebBrowserControl::Previous | SFZWebBrowserControl::Next | SFZWebBrowserControl::Reload
[ public ] SFCError Open( SFXAnsiStringConstRef url // URL to open );
[ public ] SFCError Open( SFXAnsiStringConstRef url // URL to open SFXAnsiStringConstRef method // HTTP method );
[ public ] SFCError Open( SFXAnsiStringConstRef url // URL to open SFXAnsiStringConstRef method // HTTP method SFXAnsiStringConstRef data // data to send to the server by POST method );
[ public ] SFCError Open( SFXAnsiStringConstRef url // URL to open SFXAnsiStringConstRef method // HTTP method SFXBufferConstRef data // data to send to the server by POST method );
[ public ] SFCError Open( SFBSourceSmpConstRef source // HTML source );
[ public ] SFCError Open( SFBSourceSmpConstRef source // HTML souce SFXAnsiStringConstRef basdUrl // base URL );
[ public ] SFCError Open( SFBAStreamSmpConstRef stream // HTML stream );
[ public ] SFCError Open( SFBAStreamSmpConstRef src // HTML stream SFXAnsiStringConstRef baseUrl // base URL );
Specify the URL to access. Render the HTML data of specified URL.
The schemes of http, https, file, and res are supported.
Specify the HTTP method to access the page.
GET and POST methods are supported.(GET is a default method)
In case of POST method, specify data to send to the server.
URL ( All the URLs in the HTML data are relative URLs from this "url" argument.)
ISource interface that preserves the HTML data
IAStream interface that preserves the HTML data
Immediately after the inline image is received, it is displayed.
![]() |
The Errors about communication. |
|---|---|
|
The Errors about communication cannot be gotten by return values. While finishing rendering and getting the errors about communication, It is necessary to inherit from the SFZWebBrowserControl class, create a new class with overrided DoneNotifyHandler function. | |
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 SFZWebBrowserControl::Next function. To get the communication errors or the event that rendering is finished, it is necessary to create a new class inheriting from the SFZWebBrowserControl class with overrided SFZWebBrowserControl::DoneNotifyHandler function. | |
SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::Navigate | SFZWebBrowserControl::Move | SFZWebBrowserControl::Previous | SFZWebBrowserControl::Reload
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 SFZWebBrowserControl::Previous function. To get the communication errors or the event that rendering is finished, it is necessary to create a new class inheriting from the SFZWebBrowserControl class with overrided SFZWebBrowserControl::DoneNotifyHandler function. | |
SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::Navigate | SFZWebBrowserControl::Move | SFZWebBrowserControl::Next | SFZWebBrowserControl::Reload
[ public ] Void Reload(Void);
When the current page is displayed by the SFZWebBrowserControl::Load function or by the SFZWebBrowserControl::Navigate function with the argument of IAStream or ISource, the redrawing fails if its "url" is not set validlly.
[ protected, virtual ] Bool ResponseNotifyHandler( ResponseNotifyConstRef notify // notification );
The information to be notified is set in the "notify" argument. The HTTP response code or the BREW error code can be gotten through this argument.
This function is called before rendering.
The standard implement is to do nathing and return a false. To do any other process, it is necessary to overrice the ResponseNotifyHandler() function.
This function is different with SFZWebBrowserControl::DoneNotifyHandler in the timing being called.
The code below is to override this function.
#include <SFZResponder/SFZControl/SFZWebBrowserControl.hpp>
SFMTYPEDEFRESPONDER(MyBrowserControl)
class MyBrowserControl : public SFZWebBrowserControl {
SFBSEALRESPONDER(MyBrowserControl)
SFMRESPONDERINSTANTIATEFOUR(MyBrowserControl, SFZWebBrowserControl, SFYControl, SFYWidget, SFYResponder)
public:
static MyBrowserControlSmp NewInstance(SFCErrorPtr exception = null);
protected:
explicit MyBrowserControl(Void) static_throws;
virtual ~MyBrowserControl(Void);
virtual Void ResponseNotifyHandler(ResponseNotifyConstRef notify) {
if (notify.GetErrorCode() != SFERR_NO_ERROR) {
// if there is a communication error, show the error dialog, stop rendering
ErrorDialog(notify.GetErrorCode());
return true;
}
else if (WEB_SUCCEEDED(notify.GetDoneCode())) {
// if there is a HTTP error, show the warning dialog
WarningDialog(notify.GetResposenCode());
}
return false; // if there is normal or warning, render the HTML page
}
};
SFZWebBrowserControl::ResponseNotify | SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::FocusNotifyHandler | SFZWebBrowserControl::JumpNotifyHandler
[ public ] SFCError SetAuthorizeData( SFXAnsiStringConstRef user // user name for the Basic HTTP authorization SFXAnsiStringConstRef passwd // password for the Basic HTTP authorization SFXAnsiStringConstRef url // URL for the Basic HTTP authorization );
Specify the user name for the Basic HTTP authorization.
Specify the password for the Basic HTTP authorization.
Specify the URL for the Basic HTTP authorization. The web pages reachable from this URL link are protected for the Basic HTTP authorization.
The Basic HTTP authorization is not processed when an error code other than SFERR_NO_ERROR is returned.
After this setting, all the http request headers are included with this authorization information when accessing the web pages .
When accessing the web pages not reachable from the specified URL link, this authorization settings are canceled.
To cancel the authorization settings, use the UnsetAuthorizeData function.
The new size of history list. It cannot be set to 0 or a value smaller than the current value.
The size of history list is not modified when an error code other than SFERR_NO_ERROR is returned.
If the value less than the size of current history list is set, old history entries outside the specified size are removed.
The value less than the size returned by SFZWebBrowserControl::GetCurrentHistoryIndex function cannot be set.
SFZWebBrowserControl::GetCurrentHistoryIndex | SFZWebBrowserControl::GetHistory | SFZWebBrowserControl::GetHistoryList | SFZWebBrowserControl::Move | SFZWebBrowserControl::SetHistorySize
Specify the width of indent in pixels.
Return SFERR_NO_ERROR.
[ public ] SFCError SetLinkColor( SFXRGBColorConstRef color // link color );
Specify the color of link text.
Set the spacing between paragraphs in pixels.
Return SFERR_NO_ERROR.
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 SetWeb( SFBWebSmpConstRef web // iWeb interface );
The IWeb interface for communication.
Use the specified IWeb interface for HTTP accessing.
If it is under rendering, or communicating, interrupt it.
![]() |
Caution when specify the WebOpt. |
|---|---|
|
Though any WebOpt can be set for gotten IWeb instance, the user-set data of WebOpt should be kept by user till it is useable by another IWeb instance. Please see the "Instructions about the life-time of WEBOPT" in BREW API Reference. | |
![]() |
The behavior when suspend. |
|---|---|
|
When suspend, the IWeb instance is set to be created internally as default. At this time, the information of specified WebOpt will be reset, too. When continue to use user-original IWeb instance, Please reset it by resume handler. | |
The specified value can be gotten by GetWeb function.
Set the user agent name.
The setting will be abandoned if the device suspends. It is necessary to set in the resume handler again.
SCError SetUserAgent(SFZWebBrowserControlRef browser) {
SFBWebSmp web;
web = browser.GetWeb();
if (web == null) {
web = SFBWeb::Instance();
}
WebOpt opts[2];
opts[0].nId = WEB_HEADER;
// do not release the setting string if it is in effective until you secure the heap of it
opts[0].pVal = "User-Agent: ibROWSE/0.1 (SophiaFramework; I; BREW 3.1)\r\n";
opts[1].nId = WEBOPT_END;
opts[1].pVal = null;
int s = web->AddOpt(opts);
if (s != SFERR_NO_ERROR) {
return s;
}
browser.SetWeb(web);
return SFERR_NO_ERROR;
}
SFBWeb | SFZWebBrowserControl::UnsetWeb | SFZWebBrowserControl::GetWeb
[ public ] Void Stop(Void);
Nothing happens except under accessing the network or rendering. The content that has already been displayed takes no influence by calling the SFZWebBrowserControl::Stop function.
[ public ] SFCError UnsetAuthorizeData(Void);
The SFZWebBrowserControl::UnsetAuthorizeData function used to cancel the settings for Basic HTTP authorization set by the SFZWebBrowserControl::SetAuthorizeData function.
After calling this function, information on the Basic HTTP authorization is not included with the http request header.
[ public ] Void UnsetWeb(Void);
The SFZWebBrowserControl::UnsetWeb function is used to have the IWeb interface for communication to be created inside the control.
In case of rendering or communicating, its process is interrupted.
SFBWeb | SFZWebBrowserControl::SetWeb | SFZWebBrowserControl::GetWeb
enum DEFAULT {
HISTORY_SIZE = 30
};
Only HISTORY_SIZE is defined to represent the size of history list.
[ public ]
SFMTYPEDEFCLASS(DoneNotify)
class DoneNotify : public Notify {
public:
DoneNotify (SFBHTMLViewerPtr hv, int done_code);
SInt32 GetDoneCode (Void) const;
SFCError GetErrorCode (Void) const;
UInt32 GetResponseCode(Void) const;
};
The DoneNotify class is derived from the HVNotify of BREW API.
The DoneNotify class is mainly used as the argument of SFZWebBrowserControl::DoneNotifyHandler function.
The member functions of DoneNotify class are as below:
| GetDoneCode | Get the result code of communication or rendering. To check whether the communication succeeded or not, pass the result code to the WEB_ERROR_SUCCEEDED function. If communication succeeded, the response code from server is returned. Otherwise, a negative value is returned. And the result code can be converted into the BREW error code to send it to the WEB_ERROR_MAP function. |
| GetErrorCode | Get the error code of communication or rendering. If no error, SFERR_NO_ERROR is returned. |
| GetResponseCode | Get the response code from server. 0 is returned if the HTTP session failed because of communication error etc. |
[ public ]
SFMTYPEDEFCLASS(FocusNotify)
class FocusNotify : public Notify {
public:
FocusNotify (SFBHTMLViewerPtr hv, SInt32 elementNo, HVFocusType type, SInt32 state);
SInt32 GetElementNo(Void) const;
HVFocusType GetFocusType(Void) const;
SInt32 GetState (Void) const;
};
The FocusNotify class is derived from the HVNotify of BREW API.
The FocusNotify class is mainly used as the argument of SFZWebBrowserControl::FocusNotifyHandler function.
The member functions of FocusNotify class are as below:
| GetState | Get the status of focused element. This value is meaningful only when the return value of GetFocusType function is HVFOCUS_CHECKBOX or HVFOCUS_RADIO. If the checkbox or radiobutton focused is not selected, 0 is returned. Otherwise a value other than 0 is returned. |
| GetElementNo | Get the position of focused element. The return value is of the same type as the element position by the SFZWebBrowserControl::FindElement function. |
| GetFocusType |
Get the type of focused element.
The return value is one of the following:
|
[ public ]
struct HistoryEntry {
SFXAnsiString url;
SFXAnsiString title;
};
[ public ]
SFMTYPEDEFCLASS(JumpNotify)
class JumpNotify : public Notify {
public:
JumpNotify (SFBHTMLViewerPtr hv, SInt32 elementNo, ACharConstPtr url, ACharConstPtr method = null, ACharConstPtr data = null);
JumpNotify (SFBHTMLViewerPtr hv, ACharConstPtr url, ACharConstPtr method = null, ACharConstPtr data = null);
SInt32 GetElementNo(Void) const;
SFXAnsiStringConst GetUrl (Void) const;
SFXAnsiStringConst GetMethod (Void) const;
SFXAnsiStringConst GetData (Void) const;
};
The JumpNotify class is derived from the HVNotify of BREW API.
The JumpNotify class is mainly used as the argument of SFZWebBrowserControl::JumpNotifyHandler function.
The member functions of JumpNotify class are as below:
| GetElementNo | Get the position of link element selected. The return value is of the same type as the element position by the SFZWebBrowserControl::FindElement function. |
| GetUrl | Get the URL of link selected by user. |
| GetMethod | Get the access method to the server of selected URL link. Get and POST are supported. |
| GetData | Get data to be sent to the server by POST method. If there is no data to be sent, or the method is not POST, an empty string is returned. |
[ public ]
SFMTYPEDEFCLASS(ResponseNotify)
class ResponseNotify : public Notify {
public:
ResponseNotify (SFBHTMLViewerPtr hv, int error_code);
SFCError GetErrorCode (Void) const;
UInt32 GetResponseCode(Void) const;
};
The ResponseNotify class is derived from the HVNotify of BREW API.
The ResponseNotify class is mainly used as the argument of SFZWebBrowserControl::ResponseNotifyHandler function.
The member functions of ResponseNotify class are as below:
| GetErrorCode | Return the error code in communicating or rendering. If no error, SFERR_NO_ERRO is returned. |
| GetResponseCode | Return the response code from the server. 0 is returned if the HTTP session failed because of communication error etc. |
|
Copyright(c) 2002 - 2010 Sophia Cradle Incorporated All Rights Reserved. |
![]() ![]() ![]()
|