本文整理汇总了C++中InvokeRequest类的典型用法代码示例。如果您正苦于以下问题:C++ InvokeRequest类的具体用法?C++ InvokeRequest怎么用?C++ InvokeRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InvokeRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: qDebug
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&)));
}
}
示例3: startHeadless
void ApplicationUI::startHeadless()
{
InvokeRequest request;
request.setTarget("com.RogerLeblanc.callerService");
request.setAction("com.RogerLeblanc.callerService.START");
m_invokeManager->invoke(request);
}
示例4: 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);
}
示例5: vcfCard
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);
}
示例6: qDebug
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: 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);
}
示例8: 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());
}
}
}
示例9: 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();
}
示例10: stopLocking
void ApplicationUI::stopLocking()
{
InvokeRequest request;
request.setTarget(SERVICE_APP_TARGET);
request.setAction(SERVICE_STOP_LOCKING_ACTION);
m_invokeManager->invoke(request);
}
示例11: inviteBBM
void ApplicationUI::inviteBBM() {
InvokeRequest bbmRequest;
bbmRequest.setTarget("sys.bbm.invitehandler");
bbmRequest.setAction("bb.action.INVITEBBM");
qDebug() << "invite to BBM";
mInvokeManager->invoke(bbmRequest);
}
示例12: 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);
}
示例13: qDebug
/**
* 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);
}
示例14: data
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);
}
示例15: 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);
}