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

#include "config.h"

#if ENABLE(RMAI)

#include "MOMVODManager.h"
#include "MOMContentItem.h"
#include "MOMContentList.h"

#include "EventNames.h"

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

namespace WebCore {

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

MOMVODManager::MOMVODManager(ScriptExecutionContext* context)
    : ActiveDOMObject(context)
{
}

MOMVODManager::~MOMVODManager()
{
}

EventTargetInterface MOMVODManager::eventTargetInterface() const
{
    return MOMVODManagerEventTargetInterfaceType;
}

MOMContentItem* MOMVODManager::catalogues() const
{
    if (!m_catalogues)
        m_catalogues = MOMContentList::create(scriptExecutionContext(), mom_vod_manager_get_catalogues());
    return m_catalogues.get();
}

} // namespace WebCore

#endif // ENABLE(RMAI)
