2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2013-10-09 13:40:12 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_Icc_h
|
|
|
|
#define mozilla_dom_Icc_h
|
|
|
|
|
2014-11-11 13:16:57 +03:00
|
|
|
#include "mozilla/dom/MozIccBinding.h"
|
2014-04-01 10:13:50 +04:00
|
|
|
#include "mozilla/DOMEventTargetHelper.h"
|
2014-09-19 11:53:05 +04:00
|
|
|
|
2015-01-13 13:03:44 +03:00
|
|
|
class nsIIcc;
|
2014-09-19 11:53:05 +04:00
|
|
|
class nsIIccInfo;
|
|
|
|
class nsIIccProvider;
|
2015-04-27 11:01:56 +03:00
|
|
|
class nsIStkProactiveCmd;
|
2013-10-09 13:40:12 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2014-05-20 00:37:58 +04:00
|
|
|
class DOMRequest;
|
2014-10-01 22:43:26 +04:00
|
|
|
class OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo;
|
2015-06-16 12:38:27 +03:00
|
|
|
class mozContact;
|
2014-12-26 05:11:20 +03:00
|
|
|
class Promise;
|
2014-05-20 00:37:58 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class Icc final : public DOMEventTargetHelper
|
2013-10-09 13:40:12 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-09-19 11:53:05 +04:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(Icc, DOMEventTargetHelper)
|
2014-04-01 10:13:50 +04:00
|
|
|
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
|
2013-10-09 13:40:12 +04:00
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
Icc(nsPIDOMWindowInner* aWindow, nsIIcc* aHandler, nsIIccInfo* aIccInfo);
|
2013-10-09 13:40:12 +04:00
|
|
|
|
|
|
|
void
|
|
|
|
Shutdown();
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NotifyEvent(const nsAString& aName);
|
|
|
|
|
|
|
|
nsresult
|
2015-04-27 11:01:56 +03:00
|
|
|
NotifyStkEvent(const nsAString& aName, nsIStkProactiveCmd* aStkProactiveCmd);
|
2013-10-09 13:40:12 +04:00
|
|
|
|
|
|
|
nsString
|
|
|
|
GetIccId()
|
|
|
|
{
|
|
|
|
return mIccId;
|
|
|
|
}
|
|
|
|
|
2014-09-19 11:53:05 +04:00
|
|
|
void
|
|
|
|
UpdateIccInfo(nsIIccInfo* aIccInfo);
|
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
nsPIDOMWindowInner*
|
2013-10-09 13:40:12 +04:00
|
|
|
GetParentObject() const
|
|
|
|
{
|
|
|
|
return GetOwner();
|
|
|
|
}
|
|
|
|
|
|
|
|
// WrapperCache
|
|
|
|
virtual JSObject*
|
2015-03-21 19:28:04 +03:00
|
|
|
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-10-09 13:40:12 +04:00
|
|
|
|
|
|
|
// MozIcc WebIDL
|
2014-09-19 11:53:05 +04:00
|
|
|
void
|
|
|
|
GetIccInfo(Nullable<OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo>& aIccInfo) const;
|
2013-10-09 13:40:12 +04:00
|
|
|
|
2014-09-03 15:31:00 +04:00
|
|
|
Nullable<IccCardState>
|
|
|
|
GetCardState() const;
|
2013-10-09 13:40:12 +04:00
|
|
|
|
|
|
|
void
|
2014-01-09 21:39:36 +04:00
|
|
|
SendStkResponse(const JSContext* aCx, JS::Handle<JS::Value> aCommand,
|
|
|
|
JS::Handle<JS::Value> aResponse, ErrorResult& aRv);
|
2013-10-09 13:40:12 +04:00
|
|
|
|
|
|
|
void
|
|
|
|
SendStkMenuSelection(uint16_t aItemIdentifier, bool aHelpRequested,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
|
|
|
void
|
2014-01-09 21:39:36 +04:00
|
|
|
SendStkTimerExpiration(const JSContext* aCx, JS::Handle<JS::Value> aTimer,
|
2013-10-09 13:40:12 +04:00
|
|
|
ErrorResult& aRv);
|
|
|
|
|
|
|
|
void
|
2014-01-09 21:39:36 +04:00
|
|
|
SendStkEventDownload(const JSContext* aCx, JS::Handle<JS::Value> aEvent,
|
2013-10-09 13:40:12 +04:00
|
|
|
ErrorResult& aRv);
|
|
|
|
|
2014-05-20 00:37:58 +04:00
|
|
|
already_AddRefed<DOMRequest>
|
2014-11-11 13:16:57 +03:00
|
|
|
GetCardLock(IccLockType aLockType, ErrorResult& aRv);
|
2013-10-09 13:40:12 +04:00
|
|
|
|
2014-05-20 00:37:58 +04:00
|
|
|
already_AddRefed<DOMRequest>
|
2014-11-11 13:16:57 +03:00
|
|
|
UnlockCardLock(const IccUnlockCardLockOptions& aOptions, ErrorResult& aRv);
|
2013-10-09 13:40:12 +04:00
|
|
|
|
2014-05-20 00:37:58 +04:00
|
|
|
already_AddRefed<DOMRequest>
|
2014-11-11 13:16:57 +03:00
|
|
|
SetCardLock(const IccSetCardLockOptions& aOptions, ErrorResult& aRv);
|
2013-10-09 13:40:12 +04:00
|
|
|
|
2014-05-20 00:37:58 +04:00
|
|
|
already_AddRefed<DOMRequest>
|
2014-11-11 13:16:57 +03:00
|
|
|
GetCardLockRetryCount(IccLockType aLockType, ErrorResult& aRv);
|
2013-10-09 13:40:12 +04:00
|
|
|
|
2014-05-20 00:37:58 +04:00
|
|
|
already_AddRefed<DOMRequest>
|
2014-12-12 06:08:27 +03:00
|
|
|
ReadContacts(IccContactType aContactType, ErrorResult& aRv);
|
2013-10-09 13:40:12 +04:00
|
|
|
|
2014-05-20 00:37:58 +04:00
|
|
|
already_AddRefed<DOMRequest>
|
2015-06-16 12:38:27 +03:00
|
|
|
UpdateContact(IccContactType aContactType, mozContact& aContact,
|
|
|
|
const nsAString& aPin2, ErrorResult& aRv);
|
2013-10-09 13:40:12 +04:00
|
|
|
|
2014-05-20 00:37:58 +04:00
|
|
|
already_AddRefed<DOMRequest>
|
2014-12-12 14:04:00 +03:00
|
|
|
MatchMvno(IccMvnoType aMvnoType, const nsAString& aMatchData,
|
2014-01-28 14:58:00 +04:00
|
|
|
ErrorResult& aRv);
|
|
|
|
|
2014-12-26 05:11:20 +03:00
|
|
|
already_AddRefed<Promise>
|
|
|
|
GetServiceState(IccService aService, ErrorResult& aRv);
|
|
|
|
|
2013-10-09 13:40:12 +04:00
|
|
|
IMPL_EVENT_HANDLER(iccinfochange)
|
|
|
|
IMPL_EVENT_HANDLER(cardstatechange)
|
|
|
|
IMPL_EVENT_HANDLER(stkcommand)
|
|
|
|
IMPL_EVENT_HANDLER(stksessionend)
|
|
|
|
|
|
|
|
private:
|
2015-01-13 13:03:44 +03:00
|
|
|
// Put definition of the destructor in Icc.cpp to ensure forward declaration
|
|
|
|
// of nsIIccProvider, nsIIcc for the auto-generated .cpp file (i.e.,
|
|
|
|
// MozIccManagerBinding.cpp) that includes this header.
|
2015-03-12 18:55:50 +03:00
|
|
|
~Icc();
|
2015-03-03 13:06:46 +03:00
|
|
|
|
2013-10-09 13:40:12 +04:00
|
|
|
bool mLive;
|
|
|
|
nsString mIccId;
|
2015-01-13 13:03:44 +03:00
|
|
|
// mHandler will be released at Shutdown(), so there is no need to join cycle
|
|
|
|
// collection.
|
|
|
|
nsCOMPtr<nsIIcc> mHandler;
|
2014-09-19 11:53:05 +04:00
|
|
|
Nullable<OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo> mIccInfo;
|
2013-10-09 13:40:12 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_icc_Icc_h
|