michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_mobilemessage_SmsParent_h michael@0: #define mozilla_dom_mobilemessage_SmsParent_h michael@0: michael@0: #include "mozilla/dom/mobilemessage/PSmsParent.h" michael@0: #include "mozilla/dom/mobilemessage/PSmsRequestParent.h" michael@0: #include "mozilla/dom/mobilemessage/PMobileMessageCursorParent.h" michael@0: #include "nsIDOMDOMCursor.h" michael@0: #include "nsIMobileMessageCallback.h" michael@0: #include "nsIMobileMessageCursorCallback.h" michael@0: #include "nsIObserver.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class ContentParent; michael@0: michael@0: namespace mobilemessage { michael@0: michael@0: class SmsParent : public PSmsParent michael@0: , public nsIObserver michael@0: { michael@0: friend class mozilla::dom::ContentParent; michael@0: michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIOBSERVER michael@0: michael@0: protected: michael@0: virtual bool michael@0: RecvAddSilentNumber(const nsString& aNumber) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvRemoveSilentNumber(const nsString& aNumber) MOZ_OVERRIDE; michael@0: michael@0: SmsParent(); michael@0: virtual ~SmsParent() michael@0: { michael@0: MOZ_COUNT_DTOR(SmsParent); michael@0: } michael@0: michael@0: virtual void michael@0: ActorDestroy(ActorDestroyReason why); michael@0: michael@0: virtual bool michael@0: RecvPSmsRequestConstructor(PSmsRequestParent* aActor, michael@0: const IPCSmsRequest& aRequest) MOZ_OVERRIDE; michael@0: michael@0: virtual PSmsRequestParent* michael@0: AllocPSmsRequestParent(const IPCSmsRequest& aRequest) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: DeallocPSmsRequestParent(PSmsRequestParent* aActor) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvPMobileMessageCursorConstructor(PMobileMessageCursorParent* aActor, michael@0: const IPCMobileMessageCursor& aCursor) MOZ_OVERRIDE; michael@0: michael@0: virtual PMobileMessageCursorParent* michael@0: AllocPMobileMessageCursorParent(const IPCMobileMessageCursor& aCursor) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: DeallocPMobileMessageCursorParent(PMobileMessageCursorParent* aActor) MOZ_OVERRIDE; michael@0: michael@0: bool michael@0: GetMobileMessageDataFromMessage(nsISupports* aMsg, MobileMessageData& aData); michael@0: michael@0: private: michael@0: nsTArray mSilentNumbers; michael@0: }; michael@0: michael@0: class SmsRequestParent : public PSmsRequestParent michael@0: , public nsIMobileMessageCallback michael@0: { michael@0: friend class SmsParent; michael@0: michael@0: bool mActorDestroyed; michael@0: michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIMOBILEMESSAGECALLBACK michael@0: michael@0: protected: michael@0: SmsRequestParent() michael@0: : mActorDestroyed(false) michael@0: { michael@0: MOZ_COUNT_CTOR(SmsRequestParent); michael@0: } michael@0: michael@0: virtual ~SmsRequestParent() michael@0: { michael@0: MOZ_COUNT_DTOR(SmsRequestParent); michael@0: } michael@0: michael@0: virtual void michael@0: ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; michael@0: michael@0: bool michael@0: DoRequest(const SendMessageRequest& aRequest); michael@0: michael@0: bool michael@0: DoRequest(const RetrieveMessageRequest& aRequest); michael@0: michael@0: bool michael@0: DoRequest(const GetMessageRequest& aRequest); michael@0: michael@0: bool michael@0: DoRequest(const DeleteMessageRequest& aRequest); michael@0: michael@0: bool michael@0: DoRequest(const MarkMessageReadRequest& aRequest); michael@0: michael@0: bool michael@0: DoRequest(const GetSegmentInfoForTextRequest& aRequest); michael@0: michael@0: bool michael@0: DoRequest(const GetSmscAddressRequest& aRequest); michael@0: michael@0: nsresult michael@0: SendReply(const MessageReply& aReply); michael@0: }; michael@0: michael@0: class MobileMessageCursorParent : public PMobileMessageCursorParent michael@0: , public nsIMobileMessageCursorCallback michael@0: { michael@0: friend class SmsParent; michael@0: michael@0: nsCOMPtr mContinueCallback; michael@0: michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIMOBILEMESSAGECURSORCALLBACK michael@0: michael@0: protected: michael@0: MobileMessageCursorParent() michael@0: { michael@0: MOZ_COUNT_CTOR(MobileMessageCursorParent); michael@0: } michael@0: michael@0: virtual ~MobileMessageCursorParent() michael@0: { michael@0: MOZ_COUNT_DTOR(MobileMessageCursorParent); michael@0: } michael@0: michael@0: virtual void michael@0: ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: RecvContinue() MOZ_OVERRIDE; michael@0: michael@0: bool michael@0: DoRequest(const CreateMessageCursorRequest& aRequest); michael@0: michael@0: bool michael@0: DoRequest(const CreateThreadCursorRequest& aRequest); michael@0: }; michael@0: michael@0: } // namespace mobilemessage michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_mobilemessage_SmsParent_h