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


C++ SmsMessage类代码示例

本文整理汇总了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;
}
开发者ID:nixiValor,项目名称:Waterfox,代码行数:55,代码来源:SmsParent.cpp

示例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;
}
开发者ID:haluto,项目名称:appmanager,代码行数:22,代码来源:SmsParent.cpp

示例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;
}
开发者ID:haluto,项目名称:appmanager,代码行数:37,代码来源:SmsParent.cpp

示例4: Delete

already_AddRefed<DOMRequest>
MobileMessageManager::Delete(SmsMessage& aMessage,
                             ErrorResult& aRv)
{
  return Delete(aMessage.Id(), aRv);
}
开发者ID:MekliCZ,项目名称:positron,代码行数:6,代码来源:MobileMessageManager.cpp


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