本文整理汇总了C++中InvokeRequest::data方法的典型用法代码示例。如果您正苦于以下问题:C++ InvokeRequest::data方法的具体用法?C++ InvokeRequest::data怎么用?C++ InvokeRequest::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InvokeRequest
的用法示例。
在下文中一共展示了InvokeRequest::data方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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
}
}
示例2: onInvoked
void App::onInvoked(const InvokeRequest &request)
{
if (m_configurationService.hasConfiguration()) {
// The underlying PushService instance might not have been
// initialized when an invoke first comes in
// Make sure that we initialize it here if it hasn't been already
// It requires an application ID (for consumer applications) so we have to check
// that configuration settings have already been stored
m_pushNotificationService.initializePushService();
if (request.action().compare(BB_PUSH_INVOCATION_ACTION) == 0) {
qDebug() << "Received push action";
// Received an incoming push
// Extract it from the invoke request and then process it
PushPayload payload(request);
if (payload.isValid()) {
pushNotificationHandler(payload);
}
} else if (request.action().compare(BB_OPEN_INVOCATION_ACTION) == 0){
qDebug() << "Received open action";
// Received an invoke request to open an existing push (ie. from a notification in the BlackBerry Hub)
// The payload from the open invoke is the seqnum for the push in the database
openPush(request.data().toInt());
}
}
}
示例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: 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();
}
示例5: onInvoked
void App::onInvoked(const InvokeRequest &request)
{
if (request.action().compare(BB_OPEN_INVOCATION_ACTION) == 0){
qDebug() << "Received open action";
// Received an invoke request to open an existing push (ie. from a notification in the BlackBerry Hub)
// The payload from the open invoke is the seqnum for the push in the database
openPush(request.data().toInt());
}
}