1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/icc/src/IccManager.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,61 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef mozilla_dom_IccManager_h 1.9 +#define mozilla_dom_IccManager_h 1.10 + 1.11 +#include "mozilla/DOMEventTargetHelper.h" 1.12 +#include "nsCycleCollectionParticipant.h" 1.13 +#include "nsIIccProvider.h" 1.14 +#include "nsTArrayHelpers.h" 1.15 + 1.16 +namespace mozilla { 1.17 +namespace dom { 1.18 + 1.19 +class IccListener; 1.20 + 1.21 +class IccManager MOZ_FINAL : public DOMEventTargetHelper 1.22 +{ 1.23 +public: 1.24 + NS_DECL_ISUPPORTS_INHERITED 1.25 + 1.26 + NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper) 1.27 + 1.28 + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(IccManager, DOMEventTargetHelper) 1.29 + 1.30 + IccManager(nsPIDOMWindow* aWindow); 1.31 + ~IccManager(); 1.32 + 1.33 + void 1.34 + Shutdown(); 1.35 + 1.36 + nsresult 1.37 + NotifyIccAdd(const nsAString& aIccId); 1.38 + 1.39 + nsresult 1.40 + NotifyIccRemove(const nsAString& aIccId); 1.41 + 1.42 + IMPL_EVENT_HANDLER(iccdetected) 1.43 + IMPL_EVENT_HANDLER(iccundetected) 1.44 + 1.45 + void 1.46 + GetIccIds(nsTArray<nsString>& aIccIds); 1.47 + 1.48 + already_AddRefed<nsISupports> 1.49 + GetIccById(const nsAString& aIccId) const; 1.50 + 1.51 + nsPIDOMWindow* 1.52 + GetParentObject() const { return GetOwner(); } 1.53 + 1.54 + virtual JSObject* 1.55 + WrapObject(JSContext* aCx) MOZ_OVERRIDE; 1.56 + 1.57 +private: 1.58 + nsTArray<nsRefPtr<IccListener>> mIccListeners; 1.59 +}; 1.60 + 1.61 +} // namespace dom 1.62 +} // namespace mozilla 1.63 + 1.64 +#endif // mozilla_dom_IccManager_h