Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef mozilla_dom_Icc_h |
michael@0 | 6 | #define mozilla_dom_Icc_h |
michael@0 | 7 | |
michael@0 | 8 | #include "mozilla/DOMEventTargetHelper.h" |
michael@0 | 9 | #include "nsIIccProvider.h" |
michael@0 | 10 | |
michael@0 | 11 | namespace mozilla { |
michael@0 | 12 | namespace dom { |
michael@0 | 13 | |
michael@0 | 14 | class Icc MOZ_FINAL : public DOMEventTargetHelper |
michael@0 | 15 | { |
michael@0 | 16 | public: |
michael@0 | 17 | NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper) |
michael@0 | 18 | |
michael@0 | 19 | Icc(nsPIDOMWindow* aWindow, long aClientId, const nsAString& aIccId); |
michael@0 | 20 | |
michael@0 | 21 | void |
michael@0 | 22 | Shutdown(); |
michael@0 | 23 | |
michael@0 | 24 | nsresult |
michael@0 | 25 | NotifyEvent(const nsAString& aName); |
michael@0 | 26 | |
michael@0 | 27 | nsresult |
michael@0 | 28 | NotifyStkEvent(const nsAString& aName, const nsAString& aMessage); |
michael@0 | 29 | |
michael@0 | 30 | nsString |
michael@0 | 31 | GetIccId() |
michael@0 | 32 | { |
michael@0 | 33 | return mIccId; |
michael@0 | 34 | } |
michael@0 | 35 | |
michael@0 | 36 | nsPIDOMWindow* |
michael@0 | 37 | GetParentObject() const |
michael@0 | 38 | { |
michael@0 | 39 | return GetOwner(); |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | // WrapperCache |
michael@0 | 43 | virtual JSObject* |
michael@0 | 44 | WrapObject(JSContext* aCx) MOZ_OVERRIDE; |
michael@0 | 45 | |
michael@0 | 46 | // MozIcc WebIDL |
michael@0 | 47 | already_AddRefed<nsIDOMMozIccInfo> |
michael@0 | 48 | GetIccInfo() const; |
michael@0 | 49 | |
michael@0 | 50 | void |
michael@0 | 51 | GetCardState(nsString& aCardState) const; |
michael@0 | 52 | |
michael@0 | 53 | void |
michael@0 | 54 | SendStkResponse(const JSContext* aCx, JS::Handle<JS::Value> aCommand, |
michael@0 | 55 | JS::Handle<JS::Value> aResponse, ErrorResult& aRv); |
michael@0 | 56 | |
michael@0 | 57 | void |
michael@0 | 58 | SendStkMenuSelection(uint16_t aItemIdentifier, bool aHelpRequested, |
michael@0 | 59 | ErrorResult& aRv); |
michael@0 | 60 | |
michael@0 | 61 | void |
michael@0 | 62 | SendStkTimerExpiration(const JSContext* aCx, JS::Handle<JS::Value> aTimer, |
michael@0 | 63 | ErrorResult& aRv); |
michael@0 | 64 | |
michael@0 | 65 | void |
michael@0 | 66 | SendStkEventDownload(const JSContext* aCx, JS::Handle<JS::Value> aEvent, |
michael@0 | 67 | ErrorResult& aRv); |
michael@0 | 68 | |
michael@0 | 69 | already_AddRefed<nsISupports> |
michael@0 | 70 | GetCardLock(const nsAString& aLockType, ErrorResult& aRv); |
michael@0 | 71 | |
michael@0 | 72 | already_AddRefed<nsISupports> |
michael@0 | 73 | UnlockCardLock(const JSContext* aCx, JS::Handle<JS::Value> aInfo, |
michael@0 | 74 | ErrorResult& aRv); |
michael@0 | 75 | |
michael@0 | 76 | already_AddRefed<nsISupports> |
michael@0 | 77 | SetCardLock(const JSContext* aCx, JS::Handle<JS::Value> aInfo, |
michael@0 | 78 | ErrorResult& aRv); |
michael@0 | 79 | |
michael@0 | 80 | already_AddRefed<nsISupports> |
michael@0 | 81 | GetCardLockRetryCount(const nsAString& aLockType, ErrorResult& aRv); |
michael@0 | 82 | |
michael@0 | 83 | already_AddRefed<nsISupports> |
michael@0 | 84 | ReadContacts(const nsAString& aContactType, ErrorResult& aRv); |
michael@0 | 85 | |
michael@0 | 86 | already_AddRefed<nsISupports> |
michael@0 | 87 | UpdateContact(const JSContext* aCx, const nsAString& aContactType, |
michael@0 | 88 | JS::Handle<JS::Value> aContact, const nsAString& aPin2, |
michael@0 | 89 | ErrorResult& aRv); |
michael@0 | 90 | |
michael@0 | 91 | already_AddRefed<nsISupports> |
michael@0 | 92 | IccOpenChannel(const nsAString& aAid, ErrorResult& aRv); |
michael@0 | 93 | |
michael@0 | 94 | already_AddRefed<nsISupports> |
michael@0 | 95 | IccExchangeAPDU(const JSContext* aCx, int32_t aChannel, |
michael@0 | 96 | JS::Handle<JS::Value> aApdu, ErrorResult& aRv); |
michael@0 | 97 | |
michael@0 | 98 | already_AddRefed<nsISupports> |
michael@0 | 99 | IccCloseChannel(int32_t aChannel, ErrorResult& aRv); |
michael@0 | 100 | |
michael@0 | 101 | already_AddRefed<nsISupports> |
michael@0 | 102 | MatchMvno(const nsAString& aMvnoType, const nsAString& aMatchData, |
michael@0 | 103 | ErrorResult& aRv); |
michael@0 | 104 | |
michael@0 | 105 | IMPL_EVENT_HANDLER(iccinfochange) |
michael@0 | 106 | IMPL_EVENT_HANDLER(cardstatechange) |
michael@0 | 107 | IMPL_EVENT_HANDLER(stkcommand) |
michael@0 | 108 | IMPL_EVENT_HANDLER(stksessionend) |
michael@0 | 109 | |
michael@0 | 110 | private: |
michael@0 | 111 | bool mLive; |
michael@0 | 112 | uint32_t mClientId; |
michael@0 | 113 | nsString mIccId; |
michael@0 | 114 | // mProvider is a xpcom service and will be released at shutdown, so it |
michael@0 | 115 | // doesn't need to be cycle collected. |
michael@0 | 116 | nsCOMPtr<nsIIccProvider> mProvider; |
michael@0 | 117 | }; |
michael@0 | 118 | |
michael@0 | 119 | } // namespace dom |
michael@0 | 120 | } // namespace mozilla |
michael@0 | 121 | |
michael@0 | 122 | #endif // mozilla_dom_icc_Icc_h |