コード例 #1
0
void DataTransfer::setDragImage(Element* image, int x, int y) {
  ASSERT(image);

  if (!isForDragAndDrop())
    return;

  IntPoint location(x, y);
  if (isHTMLImageElement(*image) && !image->isConnected())
    setDragImageResource(toHTMLImageElement(*image).cachedImage(), location);
  else
    setDragImageElement(image, location);
}
コード例 #2
0
ファイル: Clipboard.cpp プロジェクト: 1833183060/wke
void Clipboard::setDropEffect(const String &effect)
{
    if (!isForDragAndDrop())
        return;

    // The attribute must ignore any attempts to set it to a value other than none, copy, link, and move. 
    if (effect != "none" && effect != "copy"  && effect != "link" && effect != "move")
        return;

    if (m_policy == ClipboardReadable || m_policy == ClipboardTypesReadable)
        m_dropEffect = effect;
}
コード例 #3
0
void DataTransfer::setDropEffect(const String &effect)
{
    if (!isForDragAndDrop())
        return;

    // The attribute must ignore any attempts to set it to a value other than none, copy, link, and move.
    if (effect != "none" && effect != "copy"  && effect != "link" && effect != "move")
        return;

    // FIXME: The spec actually allows this in all circumstances, even though there's no point in
    // setting the drop effect when this condition is not true.
    if (canReadTypes())
        m_dropEffect = effect;
}
コード例 #4
0
void DataTransfer::setDragImage(Element* image, int x, int y, ExceptionState& exceptionState)
{
    if (!isForDragAndDrop())
        return;

    if (!image) {
        exceptionState.throwTypeError("setDragImage: Invalid first argument");
        return;
    }
    IntPoint location(x, y);
    if (isHTMLImageElement(*image) && !image->inDocument())
        setDragImageResource(toHTMLImageElement(*image).cachedImage(), location);
    else
        setDragImageElement(image, location);
}
コード例 #5
0
void ClipboardQt::clearData(const String& type)
{
    if (policy() != ClipboardWritable)
        return;

    if (m_writableData) {
        m_writableData->removeFormat(type);
        if (m_writableData->formats().isEmpty()) {
            if (isForDragAndDrop())
                delete m_writableData;
            m_writableData = 0;
        }
    }
#ifndef QT_NO_CLIPBOARD
    if (isForCopyAndPaste())
        QApplication::clipboard()->setMimeData(m_writableData);
#endif
}
コード例 #6
0
void DataTransfer::setEffectAllowed(const String& effect) {
  if (!isForDragAndDrop())
    return;

  if (convertEffectAllowedToDragOperation(effect) == DragOperationPrivate) {
    // This means that there was no conversion, and the effectAllowed that
    // we are passed isn't a valid effectAllowed, so we should ignore it,
    // and not set m_effectAllowed.

    // The attribute must ignore any attempts to set it to a value other than
    // none, copy, copyLink, copyMove, link, linkMove, move, all, and
    // uninitialized.
    return;
  }

  if (canWriteData())
    m_effectAllowed = effect;
}
コード例 #7
0
ファイル: Clipboard.cpp プロジェクト: 1833183060/wke
void Clipboard::setEffectAllowed(const String &effect)
{
    if (!isForDragAndDrop())
        return;

    if (dragOpFromIEOp(effect) == DragOperationPrivate) {
        // This means that there was no conversion, and the effectAllowed that
        // we are passed isn't a valid effectAllowed, so we should ignore it,
        // and not set m_effectAllowed.

        // The attribute must ignore any attempts to set it to a value other than 
        // none, copy, copyLink, copyMove, link, linkMove, move, all, and uninitialized.
        return;
    }


    if (m_policy == ClipboardWritable)
        m_effectAllowed = effect;
}
コード例 #8
0
ファイル: Clipboard.cpp プロジェクト: Drakey83/steamlink-sdk
bool Clipboard::hasData()
{
    ASSERT(isForDragAndDrop());

    return m_dataObject->length() > 0;
}