PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFRBrowserControl
Responder which implements a simple Web Browser.
#include <SFRBrowserControl.hpp>
class SFRBrowserControl : public SFRControl;
SFMTYPEDEFCLASS(SFRBrowserControl)

Inheritance diagram

 Inheritance diagram of SFRBrowserControlClass

Collaboration diagram

 Collaboration diagram of SFRBrowserControlClass

Description

The following functions are available in the SFRBrowserControl class:

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

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

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

Error Value

Several member functions of SFRBrowserControl class record its status internally if 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 a simple Web Browser:

SFMTYPEDEFCLASS(MyWindow)
class MyWindow : public SFRTitleWindow {
    SFMSEALCOPY(MyWindow)
public:
    MyWindow(Void) static_throws;
    virtual ~MyWindow(Void) { return; }
    
    // define the simple Web Browser as a member function of pointer type
    SFRBrowserControlPtr     _browser;      // simple Web Browser

};

// constructor(error processing is omitted)
MyWindow::MyWindow(Void) : SFRTitleWindow(SFRApplication::GetInstance(),
    SFXRectangle(20, 20, 200, 250), "my window") static_throws
{
    
    // input the browser by string
    SFXAnsiString buffer(
         "BrowserControl<br /><br />"
         "<a href=\"/example/tabbrowser/\">Sophia Cradle</a><br /><br />"
    );
				
    // create a simple Web Browser
    // the first argument: parent responder
    // the second argument: position and size of the tab
    _browser = ::new SFRBrowserControl(this, rect);
				
    // start rendering the string as HTML
   _browser->Load(buffer);
			
    return;
}

Reference

SFRResponder | SFRApplication | SFRWindow | SFRDialog | SFRControl | SFBHTMLViewer | SFBWeb | Simple Web Browser

Member

