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

#include "config.h"

#if ENABLE(RMAI)

#include "MOMContentPagedList.h"
#include "MOMException.h"

extern "C" {
#include "layers.h"
}

namespace WebCore {

PassRefPtr<MOMContentPagedList> MOMContentPagedList::createAdopt(ScriptExecutionContext *context, mom_content_paged_list list)
{
    return static_pointer_cast<MOMContentPagedList>(MOMContentItem::createAdopt(context, (mom_content_item)list));
}

MOMContentPagedList::MOMContentPagedList(ScriptExecutionContext *context, mom_content_item item)
    : MOMContentList(context, item)
{
}

void MOMContentPagedList::getPage( int page, int pageSize, ExceptionCode& ec )
{
    mom_error err = mom_content_paged_list_get_page( itemAsContentPagedList(), page, pageSize );
    MOMException::setFromMOMError(err, ec);
}

void MOMContentPagedList::abort(ExceptionCode& ec)
{
    mom_error err = mom_content_paged_list_abort( itemAsContentPagedList() );
    MOMException::setFromMOMError(err, ec);
}

} // namespace WebCore

#endif // ENABLE(RMAI)
