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