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 michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_mobilemessage_MobileMessageManager_h michael@0: #define mozilla_dom_mobilemessage_MobileMessageManager_h michael@0: michael@0: #include "mozilla/DOMEventTargetHelper.h" michael@0: #include "nsIDOMMobileMessageManager.h" michael@0: #include "nsIObserver.h" michael@0: michael@0: class nsIDOMMozSmsMessage; michael@0: class nsIDOMMozMmsMessage; michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class MobileMessageManager : public DOMEventTargetHelper michael@0: , public nsIDOMMozMobileMessageManager michael@0: , public nsIObserver michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: NS_DECL_NSIOBSERVER michael@0: NS_DECL_NSIDOMMOZMOBILEMESSAGEMANAGER michael@0: michael@0: NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper) michael@0: michael@0: void Init(nsPIDOMWindow *aWindow); michael@0: void Shutdown(); michael@0: michael@0: private: michael@0: /** michael@0: * Internal Send() method used to send one message. michael@0: */ michael@0: nsresult Send(JSContext* aCx, JS::Handle aGlobal, michael@0: uint32_t aServiceId, michael@0: JS::Handle aNumber, michael@0: const nsAString& aMessage, michael@0: JS::Value* aRequest); michael@0: michael@0: nsresult DispatchTrustedSmsEventToSelf(const char* aTopic, michael@0: const nsAString& aEventName, michael@0: nsISupports* aMsg); michael@0: michael@0: /** michael@0: * Helper to get message ID from SMS/MMS Message object michael@0: */ michael@0: nsresult GetMessageId(JSContext* aCx, const JS::Value& aMessage, michael@0: int32_t* aId); michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_mobilemessage_MobileMessageManager_h