1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/mobilemessage/src/ipc/SmsChild.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,135 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef mozilla_dom_mobilemessage_SmsChild_h 1.10 +#define mozilla_dom_mobilemessage_SmsChild_h 1.11 + 1.12 +#include "mozilla/dom/mobilemessage/PSmsChild.h" 1.13 +#include "mozilla/dom/mobilemessage/PSmsRequestChild.h" 1.14 +#include "mozilla/dom/mobilemessage/PMobileMessageCursorChild.h" 1.15 +#include "nsIDOMDOMCursor.h" 1.16 +#include "nsIMobileMessageCallback.h" 1.17 +#include "nsIMobileMessageCursorCallback.h" 1.18 + 1.19 +namespace mozilla { 1.20 +namespace dom { 1.21 +namespace mobilemessage { 1.22 + 1.23 +class SmsChild : public PSmsChild 1.24 +{ 1.25 +public: 1.26 + SmsChild() 1.27 + { 1.28 + MOZ_COUNT_CTOR(SmsChild); 1.29 + } 1.30 + 1.31 +protected: 1.32 + virtual ~SmsChild() 1.33 + { 1.34 + MOZ_COUNT_DTOR(SmsChild); 1.35 + } 1.36 + 1.37 + virtual void 1.38 + ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; 1.39 + 1.40 + virtual bool 1.41 + RecvNotifyReceivedMessage(const MobileMessageData& aMessage) MOZ_OVERRIDE; 1.42 + 1.43 + virtual bool 1.44 + RecvNotifyRetrievingMessage(const MobileMessageData& aMessage) MOZ_OVERRIDE; 1.45 + 1.46 + virtual bool 1.47 + RecvNotifySendingMessage(const MobileMessageData& aMessage) MOZ_OVERRIDE; 1.48 + 1.49 + virtual bool 1.50 + RecvNotifySentMessage(const MobileMessageData& aMessage) MOZ_OVERRIDE; 1.51 + 1.52 + virtual bool 1.53 + RecvNotifyFailedMessage(const MobileMessageData& aMessage) MOZ_OVERRIDE; 1.54 + 1.55 + virtual bool 1.56 + RecvNotifyDeliverySuccessMessage(const MobileMessageData& aMessage) MOZ_OVERRIDE; 1.57 + 1.58 + virtual bool 1.59 + RecvNotifyDeliveryErrorMessage(const MobileMessageData& aMessage) MOZ_OVERRIDE; 1.60 + 1.61 + virtual bool 1.62 + RecvNotifyReceivedSilentMessage(const MobileMessageData& aMessage) MOZ_OVERRIDE; 1.63 + 1.64 + virtual bool 1.65 + RecvNotifyReadSuccessMessage(const MobileMessageData& aMessage) MOZ_OVERRIDE; 1.66 + 1.67 + virtual bool 1.68 + RecvNotifyReadErrorMessage(const MobileMessageData& aMessage) MOZ_OVERRIDE; 1.69 + 1.70 + virtual PSmsRequestChild* 1.71 + AllocPSmsRequestChild(const IPCSmsRequest& aRequest) MOZ_OVERRIDE; 1.72 + 1.73 + virtual bool 1.74 + DeallocPSmsRequestChild(PSmsRequestChild* aActor) MOZ_OVERRIDE; 1.75 + 1.76 + virtual PMobileMessageCursorChild* 1.77 + AllocPMobileMessageCursorChild(const IPCMobileMessageCursor& aCursor) MOZ_OVERRIDE; 1.78 + 1.79 + virtual bool 1.80 + DeallocPMobileMessageCursorChild(PMobileMessageCursorChild* aActor) MOZ_OVERRIDE; 1.81 +}; 1.82 + 1.83 +class SmsRequestChild : public PSmsRequestChild 1.84 +{ 1.85 + friend class SmsChild; 1.86 + 1.87 + nsCOMPtr<nsIMobileMessageCallback> mReplyRequest; 1.88 + 1.89 +public: 1.90 + SmsRequestChild(nsIMobileMessageCallback* aReplyRequest); 1.91 + 1.92 +protected: 1.93 + virtual ~SmsRequestChild() 1.94 + { 1.95 + MOZ_COUNT_DTOR(SmsRequestChild); 1.96 + } 1.97 + 1.98 + virtual void 1.99 + ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; 1.100 + 1.101 + virtual bool 1.102 + Recv__delete__(const MessageReply& aReply) MOZ_OVERRIDE; 1.103 +}; 1.104 + 1.105 +class MobileMessageCursorChild : public PMobileMessageCursorChild 1.106 + , public nsICursorContinueCallback 1.107 +{ 1.108 + friend class SmsChild; 1.109 + 1.110 + nsCOMPtr<nsIMobileMessageCursorCallback> mCursorCallback; 1.111 + 1.112 +public: 1.113 + NS_DECL_ISUPPORTS 1.114 + NS_DECL_NSICURSORCONTINUECALLBACK 1.115 + 1.116 + MobileMessageCursorChild(nsIMobileMessageCursorCallback* aCallback); 1.117 + 1.118 +protected: 1.119 + virtual ~MobileMessageCursorChild() 1.120 + { 1.121 + MOZ_COUNT_DTOR(MobileMessageCursorChild); 1.122 + } 1.123 + 1.124 + virtual void 1.125 + ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; 1.126 + 1.127 + virtual bool 1.128 + RecvNotifyResult(const MobileMessageCursorData& aData) MOZ_OVERRIDE; 1.129 + 1.130 + virtual bool 1.131 + Recv__delete__(const int32_t& aError) MOZ_OVERRIDE; 1.132 +}; 1.133 + 1.134 +} // namespace mobilemessage 1.135 +} // namespace dom 1.136 +} // namespace mozilla 1.137 + 1.138 +#endif // mozilla_dom_mobilemessage_SmsChild_h