本文整理汇总了C++中InvokeRequest::setData方法的典型用法代码示例。如果您正苦于以下问题:C++ InvokeRequest::setData方法的具体用法?C++ InvokeRequest::setData怎么用?C++ InvokeRequest::setData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InvokeRequest
的用法示例。
在下文中一共展示了InvokeRequest::setData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: invoke
void ApplicationUI::invoke(QString platform)
{
// Create a new invocation request
InvokeRequest request;
if (platform == "BBM") {
request.setAction("bb.action.BBMCHAT");
request.setUri("pin:2B1F7E7B");
request.setTarget("sys.bbm.sharehandler");
}
if (platform == "EMAIL") {
request.setAction("bb.action.COMPOSE");
bb::Application* thisApp;
const QString uri = "mailto:[email protected]?subject=" + thisApp->applicationName() + "%20version%20" + thisApp->applicationVersion();
request.setUri(uri);
request.setMimeType("text/plain");
request.setData("Test");
request.setTarget("sys.pim.uib.email.hybridcomposer");
}
if (platform == "TWITTER") {
request.setAction("bb.action.VIEW");
request.setUri("twitter:connect:RodgerLeblanc");
request.setTarget("com.twitter.urihandler");
}
if (platform == "BBW") {
request.setAction("bb.action.OPEN");
request.setUri("appworld://vendor/70290");
request.setTarget("sys.appworld");
}
// Start the invocation
InvokeManager* invokeManager = new InvokeManager(this);
invokeManager->invoke(request);
invokeManager->deleteLater();
}
示例2: invoke
void ApplicationUI::invoke(const QString& platform, const QString& data) {
// Some invoke only works in C++, that's why all my invoke are done in C++
qDebug() << "ApplicationUI::invoke()" << platform << data;
// Load from previous saved information
const QString jsonPathFile = QDir::currentPath() + "/app/native/assets/InvokeTargets.json";
QVariantMap invokeTargets = jda.load(jsonPathFile).toMap()[platform].toMap();
qDebug() << "invokeTargets:" << invokeTargets;
// Create a new invocation request
InvokeRequest request;
if (!invokeTargets["target"].isNull())
request.setTarget(invokeTargets["target"].toString());
if (!invokeTargets["action"].isNull())
request.setAction(invokeTargets["action"].toString());
if (!invokeTargets["mimeType"].isNull())
request.setMimeType(invokeTargets["mimeType"].toString());
if (!invokeTargets["uri"].isNull())
request.setUri(invokeTargets["uri"].toString() + data);
request.setData(data.toUtf8());
// Start the invocation
m_invokeManager->invoke(request);
connect(m_invokeManager, SIGNAL(childCardDone(const bb::system::CardDoneMessage&)), this, SLOT(invokeNext()));
}
示例3: loadEvent
void ApplicationUI::loadEvent(int id, int account, QDateTime start)
{
QString startString = start.toString("yyyy-MM-dd hh:mm:ss");
qDebug() << "FMI ######### received event " << id << " account " << account << " beginning " << startString;
InvokeRequest invokeRequest;
invokeRequest.setAction("bb.calendar.OPEN");
invokeRequest.setTarget("sys.pim.calendar.viewer.ics");
invokeRequest.setMimeType("text/calendar");
QVariantMap data;
data.insert("accountId", account);
data.insert("eventId", id);
data.insert("type", "event");
data.insert("start", startString);
// data.insert("start", "2013-12-07 11:00:00");
//invokeRequest.setData(bb::PpsObject::encode(data, NULL));
bool ok;
QByteArray encData = bb::PpsObject::encode(data, &ok);
if (ok) {
invokeRequest.setData(encData);
// Start the invocation
const InvokeReply *reply = m_invokeManager->invoke(invokeRequest);
// reply->setParent(this);
connect(reply, SIGNAL(finished()), this, SLOT(processInvokeReply()));
connectResult = connect(m_invokeManager, SIGNAL(childCardDone(const bb::system::CardDoneMessage&)), this, SLOT(childCardDone(const bb::system::CardDoneMessage&)));
}
}
示例4: sendToHL
void ApplicationUI::sendToHL(const QString& command, QString data) {
InvokeRequest request;
request.setTarget(SERVICE_APP_TARGET);
request.setAction(QString(SERVICE_APP_TARGET) + "." + command.toUpper());
if (!data.isEmpty())
request.setData(data.toUtf8());
m_invokeManager->invoke(request);
}
示例5: startChat
void ApplicationUI::startChat(const QString& text) {
InvokeRequest bbmRequest;
bbmRequest.setTarget("sys.bbm.chathandler");
bbmRequest.setAction("bb.action.BBMCHAT");
bbmRequest.setData(text.toUtf8());
qDebug() << "start chat with BBM: " << text;
mInvokeManager->invoke(bbmRequest);
}
示例6: onRemoveScanRequest
void ApplicationUI::onRemoveScanRequest(const QString &address) {
QByteArray data(address.toAscii().data());
InvokeRequest request;
request.setTarget(WAKEME_INVOKE_HEADLESS_SERVICE);
request.setAction(WAKEME_INVOKE_ACTION_REMOVESCAN);
request.setData(data);
_invokeManager->invoke(request);
}
示例7: shareTextWithBBM
void ApplicationUI::shareTextWithBBM(const QString& text) {
InvokeRequest bbmRequest;
bbmRequest.setTarget("sys.bbm.sharehandler");
bbmRequest.setAction("bb.action.SHARE");
bbmRequest.setData(text.toUtf8());
qDebug() << "share with BBM: " << text;
mInvokeManager->invoke(bbmRequest);
// TODO listen to InvokeTargetReply *reply to see if invocation was successfull
// https://developer.blackberry.com/cascades/documentation/device_platform/invocation/sending_invocation.html
}
示例8: lockThisApp
void ApplicationUI::lockThisApp(const QString& app)
{
InvokeRequest request;
request.setTarget(SERVICE_APP_TARGET);
request.setAction(SERVICE_LOCK_THIS_APP_ACTION);
request.setData(app.toUtf8());
m_invokeManager->invoke(request);
bb::Application::instance()->requestExit();
}
示例9: openCalendar
void ApplicationUI::openCalendar()
{
InvokeRequest invokeRequest;
invokeRequest.setAction("bb.calendar.OPEN");
invokeRequest.setMimeType("text/calendar");
QVariantMap data;
data.insert("view", "agenda");
invokeRequest.setData(bb::PpsObject::encode(data, NULL));
// Start the invocation
m_invokeManager->invoke(invokeRequest);
}
示例10: showCamera
void TCUFPE::showCamera() {
InvokeRequest cardRequest;
cardRequest.setTarget("sys.camera.card");
cardRequest.setAction("bb.action.CAPTURE");
cardRequest.setData("photo");
InvokeTargetReply* reply = m_iManager->invoke(cardRequest);
reply->setParent(this);
connect(m_iManager,
SIGNAL(childCardDone(const bb::system::CardDoneMessage &)), this,
SLOT(onCameraCardDone(const bb::system::CardDoneMessage &)));
qDebug() << "waiting for you";
}
示例11: createWinnerScrapCard
void App::createWinnerScrapCard()
{
InvokeRequest cardRequest;
cardRequest.setTarget("scrapcard.target");
cardRequest.setAction("bb.action.CREATE");
cardRequest.setMimeType("application/custom");
qDebug() << "score" << m_pScoreCounter->seconds();
cardRequest.setData(
QByteArray().append(
QString(m_pSettings->getValueFor("player_name", "playerName")).append(",")).append(
QString::number(m_pScoreCounter->seconds())));
m_pInvokeManager->invoke(cardRequest);
}
示例12: invoke
void App::invoke(int targetType, const QString &action, const QString &mime, const QString &uri, const QString &data, const QString &target) {
iManager = new InvokeManager(this);
InvokeRequest iRequest;
if (action != 0 && action.length() > 0) {
printf("################");
printf(action.toAscii().constData());
if (action != QString("All") && action != QString("Menu Actions")) {
iRequest.setAction(action);
} else if(target.length() <= 0){
root->findChild<QObject*>("qlDialogMessage")->setProperty("text", "[" + action + "] is not a valid action type for an unbound invocation.");
root->findChild<QObject*>("qcdDialog")->setProperty("visible", true);
return;
}
}
if (mime != 0 && mime.length() > 0) {
printf("################");
printf(mime.toAscii().constData());
iRequest.setMimeType(mime);
} else {
root->findChild<QObject*>("qlDialogMessage")->setProperty("text", "MIME type must be specified!");
root->findChild<QObject*>("qcdDialog")->setProperty("visible", true);
return;
}
if (uri != 0 && uri.length() > 0) {
printf("################");
printf(uri.toAscii().constData());
iRequest.setUri(uri);
}
if (data != 0 && data.length() > 0) {
printf("################");
printf(data.toAscii().constData());
iRequest.setData(data.toUtf8());
}
if (target != 0 && target.length() > 0) {
printf("################");
printf(target.toAscii().constData());
iRequest.setTarget(target);
}
iReply = iManager->invoke(iRequest);
QObject::connect(iReply, SIGNAL(finished()), this, SLOT(processInvokeReply()));
if (iReply == NULL) {
root->findChild<QObject*>("qlDialogMessage")->setProperty("text", "Invoke Failed! InvokeReply is NULL.");
root->findChild<QObject*>("qcdDialog")->setProperty("visible", true);
return;
}
}
示例13: invoke_sms_compose
void ApplicationUIBase::invoke_sms_compose(QString to, QString body, bool send)
{
InvokeRequest request;
request.setTarget("sys.pim.text_messaging.composer");
request.setAction("bb.action.COMPOSE");
QVariantMap map;
map.insert("to", to);
map.insert("body", body);
map.insert("send", send);
QByteArray requestData = PpsObject::encode(map, NULL);
request.setData(requestData);
_invoke_manager->invoke(request);
}
示例14: onSSO
// Login/Connect with Foursquare
// This card will call back to your childCardDone slot with the appropriate
// response for the actions taken by the user.
//
// Pass in your client_id from your Foursquare API consumer.
//
// If the user authorizes your app or has already authorized you:
// The response reason will be "success" and the data block will have a
// json encoded access token which you can use for authenticated Foursquare
// requests. That response string looks something like this:
// { access_token: "masdfvasvawefafawvwef90we0900990092012" }
//
// If the user denies the authentication: the response reason will be "denied".
// If the user cancels the login without any action: the reason message will be "canceled"
void SocialInvocation::onSSO() {
InvokeRequest cardRequest;
cardRequest.setTarget("com.foursquare.blackberry.sso.card");
cardRequest.setAction("bb.action.VIEW");
cardRequest.setMimeType("sso/foursquare");
// Pass in the client_id that you receive when registering
// your app with Foursquare.
//
// You can register your app with Foursquare here:
// https://foursquare.com/developers/apps
//
// For more information on Foursquare API credentials, see here:
// https://developer.foursquare.com/overview/auth
cardRequest.setData(QString("UFVANV2FBBFRPXSBXHCCKECVUDANDKP5KQFKICRCA1VAFV4V").toUtf8());
m_invokeManager->invoke(cardRequest);
}
示例15: show
void CameraInvocation::show() {
if (invokeReply_ && !invokeReply_->isFinished()) {
// Don't send another invoke request if one is already pending.
return;
}
InvokeRequest request;
request.setTarget("sys.camera.card");
request.setAction("bb.action.CAPTURE");
request.setData("photo"); // TODO: use CameraOptionsType.mediaTypes
invokeReply_ = invokeManager_.invoke(request);
if (!invokeReply_) {
fprintf(stderr, "Failed to send camera card invoke\n");
return;
}
connect(invokeReply_, SIGNAL(finished()), SLOT(cameraCardReplyFinished));
}