当前位置: 首页>>代码示例>>C++>>正文


C++ DocumentWriter::begin方法代码示例

本文整理汇总了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();
}
开发者ID:dzhshf,项目名称:WebKit,代码行数:7,代码来源:SelectPopupClient.cpp

示例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();
}
开发者ID:dog-god,项目名称:iptv,代码行数:18,代码来源:PagePopupBlackBerry.cpp

示例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();
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:23,代码来源:MockPagePopupDriver.cpp


注:本文中的DocumentWriter::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。