Constructor/Destructor
SFRBrowserControl( SFRResponderPtr director , SFXRectangleConstRef rect , BehaviorType behavior = BEHAVIOR_SFRBROWSERCONTROL , SFCType attribute = ATTRIBUTE_SFRBROWSERCONTROL )
Constructor of the SFRBrowserControl class.
~SFRBrowserControl( Void )
Destructor of the SFRBrowserControl 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 Next( SInt32 n = 1 )
Move to the next page in specified history, get and render the page again.
SFCError Open( SFXAnsiStringConstRef url )
Start to render the page of specified URL.
SFCError Open( SFXAnsiStringConstRef url , SFXAnsiStringConstRef method )
Start to render the page of specified URL.
SFCError Open( SFXAnsiStringConstRef url , SFXAnsiStringConstRef method , SFXAnsiStringConstRef data )
Start to render the page of specified URL.
SFCError Open( SFXAnsiStringConstRef url , SFXAnsiStringConstRef method , SFXBufferConstRef data )
Start to render the page of specified URL.
SFCError Open( SFBSourceSmpConstRef source )
Start to render the page of specified URL.
SFCError Open( SFBSourceSmpConstRef source , SFXAnsiStringConstRef basdUrl )
Start to render the page of specified URL.
SFCError Open( SFBAStreamSmpConstRef stream )
Start to render the page of specified URL.
SFCError Open( SFBAStreamSmpConstRef src , SFXAnsiStringConstRef baseUrl )
Start to render the page of specified URL.
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.
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 SFRBrowserControl::SetWeb function.
Bool ClearHandler( Void ) (inherits from SFRResponder)
[Handler] Clear the " Targeted " status of responder, or destroy the responder.
Bool Compare( SFCType type , SFCType attribute , BehaviorType behavior ) (inherits from SFRResponder)
Compare with type, attribute and behavior.
Bool FocusDown( Bool repeat = true ) (inherits from SFRResponder)
Focus down to the next responder.
Bool FocusDownHandler( Void ) (inherits from SFRResponder)
[Handler] Focus down to the next responder.
Bool FocusLeft( Bool repeat = true ) (inherits from SFRResponder)
Focus left to the next responder.
Bool FocusLeftHandler( Void ) (inherits from SFRResponder)
[Handler] Focus left to the next responder.
Bool FocusNext( Bool repeat = true ) (inherits from SFRResponder)
Focus to the next sibling responder.
Bool FocusNextHandler( Void ) (inherits from SFRResponder)
[Handler] Focus to the next sibling responder.
Bool FocusPrevious( Bool repeat = true ) (inherits from SFRResponder)
Focus to the previous sibling responder.
Bool FocusPreviousHandler( Void ) (inherits from SFRResponder)
[Handler] Focus to the previous sibling responder.
Bool FocusRight( Bool repeat = true ) (inherits from SFRResponder)
Focus right to the next responder.
Bool FocusRightHandler( Void ) (inherits from SFRResponder)
[Handler] Focus right to the next responder.
Bool FocusUp( Bool repeat = true ) (inherits from SFRResponder)
Focus up to the next responder.
Bool FocusUpHandler( Void ) (inherits from SFRResponder)
[Handler] Focus up to the next responder.
SFCType GetAttribute( Void ) (inherits from SFRResponder)
Get the attribute.
SFRResponderPtr GetBack( SFCType type = TYPE_WILDCARD , SFCType attribute = ATTRIBUTE_WILDCARD , BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE ) (inherits from SFRResponder)
Get the child responder at the most background that matches the specified search condition.
SFXRectangleConstRef GetBaseBound( Void ) (inherits from SFRResponder)
Get the base region with the coordinate of content region of parent responder.
SFXRectangle GetBaseWorld( Void ) (inherits from SFRResponder)
Get the base region.
SFXRectangleConstRef GetContentBound( Void ) (inherits from SFRResponder)
Get the content region with the coordinate of base region.
SFXRectangle GetContentWorld( Void ) (inherits from SFRResponder)
Get the content region.
SFRResponderPtr GetDirector( Void ) (inherits from SFRResponder)
Get the parent responder.
SFRResponderPtr GetFocus( Void ) (inherits from SFRResponder)
Get the responder with focus in its ownership hierarchy.
SFXMargin GetFrameMargin( Void ) (inherits from SFRResponder)
Get the margin between base and content region(in pixels).
SFRResponderPtr GetFront( SFCType type = TYPE_WILDCARD , SFCType attribute = ATTRIBUTE_WILDCARD , BehaviorType compare = STATUS_VISIBLE | STATUS_ENABLE ) (inherits from SFRResponder)
Get the child responder at the most foreground that matches the specified search condition.
SInt16 GetIndexBackward( SFCType type = TYPE_WILDCARD , SFCType attribute = ATTRIBUTE_WILDCARD , BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE ) (inherits from SFRResponder)
Get the index number from the most background of responder that matches the specified search condition.
SInt16 GetIndexForward( SFCType type = TYPE_WILDCARD , SFCType attribute = ATTRIBUTE_WILDCARD , BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE ) (inherits from SFRResponder)
Get the index number from the most foreground of responder that matches the specified search condition.
Bool GetInheritEnable( Void ) (inherits from SFRResponder)
Get the " Enable / Disable " status of responder including its parent responders.
Bool GetInheritFocus( Void ) (inherits from SFRResponder)
Get the " Focused / Unfocused " status of responder including its parent responders.
Bool GetInheritTarget( Void ) (inherits from SFRResponder)
Get the " Target / Not-Target " status of responder including its parent responders.
Bool GetInheritVisible( Void ) (inherits from SFRResponder)
Get the " Visible / Invisible " status of responder including its parent responders.
SFRResponderPtr GetLeft( SFCType type = TYPE_WILDCARD , SFCType attribute = ATTRIBUTE_WILDCARD , BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE ) (inherits from SFRResponder)
Get the previous responder among the grouped responders that matches the specified search condition.
SInt16 GetMoveInterval( Void ) (inherits from SFRResponder)
Get the move interval in pixels.
SInt16 GetMoveMargin( Void ) (inherits from SFRResponder)
Get the margin pixels of content region ( or virtual region if set with the parent responder ) where the child responder cannot move.
SFRResponderPtr GetNext( SFCType type = TYPE_WILDCARD , SFCType attribute = ATTRIBUTE_WILDCARD , BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE , Bool repeat = true ) (inherits from SFRResponder)
Get the next sibling responder that matches the specified search condition.
SFRResponderPtr GetNthBackward( SInt16 index , SFCType type = TYPE_WILDCARD , SFCType attribute = ATTRIBUTE_WILDCARD , BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE ) (inherits from SFRResponder)
Get the Nth child responder from the most background that matches the specified search condition.
SFRResponderPtr GetNthForward( SInt16 index , SFCType type = TYPE_WILDCARD , SFCType attribute = ATTRIBUTE_WILDCARD , BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE ) (inherits from SFRResponder)
Get the Nth child responder from the most foreground that matches the specified search condition.
SFRResponderPtr GetPrevious( SFCType type = TYPE_WILDCARD , SFCType attribute = ATTRIBUTE_WILDCARD , BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE , Bool repeat = true ) (inherits from SFRResponder)
Get the previous sibling responder that matches the specified search condition.
VoidPtr GetReference( Void ) (inherits from SFRResponder)
Get the reference value.
SFRResponderPtr GetRight( SFCType type = TYPE_WILDCARD , SFCType attribute = ATTRIBUTE_WILDCARD , BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE ) (inherits from SFRResponder)
Get the next responder among the grouped responders that matches the specified search condition.
SInt16 GetScrollInterval( Void ) (inherits from SFRResponder)
Get the scroll interval in pixels.
Bool GetStatusEnable( Void ) (inherits from SFRResponder)
Get the value of " Enable / Disable " flag.
Bool GetStatusFocus( Void ) (inherits from SFRResponder)
Get the value of " Focused / Unfocused " flag.
Bool GetStatusTarget( Void ) (inherits from SFRResponder)
Get the value of " Target / Non-target " flag.
Bool GetStatusVisible( Void ) (inherits from SFRResponder)
Get the value of " Visible / Invisible " flag.
SFXGrid GetTranslate( Void ) (inherits from SFRResponder)
Get the origin coordinate of virtual region with the coordinate of content region.
SInt16 GetTravelMargin( Void ) (inherits from SFRResponder)
Get the margin pixels of content region inside which the rectangle in the virtual region but outside the content region should be automatically scrolled by using the SFRResponder::Travel function.
SFCType GetType( Void ) (inherits from SFRResponder)
Get the responder type.
SFXRectangleConstRef GetVirtualBound( Void ) (inherits from SFRResponder)
Get the virtual region with the coordinate of content region.
SFXRectangle GetVirtualWorld( Void ) (inherits from SFRResponder)
Get the virtual region
Void Group( SFRResponderPtr with ) (inherits from SFRResponder)
Group the responder with the group of which representative responder is specified as an argument.
Void GroupMove( SFXSizeConstRef size ) (inherits from SFRResponder)
Move all the responders grouped together.
Void GroupScroll( SFXSizeConstRef size ) (inherits from SFRResponder)
Scroll all the virtual regions of responders grouped together.
Void GroupSelect( Void ) (inherits from SFRResponder)
Select all the responders grouped together. ( move all of them to the most foreground )
Void GroupStatusEnable( Bool enable ) (inherits from SFRResponder)
Set the " Enable / Disable " status of all the responders grouped together.
Void GroupStatusVisible( Bool visible ) (inherits from SFRResponder)
Set the " Visible / Invisible " status of all the responders grouped together.
Void InvalidateBase( Void ) (inherits from SFRResponder)
Register an area in the base region to be redrawn.
Void InvalidateBase( SFXRectangleConstRef rect ) (inherits from SFRResponder)
Register an area in the base region to be redrawn.
Void InvalidateContent( Void ) (inherits from SFRResponder)
Register an area in the content region to be redrawn.
Void InvalidateContent( SFXRectangleConstRef rect ) (inherits from SFRResponder)
Register an area in the content region to be redrawn.
Void InvalidateVirtual( Void ) (inherits from SFRResponder)
Register an area in the virtual region to be redrawn.
Void InvalidateVirtual( SFXRectangleConstRef rect ) (inherits from SFRResponder)
Register an area in the virtual region to be redrawn.
Bool Invoke( SFXEventConstRef event ) (inherits from SFRResponder)
Send the specified event.
Bool MoveDownHandler( Void ) (inherits from SFRResponder)
[Handler] Move the responder down.
Bool MoveLeftHandler( Void ) (inherits from SFRResponder)
[Handler] Move the responder left.
Bool MoveRightHandler( Void ) (inherits from SFRResponder)
[Handler] Move the responder right.
Bool MoveUpHandler( Void ) (inherits from SFRResponder)
[Handler] Move the responder up.
SFCError RegisterHandler( HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref ) (inherits from SFRHandler)
Register a handler.
SFCError RegisterHandler( SFCEventEnum type , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref ) (inherits from SFRHandler)
Register a handler.
SFCError RegisterHandler( SFCEventEnum type , UInt16 p16 , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref ) (inherits from SFRHandler)
Register a handler.
SFCError RegisterHandler( SFCEventEnum type , UInt16 bp16 , UInt16 ep16 , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref ) (inherits from SFRHandler)
Register a handler.
SFCError RegisterHandler( SFCEventEnum btype , SFCEventEnum etype , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref ) (inherits from SFRHandler)
Register a handler.
SFCError RegisterHandler( SFCEventEnum btype , SFCEventEnum endType , UInt16 p16 , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref ) (inherits from SFRHandler)
Register a handler.
SFCError RegisterHandler( SFCEventEnum btype , SFCEventEnum etype , UInt16 bp16 , UInt16 ep16 , HandlerEnum timing , SFRHandlerSPP spp , VoidPtr ref ) (inherits from SFRHandler)
Register a handler.
SFCError RegisterTracer( BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum type , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum type , UInt16 p16 , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum type , UInt16 bgnP16 , UInt16 endP16 , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum bgnType , SFCEventEnum endType , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 p16 , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
SFCError RegisterTracer( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 bgnP16 , UInt16 endP16 , BehaviorType behavior , TracerEnum trace ) (inherits from SFRTracer)
Register the tracer.
Void Scroll( SFXSizeConstRef size ) (inherits from SFRResponder)
Scroll the virtual region.
Bool ScrollDownHandler( Void ) (inherits from SFRResponder)
[Handler] Scroll the virtual region down.
Bool ScrollLeftHandler( Void ) (inherits from SFRResponder)
[Handler] Scroll the virtual region left.
Bool ScrollRightHandler( Void ) (inherits from SFRResponder)
[Handler] Scroll the virtual region right.
Bool ScrollUpHandler( Void ) (inherits from SFRResponder)
[Handler] Scroll the virtual region up.
Void Select( Void ) (inherits from SFRResponder)
Select the responder and move it to the most foreground.
Bool SelectHandler( Void ) (inherits from SFRResponder)
[Handler] Set the target status of a responder to true.
Void SetBaseBound( SFXRectangleConstRef rect ) (inherits from SFRResponder)
Set the base region with the coordinate of virtual region of parent responder.
Void SetContentBound( SFXRectangleConstRef rect ) (inherits from SFRResponder)
Set the content region with the coordinate of base region.
Void SetFrameMargin( SFXMarginConstRef param ) (inherits from SFRResponder)
Set the margin between base and content region(in pixels).
Void SetMoveInterval( SInt16 interval ) (inherits from SFRResponder)
Set the move interval in pixels.
Void SetMoveMargin( SInt16 margin ) (inherits from SFRResponder)
Set the margin pixels of content region ( or virtual region if set with the parent responder ) where the child responder cannot move.
Void SetReference( VoidPtr ref ) (inherits from SFRResponder)
Set the reference value.
Void SetScrollInterval( SInt16 interval ) (inherits from SFRResponder)
Set the scroll interval in pixels.
Void SetStatusEnable( Bool enable ) (inherits from SFRResponder)
Set the value of " Enable / Disable " flag.
Void SetStatusFocus( Bool focus ) (inherits from SFRResponder)
Set the value of " Focused / Unfocused " flag.
Void SetStatusTarget( Bool target ) (inherits from SFRResponder)
Set the value of " Target / Not-Target " flag.
Void SetStatusVisible( Bool visible ) (inherits from SFRResponder)
Set the value of " Visible / Invisible " flag.
Void SetTranslate( SFXGridConstRef point ) (inherits from SFRResponder)
Set the origin coordinate of virtual region with the coordinate of content region.
Void SetTravelMargin( SInt16 margin ) (inherits from SFRResponder)
Set the margin pixels of content region inside which the rectangle in the virtual region but outside the content region should be automatically scrolled by using the SFRResponder::Travel function.
Void SetVirtualBound( SFXRectangleConstRef rect ) (inherits from SFRResponder)
Set the virtual region with the coordinate of content region.
Void Travel( SFXRectangleConstRef rect ) (inherits from SFRResponder)
Scroll the virtual region of responder so that the specified rectangle can get into the content region.
Void Ungroup( Void ) (inherits from SFRResponder)
Ungroup the responders which are grouped together.
Void UnregisterHandler( HandlerEnum timing ) (inherits from SFRHandler)
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum type , HandlerEnum timing ) (inherits from SFRHandler)
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum type , UInt16 p16 , HandlerEnum timing ) (inherits from SFRHandler)
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum type , UInt16 bgnP16 , UInt16 endP16 , HandlerEnum timing ) (inherits from SFRHandler)
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum bgnType , SFCEventEnum endType , HandlerEnum timing ) (inherits from SFRHandler)
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 p16 , HandlerEnum timing ) (inherits from SFRHandler)
Unregister the registered handler.
Void UnregisterHandler( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 bgnP16 , UInt16 endP16 , HandlerEnum timing ) (inherits from SFRHandler)
Unregister the registered handler.
Void UnregisterTracer( Void ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum type ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum type , UInt16 p16 ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum type , UInt16 bgnP16 , UInt16 endP16 ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum bgnType , SFCEventEnum endType ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 p16 ) (inherits from SFRTracer)
Unregister the tracer.
Void UnregisterTracer( SFCEventEnum bgnType , SFCEventEnum endType , UInt16 bgnP16 , UInt16 endP16 ) (inherits from SFRTracer)
Unregister the tracer.
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.
Bool GetAppearanceTransparent( Void ) (inherits from SFRResponder)
Get the value of APPEARANCE_TRANSPARENT flag.
Bool GetPropertyClosable( Void ) (inherits from SFRResponder)
Get the value of PROPERTY_CLOSABLE flag.
Bool GetPropertyDirect( Void ) (inherits from SFRResponder)
Get the value of PROPERTY_DIRECT flag.
Bool GetPropertyMovable( Void ) (inherits from SFRResponder)
Get the value of PROPERTY_MOVABLE flag.
Bool GetPropertyScrollable( Void ) (inherits from SFRResponder)
Get the value of PROPERTY_SCROLLABLE flag.
Bool GetPropertySelect( Void ) (inherits from SFRResponder)
Get the value of PROPERTY_SELECT flag.
Bool GetPropertyTravel( Void ) (inherits from SFRResponder)
Get the value of PROPERTY_TRAVEL flag.
HandlerRecConstPtr SearchHandler( SFXEventConstRef event , HandlerEnum timing ) (inherits from SFRHandler)
Search for the handler that matches the specified event.
TracerRecConstPtr SearchTracer( SFXEventConstRef event ) (inherits from SFRTracer)
Search for the tracer that matches the specified event.
Types
DEFAULT
Enumerated type for the initial value of SFRBrowserControl 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.
BehaviorEnum (inherits from SFRControl)
Constant that represents the behavior of control.
HandlerEnum (inherits from SFRHandler)
Constant that represents the timing to call the handler.
SFRHandlerSPP (inherits from SFRHandler)
Type of the callback function.
TracerEnum (inherits from SFRTracer)
Constant that represents the trace order.
TracerTraceMPP (inherits from SFRTracer)
Type of the callback function.

