Skip to content

Instantly share code, notes, and snippets.

@40
Created September 28, 2012 23:19
Show Gist options
  • Select an option

  • Save 40/3802560 to your computer and use it in GitHub Desktop.

Select an option

Save 40/3802560 to your computer and use it in GitHub Desktop.
Bound Invocation Sample PDF File BB10 Cascades
InvokaManager *iManager = new InvokeManager(this);
InvokeRequest iRequest;
iRequest.setTarget("com.example.MYTARGET");
iRequest.setAction("bb.action.OPEN");
iRequest.setMimeType("application/pdf");
iRequest.setUri("file:///.../..../sample.pdf");
InvokeTargetReply *iReply = iManager->invoke(iRequest);
// connect signals and slots
QObject::connect(iReply, SIGNAL(finished()), this, SLOT(myInvokeReplySlot()));
// this myInvokeReplySlot allows you to see if invocation succeeded or failed
void myInvokeReplySlot(){
switch(iReply->error()){
case InvokeReplyError::NoTarget: cout << "Error: no target" << endl; break;
case InvokeReplyError::BadRequest: cout << "Error: bad request" << endl; break;
case InvokeReplyError::Internal: cout << "Error: internal" << endl; break;
default: cout << "Invoke Succeeded" << endl; break;
}
delete iReply
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment