本文整理汇总了C++中COMPtr::QueryInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ COMPtr::QueryInterface方法的具体用法?C++ COMPtr::QueryInterface怎么用?C++ COMPtr::QueryInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COMPtr
的用法示例。
在下文中一共展示了COMPtr::QueryInterface方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSmartInsertDeleteEnabled
void TestRunner::setSmartInsertDeleteEnabled(bool flag)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return;
COMPtr<IWebViewEditing> viewEditing;
if (FAILED(webView->QueryInterface(&viewEditing)))
return;
viewEditing->setSmartInsertDeleteEnabled(flag ? TRUE : FALSE);
}
示例2: dispatchPendingLoadRequests
void TestRunner::dispatchPendingLoadRequests()
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return;
COMPtr<IWebViewPrivate2> viewPrivate;
if (FAILED(webView->QueryInterface(&viewPrivate)))
return;
viewPrivate->dispatchPendingLoadRequests();
}
示例3: setTabKeyCyclesThroughElements
void TestRunner::setTabKeyCyclesThroughElements(bool shouldCycle)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return;
COMPtr<IWebViewPrivate> viewPrivate;
if (FAILED(webView->QueryInterface(&viewPrivate)))
return;
viewPrivate->setTabKeyCyclesThroughElements(shouldCycle ? TRUE : FALSE);
}
示例4: setDefersLoading
void TestRunner::setDefersLoading(bool defers)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return;
COMPtr<IWebViewPrivate2> viewPrivate;
if (FAILED(webView->QueryInterface(&viewPrivate)))
return;
viewPrivate->setDefersCallbacks(defers);
}
示例5: setSerializeHTTPLoads
void TestRunner::setSerializeHTTPLoads(bool serializeLoads)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return;
COMPtr<IWebViewPrivate2> viewPrivate;
if (FAILED(webView->QueryInterface(&viewPrivate)))
return;
viewPrivate->setLoadResourcesSerially(serializeLoads);
}
示例6: setWebViewEditable
void TestRunner::setWebViewEditable(bool editable)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return;
COMPtr<IWebViewEditing> viewEditing;
if (FAILED(webView->QueryInterface(&viewEditing)))
return;
viewEditing->setEditable(editable);
}
示例7: setSelectTrailingWhitespaceEnabled
void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return;
COMPtr<IWebViewEditing> viewEditing;
if (FAILED(webView->QueryInterface(&viewEditing)))
return;
viewEditing->setSelectTrailingWhitespaceEnabled(flag ? TRUE : FALSE);
}
示例8: editingDelegate
LayoutTestController::~LayoutTestController()
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return;
// reset webview-related states back to default values in preparation for next test
COMPtr<IWebViewPrivate> viewPrivate;
if (SUCCEEDED(webView->QueryInterface(&viewPrivate)))
viewPrivate->setTabKeyCyclesThroughElements(TRUE);
COMPtr<IWebViewEditing> viewEditing;
if (FAILED(webView->QueryInterface(&viewEditing)))
return;
COMPtr<IWebEditingDelegate> delegate;
if (FAILED(viewEditing->editingDelegate(&delegate)))
return;
COMPtr<EditingDelegate> editingDelegate(Query, viewEditing.get());
if (editingDelegate)
editingDelegate->setAcceptsEditing(TRUE);
}
示例9: form
HRESULT DOMHTMLTextAreaElement::form(_COM_Outptr_opt_ IDOMHTMLElement** result)
{
if (!result)
return E_POINTER;
*result = nullptr;
ASSERT(is<HTMLTextAreaElement>(m_element));
HTMLTextAreaElement& textareaElement = downcast<HTMLTextAreaElement>(*m_element);
COMPtr<IDOMElement> domElement;
domElement.adoptRef(DOMHTMLElement::createInstance(textareaElement.form()));
if (domElement)
return domElement->QueryInterface(IID_IDOMHTMLElement, (void**) result);
return E_FAIL;
}
示例10: textZoomOutCallback
static JSValueRef textZoomOutCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return JSValueMakeUndefined(context);
COMPtr<IWebIBActions> webIBActions;
if (FAILED(webView->QueryInterface(IID_IWebIBActions, (void**)&webIBActions)))
return JSValueMakeUndefined(context);
webIBActions->makeTextSmaller(0);
return JSValueMakeUndefined(context);
}
示例11: shouldInterruptJavaScript
bool WebChromeClient::shouldInterruptJavaScript()
{
COMPtr<IWebUIDelegate> uiDelegate;
if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
COMPtr<IWebUIDelegatePrivate> uiPrivate;
if (SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**)&uiPrivate))) {
BOOL result;
if (SUCCEEDED(uiPrivate->webViewShouldInterruptJavaScript(m_webView, &result)))
return !!result;
}
}
return false;
}
示例12: invoke
bool ReloadItem::invoke() const
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return false;
COMPtr<IWebIBActions> webActions;
if (FAILED(webView->QueryInterface(&webActions)))
return false;
webActions->reload(0);
return true;
}
示例13: execCommand
void TestRunner::execCommand(JSStringRef name, JSStringRef value)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return;
COMPtr<IWebViewPrivate2> viewPrivate;
if (FAILED(webView->QueryInterface(&viewPrivate)))
return;
_bstr_t nameBSTR(JSStringCopyBSTR(name), false);
_bstr_t valueBSTR(JSStringCopyBSTR(value), false);
viewPrivate->executeCoreCommandByName(nameBSTR, valueBSTR);
}
示例14: body
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::body(
/* [retval][out] */ IDOMHTMLElement** bodyElement)
{
*bodyElement = nullptr;
if (!is<HTMLDocument>(m_document))
return E_FAIL;
HTMLDocument& htmlDoc = downcast<HTMLDocument>(*m_document);
COMPtr<IDOMElement> domElement;
domElement.adoptRef(DOMHTMLElement::createInstance(htmlDoc.body()));
if (domElement)
return domElement->QueryInterface(IID_IDOMHTMLElement, (void**) bodyElement);
return E_FAIL;
}
示例15: callShouldCloseOnWebView
bool LayoutTestController::callShouldCloseOnWebView()
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
return false;
COMPtr<IWebViewPrivate> viewPrivate;
if (FAILED(webView->QueryInterface(&viewPrivate)))
return false;
BOOL result;
viewPrivate->shouldClose(&result);
return result;
}