本文整理汇总了C++中CClipboard::StreamDictionary方法的典型用法代码示例。如果您正苦于以下问题:C++ CClipboard::StreamDictionary方法的具体用法?C++ CClipboard::StreamDictionary怎么用?C++ CClipboard::StreamDictionary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClipboard
的用法示例。
在下文中一共展示了CClipboard::StreamDictionary方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleViewCommandL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CShowString::HandleViewCommandL(TInt aCommand)
{
switch(aCommand)
{
case ESSCopyClipBoard:
if(iString)
{
CClipboard* cb = CClipboard::NewForWritingLC(CCoeEnv::Static()->FsSession());
cb->StreamDictionary().At(KClipboardUidTypePlainText);
CPlainText* BPlainText = CPlainText::NewL();
CleanupStack::PushL(BPlainText);
BPlainText->InsertL(0,iString->Des());
BPlainText->CopyToStoreL(cb->Store(),cb->StreamDictionary(),0,BPlainText->DocumentLength());
CleanupStack::PopAndDestroy(); // CBPlainText
cb->CommitL();
CleanupStack::PopAndDestroy(); // cb
}
break;
};
}
示例2: mimeData
const QMimeData* QClipboard::mimeData(Mode mode) const
{
if (mode != Clipboard) return 0;
QClipboardData *d = clipboardData();
bool dataExists(false);
if (d)
{
TRAPD(err,{
RFs fs = qt_s60GetRFs();
CClipboard* cb = CClipboard::NewForReadingLC(fs);
Q_ASSERT(cb);
//stream for qt
RStoreReadStream stream;
TStreamId stid = (cb->StreamDictionary()).At(KQtCbDataStream);
if (stid != 0) {
stream.OpenLC(cb->Store(),stid);
QT_TRYCATCH_LEAVING(readFromStreamLX(d->source(),stream));
CleanupStack::PopAndDestroy(&stream);
dataExists = true;
}
else {
//symbian clipboard
RStoreReadStream symbianStream;
TStreamId symbianStId = (cb->StreamDictionary()).At(KClipboardUidTypePlainText);
if (symbianStId != 0) {
symbianStream.OpenLC(cb->Store(), symbianStId);
QT_TRYCATCH_LEAVING(readSymbianStoreLX(d->source(), cb));
CleanupStack::PopAndDestroy(&symbianStream);
dataExists = true;
}
}
CleanupStack::PopAndDestroy(cb);
});
if (err != KErrNone){
qDebug()<< "clipboard is empty/err: " << err;
}
if (dataExists) {
return d->source();
}
}
示例3: mimeData
const QMimeData* QClipboard::mimeData(Mode mode) const
{
if (mode != Clipboard) return 0;
QClipboardData *d = clipboardData();
if (d)
{
TRAPD(err,{
RFs fs = qt_s60GetRFs();
CClipboard* cb = CClipboard::NewForReadingLC(fs);
Q_ASSERT(cb);
RStoreReadStream stream;
TStreamId stid = (cb->StreamDictionary()).At(KQtCbDataStream);
stream.OpenLC(cb->Store(),stid);
QT_TRYCATCH_LEAVING(readFromStreamLX(d->source(),stream));
CleanupStack::PopAndDestroy(2,cb);
return d->source();
});
if (err != KErrNone){
qDebug()<< "clipboard is empty/err: " << err;
}
}