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

#ifndef MOMUpdateEvent_h
#define MOMUpdateEvent_h

#if ENABLE(RMAI)

#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/AtomicString.h>

#include "MOMEvent.h"

namespace WebCore {

class MOMContentItem;

class MOMUpdateEvent : public MOMEvent {
public:
    enum {
        CHANNEL_LIST_INVALIDATED = 0,
        PROGRAMMES_INVALIDATED = 1,
        ACCESS_CHANGE = 2,
        CHANNEL_FILTER_CHANGE = 3,
        BLOCK = 1,
        LOCK = 2,
        TITLES = 4,
        BLOCKED_CHANNELS = 1,
        FAVOURITE_CHANNELS = 2,
        HIDDEN_CHANNELS = 4,
        UNAUTHORISED_CHANNELS = 8,
    };
    static PassRefPtr<MOMUpdateEvent> create()
    {
        return adoptRef(new MOMUpdateEvent);
    }
    
    int action() const { return getIntParam(mom_event_UPDATE_TYPE); }
    int info() const { return getIntParam(mom_event_UPDATE_INFO); }
    MOMContentItem* object() const { return m_object.get(); }

    MOMUpdateEvent(const mom_event_params* params, ScriptExecutionContext* context);
private:
    MOMUpdateEvent();
    mutable RefPtr<MOMContentItem> m_object;
};

} // namespace WebCore

#endif // ENABLE(RMAI)

#endif // MOMUpdateEvent_h
