InviteToDownload.cpp Example File
bbminvitetodownload/src/InviteToDownload.cpp
#include "InviteToDownload.hpp"
#include "RegistrationHandler.hpp"
#include <bb/cascades/AbstractPane>
#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/platform/bbm/MessageService>
using namespace bb::cascades;
InviteToDownload::InviteToDownload(bb::platform::bbm::Context &context, QObject *parent)
: QObject(parent)
, m_messageService(0)
, m_context(&context)
{
}
void InviteToDownload::show()
{
QmlDocument* qml = QmlDocument::create("asset:///invite.qml").parent(Application::instance());
qml->setContextProperty("_inviteToDownload", this);
AbstractPane* root = qml->createRootObject<AbstractPane>();
Application::instance()->setScene(root);
}
void InviteToDownload::sendInvite()
{
if (!m_messageService) {
m_messageService = new bb::platform::bbm::MessageService(m_context, this);
}
m_messageService->sendDownloadInvitation();
}