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