2012-06-28 14:21:48 +00: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/. */
|
|
|
|
|
2013-10-22 11:23:00 +00:00
|
|
|
#ifndef mozilla_dom_IccManager_h
|
|
|
|
#define mozilla_dom_IccManager_h
|
2012-06-28 14:21:48 +00:00
|
|
|
|
2014-04-01 06:13:50 +00:00
|
|
|
#include "mozilla/DOMEventTargetHelper.h"
|
2012-06-28 14:21:48 +00:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2013-03-06 09:53:27 +00:00
|
|
|
#include "nsIIccProvider.h"
|
2013-10-09 09:40:12 +00:00
|
|
|
#include "nsTArrayHelpers.h"
|
2012-06-28 14:21:48 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-10-09 09:40:12 +00:00
|
|
|
class IccListener;
|
2014-05-19 17:20:21 +00:00
|
|
|
class Icc;
|
2013-03-06 09:53:27 +00:00
|
|
|
|
2014-04-01 06:13:50 +00:00
|
|
|
class IccManager MOZ_FINAL : public DOMEventTargetHelper
|
2013-10-09 09:40:12 +00:00
|
|
|
{
|
2012-06-28 14:21:48 +00:00
|
|
|
public:
|
2013-03-06 09:53:27 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2012-06-28 14:21:48 +00:00
|
|
|
|
2014-04-01 06:13:50 +00:00
|
|
|
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
|
2012-06-28 14:21:48 +00:00
|
|
|
|
2014-04-16 07:30:28 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(IccManager, DOMEventTargetHelper)
|
2013-10-09 09:40:12 +00:00
|
|
|
|
|
|
|
IccManager(nsPIDOMWindow* aWindow);
|
|
|
|
|
|
|
|
void
|
|
|
|
Shutdown();
|
2012-06-28 14:21:48 +00:00
|
|
|
|
2013-10-09 09:40:12 +00:00
|
|
|
nsresult
|
|
|
|
NotifyIccAdd(const nsAString& aIccId);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NotifyIccRemove(const nsAString& aIccId);
|
2012-06-28 14:21:48 +00:00
|
|
|
|
2014-04-16 07:30:28 +00:00
|
|
|
IMPL_EVENT_HANDLER(iccdetected)
|
|
|
|
IMPL_EVENT_HANDLER(iccundetected)
|
|
|
|
|
|
|
|
void
|
|
|
|
GetIccIds(nsTArray<nsString>& aIccIds);
|
2013-10-09 09:40:12 +00:00
|
|
|
|
2014-05-19 17:20:21 +00:00
|
|
|
Icc*
|
2014-04-16 07:30:28 +00:00
|
|
|
GetIccById(const nsAString& aIccId) const;
|
2013-10-09 09:40:12 +00:00
|
|
|
|
2014-04-16 07:30:28 +00:00
|
|
|
nsPIDOMWindow*
|
|
|
|
GetParentObject() const { return GetOwner(); }
|
|
|
|
|
|
|
|
virtual JSObject*
|
|
|
|
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
|
|
|
|
2014-07-11 07:58:01 +00:00
|
|
|
private:
|
|
|
|
~IccManager();
|
|
|
|
|
2014-04-16 07:30:28 +00:00
|
|
|
private:
|
|
|
|
nsTArray<nsRefPtr<IccListener>> mIccListeners;
|
2012-06-28 14:21:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-10-22 11:23:00 +00:00
|
|
|
#endif // mozilla_dom_IccManager_h
|