gecko-dev/dom/icc/Icc.h

129 строки
3.3 KiB
C
Исходник Обычный вид История

/* 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
#include "mozilla/dom/MozIccBinding.h"
#include "mozilla/DOMEventTargetHelper.h"
class nsIIccInfo;
class nsIIccProvider;
namespace mozilla {
namespace dom {
class DOMRequest;
class OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo;
class Promise;
class Icc MOZ_FINAL : public DOMEventTargetHelper
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(Icc, DOMEventTargetHelper)
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
Icc(nsPIDOMWindow* aWindow, long aClientId, nsIIccInfo* aIccInfo);
void
Shutdown();
nsresult
NotifyEvent(const nsAString& aName);
nsresult
NotifyStkEvent(const nsAString& aName, const nsAString& aMessage);
nsString
GetIccId()
{
return mIccId;
}
void
UpdateIccInfo(nsIIccInfo* aIccInfo);
nsPIDOMWindow*
GetParentObject() const
{
return GetOwner();
}
// WrapperCache
virtual JSObject*
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv The only manual changes here are to BindingUtils.h, BindingUtils.cpp, Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp, dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp, Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp, Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The rest of this diff was generated by running the following commands: find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
// MozIcc WebIDL
void
GetIccInfo(Nullable<OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo>& aIccInfo) const;
Nullable<IccCardState>
GetCardState() const;
void
SendStkResponse(const JSContext* aCx, JS::Handle<JS::Value> aCommand,
JS::Handle<JS::Value> aResponse, ErrorResult& aRv);
void
SendStkMenuSelection(uint16_t aItemIdentifier, bool aHelpRequested,
ErrorResult& aRv);
void
SendStkTimerExpiration(const JSContext* aCx, JS::Handle<JS::Value> aTimer,
ErrorResult& aRv);
void
SendStkEventDownload(const JSContext* aCx, JS::Handle<JS::Value> aEvent,
ErrorResult& aRv);
already_AddRefed<DOMRequest>
GetCardLock(IccLockType aLockType, ErrorResult& aRv);
already_AddRefed<DOMRequest>
UnlockCardLock(const IccUnlockCardLockOptions& aOptions, ErrorResult& aRv);
already_AddRefed<DOMRequest>
SetCardLock(const IccSetCardLockOptions& aOptions, ErrorResult& aRv);
already_AddRefed<DOMRequest>
GetCardLockRetryCount(IccLockType aLockType, ErrorResult& aRv);
already_AddRefed<DOMRequest>
ReadContacts(IccContactType aContactType, ErrorResult& aRv);
already_AddRefed<DOMRequest>
UpdateContact(const JSContext* aCx, IccContactType aContactType,
JS::Handle<JS::Value> aContact, const nsAString& aPin2,
ErrorResult& aRv);
already_AddRefed<DOMRequest>
MatchMvno(IccMvnoType aMvnoType, const nsAString& aMatchData,
ErrorResult& aRv);
already_AddRefed<Promise>
GetServiceState(IccService aService, ErrorResult& aRv);
IMPL_EVENT_HANDLER(iccinfochange)
IMPL_EVENT_HANDLER(cardstatechange)
IMPL_EVENT_HANDLER(stkcommand)
IMPL_EVENT_HANDLER(stksessionend)
private:
~Icc();
bool mLive;
uint32_t mClientId;
nsString mIccId;
// mProvider is a xpcom service and will be released at shutdown, so it
// doesn't need to be cycle collected.
nsCOMPtr<nsIIccProvider> mProvider;
Nullable<OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo> mIccInfo;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_icc_Icc_h