void MediaListImpl::setMediaText(const DOM::DOMString &value)
{
    m_lstMedia.clear();
    QString val = value.string();
    QStringList list = QStringList::split( ',', value.string() );
    for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
    {
        DOMString medium = (*it).stripWhiteSpace();
        if( medium != "" )
            m_lstMedia.append( medium );
    }
}
Example #2
0
void MetabarFunctions::toggle(DOM::DOMString item)
{
    DOM::HTMLDocument doc = m_html->htmlDocument();
    DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById(item));

    if(!node.isNull()) {
        DOM::NodeList children = node.childNodes();
        DOM::CSSStyleDeclaration style = node.style();
        DOM::DOMString expanded = node.getAttribute("expanded");

        bool isExpanded = expanded == "true";

        int height = 0;
        if(!isExpanded) {
            height = getHeight(node);
        }

        DOM::DOMString att = isExpanded ? "false" : "true";
        node.setAttribute("expanded", att);

        KConfig config("metabarrc");
        config.setGroup("General");

        if(config.readBoolEntry("AnimateResize", false)) {
            resizeMap[item.string()] = height;

            if(!timer->isActive()) {
                timer->start(RESIZE_SPEED);
            }
        }
        else {
            style.setProperty("height", QString("%1px").arg(height), CSS_PRIORITY);
        }
    }
}
Example #3
0
void MediaListImpl::setMediaText(const DOM::DOMString &value)
{
    m_lstMedia.clear();
    const QString val = value.string();
    const QStringList list = QStringList::split( ',', val );

    const QStringList::ConstIterator itEnd = list.end();

    for ( QStringList::ConstIterator it = list.begin(); it != itEnd; ++it )
    {
        const DOMString medium = (*it).stripWhiteSpace();
        if( !medium.isEmpty() )
            m_lstMedia.append( medium );
    }
}
Example #4
0
void DOMTreeView::initializeCSSInfoFromElement(const DOM::Element &element)
{
  DOM::Document doc = element.ownerDocument();
  DOM::AbstractView view = doc.defaultView();
  DOM::CSSStyleDeclaration styleDecl = view.getComputedStyle(element,
                                                             DOM::DOMString());

  unsigned long l = styleDecl.length();
  cssProperties->clear();
  cssProperties->setEnabled(true);
  QList<QTreeWidgetItem *> items;
  for (unsigned long i = 0; i < l; ++i) {
    DOM::DOMString name = styleDecl.item(i);
    DOM::DOMString value = styleDecl.getPropertyValue(name);

    QStringList values;
    values.append(name.string());
    values.append(value.string());
    items.append(new QTreeWidgetItem(static_cast<QTreeWidget*>(0), values));
  }

  cssProperties->insertTopLevelItems(0, items);
  cssProperties->resizeColumnToContents(0);
}
void XBLDocumentImpl::setPrototypeBinding(const DOM::DOMString& id, XBLPrototypeBinding* binding)
{
    m_prototypeBindingTable.replace(id.string(), binding);
}