Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef mozilla_dom_mobilemessage_SmsParent_h |
michael@0 | 7 | #define mozilla_dom_mobilemessage_SmsParent_h |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/dom/mobilemessage/PSmsParent.h" |
michael@0 | 10 | #include "mozilla/dom/mobilemessage/PSmsRequestParent.h" |
michael@0 | 11 | #include "mozilla/dom/mobilemessage/PMobileMessageCursorParent.h" |
michael@0 | 12 | #include "nsIDOMDOMCursor.h" |
michael@0 | 13 | #include "nsIMobileMessageCallback.h" |
michael@0 | 14 | #include "nsIMobileMessageCursorCallback.h" |
michael@0 | 15 | #include "nsIObserver.h" |
michael@0 | 16 | |
michael@0 | 17 | namespace mozilla { |
michael@0 | 18 | namespace dom { |
michael@0 | 19 | |
michael@0 | 20 | class ContentParent; |
michael@0 | 21 | |
michael@0 | 22 | namespace mobilemessage { |
michael@0 | 23 | |
michael@0 | 24 | class SmsParent : public PSmsParent |
michael@0 | 25 | , public nsIObserver |
michael@0 | 26 | { |
michael@0 | 27 | friend class mozilla::dom::ContentParent; |
michael@0 | 28 | |
michael@0 | 29 | public: |
michael@0 | 30 | NS_DECL_ISUPPORTS |
michael@0 | 31 | NS_DECL_NSIOBSERVER |
michael@0 | 32 | |
michael@0 | 33 | protected: |
michael@0 | 34 | virtual bool |
michael@0 | 35 | RecvAddSilentNumber(const nsString& aNumber) MOZ_OVERRIDE; |
michael@0 | 36 | |
michael@0 | 37 | virtual bool |
michael@0 | 38 | RecvRemoveSilentNumber(const nsString& aNumber) MOZ_OVERRIDE; |
michael@0 | 39 | |
michael@0 | 40 | SmsParent(); |
michael@0 | 41 | virtual ~SmsParent() |
michael@0 | 42 | { |
michael@0 | 43 | MOZ_COUNT_DTOR(SmsParent); |
michael@0 | 44 | } |
michael@0 | 45 | |
michael@0 | 46 | virtual void |
michael@0 | 47 | ActorDestroy(ActorDestroyReason why); |
michael@0 | 48 | |
michael@0 | 49 | virtual bool |
michael@0 | 50 | RecvPSmsRequestConstructor(PSmsRequestParent* aActor, |
michael@0 | 51 | const IPCSmsRequest& aRequest) MOZ_OVERRIDE; |
michael@0 | 52 | |
michael@0 | 53 | virtual PSmsRequestParent* |
michael@0 | 54 | AllocPSmsRequestParent(const IPCSmsRequest& aRequest) MOZ_OVERRIDE; |
michael@0 | 55 | |
michael@0 | 56 | virtual bool |
michael@0 | 57 | DeallocPSmsRequestParent(PSmsRequestParent* aActor) MOZ_OVERRIDE; |
michael@0 | 58 | |
michael@0 | 59 | virtual bool |
michael@0 | 60 | RecvPMobileMessageCursorConstructor(PMobileMessageCursorParent* aActor, |
michael@0 | 61 | const IPCMobileMessageCursor& aCursor) MOZ_OVERRIDE; |
michael@0 | 62 | |
michael@0 | 63 | virtual PMobileMessageCursorParent* |
michael@0 | 64 | AllocPMobileMessageCursorParent(const IPCMobileMessageCursor& aCursor) MOZ_OVERRIDE; |
michael@0 | 65 | |
michael@0 | 66 | virtual bool |
michael@0 | 67 | DeallocPMobileMessageCursorParent(PMobileMessageCursorParent* aActor) MOZ_OVERRIDE; |
michael@0 | 68 | |
michael@0 | 69 | bool |
michael@0 | 70 | GetMobileMessageDataFromMessage(nsISupports* aMsg, MobileMessageData& aData); |
michael@0 | 71 | |
michael@0 | 72 | private: |
michael@0 | 73 | nsTArray<nsString> mSilentNumbers; |
michael@0 | 74 | }; |
michael@0 | 75 | |
michael@0 | 76 | class SmsRequestParent : public PSmsRequestParent |
michael@0 | 77 | , public nsIMobileMessageCallback |
michael@0 | 78 | { |
michael@0 | 79 | friend class SmsParent; |
michael@0 | 80 | |
michael@0 | 81 | bool mActorDestroyed; |
michael@0 | 82 | |
michael@0 | 83 | public: |
michael@0 | 84 | NS_DECL_ISUPPORTS |
michael@0 | 85 | NS_DECL_NSIMOBILEMESSAGECALLBACK |
michael@0 | 86 | |
michael@0 | 87 | protected: |
michael@0 | 88 | SmsRequestParent() |
michael@0 | 89 | : mActorDestroyed(false) |
michael@0 | 90 | { |
michael@0 | 91 | MOZ_COUNT_CTOR(SmsRequestParent); |
michael@0 | 92 | } |
michael@0 | 93 | |
michael@0 | 94 | virtual ~SmsRequestParent() |
michael@0 | 95 | { |
michael@0 | 96 | MOZ_COUNT_DTOR(SmsRequestParent); |
michael@0 | 97 | } |
michael@0 | 98 | |
michael@0 | 99 | virtual void |
michael@0 | 100 | ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; |
michael@0 | 101 | |
michael@0 | 102 | bool |
michael@0 | 103 | DoRequest(const SendMessageRequest& aRequest); |
michael@0 | 104 | |
michael@0 | 105 | bool |
michael@0 | 106 | DoRequest(const RetrieveMessageRequest& aRequest); |
michael@0 | 107 | |
michael@0 | 108 | bool |
michael@0 | 109 | DoRequest(const GetMessageRequest& aRequest); |
michael@0 | 110 | |
michael@0 | 111 | bool |
michael@0 | 112 | DoRequest(const DeleteMessageRequest& aRequest); |
michael@0 | 113 | |
michael@0 | 114 | bool |
michael@0 | 115 | DoRequest(const MarkMessageReadRequest& aRequest); |
michael@0 | 116 | |
michael@0 | 117 | bool |
michael@0 | 118 | DoRequest(const GetSegmentInfoForTextRequest& aRequest); |
michael@0 | 119 | |
michael@0 | 120 | bool |
michael@0 | 121 | DoRequest(const GetSmscAddressRequest& aRequest); |
michael@0 | 122 | |
michael@0 | 123 | nsresult |
michael@0 | 124 | SendReply(const MessageReply& aReply); |
michael@0 | 125 | }; |
michael@0 | 126 | |
michael@0 | 127 | class MobileMessageCursorParent : public PMobileMessageCursorParent |
michael@0 | 128 | , public nsIMobileMessageCursorCallback |
michael@0 | 129 | { |
michael@0 | 130 | friend class SmsParent; |
michael@0 | 131 | |
michael@0 | 132 | nsCOMPtr<nsICursorContinueCallback> mContinueCallback; |
michael@0 | 133 | |
michael@0 | 134 | public: |
michael@0 | 135 | NS_DECL_ISUPPORTS |
michael@0 | 136 | NS_DECL_NSIMOBILEMESSAGECURSORCALLBACK |
michael@0 | 137 | |
michael@0 | 138 | protected: |
michael@0 | 139 | MobileMessageCursorParent() |
michael@0 | 140 | { |
michael@0 | 141 | MOZ_COUNT_CTOR(MobileMessageCursorParent); |
michael@0 | 142 | } |
michael@0 | 143 | |
michael@0 | 144 | virtual ~MobileMessageCursorParent() |
michael@0 | 145 | { |
michael@0 | 146 | MOZ_COUNT_DTOR(MobileMessageCursorParent); |
michael@0 | 147 | } |
michael@0 | 148 | |
michael@0 | 149 | virtual void |
michael@0 | 150 | ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE; |
michael@0 | 151 | |
michael@0 | 152 | virtual bool |
michael@0 | 153 | RecvContinue() MOZ_OVERRIDE; |
michael@0 | 154 | |
michael@0 | 155 | bool |
michael@0 | 156 | DoRequest(const CreateMessageCursorRequest& aRequest); |
michael@0 | 157 | |
michael@0 | 158 | bool |
michael@0 | 159 | DoRequest(const CreateThreadCursorRequest& aRequest); |
michael@0 | 160 | }; |
michael@0 | 161 | |
michael@0 | 162 | } // namespace mobilemessage |
michael@0 | 163 | } // namespace dom |
michael@0 | 164 | } // namespace mozilla |
michael@0 | 165 | |
michael@0 | 166 | #endif // mozilla_dom_mobilemessage_SmsParent_h |