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 file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_Icc_h michael@0: #define mozilla_dom_Icc_h michael@0: michael@0: #include "mozilla/DOMEventTargetHelper.h" michael@0: #include "nsIIccProvider.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class Icc MOZ_FINAL : public DOMEventTargetHelper michael@0: { michael@0: public: michael@0: NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper) michael@0: michael@0: Icc(nsPIDOMWindow* aWindow, long aClientId, const nsAString& aIccId); michael@0: michael@0: void michael@0: Shutdown(); michael@0: michael@0: nsresult michael@0: NotifyEvent(const nsAString& aName); michael@0: michael@0: nsresult michael@0: NotifyStkEvent(const nsAString& aName, const nsAString& aMessage); michael@0: michael@0: nsString michael@0: GetIccId() michael@0: { michael@0: return mIccId; michael@0: } michael@0: michael@0: nsPIDOMWindow* michael@0: GetParentObject() const michael@0: { michael@0: return GetOwner(); michael@0: } michael@0: michael@0: // WrapperCache michael@0: virtual JSObject* michael@0: WrapObject(JSContext* aCx) MOZ_OVERRIDE; michael@0: michael@0: // MozIcc WebIDL michael@0: already_AddRefed michael@0: GetIccInfo() const; michael@0: michael@0: void michael@0: GetCardState(nsString& aCardState) const; michael@0: michael@0: void michael@0: SendStkResponse(const JSContext* aCx, JS::Handle aCommand, michael@0: JS::Handle aResponse, ErrorResult& aRv); michael@0: michael@0: void michael@0: SendStkMenuSelection(uint16_t aItemIdentifier, bool aHelpRequested, michael@0: ErrorResult& aRv); michael@0: michael@0: void michael@0: SendStkTimerExpiration(const JSContext* aCx, JS::Handle aTimer, michael@0: ErrorResult& aRv); michael@0: michael@0: void michael@0: SendStkEventDownload(const JSContext* aCx, JS::Handle aEvent, michael@0: ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: GetCardLock(const nsAString& aLockType, ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: UnlockCardLock(const JSContext* aCx, JS::Handle aInfo, michael@0: ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: SetCardLock(const JSContext* aCx, JS::Handle aInfo, michael@0: ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: GetCardLockRetryCount(const nsAString& aLockType, ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: ReadContacts(const nsAString& aContactType, ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: UpdateContact(const JSContext* aCx, const nsAString& aContactType, michael@0: JS::Handle aContact, const nsAString& aPin2, michael@0: ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: IccOpenChannel(const nsAString& aAid, ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: IccExchangeAPDU(const JSContext* aCx, int32_t aChannel, michael@0: JS::Handle aApdu, ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: IccCloseChannel(int32_t aChannel, ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: MatchMvno(const nsAString& aMvnoType, const nsAString& aMatchData, michael@0: ErrorResult& aRv); michael@0: michael@0: IMPL_EVENT_HANDLER(iccinfochange) michael@0: IMPL_EVENT_HANDLER(cardstatechange) michael@0: IMPL_EVENT_HANDLER(stkcommand) michael@0: IMPL_EVENT_HANDLER(stksessionend) michael@0: michael@0: private: michael@0: bool mLive; michael@0: uint32_t mClientId; michael@0: nsString mIccId; michael@0: // mProvider is a xpcom service and will be released at shutdown, so it michael@0: // doesn't need to be cycle collected. michael@0: nsCOMPtr mProvider; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_icc_Icc_h