mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 05:35:31 +00:00
cecc48a638
This patch replaces numerous |/* virtual */ NS_IMETHODIMP| occurrences with |NS_IMETHODIMP|, because |NS_IMETHODIMP| always implies |virtual|. --HG-- extra : rebase_source : 6ccbb2b59667718945315b671ae6236ff527a6d4
114 lines
1.9 KiB
C++
114 lines
1.9 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* 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/. */
|
|
|
|
#include "InputPortData.h"
|
|
#include "nsString.h"
|
|
|
|
namespace mozilla {
|
|
namespace dom {
|
|
|
|
namespace {
|
|
|
|
InputPortType
|
|
ToInputPortType(const nsAString& aStr)
|
|
{
|
|
if (aStr.EqualsLiteral("av")) {
|
|
return InputPortType::Av;
|
|
}
|
|
|
|
if (aStr.EqualsLiteral("displayport")) {
|
|
return InputPortType::Displayport;
|
|
}
|
|
|
|
if (aStr.EqualsLiteral("hdmi")) {
|
|
return InputPortType::Hdmi;
|
|
}
|
|
|
|
return InputPortType::EndGuard_;
|
|
}
|
|
|
|
} // namespace
|
|
|
|
NS_IMPL_ISUPPORTS(InputPortData, nsIInputPortData)
|
|
|
|
InputPortData::InputPortData()
|
|
: mIsConnected(false)
|
|
{
|
|
}
|
|
|
|
InputPortData::~InputPortData()
|
|
{
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
InputPortData::GetId(nsAString& aId)
|
|
{
|
|
aId = mId;
|
|
return NS_OK;
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
InputPortData::SetId(const nsAString& aId)
|
|
{
|
|
if (aId.IsEmpty()) {
|
|
return NS_ERROR_INVALID_ARG;
|
|
}
|
|
|
|
mId = aId;
|
|
return NS_OK;
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
InputPortData::GetType(nsAString& aType)
|
|
{
|
|
aType = mType;
|
|
return NS_OK;
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
InputPortData::SetType(const nsAString& aType)
|
|
{
|
|
if (aType.IsEmpty()) {
|
|
return NS_ERROR_INVALID_ARG;
|
|
}
|
|
|
|
if (InputPortType::EndGuard_ == ToInputPortType(aType)) {
|
|
return NS_ERROR_INVALID_ARG;
|
|
}
|
|
|
|
mType = aType;
|
|
return NS_OK;
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
InputPortData::GetConnected(bool* aIsConnected)
|
|
{
|
|
*aIsConnected = mIsConnected;
|
|
return NS_OK;
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
InputPortData::SetConnected(const bool aIsConnected)
|
|
{
|
|
mIsConnected = aIsConnected;
|
|
return NS_OK;
|
|
}
|
|
|
|
const nsString&
|
|
InputPortData::GetId() const
|
|
{
|
|
return mId;
|
|
}
|
|
|
|
InputPortType
|
|
InputPortData::GetType() const
|
|
{
|
|
return ToInputPortType(mType);
|
|
}
|
|
|
|
} // namespace dom
|
|
} // namespace mozilla
|