dom/mobilemessage/src/MobileMessageManager.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/mobilemessage/src/MobileMessageManager.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     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
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef mozilla_dom_mobilemessage_MobileMessageManager_h
    1.10 +#define mozilla_dom_mobilemessage_MobileMessageManager_h
    1.11 +
    1.12 +#include "mozilla/DOMEventTargetHelper.h"
    1.13 +#include "nsIDOMMobileMessageManager.h"
    1.14 +#include "nsIObserver.h"
    1.15 +
    1.16 +class nsIDOMMozSmsMessage;
    1.17 +class nsIDOMMozMmsMessage;
    1.18 +
    1.19 +namespace mozilla {
    1.20 +namespace dom {
    1.21 +
    1.22 +class MobileMessageManager : public DOMEventTargetHelper
    1.23 +                           , public nsIDOMMozMobileMessageManager
    1.24 +                           , public nsIObserver
    1.25 +{
    1.26 +public:
    1.27 +  NS_DECL_ISUPPORTS_INHERITED
    1.28 +  NS_DECL_NSIOBSERVER
    1.29 +  NS_DECL_NSIDOMMOZMOBILEMESSAGEMANAGER
    1.30 +
    1.31 +  NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
    1.32 +
    1.33 +  void Init(nsPIDOMWindow *aWindow);
    1.34 +  void Shutdown();
    1.35 +
    1.36 +private:
    1.37 +  /**
    1.38 +   * Internal Send() method used to send one message.
    1.39 +   */
    1.40 +  nsresult Send(JSContext* aCx, JS::Handle<JSObject*> aGlobal,
    1.41 +                uint32_t aServiceId,
    1.42 +                JS::Handle<JSString*> aNumber,
    1.43 +                const nsAString& aMessage,
    1.44 +                JS::Value* aRequest);
    1.45 +
    1.46 +  nsresult DispatchTrustedSmsEventToSelf(const char* aTopic,
    1.47 +                                         const nsAString& aEventName,
    1.48 +                                         nsISupports* aMsg);
    1.49 +
    1.50 +  /**
    1.51 +   * Helper to get message ID from SMS/MMS Message object
    1.52 +   */
    1.53 +  nsresult GetMessageId(JSContext* aCx, const JS::Value& aMessage,
    1.54 +                        int32_t* aId);
    1.55 +};
    1.56 +
    1.57 +} // namespace dom
    1.58 +} // namespace mozilla
    1.59 +
    1.60 +#endif // mozilla_dom_mobilemessage_MobileMessageManager_h

mercurial