/** @file MOMNetworkInterfaceCollection.cpp
 *
 * Copyright (C) Espial Limited 2014 - Company confidential - All rights reserved.
 *
 */

#include "config.h"

#if ENABLE(RMAI)

#include "MOMNetworkInterfaceCollection.h"
#include "MOMNetworkInterface.h"


extern "C" {
#include "layers.h"
#include "cdf/mom_networkinterface_collection.h"
}

namespace WebCore {

PassRefPtr<MOMNetworkInterfaceCollection> MOMNetworkInterfaceCollection::create(ScriptExecutionContext* context)
{
    return adoptRef(new MOMNetworkInterfaceCollection(context));
}

MOMNetworkInterfaceCollection::MOMNetworkInterfaceCollection(ScriptExecutionContext* context)
    : m_context(context)
{
}

int MOMNetworkInterfaceCollection::length() const
{
    return mom_networkinterface_collection_get_length();
}

PassRefPtr<MOMNetworkInterface> MOMNetworkInterfaceCollection::item( int index )
{
    return MOMNetworkInterface::create(m_context, index);
}

} // namespace WebCore

#endif // ENABLE(RMAI)