SFRBrowserControl::SFRBrowserControl
Constructor of the SFRBrowserControl class.
[ public ]
SFRBrowserControl(
    SFRResponderPtr director                             // parent responder
    SFXRectangleConstRef rect                            // size of the control
    BehaviorType behavior = BEHAVIOR_SFRBROWSERCONTROL   // behavior
    SFCType attribute = ATTRIBUTE_SFRBROWSERCONTROL      // attribute
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If failed: SFERR_FAILED

Description

Initialize member variables, and create the IHtmlViewer interface for rendering the web pages.(*)

* The IWeb interface is not created here.


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

Description

The SFRBrowserControl::~SFRBrowserControl function terminates communication and rendering of HTML data and releases all the resources internally.


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

Return value

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

Description

Return the current history number as 0.

Reference

SFRBrowserControl::GetCurrentHistoryIndex


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

Argument

notify

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

Description

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

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

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

Example

The code below is to override this function.

#include <SFRResponder/SFRControl/SFRBrowserControl.hpp>

class MyBrowserControl : public SFRBrowserControl {
public:
    MyBrowserControl(SFRResponderPtr director, SFXRectangleConstRef rect)
        : SFRBrowserControl(director, rect) {
    }

protected:
    virtual Void DoneNotifyHandler(DoneNotifyConstRef notify) {
        if (notify.GetErrorCode() != SFERR_NO_ERROR) {
            // if communication error occored, show the error dialog
            ErrorDialog(notify.GetErrorCode());
        }
        else if (WEB_SUCCEEDED(notify.GetDoneCode())) {
            // if HTTP error occored, show the warning dialog
            WarningDialog(notify.GetResposenCode());
        }
    }
};

Reference

SFRBrowserControl::DoneNotify | SFRBrowserControl::FocusNotifyHandler | SFRBrowserControl::JumpNotifyHandler | SFRBrowserControl::ResponseNotifyHandler


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

Argument

element

Specify the name of the element to find.

no

Specify the index of the element to find.

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

Return value

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

Description

The SFRBrowserControl::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 SFRBrowserControl::GetElementText or SFRBrowserControl::GetElementAttribute function.

Reference

SFRBrowserControl::GetElementText | SFRBrowserControl::GetElementAttribute


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

Argument

notify

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

Description

It do nothing in a standard implement.

If do something outside the standard, users need to override the FocusNotifyHandler() function.

Reference

SFRBrowserControl::FocusNotify | SFRBrowserControl::DoneNotifyHandler | SFRBrowserControl::JumpNotifyHandler | SFRBrowserControl::ResponseNotifyHandler


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

Return value

It returns the history of the current page.

Reference

SFRBrowserControl::GetCurrentHistoryIndex | SFRBrowserControl::GetHistory


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

Return value

It returns the current history index of the current page.

Description

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

Reference

SFRBrowserControl::Move | SFRBrowserControl::Previous | SFRBrowserControl::Next | SFRBrowserControl::ClearHistory


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

Argument

elementIndex

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

attr

Specify the attribute name.

Return value

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

Description

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

[Important] About the attribute without value.

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

Reference

SFRBrowserControl::FindElement | SFRBrowserControl::GetElementText


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

Argument

elementIndex

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

Return values

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

Description

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

Reference

SFRBrowserControl::FindElement | SFRBrowserControl::GetElementAttribute


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

Argument

historyIndex

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

Return value

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

Reference

SFRBrowserControl::HistoryEntry | SFRBrowserControl::GetHistoryList | SFRBrowserControl::GetCurrentHistory


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

Return value

Return a pointer to the history list: an array of SFRBrowserControl::HistoryEntry structure, which size is the return value by the SFRBrowserControl::GetHistorySize function.

Description

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

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

[Warning] Warning

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

Example

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

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

Reference

SFRBrowserControl::HistoryEntry | SFRBrowserControl::GetHistorySize


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

Return value

Return the number of entries in the current history list.

Description

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

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

Reference

SFRBrowserControl::GetHistory | SFRBrowserControl::GetHistoryList | SFRBrowserControl::Move | SFRBrowserControl::SetHistorySize


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

Return value

Return the width of specified indent in pixels.

Reference

SFRBrowserControl::SetIndent


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

Return value

Return the color of link text.

Reference

SFRBrowserControl::SetLinkColor | SFRBrowserControl::GetTextColor


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

Return value

Return the spacing between paragraphs in pixels.

Reference

SFRBrowserControl::SetParagraphSpacing


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

Return value

Return the width of scroll bar in pixels.

Reference

SFRBrowserControl::SetScrollbarWidth


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

Return value

Return the text color of HTML.

Reference

SFRBrowserControl::SetTextColor | SFRBrowserControl::GetLinkColor


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

Return value

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

Description

[Important] Caution when specifying the WebOpt.

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

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

[Important] The behavior when suspended.

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

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

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

Reference

SFBWeb | SFRBrowserControl::UnsetWeb | SFRBrowserControl::SetWeb


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

Return value

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

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

Return value

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

Reference

SFRBrowserControl::SetInlineEditEnable


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

Return value

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

Reference

SFRBrowserControl::SetScrollbarEnable


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

Argument

notify

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

Description

Open the linked URL automatically.

The SFRBrowserControl::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 SFRBrowserControl::JumpNotifyHandler function.

Example

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

#include <SFRResponder/SFRControl/SFRBrowserControl.hpp>

class MyBrowserControl : public SFRBrowserControl {
public:
    MyBrowserControl(SFRResponderPtr director, SFXRectangleConstRef rect)
        : SFRBrowserControl(director, rect) {
    }

protected:
    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
     SFRBrowserControl::JumpNotifyHandler(notify);
        }
    }
};

