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


SFZWebBrowserControl クラスは、以下の機能を備える簡易ウェブブラウザコントロールです。
SFZWebBrowserControl クラスは BREW API の IHtmlViewer を使って実装されているので、HTML レンダリングに関する制限は IHtmlViewer と概ね同等です。
エラー値
SFZWebBrowserControl クラスのいくつかのメンバ関数は、 エラーが発生すると内部的にその状態を記録します。
メンバ関数で発生したエラーは、 static_catch 関数により取得できます。
エラーが発生しなかった場合は、SFERR_NO_ERROR を返します。

SFZWebBrowserControl クラスのサンプルコードは以下のようになります。
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);
// 簡易ウェブブラウザをスマートポインタ型のメンバ変数として定義する
SFZWebBrowserControlSmp _browser; // 簡易ウェブブラウザ
};
// コンストラクタ (エラー処理は省略)
MyWindow::MyWindow(Void) static_throws
{
if (static_try()) {
// 表示するブラウザを文字列で入力する
SFXAnsiString buffer(
"BrowserControl<br /><br />"
"<a href=\"http://www.s-cradle.com/example/tabbrowser/\">ソフィアクレイドル</a><br /><br />"
);
// 簡易ウェブブラウザの作成
_browser = SFZWebBrowserControl::NewInstance();
_browser->SetParent(GetThis());
_browser->SetRealBound(GetLocalBound());
_browser->SetState(true, true, true, true);
//文字列データを HTML とみなして、レンダリングを開始する
_browser->Load(buffer);
}
}
SFYResponder | SFYApplication | SFZWindow | SFZDialog | SFYControl | SFBHTMLViewer | SFBWeb |
| コンストラクタ/デストラクタ |
|---|
|
SFZWebBrowserControl( Void )
SFZWebBrowserControl クラスのコンストラクタです。
|
|
~SFZWebBrowserControl( Void )
SFZWebBrowserControl クラスのデストラクタです。
|
| パブリック関数 | |
|---|---|
| SFCError |
ClearHistory( Void ) 履歴リストを空にします。
|
| SInt32 |
FindElement(
ACharConstPtr element
, SInt32 no
) 表示中のページから、指定した要素を検索します。
|
| HistoryEntry |
GetCurrentHistory( Void ) 現在表示しているページの URL とタイトルを取得します。
|
| UInt32 |
GetCurrentHistoryIndex( Void ) 現在の履歴番号を取得します。
|
| SFXAnsiString |
GetElementAttribute(
SInt32 elementIndex
, ACharConstPtr attr
) 指定した要素の属性値を取得します。
|
| SFXAnsiString |
GetElementText(
SInt32 elementIndex
) 指定した要素の内容を取得します。
|
| HistoryEntry |
GetHistory(
UInt32 historyIndex = 0
) 指定した履歴番号の履歴内容を取得します。
|
| HistoryEntryConstPtr |
GetHistoryList( Void ) 履歴リストを取得します。
|
| UInt32 |
GetHistorySize( Void ) 履歴リストのエントリ数を取得します。
|
| SInt32 |
GetIndent( Void ) インデントの幅を取得します。
|
| SFXRGBColor |
GetLinkColor( Void ) リンク文字列の表示色を取得します。
|
| SInt32 |
GetParagraphSpacing( Void ) 段落間の行間の長さを取得します。
|
| SInt32 |
GetScrollbarWidth( Void ) スクロールバーの幅を取得します。
|
| SFXRGBColor |
GetTextColor( Void ) 本文の表示色を取得します。
|
| SFBWebSmpConstRef |
GetWeb( Void ) IWeb インターフェースを取得します。
|
| Bool |
IsBusy( Void ) 通信中、あるいはレンダリング中か判定します。
|
| Bool |
IsInlineEditEnable( Void ) 文字をインラインで入力する設定か判定します。
|
| Bool |
IsScrollbarEnable( Void ) スクロールバーがあるか判定します。
|
| SFCError |
Load(
SFXAnsiStringConstRef data
) Load( SFXAnsiStringConstRef data , SFXAnsiStringConstRef url )
文字列データを HTML とみなして、レンダリングを開始します。
|
| SFCError |
Move(
UInt32 historyIndex = 0
)
指定した履歴内のページに移動し、ページの再取得と再レンダリングを行います。
|
| SFCError |
Navigate(
SFXAnsiStringConstRef url
) Navigate( SFBAStreamSmpConstRef src , SFXAnsiStringConstRef baseUrl ) Navigate( SFBAStreamSmpConstRef stream ) Navigate( SFBSourceSmpConstRef source , SFXAnsiStringConstRef basdUrl ) Navigate( SFBSourceSmpConstRef source ) Navigate( SFXAnsiStringConstRef url , SFXAnsiStringConstRef method , SFXBufferConstRef data ) Navigate( SFXAnsiStringConstRef url , SFXAnsiStringConstRef method , SFXAnsiStringConstRef data ) Navigate( SFXAnsiStringConstRef url , SFXAnsiStringConstRef method ) 指定した URL のページを取得して、レンダリングを開始します。
|
| SFCError |
Next(
SInt32 n = 1
) 指定した履歴を進み、ページの再取得と再レンダリングを行います。
|
| SFCError |
Previous(
SInt32 n = 1
) 指定した履歴を戻り、ページの再取得と再レンダリングを行います。
|
| Void |
Reload( Void )
現在表示しているページを再取得して再描画します。
|
| SFCError |
SetAuthorizeData(
SFXAnsiStringConstRef user
, SFXAnsiStringConstRef passwd
, SFXAnsiStringConstRef url
) HTTP ベーシック認証の情報を設定します。
|
| SFCError |
SetHistorySize(
UInt32 size
) 履歴リストの大きさを設定します。
|
| SFCError |
SetIndent(
SInt32 pixel
) インデントの幅を設定します。( 単位 : ピクセル )
|
| SFCError |
SetInlineEditEnable(
Bool enable
)
文字をインライン入力するか設定します。
|
| SFCError |
SetLinkColor(
SFXRGBColorConstRef color
) リンク文字列の表示色を設定します。
|
| SFCError |
SetParagraphSpacing(
SInt32 pixel
) 段落間の行間の長さを設定します。( 単位 : ピクセル )
|
| SFCError |
SetScrollbarEnable(
Bool enable
) スクロールバーの有無を設定します。
|
| SFCError |
SetScrollbarWidth(
SInt32 pixel
) スクロールバーの幅を設定します。( 単位 : ピクセル )
|
| SFCError |
SetTextColor(
SFXRGBColorConstRef color
) テキストの表示色を設定します。
|
| Void |
SetWeb(
SFBWebSmpConstRef web
) IWeb インターフェースを設定します。
|
| Void |
Stop( Void )
通信、あるいはレンダリングの処理を中断します。
|
| SFCError |
UnsetAuthorizeData( Void ) HTTP ベーシック認証の情報を設定を取り消します。
|
| Void |
UnsetWeb( Void )
SetWeb の設定を取り消します。
|
| Void |
ClearHandler( Void )
(SFYResponder から継承)
ハンドラの登録をすべて解除します。
|
| Void |
ClearTracer( Void )
(SFYResponder から継承)
トレーサの登録をすべて解除します。
|
| SFCError |
Distribute(
SFXEventConstRef event
, BoolPtr result = null
)
(SFYResponder から継承)
配信エンジンを起動してイベントを配信します。
|
| SFXRGBColorConstRef |
GetBackgroundColor( Void )
(SFYWidget から継承)
背景の色を取得します。
|
| SFYResponderSmp |
GetChildBack( Void )
(SFYResponder から継承)
GetChildBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetChildBack( UInt32 id ) (SFYResponder から継承) GetChildBack( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 最背面に位置する子レスポンダを取得します。
|
| SFYResponderSmp |
GetChildBackward(
SInt32 index
)
(SFYResponder から継承)
GetChildBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetChildBackward( SInt32 index , UInt32 id ) (SFYResponder から継承) GetChildBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 背面から数えて指定された順番に位置する子レスポンダを取得します。
|
| SInt32 |
GetChildCount( Void )
(SFYResponder から継承)
GetChildCount( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetChildCount( UInt32 id ) (SFYResponder から継承) GetChildCount( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 子レスポンダの数を取得します。
|
| SFYResponderSmp |
GetChildForward(
SInt32 index
)
(SFYResponder から継承)
GetChildForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetChildForward( SInt32 index , UInt32 id ) (SFYResponder から継承) GetChildForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 前面から数えて指定された順番に位置する子レスポンダを取得します。
|
| SFYResponderSmp |
GetChildFront( Void )
(SFYResponder から継承)
GetChildFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetChildFront( UInt32 id ) (SFYResponder から継承) GetChildFront( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 最前面に位置する子レスポンダを取得します。
|
| SInt32 |
GetCurrentValue( Void )
(SFYControl から継承)
コントロールの現在値を取得します。
|
| SFYDistributerPtr |
GetDistributer( Void )
(SFYResponder から継承)
配信エンジンを取得します。
|
| SFXRectangle |
GetGlobalBound( Void )
(SFYResponder から継承)
グローバル領域を取得します。
|
| UInt32 |
GetID( Void )
(SFYResponder から継承)
ID を取得します。
|
| SFXRectangle |
GetLocalBound( Void )
(SFYResponder から継承)
ローカル領域を取得します。
|
| SInt32 |
GetMaximumValue( Void )
(SFYControl から継承)
コントロールの最大値を取得します。
|
| SInt32 |
GetMinimumValue( Void )
(SFYControl から継承)
コントロールの最小値を取得します。
|
| SInt32 |
GetNthBackward( Void )
(SFYResponder から継承)
GetNthBackward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetNthBackward( UInt32 id ) (SFYResponder から継承) GetNthBackward( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが背面から数えて何番目に位置するかを取得します。
|
| SInt32 |
GetNthForward( Void )
(SFYResponder から継承)
GetNthForward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) GetNthForward( UInt32 id ) (SFYResponder から継承) GetNthForward( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが前面から数えて何番目に位置するかを取得します。
|
| SFYResponderSmp |
GetParent( Void )
(SFYResponder から継承)
親レスポンダを取得します。
|
| Bool |
GetPropertyTransparent( Void )
(SFYResponder から継承)
透過属性を取得します。
|
| SFXRectangleConstRef |
GetRealBound( Void )
(SFYResponder から継承)
実領域を取得します。
|
| VoidPtr |
GetReference( Void )
(SFYResponder から継承)
リファレンス値を取得します。
|
| SFYRendererPtr |
GetRenderer( Void )
(SFYResponder から継承)
描画エンジンを取得します。
|
| SFYResponderSmp |
GetRoot( Void )
(SFYResponder から継承)
ルートレスポンダを取得します。
|
| Bool |
GetStateActive(
Bool inherit = false
)
(SFYResponder から継承)
活性状態を取得します。
|
| Bool |
GetStateEnable(
Bool inherit = false
)
(SFYResponder から継承)
操作可能状態を取得します。
|
| Bool |
GetStateFocus(
Bool inherit = false
)
(SFYResponder から継承)
フォーカス状態を取得します。
|
| Bool |
GetStateVisible(
Bool inherit = false
)
(SFYResponder から継承)
可視状態を取得します。
|
| SFXRectangle |
GetSuitableBound( Void )
(SFYResponder から継承)
GetSuitableBound( SFXRectangleConstRef param ) (SFYResponder から継承) 最適な大きさを取得します。
|
| SFXMargin |
GetSuitableMargin( Void )
(SFYResponder から継承)
最適な余白を取得します。
|
| SFCType |
GetType( Void )
(SFYResponder から継承)
タイプを取得します。
|
| SFXRectangleConstRef |
GetVirtualBound( Void )
(SFYResponder から継承)
仮想領域を取得します。
|
| Void |
Initialize( Void )
(SFYResponder から継承)
レスポンダを初期化します。
|
| Void |
Invalidate( Void )
(SFYResponder から継承)
Invalidate( SFXRectangleConstRef param ) (SFYResponder から継承) 再描画領域を登録します。
|
| Void |
InvokeBackward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(SFYResponder から継承)
レスポンダにイベントを送信します。ハンドラ関数はハンドラリストに登録された順序で呼び出されます。
|
| Void |
InvokeForward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(SFYResponder から継承)
レスポンダにイベントを送信します。ハンドラ関数はハンドラリストに登録された逆順で呼び出されます。
|
| Bool |
IsBack( Void )
(SFYResponder から継承)
IsBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) IsBack( UInt32 id ) (SFYResponder から継承) IsBack( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが最背面に位置するかどうかを判定します。
|
| Bool |
IsFront( Void )
(SFYResponder から継承)
IsFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) IsFront( UInt32 id ) (SFYResponder から継承) IsFront( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが最前面に位置するかどうかを判定します。
|
| Bool |
IsNthBackward(
SInt32 index
)
(SFYResponder から継承)
IsNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) IsNthBackward( SInt32 index , UInt32 id ) (SFYResponder から継承) IsNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが背面から数えて指定された順番に位置するかどうかを判定します。
|
| Bool |
IsNthForward(
SInt32 index
)
(SFYResponder から継承)
IsNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) IsNthForward( SInt32 index , UInt32 id ) (SFYResponder から継承) IsNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダが前面から数えて指定された順番に位置するかどうかを判定します。
|
| Bool |
IsRoot( Void )
(SFYResponder から継承)
自レスポンダがルートレスポンダかどうかを判定します。
|
| SFCError |
RegisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(SFYResponder から継承)
RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (SFYResponder から継承) RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (SFYResponder から継承) RegisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (SFYResponder から継承) ハンドラを登録します。
|
| SFCError |
RegisterTracer(
SFXEventRangeConstRef range
, SFYTracer::RuleRecConstRef rule
)
(SFYResponder から継承)
RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::OrderEnumConstPtr order , SFYTracer::StateEnumConstPtr state , BoolConstPtr overload , SInt32 length ) (SFYResponder から継承) RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::RuleRecConstPtr rule , SInt32 length ) (SFYResponder から継承) RegisterTracer( SFXEventRangeConstRef range , SFYTracer::OrderEnum order , SFYTracer::StateEnum state , Bool overload ) (SFYResponder から継承) トレーサを登録します。
|
| SFCError |
Render(
Bool force = false
)
(SFYResponder から継承)
描画エンジンを起動して再描画します。
|
| Void |
SetBackgroundColor(
SFXRGBColorConstRef param
)
(SFYWidget から継承)
背景の色を設定します。
|
| Void |
SetCurrentValue(
SInt32 param
)
(SFYControl から継承)
コントロールの現在値を設定します。
|
| Void |
SetDistributer(
SFYDistributerPtr param
)
(SFYResponder から継承)
配信エンジンを設定します。
|
| Void |
SetID(
UInt32 param
)
(SFYResponder から継承)
ID を設定します。
|
| Void |
SetMaximumValue(
SInt32 param
)
(SFYControl から継承)
コントロールの最大値を設定します。
|
| Void |
SetMinimumValue(
SInt32 param
)
(SFYControl から継承)
コントロールの最小値を設定します。
|
| SFCError |
SetParent(
SFYResponderSmpConstRef param
)
(SFYResponder から継承)
親レスポンダを設定します。
|
| Void |
SetProperty(
Bool transparent
)
(SFYResponder から継承)
属性をまとめて設定します。
|
| Void |
SetPropertyTransparent(
Bool param
)
(SFYResponder から継承)
透過属性を設定します。
|
| Void |
SetRealBound(
SFXRectangleConstRef param
)
(SFYResponder から継承)
実領域を設定します。
|
| Void |
SetReference(
VoidPtr param
)
(SFYResponder から継承)
リファレンス値を設定します。
|
| Void |
SetRenderer(
SFYRendererPtr param
)
(SFYResponder から継承)
描画エンジンを設定します。
|
| Void |
SetState(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(SFYResponder から継承)
状態をまとめて設定します。
|
| Void |
SetStateActive(
Bool param
)
(SFYResponder から継承)
活性状態を設定します。
|
| Void |
SetStateEnable(
Bool param
)
(SFYResponder から継承)
操作可能状態を設定します。
|
| Void |
SetStateFocus(
Bool param
)
(SFYResponder から継承)
フォーカス状態を設定します。
|
| Void |
SetStateVisible(
Bool param
)
(SFYResponder から継承)
可視状態を設定します。
|
| Void |
SetVirtualBound(
SFXRectangleConstRef param
)
(SFYResponder から継承)
仮想領域を設定します。
|
| Void |
Terminate( Void )
(SFYResponder から継承)
レスポンダの終了処理をします。
|
| Void |
ToBack( Void )
(SFYResponder から継承)
ToBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) ToBack( UInt32 id ) (SFYResponder から継承) ToBack( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダを姉妹レスポンダのなかで最背面に移動します。
|
| Void |
ToFront( Void )
(SFYResponder から継承)
ToFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) ToFront( UInt32 id ) (SFYResponder から継承) ToFront( Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダを姉妹レスポンダのなかで最前面に移動します。
|
| Void |
ToNthBackward(
SInt32 index
)
(SFYResponder から継承)
ToNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) ToNthBackward( SInt32 index , UInt32 id ) (SFYResponder から継承) ToNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダを背面から数えて指定された順番に移動します。
|
| Void |
ToNthForward(
SInt32 index
)
(SFYResponder から継承)
ToNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) ToNthForward( SInt32 index , UInt32 id ) (SFYResponder から継承) ToNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (SFYResponder から継承) 自レスポンダを前面から数えて指定された順番に移動します。
|
| Void |
UnregisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(SFYResponder から継承)
UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (SFYResponder から継承) UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (SFYResponder から継承) UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (SFYResponder から継承) ハンドラの登録を解除します。
|
| Void |
UnregisterTracer(
SFXEventRangeConstRef range
)
(SFYResponder から継承)
UnregisterTracer( SFXEventRangeConstPtr range , SInt32 length ) (SFYResponder から継承) トレーサの登録を解除します。
|
| T const & |
static_catch(
Void
)
(static_exception から継承)
現在保持している例外を取得します。
|
| プロテクト関数 | |
|---|---|
| Void |
DoneNotifyHandler(
DoneNotifyConstRef notify
) [ハンドラ] レンダリングの終了を通知します。
|
| Void |
FocusNotifyHandler(
FocusNotifyConstRef notify
) [ハンドラ] カーソルの移動を通知します。
|
| Void |
JumpNotifyHandler(
JumpNotifyConstRef notify
) [ハンドラ] リンクが押されたことを通知します。
|
| Bool |
ResponseNotifyHandler(
ResponseNotifyConstRef notify
) [ハンドラ] サーバーへの接続が完了したことを通知します。
|
| static SFYResponderSmp |
Factory(
SFYResponderPtr responder
, SFCErrorPtr exception = null
)
(SFYResponder から継承)
NewInstance 関数の実装を補助します。
|
| SFYResponderSmp |
GetThis( Void )
(SFYResponder から継承)
スマートポインタで保持された this を取得します。
|
| Void |
HandleBoundGlobal(
SFXRectangleConstRef rectangle
)
(SFYWidget から継承)
グローバル領域の変更処理を行います。
|
| Void |
HandleBoundOptimize(
SFXRectanglePtr rectangle
)
(SFYWidget から継承)
指定した矩形に収まる範囲内で最適なサイズを計算します。
|
| Void |
HandleBoundReal( Void )
(SFYControl から継承)
実領域の変更処理を行います。
|
| Void |
HandleBoundRequest(
SFXRectanglePtr rectangle
)
(SFYWidget から継承)
最適な矩形を計算します。
|
| Void |
HandleBoundVirtual( Void )
(SFYWidget から継承)
仮想領域の変更処理を行います。
|
| Void |
HandleRenderRequest(
SFXGraphicsPtr graphics
)
(SFYWidget から継承)
レスポンダを描画します。
|
| Void |
SetType(
SFCType param
)
(SFYResponder から継承)
タイプを設定します。
|
| Void |
static_throw(
static_exception< T > const & param
)
(static_exception から継承)
static_throw( T const & param ) (static_exception から継承) 例外を設定します。
|
| Bool |
static_try(
Void
)
(static_exception から継承)
例外が保持されているかどうかを確かめます。
|
| 型 |
|---|
|
DEFAULT
パラメータの初期値に関する列挙型です。
|
|
DoneNotify
レンダリング終了時の情報を保持するためのクラスです。
|
|
FocusNotify
ブラウザのフォーカス移動情報を保持するためのクラスです。
|
|
HistoryEntry
履歴の項目を表す構造体です。
|
|
JumpNotify
ブラウザで押されたリンクの情報を保持するためのクラスです。
|
|
ResponseNotify
レンダリング終了時の情報を保持するためのクラスです。
|
|
CodeEnum
(SFYControl から継承)
SFYControl クラスを表す定数です。
|
[ protected, explicit ] SFZTabControl(Void);
[ public, virtual ] ~SFZWebBrowserControl(Void);
通信、 HTML のレンダリングを中断し、内部で確保した全てのリソースを解放します。
[ public ] SFCError ClearHistory(Void);
SFERR_NO_ERROR を返します。
現在の履歴番号は 0 に戻ります。
[ protected, virtual ] Void DoneNotifyHandler( DoneNotifyConstRef notify // 通知情報 );
通知情報です。 HTTP のレスポンス コード、 BREW のエラーコードを取得できます。
標準の実装では、何も処理しません。
何か処理するには、SFZWebBrowserControl::DoneNotifyHandler 関数をオーバーロードする必要があります。
SFZWebBrowserControl::ResponseNotifyHandler とは呼び出されるタイミングが異なります。
オーバーロードして利用する例です。
#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) {
// 通信エラーならエラーダイアログを表示する
ErrorDialog(notify.GetErrorCode());
}
else if (WEB_SUCCEEDED(notify.GetDoneCode())) {
// HTTP エラーなら警告ダイアログを表示する
WarningDialog(notify.GetResposenCode());
}
}
};
SFZWebBrowserControl::DoneNotify | SFZWebBrowserControl::FocusNotifyHandler | SFZWebBrowserControl::JumpNotifyHandler | SFZWebBrowserControl::ResponseNotifyHandler
[ public, const ] SInt32 FindElement( ACharConstPtr element // 検索する要素名 SInt32 no // 取得する要素の番号 );
検索する要素名を設定します。
検索する要素の何番目の位置を取得するかを設定します。
0 を指定すると、 element と一致する最初の要素の位置を返します。 n を指定すると、 element と一致する n + 1 番目の要素の位置を返します。
見つかった要素の位置を返します。 見つからなければ負の値を返します。
現在表示しているページから、指定した要素を検索します。 戻り値(要素の位置)は、SFZWebBrowserControl::GetElementText 関数や SFZWebBrowserControl::GetElementAttribute 関数で使います。
[ protected, virtual ] Void FocusNotifyHandler( FocusNotifyConstRef notify // 通知情報 );
通知情報です。 現在カーソルがあたっているタグの位置、種類、状態を取得できます。
標準の関数では、何も処理しません。
何か処理するには、SFZWebBrowserControl::FocusNotifyHandler 関数をオーバーロードする必要があります。
SFZWebBrowserControl::FocusNotify | SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::JumpNotifyHandler | SFZWebBrowserControl::ResponseNotifyHandler
[ public, const ] HistoryEntry GetCurrentHistory(Void);
現在表示しているページの履歴内容を返します。
[ public, const ] UInt32 GetCurrentHistoryIndex(Void);
現在表示しているページの履歴番号を返します。
SFZWebBrowserControl::Move 関数、 SFZWebBrowserControl::Previous 関数、 SFZWebBrowserControl::Next 関数で増減し、 SFZWebBrowserControl::ClearHistory 関数で 0 に初期化されます。
SFZWebBrowserControl::Move | SFZWebBrowserControl::Previous | SFZWebBrowserControl::Next | SFZWebBrowserControl::ClearHistory
[ public, const ] SFXAnsiString GetElementAttribute( SInt32 elementIndex // 要素の位置 ACharConstPtr attr // 属性名 );
要素の位置を指定します。 この引数には、 SFZWebBrowserControl::FindElement 関数の戻り値を指定します。
属性名を指定します。
属性の内容を返します。指定の属性が見付からなければ空文字列を返します。
現在表示しているページから、指定の要素の属性を取得します。 指定の属性が見付からなければ空文字列を返します。
![]() |
値がない属性の取扱い |
|---|---|
<HR NOSHADE> のように、値が設定されていない属性がある要素で、 NOSHADE 属性の内容を取得すると、 戻り値は属性名と同じ "NOSHADE" 文字列となります。 | |
[ public, const ] SFXAnsiString GetElementText( SInt32 elementIndex // 要素の位置 );
要素の位置を指定します。 この引数には、 SFZWebBrowserControl::FindElement 関数の戻り値を指定します。
要素の内容を返します。要素の中身がない場合は空文字列を返します。
現在表示しているページから、指定の要素の内容を取得します。
[ public, const ]
HistoryEntry GetHistory(
UInt32 historyIndex = 0 // 履歴番号
);履歴番号を指定します。 指定しなければ、履歴番号 0 番(最後に訪れた履歴内容)になります。
履歴内容を返します。 履歴情報がない、もしくは無効な履歴番号を指定した場合は、 履歴構造体 SFZWebBrowserControl::HistoryEntry の url 変数の値は空文字列に設定されます。
[ public, const ] HistoryEntryConstPtr GetHistoryList(Void);
履歴リストへのポインタです。
履歴リストは SFZWebBrowserControl::HistoryEntry 構造体の配列です。そのサイズは SFZWebBrowserControl::GetHistorySize 関数で取得できます。
配列の先頭は一番新しい履歴となっており、履歴番号と配列のインデックスは一致します。
履歴情報が設定されていない部分は、履歴構造体 SFZWebBrowserControl::HistoryEntry の url 変数は空文字列に設定されます。
![]() |
使用上の注意 |
|---|---|
履歴リストの内容は書き換えてはいけません。 | |
デバッグ用に全履歴のタイトルと URL を表示します。
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);
履歴リストのエントリ数を返します。
SFZWebBrowserControl::Move 関数や SFZWebBrowserControl::GetHistory 関数など で使用する履歴番号は、履歴リストのエントリ数より小さな値である必要があります。
※ 履歴リストは SFZWebBrowserControl::GetHistoryList 関数を使って取得できます。
SFZWebBrowserControl::GetHistory | SFZWebBrowserControl::GetHistoryList | SFZWebBrowserControl::Move | SFZWebBrowserControl::SetHistorySize
[ public, const ] SInt32 GetIndent(Void);
インデントの幅を返します。( 単位 : ピクセル )
[ public, const ] SFXRGBColor GetLinkColor(Void);
リンク文字列の表示色を返します。
[ public, const ] SInt32 GetParagraphSpacing(Void);
段落間の行間の長さを返します。( 単位 : ピクセル )
[ public, const ] SInt32 GetScrollbarWidth(Void);
設定されているスクロールバーの幅を返します。( 単位 : ピクセル )
[ public, const ] SFXRGBColor GetTextColor(Void);
HTML 表示の本文の表示色を返します。
[ public, const ] SFBWebSmpConstRef GetWeb(Void);
SFZWebBrowserControl::SetWeb 関数で設定された IWeb インターフェースを返します。 IWeb インターフェースが設定されていない場合は、null を返します。
![]() |
WebOpt 指定時の注意 |
|---|---|
|
他の用途で利用するまでは、IWeb インターフェースに設定した WebOpt データを保持する必要があります。 詳しくは、BREW API リファレンス、IWeb インターフェースの「 WEBOPT の寿命に関する注意事項 」を参照してください。 | |
![]() |
サスペンド時の振る舞い |
|---|---|
|
サスペンドしたとき、WebOpt の情報はリセットされ IWeb インターフェースを内部で作成する設定(デフォルト状態)に戻ります。 サスペンド前の IWeb インターフェースを使うには、レジューム時に WebOpt データを再設定する必要があります。 | |
[ public, const ] Bool IsBusy(Void);
[ public, const ] Bool IsInlineEditEnable(Void);
[ public, const ] Bool IsScrollbarEnable(Void);
[ protected, virtual ] Void JumpNotifyHandler( JumpNotifyConstRef notify // 通知情報 );
通知情報を返します。 押されたリンクのリンク先 URL、 HTTP メソッド、 POST データを保持しています。
リンク先の url を自動的に Open します。
リンクが http://、https://、file://、res: 以外のスキームのときは何もしません。
標準以外の処理を行うときは、SFZWebBrowserControl::JumpNotifyHandler 関数をオーバーライドする必要があります。
SFZWebBrowserControl::JumpNotifyHandler 関数をオーバーライドして使うサンプルコードです。
#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:")) {
// mailto:ならメーラを呼ぶ
Mailer(notify.GetUrl());
}
else {
// それ以外なら標準ハンドラを呼ぶ
SFZWebBrowserControl::JumpNotifyHandler(notify);
}
}
};
SFZWebBrowserControl::JumpNotify | SFZWebBrowserControl::Navigate | SFZWebBrowserControl::DoneNotifyHandler | SFZWebBrowserControl::FocusNotifyHandler | SFZWebBrowserControl::ResponseNotifyHandler
[ public ] SFCError Load( SFXAnsiStringConstRef data // HTML データ );
[ public ] SFCError Load( SFXAnsiStringConstRef data // HTML データ SFXAnsiStringConstRef url // 基準となる URL );
HTML とみなす文字列です。
基準となる URL です。 HTML データ内にある相対 URL 表記は、 この引数で指定された URL からの相対パスと解釈されます。
インライン画像は取得できしだい表示されます。
![]() |
通信に関するエラー |
|---|---|
|
通信に関するエラーは戻り値では取得できません。 レンダリングの終了や、通信に関するエラーを取得する場合は、 SFZWebBrowserControl クラスを継承して、 SFZWebBrowserControl::DoneNotifyHandler 関数をオーバロードするクラスを作成する必要があります。 | |
ジャンプ先の履歴番号です。 省略時は、履歴番号 0、最新の履歴に飛びます。