Bumping gaia.json for 4 gaia revision(s) a=gaia-bump
[gecko.git] / dom / telephony / TelephonyCallId.h
blob4596c1f9a2d7c1e61eee85914f2973c96997814a
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_TelephonyCallId_h
8 #define mozilla_dom_TelephonyCallId_h
10 #include "mozilla/dom/TelephonyCallIdBinding.h"
11 #include "mozilla/dom/telephony/TelephonyCommon.h"
13 #include "nsWrapperCache.h"
15 class nsPIDOMWindow;
17 namespace mozilla {
18 namespace dom {
20 class TelephonyCallId MOZ_FINAL : public nsISupports,
21 public nsWrapperCache
23 public:
24 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
25 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TelephonyCallId)
27 TelephonyCallId(nsPIDOMWindow* aWindow, const nsAString& aNumber,
28 uint16_t aNumberPresentation, const nsAString& aName,
29 uint16_t aNamePresentation);
31 nsPIDOMWindow*
32 GetParentObject() const
34 return mWindow;
37 virtual JSObject*
38 WrapObject(JSContext* aCx) MOZ_OVERRIDE;
40 // WebIDL
42 void
43 GetNumber(nsString& aNumber) const
45 aNumber.Assign(mNumber);
48 CallIdPresentation
49 NumberPresentation() const;
51 void
52 GetName(nsString& aName) const
54 aName.Assign(mName);
57 CallIdPresentation
58 NamePresentation() const;
60 void
61 UpdateNumber(const nsAString& aNumber)
63 mNumber = aNumber;
66 private:
67 ~TelephonyCallId();
69 nsCOMPtr<nsPIDOMWindow> mWindow;
70 nsString mNumber;
71 uint16_t mNumberPresentation;
72 nsString mName;
73 uint16_t mNamePresentation;
75 CallIdPresentation
76 GetPresentationStr(uint16_t aPresentation) const;
79 } // namespace dom
80 } // namespace mozilla
82 #endif // mozilla_dom_TelephonyCallId_h