Reference

SFRBrowserControl::JumpNotify | SFRBrowserControl::Open | SFRBrowserControl::DoneNotifyHandler | SFRBrowserControl::FocusNotifyHandler | SFRBrowserControl::ResponseNotifyHandler


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

Argument

data

the string in the HTML format

url

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

Return value

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

Description

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

[Important] About communication error:

The communication errors cannot be gotten from the return value of SFRBrowserControl::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 SFRBrowserControl class with overrided SFRBrowserControl::DoneNotifyHandler function.

Reference

SFRBrowserControl::Open | SFRBrowserControl::DoneNotifyHandler


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

Argument

historyIndex

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

Return value

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

Description

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

[Important] About communication error:

The communication errors cannot be gotten from the return value of SFRBrowserControl::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 SFRBrowserControl class with overrided SFRBrowserControl::DoneNotifyHandler function.

Reference

SFRBrowserControl::DoneNotifyHandler | SFRBrowserControl::Open | SFRBrowserControl::Previous | SFRBrowserControl::Next | SFRBrowserControl::Reload


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

Argument

n

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

Return value

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

Instruction

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

[Important] About communication error:

The communication errors cannot be gotten from the return value of SFRBrowserControl::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 SFRBrowserControl class with overrided SFRBrowserControl::DoneNotifyHandler function.

