本文整理汇总了C++中SmsMessage类的典型用法代码示例。如果您正苦于以下问题:C++ SmsMessage类的具体用法?C++ SmsMessage怎么用?C++ SmsMessage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SmsMessage类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MOZ_ASSERT
NS_IMETHODIMP
MobileMessageCursorParent::NotifyCursorResult(nsISupports** aResults,
uint32_t aSize)
{
MOZ_ASSERT(aResults && *aResults && aSize);
// The child process could die before this asynchronous notification, in which
// case ActorDestroy() was called and mContinueCallback is now null. Return an
// error here to avoid sending a message to the dead process.
NS_ENSURE_TRUE(mContinueCallback, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMMozMobileMessageThread> iThread =
do_QueryInterface(aResults[0]);
if (iThread) {
nsTArray<ThreadData> threads;
for (uint32_t i = 0; i < aSize; i++) {
nsCOMPtr<nsIDOMMozMobileMessageThread> iThread =
do_QueryInterface(aResults[i]);
NS_ENSURE_TRUE(iThread, NS_ERROR_FAILURE);
MobileMessageThread* thread =
static_cast<MobileMessageThread*>(iThread.get());
threads.AppendElement(thread->GetData());
}
return SendNotifyResult(MobileMessageCursorData(ThreadArrayData(threads)))
? NS_OK : NS_ERROR_FAILURE;
}
ContentParent* parent = static_cast<ContentParent*>(Manager()->Manager());
nsTArray<MobileMessageData> messages;
for (uint32_t i = 0; i < aSize; i++) {
nsCOMPtr<nsIDOMMozSmsMessage> iSms = do_QueryInterface(aResults[i]);
if (iSms) {
SmsMessage* sms = static_cast<SmsMessage*>(iSms.get());
messages.AppendElement(sms->GetData());
continue;
}
nsCOMPtr<nsIDOMMozMmsMessage> iMms = do_QueryInterface(aResults[i]);
if (iMms) {
MmsMessage* mms = static_cast<MmsMessage*>(iMms.get());
MmsMessageData mmsData;
NS_ENSURE_TRUE(mms->GetData(parent, mmsData), NS_ERROR_FAILURE);
messages.AppendElement(mmsData);
continue;
}
return NS_ERROR_FAILURE;
}
return SendNotifyResult(MobileMessageCursorData(MobileMessageArrayData(messages)))
? NS_OK : NS_ERROR_FAILURE;
}
示例2: do_QueryInterface
NS_IMETHODIMP
SmsRequestParent::NotifyMessageGot(nsISupports *aMessage)
{
nsCOMPtr<nsIDOMMozMmsMessage> mms = do_QueryInterface(aMessage);
if (mms) {
MmsMessage *msg = static_cast<MmsMessage*>(mms.get());
ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager());
MmsMessageData data;
if (!msg->GetData(parent, data)) {
return NS_ERROR_FAILURE;
}
return SendReply(ReplyGetMessage(MobileMessageData(data)));
}
nsCOMPtr<nsIDOMMozSmsMessage> sms = do_QueryInterface(aMessage);
if (sms) {
SmsMessage* msg = static_cast<SmsMessage*>(sms.get());
return SendReply(ReplyGetMessage(MobileMessageData(msg->GetData())));
}
return NS_ERROR_FAILURE;
}
示例3: NS_ENSURE_TRUE
NS_IMETHODIMP
MobileMessageCursorParent::NotifyCursorResult(nsISupports* aResult)
{
// The child process could die before this asynchronous notification, in which
// case ActorDestroy() was called and mContinueCallback is now null. Return an
// error here to avoid sending a message to the dead process.
NS_ENSURE_TRUE(mContinueCallback, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMMozSmsMessage> iSms = do_QueryInterface(aResult);
if (iSms) {
SmsMessage* message = static_cast<SmsMessage*>(aResult);
return SendNotifyResult(MobileMessageCursorData(message->GetData()))
? NS_OK : NS_ERROR_FAILURE;
}
nsCOMPtr<nsIDOMMozMmsMessage> iMms = do_QueryInterface(aResult);
if (iMms) {
MmsMessage* message = static_cast<MmsMessage*>(aResult);
ContentParent* parent = static_cast<ContentParent*>(Manager()->Manager());
MmsMessageData data;
if (!message->GetData(parent, data)) {
return NS_ERROR_FAILURE;
}
return SendNotifyResult(MobileMessageCursorData(data))
? NS_OK : NS_ERROR_FAILURE;
}
nsCOMPtr<nsIDOMMozMobileMessageThread> iThread = do_QueryInterface(aResult);
if (iThread) {
MobileMessageThread* thread = static_cast<MobileMessageThread*>(aResult);
return SendNotifyResult(MobileMessageCursorData(thread->GetData()))
? NS_OK : NS_ERROR_FAILURE;
}
MOZ_NOT_REACHED("Received invalid response parameters!");
return NS_ERROR_FAILURE;
}
示例4: Delete
already_AddRefed<DOMRequest>
MobileMessageManager::Delete(SmsMessage& aMessage,
ErrorResult& aRv)
{
return Delete(aMessage.Id(), aRv);
}