Example #1
0
// Write to the clipboard
void Pasteboard::writeSelection(Range* /*selectedRange*/, bool /*canSmartCopyOrDelete*/, Frame* frame)
{
    EA::WebKit::ViewNotification* pVN = EA::WebKit::GetViewNotification();

    if(pVN) // This should always be true.
    {
        EA::WebKit::ClipboardEventInfo cei;

        cei.mReadFromClipboard = false;

        const String str = frame->selectedText();
        GET_FIXEDSTRING16(cei.mText)->assign(str.characters(), str.length());

        pVN->ClipboardEvent(cei);
    }
}
Example #2
0
// Read from the clipboard
String Pasteboard::plainText(Frame* /*frame*/)
{
    WebCore::String retVal;

    EA::WebKit::ViewNotification* pVN = EA::WebKit::GetViewNotification();

    if(pVN) // This should always be true.
    {
        EA::WebKit::ClipboardEventInfo cei;

        cei.mReadFromClipboard = true;

        pVN->ClipboardEvent(cei); // We can ignore the return value and just look at cei.mText.

        if(!GET_FIXEDSTRING16(cei.mText)->empty())
            retVal = GET_FIXEDSTRING16(cei.mText)->c_str();
    }

    return retVal;
}