Reference

SFRBrowserControl::DoneNotifyHandler | SFRBrowserControl::Open | SFRBrowserControl::Move | SFRBrowserControl::Previous | SFRBrowserControl::Reload


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

Argument

url

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

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

method

Specify the HTTP method to access the page.

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

data

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

baseUrl

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

source

ISource interface that preserves the HTML data

stream

IAStream interface that preserves the HTML data

Return value

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

Description

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

[Important] The Errors about communication.

The Errors about communication cannot be gotten by return values.

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

Reference

SFRBrowserControl::Load | SFRBrowserControl::DoneNotifyHandler


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

Argument

n

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

Return value

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

Description

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

[Important] About communication error:

The communication errors cannot be gotten from the return value of SFRBrowserControl::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 SFRBrowserControl class with overrided SFRBrowserControl::DoneNotifyHandler function.

Reference

SFRBrowserControl::DoneNotifyHandler | SFRBrowserControl::Open | SFRBrowserControl::Move | SFRBrowserControl::Next | SFRBrowserControl::Reload


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

Description

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

Reference

SFRBrowserControl::Load | SFRBrowserControl::Open


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

Argument

notify

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

Return value

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

Description

This function is called before rendering.

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

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

Example

The code below is to override this function.

#include <SFRResponder/SFRControl/SFRBrowserControl.hpp>

