本文整理汇总了C++中KHTMLPart::javaEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ KHTMLPart::javaEnabled方法的具体用法?C++ KHTMLPart::javaEnabled怎么用?C++ KHTMLPart::javaEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KHTMLPart
的用法示例。
在下文中一共展示了KHTMLPart::javaEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getDocument
KJS::Bindings::Instance *HTMLAppletElementImpl::getAppletInstance() const
{
KHTMLPart* part = getDocument()->part();
if (!part || !part->javaEnabled())
return 0;
if (appletInstance)
return appletInstance;
RenderApplet *r = static_cast<RenderApplet*>(m_render);
if (r) {
r->createWidgetIfNecessary();
if (r->widget()){
// Call into the part (and over the bridge) to pull the Bindings::Instance
// from the guts of the plugin.
void *_view = r->widget()->getView();
appletInstance = KWQ(part)->getAppletInstanceForView((NSView *)_view);
}
}
return appletInstance;
}
示例2: new
RenderObject *HTMLAppletElementImpl::createRenderer(RenderArena *arena, RenderStyle *style)
{
#ifndef Q_WS_QWS // FIXME(E)? I don't think this is possible with Qt Embedded...
KHTMLPart *part = getDocument()->part();
if( part && part->javaEnabled() )
{
QMap<QString, QString> args;
args.insert( "code", getAttribute(ATTR_CODE).string());
DOMString codeBase = getAttribute(ATTR_CODEBASE);
if(!codeBase.isNull())
args.insert( "codeBase", codeBase.string() );
DOMString name = getDocument()->htmlMode() != DocumentImpl::XHtml ?
getAttribute(ATTR_NAME) : getAttribute(ATTR_ID);
if(!name.isNull())
args.insert( "name", name.string() );
DOMString archive = getAttribute(ATTR_ARCHIVE);
if(!archive.isNull())
args.insert( "archive", archive.string() );
args.insert( "baseURL", getDocument()->baseURL() );
DOMString mayScript = getAttribute(ATTR_MAYSCRIPT);
if (!mayScript.isNull())
args.insert("mayScript", mayScript.string());
// Other arguments (from <PARAM> tags) are added later.
return new (getDocument()->renderArena()) RenderApplet(this, args);
}
// ### remove me. we should never show an empty applet, instead
// render the alternative content given by the webpage
return new (getDocument()->renderArena()) RenderEmptyApplet(this);
#else
return 0;
#endif
}