本文整理汇总了C++中InvokeRequest::uri方法的典型用法代码示例。如果您正苦于以下问题:C++ InvokeRequest::uri方法的具体用法?C++ InvokeRequest::uri怎么用?C++ InvokeRequest::uri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InvokeRequest
的用法示例。
在下文中一共展示了InvokeRequest::uri方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleInvoke
void PgcRouterApp::handleInvoke(const InvokeRequest& request) {
// Copy data from incoming invocation request to properties
m_source =
QString::fromLatin1("%1 (%2)").arg(request.source().installId()).arg(
request.source().groupId());
m_target = request.target();
m_action = request.action();
m_mimeType = request.mimeType();
m_uri = request.uri().toString();
m_data = QString::fromUtf8(request.data());
QUrl uri = request.uri();
QFile file(uri.toLocalFile());
if (m_target == "com.destinywireless.app.pgcrouter") {
} else if (m_target == "com.destinywireless.app.pgcsender") {
} else if (m_target == "com.destinywireless.card.formeditor") {
} else if (m_target == "com.destinywireless.card.formviewer") {
} else if (m_target == "com.destinywireless.card.attachphoto") {
}
// Signal that the properties have changed
emit requestChanged();
}
示例2: handleInvoke
// triggered if Application was invoked by a client
void OpenDataSpace::handleInvoke(const InvokeRequest& request) {
// TODO
qDebug() << "Invoke Request";
qDebug() << "Invoke Request Action:" << request.action();
qDebug() << "Invoke Request Mime:" << request.mimeType();
qDebug() << "Invoke Request URI:" << request.uri();
qDebug() << "Invoke Request Data:" << request.data();
m_invokationTarget = request.target();
m_invokationSource = QString::fromLatin1("%1 (%2)").arg(
request.source().installId()).arg(request.source().groupId());
qDebug() << "Invoke Target ID: " << m_invokationTarget << " from Source: "
<< m_invokationSource;
// Invoked as Application
if (m_invokationTarget == "io.ods.bb10.invoke") {
m_isCard = false;
qDebug() << "Invoked";
}
// invoked as embedded Card (Previewer) from OPEN or SHARE
else if (m_invokationTarget == "io.ods.bb10.card.upload.previewer") {
m_isCard = true;
qDebug() << "Invoked for UploadCard as Previewer";
}
// invoked as embedded Card (Composer) from OPEN
else if (m_invokationTarget == "io.ods.bb10.upload.composer") {
m_isCard = true;
qDebug() << "Invoked for UploadCard as Composer";
}
// do some preparing-stuff for a invoked Card
// reset values (can come from pool)
// set some infos
// tell the Card that its a new invocation
if (m_isCard) {
AbstractPane *p = Application::instance()->scene();
bool ok = false;
// if there's a URI we take the URI
// else we take the data
if (request.uri().isEmpty()) {
ok = p->setProperty("filePath", request.data());
} else {
ok = p->setProperty("filePath", request.uri());
}
if (!ok) {
qDebug() << "Cannot set filePath";
}
// start a new Card Game ;-)
// setting newCard true causes testing if LogIn was needed before upload files
ok = p->setProperty("newCard", true);
if (ok) {
qDebug() << "set newCard to true";
} else {
qDebug() << "cannot set newCard";
}
} else {
// do what needed if Invoked, per ex. switch to Upload TAB
}
}
示例3: handleInvoke
//! [1]
void App::handleInvoke(const InvokeRequest& request)
{
// Copy data from incoming invocation request to properties
m_source = QString::fromLatin1("%1 (%2)").arg(request.source().installId()).arg(request.source().groupId());
m_target = request.target();
m_action = request.action();
m_mimeType = request.mimeType();
m_uri = request.uri().toString();
m_data = QString::fromUtf8(request.data());
m_backButtonVisible = false;
if (m_target == "com.example.bb10samples.invocation.openimage1") {
m_title = tr("Open Image 1");
} else if (m_target == "com.example.bb10samples.invocation.openimage2") {
m_title = tr("Open Image 2");
} else if (m_target == "com.example.bb10samples.invocation.card.previewer") {
m_title = tr("Previewer");
m_backButtonVisible = true;
} else if (m_target == "com.example.bb10samples.invocation.card.composer") {
m_title = tr("Composer");
} else if (m_target == "com.example.bb10samples.invocation.card.picker") {
m_title = tr("Picker");
}
// Signal that the properties have changed
emit requestChanged();
}
示例4: showInView
/**
* uses Invokation Framework to View the file from URI
*
*/
void OpenDataSpace::showInView(QString uri) {
qDebug() << "showInView called: " << uri;
InvokeRequest invokeRequest;
invokeRequest.setAction("bb.action.VIEW");
invokeRequest.setUri(uri);
qDebug() << "showInView URI: " << invokeRequest.uri();
m_invokeManager->invoke(invokeRequest);
}
示例5: showInTarget
/**
* uses Invokation Framework to View the file from URI
* for a specific target like "sys.pictures.app"
*
*/
void ApplicationUI::showInTarget(QString uri, QString target) {
qDebug() << "showInTarget called: " << uri;
InvokeRequest invokeRequest;
invokeRequest.setAction("bb.action.VIEW");
invokeRequest.setUri(uri);
invokeRequest.setTarget(target);
qDebug() << "showInTarget URI: " << invokeRequest.uri();
mInvokeManager->invoke(invokeRequest);
}
示例6: showInViewForMimeType
/**
* uses Invokation Framework to View the file from URI
* for a specific MimeType
*
*/
void ApplicationUI::showInViewForMimeType(QString uri, QString mimeType) {
qDebug() << "showInViewForMimeType called: " << uri;
InvokeRequest invokeRequest;
invokeRequest.setAction("bb.action.VIEW");
invokeRequest.setUri(uri);
invokeRequest.setMimeType(mimeType);
qDebug() << "showInViewForMimeType URI: " << invokeRequest.uri() << " Mime:"
<< mimeType;
mInvokeManager->invoke(invokeRequest);
}
示例7: showInTargetForMimeType
/**
* uses Invokation Framework to View the file from URI
* for a specific MimeType
* and for a specific target like "sys.pictures.app"
*
*/
void OpenDataSpace::showInTargetForMimeType(QString uri, QString mimeType,
QString target) {
qDebug() << "showInTargetForMimeType called: " << uri;
InvokeRequest invokeRequest;
invokeRequest.setAction("bb.action.VIEW");
invokeRequest.setUri(uri);
invokeRequest.setTarget(target);
invokeRequest.setMimeType(mimeType);
qDebug() << "showInTargetForMimeType URI: " << invokeRequest.uri()
<< " MimeType:" << mimeType;
m_invokeManager->invoke(invokeRequest);
}
示例8: showInView
/**
* uses Invokation Framework to View the file from URI
*
*/
void ApplicationUI::showInView(QString uri) {
qDebug() << "showInView called: " << uri;
if (uri.endsWith(".ogg")) {
invokeBoundMediaPlayer(uri);
return;
}
if (uri.endsWith(".svg")) {
invokeBrowser(uri);
return;
}
InvokeRequest invokeRequest;
invokeRequest.setAction("bb.action.VIEW");
invokeRequest.setUri(uri);
qDebug() << "showInView URI: " << invokeRequest.uri();
mInvokeManager->invoke(invokeRequest);
}