1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
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_TVChannel_h
8 #define mozilla_dom_TVChannel_h
10 #include "mozilla/DOMEventTargetHelper.h"
11 // Include TVChannelBinding.h since enum TVChannelType can't be forward declared.
12 #include "mozilla/dom/TVChannelBinding.h"
14 class nsITVChannelData
;
24 class TVChannel MOZ_FINAL
: public DOMEventTargetHelper
27 NS_DECL_ISUPPORTS_INHERITED
28 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TVChannel
, DOMEventTargetHelper
)
30 static already_AddRefed
<TVChannel
> Create(nsPIDOMWindow
* aWindow
,
32 nsITVChannelData
* aData
);
34 // WebIDL (internal functions)
36 virtual JSObject
* WrapObject(JSContext
*aCx
) MOZ_OVERRIDE
;
38 nsresult
DispatchTVEvent(nsIDOMEvent
* aEvent
);
40 // WebIDL (public APIs)
42 already_AddRefed
<Promise
> GetPrograms(const TVGetProgramsOptions
& aOptions
,
45 already_AddRefed
<Promise
> GetCurrentProgram(ErrorResult
& aRv
);
47 void GetNetworkId(nsAString
& aNetworkId
) const;
49 void GetTransportStreamId(nsAString
& aTransportStreamId
) const;
51 void GetServiceId(nsAString
& aServiceId
) const;
53 already_AddRefed
<TVSource
> Source() const;
55 TVChannelType
Type() const;
57 void GetName(nsAString
& aName
) const;
59 void GetNumber(nsAString
& aNumber
) const;
61 bool IsEmergency() const;
66 TVChannel(nsPIDOMWindow
* aWindow
,
71 bool Init(nsITVChannelData
* aData
);
73 nsCOMPtr
<nsITVService
> mTVService
;
74 nsRefPtr
<TVSource
> mSource
;
76 nsString mTransportStreamId
;
86 } // namespace mozilla
88 #endif // mozilla_dom_TVChannel_h