Logo Search packages:      
Sourcecode: qcake version File versions  Download package

int QtNPBindable::uploadData ( const QString &  url,
const QString &  window,
const QByteArray &  data 
)

Posts data to url, and displays the result in window. Returns the ID of the request that is delivered to transferComplete() when the post-operation has finished. Returns 0 when the browser or the system doesn't support notification, or -1 when an error occured.

    void MyPlugin::sendMail()
    {
        uploadData("mailto:fred@somewhere.com", QString(), "There is a new file for you!");
    }

See Netscape's JavaScript documentation for an explanation of window names.

See also:
transferComplete() openUrl() uploadFile()

Definition at line 1515 of file qtbrowserplugin.cpp.

{
    if (!pi)
        return -1;

    int id = pi->getNotificationSeqNum();
    if (NPERR_NO_ERROR != NPN_PostURLNotify(pi->npp, url.toLocal8Bit().constData(), window.isEmpty() ? 0 : window.toLocal8Bit().constData(), data.size(), data.constData(), false, reinterpret_cast<void*>(id)))
        id = -1;

    return id;
}


Generated by  Doxygen 1.6.0   Back to index