class MyBrowserControl : public SFRBrowserContorl {
public:
    MyBrowserControl(SFRResponderPtr director, SFXRectangleConstRef rect)
        : SFRBrowserControl(director, rect) {
    }

protected:
    virtual Void ResponseNotifyHandler(ResponseNotifyConstRef notify) {
        if (notify.GetErrorCode() != SFERR_NO_ERROR) {
            // if there is a communication error, show the error dialog, stop rendering
            ErrorDialog(notify.GetErrorCode());
            return true;
        }
        else if (WEB_SUCCEEDED(notify.GetDoneCode())) {
            // if there is a HTTP error, show the warning dialog
            WarningDialog(notify.GetResposenCode());
        }
        return false;  // if there is normal or warning, render the HTML page
    }
};

Reference

SFRBrowserControl::ResponseNotify | SFRBrowserControl::DoneNotifyHandler | SFRBrowserControl::FocusNotifyHandler | SFRBrowserControl::JumpNotifyHandler


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

Argument

user

Specify the user name for the Basic HTTP authorization.

passwd

Specify the password for the Basic HTTP authorization.

url

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

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY

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

Instruction

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

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

To cancel the authorization settings, use the UnsetAuthorizeData function.

Reference

SFRBrowserControl::UnsetAuthorizeData


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

