本文整理汇总了C++中InvokeRequest::setUri方法的典型用法代码示例。如果您正苦于以下问题:C++ InvokeRequest::setUri方法的具体用法?C++ InvokeRequest::setUri怎么用?C++ InvokeRequest::setUri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InvokeRequest
的用法示例。
在下文中一共展示了InvokeRequest::setUri方法的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: invokeBoundMediaPlayer
// invoke MediaPlayer
void ApplicationUI::invokeBoundMediaPlayer(const QString& uri) {
qDebug() << "invoke bound mediaplayer" << uri;
InvokeRequest cardRequest;
// MediaPlayer needs file:// or http:// etc as prefix
// FilePicker uses /account....... etc
if (uri.startsWith('/')) {
cardRequest.setUri("file://" + uri);
} else {
cardRequest.setUri(uri);
}
cardRequest.setTarget("sys.mediaplayer.previewer");
mInvokeManager->invoke(cardRequest);
}
示例3: 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);
}
示例4: 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()));
}
示例5: 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);
}
示例6: 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);
}
示例7: invoke_media_player
void ApplicationUIBase::invoke_media_player(QString uri)
{
InvokeRequest request;
request.setTarget("sys.mediaplayer.previewer");
request.setAction("bb.action.OPEN");
request.setUri(uri);
_invoke_manager->invoke(request);
}
示例8: 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);
}
示例9: invoke_bbworld
void ApplicationUIBase::invoke_bbworld(QString uri)
{
InvokeRequest request;
request.setMimeType("application/x-bb-appworld");
request.setAction("bb.action.OPEN");
request.setUri(uri);
_invoke_manager->invoke(request);
}
示例10: 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);
}
示例11: 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);
}
示例12: invokeUnbound
// unbound Invokation
void ApplicationUI::invokeUnbound(QString uri) {
if (uri.endsWith(".svg")) {
invokeBrowser(uri);
return;
}
InvokeRequest cardRequest;
cardRequest.setUri(uri);
mInvokeManager->invoke(cardRequest);
}
示例13: shareTextWithMail
void ApplicationUI::shareTextWithMail(const QString& text) {
InvokeRequest mailRequest;
mailRequest.setTarget("sys.pim.uib.email.hybridcomposer");
mailRequest.setAction("bb.action.SENDEMAIL");
mailRequest.setMimeType("settings/view");
mailRequest.setUri("mailto:?subject=" + text);
qDebug() << "share with Mail: " << text;
mInvokeManager->invoke(mailRequest);
}
示例14: leaveReview
void ApplicationUI::leaveReview() {
InvokeRequest bbmRequest;
bbmRequest.setAction("bb.action.OPEN");
bbmRequest.setMimeType("application/x-bb-appworld");
QString uri = "appworld://content/";
uri += mOdsData->applicationId();
bbmRequest.setUri(uri);
qDebug() << "leave review";
mInvokeManager->invoke(bbmRequest);
}
示例15: 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);
}