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