Argument

size

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

Return value

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

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

Description

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

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

Reference

SFRBrowserControl::GetCurrentHistoryIndex | SFRBrowserControl::GetHistory | SFRBrowserControl::GetHistoryList | SFRBrowserControl::Move | SFRBrowserControl::SetHistorySize


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

Argument

pixel

Specify the width of indent in pixels.

Return value

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

Reference

SFRBrowserControl::GetIndent


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

Argument

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

Return value

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

Reference

SFRBrowserControl::IsInlineEditEnable


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

Argument

color

Specify the color of link text.

Return value

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

Reference

SFRBrowserControl::GetLinkColor | SFRBrowserControl::SetTextColor


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

Argument

pixel

Set the spacing between paragraphs in pixels.

Return value

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

Reference

SFRBrowserControl::GetParagraphSpacing


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

Argument

enable
  • enabled: true
  • disabled: false

Return value

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

Description

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

Reference

SFRBrowserControl::IsScrollbarEnable


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

Argument

pixel

Specify the width of the scroll bar in pixels.

Return value

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

Reference

SFRBrowserControl::GetScrollbarWidth


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

Argument

color

Specify the color of HTML text.

Return value

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

Reference

SFRBrowserControl::GetTextColor | SFRBrowserControl::SetLinkColor


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

