本文整理汇总了C++中DocumentWriter::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ DocumentWriter::begin方法的具体用法?C++ DocumentWriter::begin怎么用?C++ DocumentWriter::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentWriter
的用法示例。
在下文中一共展示了DocumentWriter::begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeDocument
void SelectPopupClient::writeDocument(DocumentWriter& writer)
{
writer.setMIMEType("text/html");
writer.begin(KURL());
writer.addData(m_source.utf8().data(), m_source.utf8().length());
writer.end();
}
示例2: generateHTML
void PagePopupBlackBerry::generateHTML(WebPage* webpage)
{
DocumentWriter* writer = webpage->d->mainFrame()->loader()->activeDocumentLoader()->writer();
writer->setMIMEType("text/html");
writer->begin(KURL());
// All the popups have the same html head and the page content should be non-zoomable.
StringBuilder source;
// FIXME: the hardcoding padding will be removed soon.
int screenWidth = webpage->d->screenSize().width() - PADDING;
source.appendLiteral("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n");
source.append("<meta name=\"viewport\" content=\"width=" + String::number(screenWidth));
source.appendLiteral(", user-scalable=no\" />\n");
writer->addData(source.toString().utf8().data(), source.toString().utf8().length());
m_client->writeDocument(*writer);
writer->end();
}
示例3: MockPagePopup
inline MockPagePopup::MockPagePopup(PagePopupClient* client, const IntRect& originBoundsInRootView, Frame* mainFrame)
: m_popupClient(client)
, m_closeTimer(this, &MockPagePopup::close)
{
Document* document = mainFrame->document();
m_iframe = HTMLIFrameElement::create(HTMLNames::iframeTag, document);
m_iframe->setIdAttribute("mock-page-popup");
m_iframe->setInlineStyleProperty(CSSPropertyBorderWidth, 0.0, CSSPrimitiveValue::CSS_PX);
m_iframe->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute);
m_iframe->setInlineStyleProperty(CSSPropertyLeft, originBoundsInRootView.x(), CSSPrimitiveValue::CSS_PX, true);
m_iframe->setInlineStyleProperty(CSSPropertyTop, originBoundsInRootView.maxY(), CSSPrimitiveValue::CSS_PX, true);
if (document->body())
document->body()->appendChild(m_iframe.get());
Frame* contentFrame = m_iframe->contentFrame();
DocumentWriter* writer = contentFrame->loader()->activeDocumentLoader()->writer();
writer->setMIMEType("text/html");
writer->setEncoding("UTF-8", false);
writer->begin();
const char scriptToSetUpPagePopupController[] = "<script>window.pagePopupController = parent.internals.pagePopupController;</script>";
writer->addData(scriptToSetUpPagePopupController, sizeof(scriptToSetUpPagePopupController));
m_popupClient->writeDocument(*writer);
writer->end();
}