本文整理汇总了C++中InvokeRequest::setTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ InvokeRequest::setTarget方法的具体用法?C++ InvokeRequest::setTarget怎么用?C++ InvokeRequest::setTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InvokeRequest
的用法示例。
在下文中一共展示了InvokeRequest::setTarget方法的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: stopLocking
void ApplicationUI::stopLocking()
{
InvokeRequest request;
request.setTarget(SERVICE_APP_TARGET);
request.setAction(SERVICE_STOP_LOCKING_ACTION);
m_invokeManager->invoke(request);
}
示例4: invoke
//! [1]
void SocialInvocation::invoke(const QString &target, const QString &action,
const QString &mimetype, const QString &uri) {
// Create a new invocation request
InvokeRequest request;
request.setTarget(target);
request.setAction(action);
if (target == QLatin1String("com.rim.bb.app.facebook")) {
QVariantMap payload;
if (!uri.isEmpty()) {
payload["object_type"] = mimetype;
payload["object_id"] = uri;
} else {
// Open the BlackBerry North America page by default
payload["object_type"] = "page";
payload["object_id"] = "328506290597521";
}
request.setMetadata(payload);
} else {
request.setUri(uri);
}
m_invokeManager->invoke(request);
}
示例5: 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&)));
}
}
示例6: onInvokeButtonClicked
void BarcodeInvoker::onInvokeButtonClicked() {
qDebug() << "+++++++ Invoke button clicked" << endl;
InvokeRequest invokeRequest;
invokeRequest.setTarget("com.example.BarcodeScanner");
invokeRequest.setAction("community.action.SCANBARCODE");
InvokeTargetReply *invokeReply = _invokeManager->invoke(invokeRequest);
}
示例7: onGetResponse
void ApplicationUI::onGetResponse(QString& response)
{
m_pCardHolder->setProperty("visible", false);
m_pResponseHolder->setProperty("visible", true);
m_pResponseHolder->setProperty("text", response);
QDir vcfPath;
vcfPath.mkdir(QDir::tempPath()+"/data/");
vcfPath.cd(QDir::tempPath()+"/data/");
QFile vcfCard(QDir::tempPath()+"/data/readContact.vcf");
if(!vcfCard.open(QIODevice::WriteOnly | QIODevice::Text))
{
showToast("Error Creating new file");
return;
}
QTextStream out(&vcfCard);
out << response;
vcfCard.close();
InvokeManager manager;
InvokeRequest request;
request.setTarget("sys.pim.contacts.card.viewer");
request.setAction("bb.action.VIEW");
request.setUri("file://" + QDir::tempPath()+"/data/readContact.vcf");
manager.invoke(request);
}
示例8: enableAutoStart
void ApplicationUI::enableAutoStart()
{
//Create the InvokeTargetFilter, which matches the filter that was
//commented out from the bar-descriptor.xml.
InvokeTargetFilter autoStartFilter;
autoStartFilter.addAction("bb.action.system.STARTED");
autoStartFilter.addMimeType("application/vnd.blackberry.system.event.STARTED");
autoStartFilter.addUri("data://local");
//Create the InvokeUpdateTargetFilterRequest and add the filter we just created.
InvokeUpdateTargetFiltersRequest updateRequest;
updateRequest.setTarget("com.example.DeferredAutoStartService");
QList<InvokeTargetFilter> filterList;
filterList.append(autoStartFilter);
updateRequest.setTargetFilters(filterList);
//Use InvokeManager to update the filter.
InvokeManager manager;
manager.updateTargetFilters(updateRequest);
//At this point the headless entry point of the application will auto run when the BlackBerry Smartphone
//boots up. However note that this does not start headless portion. Left as is, it won't start
//until next reboot. The code below starts the headless application.
InvokeRequest request;
request.setTarget("com.example.DeferredAutoStartService");
request.setAction("bb.action.system.STARTED");
manager.invoke(request);
}
示例9: invokeFoursquareVenueCard
// The Foursquare invocation calls are based on the sample available here:
// https://github.com/kylefowler/foursquare-bb10-sdk
//
// Launches a native Foursquare venue search in your app.
// This card will call back to your childCardDone slot with the appropriate
// response for the actions taken by the user.
//
// URI Params:
// query: (optional) prime the venue search with a query
// client_id: (required) the client id from your oauth consumer
// client_secret: (required) the client secret from your oauth consumer
// oauth_token: (required if no client_id/client_secret) pass this if you
// already have an authenticated user token, this way venue
// search results will be fitted to the user requesting them
// for a higher quality queryless search
//
// Response:
// When the user selects a venue, you will get the venue information in
// JSON format back through the childCardDone slot in the data object.
// The venue format will match what is listed here in the core venue fields:
// https://developer.foursquare.com/docs/responses/venue
//
// If the user cancels the search without any action: the reason message will be "canceled"
// If any of the parameters are missing you will get a reason message of "invalid_credentials"
void SocialInvocation::invokeFoursquareVenueCard(const QString &venue) {
InvokeRequest cardRequest;
cardRequest.setTarget("com.foursquare.blackberry.venuesearch.card");
cardRequest.setAction("bb.action.VIEW");
cardRequest.setMimeType("venuesearch/foursquare");
// The client_id and client_secret are the Foursquare API credentials
// 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
QUrl uri = QUrl("foursquare://venues/search");
// Replace the following values with your app's client ID and secret
uri.addQueryItem("client_id", "UFVANV2FBBFRPXSBXHCCKECVUDANDKP5KQFKICRCA1VAFV4V");
uri.addQueryItem("client_secret","11AY4DWL0A2CV1NXPKDMS2PJTEACRZJP0BMFXORNCKBSNVMH");
uri.addQueryItem("query", venue);
cardRequest.setUri(uri);
m_invokeManager->invoke(cardRequest);
}
示例10: inviteBBM
void ApplicationUI::inviteBBM() {
InvokeRequest bbmRequest;
bbmRequest.setTarget("sys.bbm.invitehandler");
bbmRequest.setAction("bb.action.INVITEBBM");
qDebug() << "invite to BBM";
mInvokeManager->invoke(bbmRequest);
}
示例11: resendNotification
void ApplicationUI::resendNotification() {
InvokeRequest request;
request.setTarget("com.example.bb_france2UpFrontService");
request.setAction("com.example.bb_france2UpFrontService.RESET");
m_invokeManager->invoke(request);
Application::instance()->minimize();
}
示例12: startHeadless
void ApplicationUI::startHeadless()
{
InvokeRequest request;
request.setTarget("com.RogerLeblanc.callerService");
request.setAction("com.RogerLeblanc.callerService.START");
m_invokeManager->invoke(request);
}
示例13: invoke_browser
void ApplicationUIBase::invoke_browser(QString url)
{
InvokeRequest request;
request.setTarget("sys.browser");
request.setAction("bb.action.OPEN");
request.setUri(url);
_invoke_manager->invoke(request);
}
示例14: resendNotification
void ApplicationUI::resendNotification()
{
InvokeRequest request;
request.setTarget(WAKEME_INVOKE_HEADLESS_SERVICE);
request.setAction(WAKEME_INVOKE_ACTION_RESET);
_invokeManager->invoke(request);
Application::instance()->minimize();
}
示例15: 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);
}