Argument

web

The IWeb interface for communication.

Description

Use the specified IWeb interface for HTTP accessing.

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

[Important] Caution when specify the WebOpt.

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

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

[Important] The behavior when suspend.

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

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

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

The specified value can be gotten by GetWeb function.

Example

Set the user agent name.

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

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

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

Reference

SFBWeb | SFRBrowserControl::UnsetWeb | SFRBrowserControl::GetWeb


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

Description

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


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

Return value

  • If succeeds: SFERR_NO_ERROR
  • If failed: Anything except SFERR_NO_ERROR

Description

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

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

Reference

SFRBrowserControl::SetAuthorizeData


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

Description

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

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

Reference

SFBWeb | SFRBrowserControl::SetWeb | SFRBrowserControl::GetWeb


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

Description

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

Reference

SFRBrowserControl::GetHistorySize | SFRBrowserControl::SetHistorySize


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

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

Description

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

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

The member functions of DoneNotify class are as below:

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

Reference

SFRBrowserControl::DoneNotifyHandler


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

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

Description

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

The FocusNotify class is mainly used as the argument of SFRBrowserControl::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 SFRBrowserControl::FindElement function.
GetFocusType Get the type of focused element. The return value is one of the following:
  • HVFOCUS_NONE
  • HVFOCUS_LINK
  • HVFOCUS_EDIT
  • HVFOCUS_CHECKBOX
  • HVFOCUS_RADIO
  • HVFOCUS_SUBMIT
  • HVFOCUS_RESET
  • HVFOCUS_LIST
Please refer to the [HVFocusType] in the BREW API for detailed information.

Reference

SFRBrowserControl::FocusNotifyHandler


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

Reference

SFRBrowserControl::GetHistory | SFRBrowserControl::GetHistoryList


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

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

Description

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

The JumpNotify class is mainly used as the argument of SFRBrowserControl::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 SFRBrowserControl::FindElement function.
GetUrl Get the URL of link selected by user.
GetMethod Get the access method to the server of selected URL link. Get and POST are supported.
GetData Get data to be sent to the server by POST method. If there is no data to be sent, or the method is not POST, an empty string is returned.

Reference

SFRBrowserControl::JumpNotifyHandler


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

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

Description

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

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

The member functions of ResponseNotify class are as below:

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

Reference

SFRBrowserControl::ResponseNotifyHandler