WebView2 日本語リファレンス
WebView2インターフェース › ICoreWebView2DownloadOperation

ICoreWebView2DownloadOperation

COM
IID3d6b6cf2-afe1-44c7-a995-c65117714336継承元IUnknown自前メソッド開始 vtbl3

メソッド 19

vtbl = vtable インデックス(0始まり)。HSP等からインデックス指定でCOMメソッドを呼ぶ際に使用します。0〜2 は IUnknown。

vtbl 3 HRESULT add_BytesReceivedChanged(ICoreWebView2BytesReceivedChangedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2BytesReceivedChangedEventHandler*in受信済みバイト数が変化したときに呼び出されるイベントハンドラへのポインタである。
tokenEventRegistrationToken*out登録したハンドラを後で解除するための EventRegistrationToken を受け取るポインタである。
vtbl 4 HRESULT remove_BytesReceivedChanged(EventRegistrationToken token)
tokenEventRegistrationTokeninadd 時に取得した、解除対象のイベント登録を識別する EventRegistrationToken を指定する。
vtbl 5 HRESULT add_EstimatedEndTimeChanged(ICoreWebView2EstimatedEndTimeChangedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2EstimatedEndTimeChangedEventHandler*in推定完了時刻が変化したときに呼び出されるイベントハンドラへのポインタである。
tokenEventRegistrationToken*out登録したハンドラを後で解除するための EventRegistrationToken を受け取るポインタである。
vtbl 6 HRESULT remove_EstimatedEndTimeChanged(EventRegistrationToken token)
tokenEventRegistrationTokeninadd 時に取得した、解除対象のイベント登録を識別する EventRegistrationToken を指定する。
vtbl 7 HRESULT add_StateChanged(ICoreWebView2StateChangedEventHandler* eventHandler, EventRegistrationToken* token)
eventHandlerICoreWebView2StateChangedEventHandler*inダウンロードの状態が変化したときに呼び出されるイベントハンドラへのポインタである。
tokenEventRegistrationToken*out登録したハンドラを後で解除するための EventRegistrationToken を受け取るポインタである。
vtbl 8 HRESULT remove_StateChanged(EventRegistrationToken token)
tokenEventRegistrationTokeninadd 時に取得した、解除対象のイベント登録を識別する EventRegistrationToken を指定する。
vtbl 9 HRESULT get_Uri(LPWSTR* uri)
uriLPWSTR*outダウンロード元の URI を受け取る LPWSTR へのポインタである。呼び出し側が CoTaskMemFree で解放する。
vtbl 10 HRESULT get_ContentDisposition(LPWSTR* contentDisposition)
contentDispositionLPWSTR*out応答の Content-Disposition ヘッダの値を受け取る LPWSTR へのポインタである。呼び出し側が CoTaskMemFree で解放する。
vtbl 11 HRESULT get_MimeType(LPWSTR* mimeType)
mimeTypeLPWSTR*outダウンロードされるコンテンツの MIME タイプを受け取る LPWSTR へのポインタである。呼び出し側が CoTaskMemFree で解放する。
vtbl 12 HRESULT get_TotalBytesToReceive(LONGLONG* totalBytesToReceive)
totalBytesToReceiveLONGLONG*outダウンロード対象の総バイト数を受け取る LONGLONG へのポインタである。不明な場合は -1 となる。
vtbl 13 HRESULT get_BytesReceived(LONGLONG* bytesReceived)
bytesReceivedLONGLONG*outこれまでに受信したバイト数を受け取る LONGLONG へのポインタである。
vtbl 14 HRESULT get_EstimatedEndTime(LPWSTR* estimatedEndTime)
estimatedEndTimeLPWSTR*outダウンロード完了の推定時刻を ISO 8601 形式の文字列として受け取る LPWSTR へのポインタである。呼び出し側が CoTaskMemFree で解放する。
vtbl 15 HRESULT get_ResultFilePath(LPWSTR* resultFilePath)
resultFilePathLPWSTR*outダウンロード先の絶対ファイルパスを受け取る LPWSTR へのポインタである。呼び出し側が CoTaskMemFree で解放する。
vtbl 16 HRESULT get_State(COREWEBVIEW2_DOWNLOAD_STATE* downloadState)
downloadStateCOREWEBVIEW2_DOWNLOAD_STATE*outダウンロードの現在の状態を受け取る COREWEBVIEW2_DOWNLOAD_STATE へのポインタである。
vtbl 17 HRESULT get_InterruptReason(COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON* interruptReason)
interruptReasonCOREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON*outダウンロードが中断された理由を受け取る COREWEBVIEW2_DOWNLOAD_INTERRUPT_REASON へのポインタである。
vtbl 18 HRESULT Cancel( void)
voidin引数はない。
vtbl 19 HRESULT Pause( void)
voidin引数はない。
vtbl 20 HRESULT Resume( void)
voidin引数はない。
vtbl 21 HRESULT get_CanResume(BOOL* canResume)
canResumeBOOL*out中断されたダウンロードを再開可能か否かを受け取る BOOL へのポインタである。

HSP用 COM定義

#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。WebView2 のインターフェースは環境/ローダ経由で取得するため #usecom 末尾は "{}"

出力引数:
#define global IID_ICoreWebView2DownloadOperation "{3D6B6CF2-AFE1-44C7-A995-C65117714336}"
#usecom global ICoreWebView2DownloadOperation IID_ICoreWebView2DownloadOperation "{}"
#comfunc global ICoreWebView2DownloadOperation_add_BytesReceivedChanged        3 sptr,var
#comfunc global ICoreWebView2DownloadOperation_remove_BytesReceivedChanged     4 int
#comfunc global ICoreWebView2DownloadOperation_add_EstimatedEndTimeChanged     5 sptr,var
#comfunc global ICoreWebView2DownloadOperation_remove_EstimatedEndTimeChanged  6 int
#comfunc global ICoreWebView2DownloadOperation_add_StateChanged                7 sptr,var
#comfunc global ICoreWebView2DownloadOperation_remove_StateChanged             8 int
#comfunc global ICoreWebView2DownloadOperation_get_Uri                         9 var
#comfunc global ICoreWebView2DownloadOperation_get_ContentDisposition          10 var
#comfunc global ICoreWebView2DownloadOperation_get_MimeType                    11 var
#comfunc global ICoreWebView2DownloadOperation_get_TotalBytesToReceive         12 var
#comfunc global ICoreWebView2DownloadOperation_get_BytesReceived               13 var
#comfunc global ICoreWebView2DownloadOperation_get_EstimatedEndTime            14 var
#comfunc global ICoreWebView2DownloadOperation_get_ResultFilePath              15 var
#comfunc global ICoreWebView2DownloadOperation_get_State                       16 var
#comfunc global ICoreWebView2DownloadOperation_get_InterruptReason             17 var
#comfunc global ICoreWebView2DownloadOperation_Cancel                          18 int
#comfunc global ICoreWebView2DownloadOperation_Pause                           19 int
#comfunc global ICoreWebView2DownloadOperation_Resume                          20 int
#comfunc global ICoreWebView2DownloadOperation_get_CanResume                   21 var
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。