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 |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef mozilla_dom_mobilemessage_MobileMessageManager_h |
michael@0 | 7 | #define mozilla_dom_mobilemessage_MobileMessageManager_h |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/DOMEventTargetHelper.h" |
michael@0 | 10 | #include "nsIDOMMobileMessageManager.h" |
michael@0 | 11 | #include "nsIObserver.h" |
michael@0 | 12 | |
michael@0 | 13 | class nsIDOMMozSmsMessage; |
michael@0 | 14 | class nsIDOMMozMmsMessage; |
michael@0 | 15 | |
michael@0 | 16 | namespace mozilla { |
michael@0 | 17 | namespace dom { |
michael@0 | 18 | |
michael@0 | 19 | class MobileMessageManager : public DOMEventTargetHelper |
michael@0 | 20 | , public nsIDOMMozMobileMessageManager |
michael@0 | 21 | , public nsIObserver |
michael@0 | 22 | { |
michael@0 | 23 | public: |
michael@0 | 24 | NS_DECL_ISUPPORTS_INHERITED |
michael@0 | 25 | NS_DECL_NSIOBSERVER |
michael@0 | 26 | NS_DECL_NSIDOMMOZMOBILEMESSAGEMANAGER |
michael@0 | 27 | |
michael@0 | 28 | NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper) |
michael@0 | 29 | |
michael@0 | 30 | void Init(nsPIDOMWindow *aWindow); |
michael@0 | 31 | void Shutdown(); |
michael@0 | 32 | |
michael@0 | 33 | private: |
michael@0 | 34 | /** |
michael@0 | 35 | * Internal Send() method used to send one message. |
michael@0 | 36 | */ |
michael@0 | 37 | nsresult Send(JSContext* aCx, JS::Handle<JSObject*> aGlobal, |
michael@0 | 38 | uint32_t aServiceId, |
michael@0 | 39 | JS::Handle<JSString*> aNumber, |
michael@0 | 40 | const nsAString& aMessage, |
michael@0 | 41 | JS::Value* aRequest); |
michael@0 | 42 | |
michael@0 | 43 | nsresult DispatchTrustedSmsEventToSelf(const char* aTopic, |
michael@0 | 44 | const nsAString& aEventName, |
michael@0 | 45 | nsISupports* aMsg); |
michael@0 | 46 | |
michael@0 | 47 | /** |
michael@0 | 48 | * Helper to get message ID from SMS/MMS Message object |
michael@0 | 49 | */ |
michael@0 | 50 | nsresult GetMessageId(JSContext* aCx, const JS::Value& aMessage, |
michael@0 | 51 | int32_t* aId); |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | } // namespace dom |
michael@0 | 55 | } // namespace mozilla |
michael@0 | 56 | |
michael@0 | 57 | #endif // mozilla_dom_mobilemessage_MobileMessageManager_h |