当前位置: 首页>>代码示例>>C++>>正文


C++ InvokeRequest::setMimeType方法代码示例

本文整理汇总了C++中InvokeRequest::setMimeType方法的典型用法代码示例。如果您正苦于以下问题:C++ InvokeRequest::setMimeType方法的具体用法?C++ InvokeRequest::setMimeType怎么用?C++ InvokeRequest::setMimeType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在InvokeRequest的用法示例。


在下文中一共展示了InvokeRequest::setMimeType方法的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();
}
开发者ID:RodgerLeblanc,项目名称:bb-france2UpFront,代码行数:33,代码来源:applicationui.cpp

示例2: 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);
}
开发者ID:AnujAroshA,项目名称:Cascades-Samples,代码行数:50,代码来源:SocialInvocation.cpp

示例3: 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()));
}
开发者ID:RodgerLeblanc,项目名称:ShareAll,代码行数:29,代码来源:applicationui.cpp

示例4: 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&)));
	}
}
开发者ID:Jendorski,项目名称:WeekViewer,代码行数:30,代码来源:applicationui.cpp

示例5: 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);
}
开发者ID:NemOry,项目名称:FacebookMessengerClientUI,代码行数:8,代码来源:applicationuibase.cpp

示例6: 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);
}
开发者ID:blackberry,项目名称:opendataspace-cascades,代码行数:9,代码来源:applicationui.cpp

示例7: 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);
}
开发者ID:blackberry,项目名称:opendataspace-cascades,代码行数:10,代码来源:applicationui.cpp

示例8: 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);
}
开发者ID:blackberry,项目名称:opendataspace-cascades,代码行数:15,代码来源:applicationui.cpp

示例9: feedbackTriggered

// handles SLOT from feedbackItem
void ApplicationUI::feedbackTriggered() {
	qDebug() << "invoke sendFeedback";
	InvokeRequest request;
	request.setAction("bb.action.SENDEMAIL");
	request.setTarget("sys.pim.uib.email.hybridcomposer");
	request.setMimeType("settings/view");
	request.setUri(
			"mailto:" + mOdsData->feedbackMail() + "?subject=Feedback%20"
					+ mOdsData->applicationName());
	mInvokeManager->invoke(request);
}
开发者ID:blackberry,项目名称:opendataspace-cascades,代码行数:12,代码来源:applicationui.cpp

示例10: sendMail

void ApplicationUI::sendMail(const QString title) {
	qDebug() << "invoke sendMail";
	InvokeRequest request;
	request.setAction("bb.action.SENDEMAIL");
	request.setTarget("sys.pim.uib.email.hybridcomposer");
	request.setMimeType("settings/view");
	request.setUri(
			"mailto:" + mOdsData->supportMail() + "?subject="
					+ mOdsData->applicationName() + "%20" + title);
	mInvokeManager->invoke(request);
}
开发者ID:blackberry,项目名称:opendataspace-cascades,代码行数:11,代码来源:applicationui.cpp

示例11: 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);
}
开发者ID:Jendorski,项目名称:WeekViewer,代码行数:12,代码来源:applicationui.cpp

示例12: showInTargetForMimeType

/**
 * uses Invokation Framework to View the file from URI
 * for a specific MimeType
 * and for a specific target like "sys.pictures.app"
 *
 */
void OpenDataSpace::showInTargetForMimeType(QString uri, QString mimeType,
		QString target) {
	qDebug() << "showInTargetForMimeType called: " << uri;
	InvokeRequest invokeRequest;
	invokeRequest.setAction("bb.action.VIEW");
	invokeRequest.setUri(uri);
	invokeRequest.setTarget(target);
	invokeRequest.setMimeType(mimeType);
	qDebug() << "showInTargetForMimeType URI: " << invokeRequest.uri()
			<< " MimeType:" << mimeType;
	m_invokeManager->invoke(invokeRequest);
}
开发者ID:osawyerr,项目名称:opendataspace-cascades,代码行数:18,代码来源:OpenDataSpace.cpp

示例13: 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);
}
开发者ID:BBDevGroupNL,项目名称:Presentations,代码行数:14,代码来源:app.cpp

示例14: 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;
	}
}
开发者ID:borceg,项目名称:Cascades-Community-Samples,代码行数:49,代码来源:app.cpp

示例15: 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);
}
开发者ID:AnujAroshA,项目名称:Cascades-Samples,代码行数:32,代码来源:SocialInvocation.cpp


注:本文中的InvokeRequest::setMimeType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。