mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-28 11:27:32 +09:00
40 lines
1.4 KiB
C++
40 lines
1.4 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
#ifndef mozilla_dom_USBConfiguration_h
|
|
#define mozilla_dom_USBConfiguration_h
|
|
|
|
#include "mozilla/dom/Nullable.h"
|
|
#include "mozilla/dom/DOMString.h"
|
|
#include "mozilla/dom/USBInterface.h"
|
|
#include "mozilla/dom/USBBinding.h"
|
|
#include "nsCOMPtr.h"
|
|
#include "nsCycleCollectionParticipant.h"
|
|
#include "nsString.h"
|
|
#include "nsTArray.h"
|
|
#include "nsWrapperCache.h"
|
|
|
|
namespace mozilla { namespace dom {
|
|
class USBConfiguration final : public nsISupports, public nsWrapperCache
|
|
{
|
|
public:
|
|
USBConfiguration(nsIGlobalObject*, uint8_t,
|
|
nsTArray<RefPtr<USBInterface>>&&);
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(USBConfiguration)
|
|
nsISupports* GetParentObject() const { return mOwner; }
|
|
uint8_t ConfigurationValue() const { return mValue; }
|
|
void GetConfigurationName(DOMString& aValue) const
|
|
{
|
|
if (mName.IsNull()) aValue.SetNull();
|
|
else aValue.SetOwnedString(mName.Value());
|
|
}
|
|
void GetInterfaces(nsTArray<RefPtr<USBInterface>>& aValue) const { aValue = mInterfaces; }
|
|
JSObject* WrapObject(JSContext*, JS::Handle<JSObject*>) override;
|
|
private:
|
|
~USBConfiguration() = default;
|
|
nsCOMPtr<nsIGlobalObject> mOwner;
|
|
uint8_t mValue;
|
|
Nullable<nsString> mName;
|
|
nsTArray<RefPtr<USBInterface>> mInterfaces;
|
|
};
|
|
} }
|
|
#endif // mozilla_dom_USBConfiguration_h
|