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

#include "config.h"

#if ENABLE(RMAI)

#include "MOMContentEvent.h"
#include "MOMException.h"

namespace WebCore {

MOMContentEvent::MOMContentEvent(const mom_event_params* params, ScriptExecutionContext* context)
    : MOMEvent(AtomicString("MOM_ContentAction"), params)
{
    ASSERT(params->arg_count == mom_event_CONTENT_COUNT);
    setIntParam(mom_event_CONTENTACTION_RESULT, MOMException::codeFromMOMError( params->args[mom_event_CONTENTACTION_RESULT] ));
    m_object = params->object ? MOMContentItem::create(context, static_cast<mom_content_item>(params->object)) : nullptr;
}

MOMContentEvent::MOMContentEvent()
    : MOMEvent(AtomicString("MOM_ContentAction"))
{
}

} // namespace WebCore

#endif // ENABLE(RMAI)
