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

#ifndef MOMDeviceEvent_h
#define MOMDeviceEvent_h

#if ENABLE(RMAI)

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

#include "MOMEvent.h"
#include "MOMDevice.h"

namespace WebCore {

class MOMDeviceEvent : public MOMEvent {
public:
    enum {
        ADDED = 0,
        REMOVED = 1,
    };

    static PassRefPtr<MOMDeviceEvent> create()
    {
        return adoptRef(new MOMDeviceEvent);
    }

    int reason() const { return getIntParam(mom_event_DEVICE_REASON); }
    MOMDevice* device() const { return m_object.get(); }

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

} // namespace WebCore

#endif // ENABLE(RMAI)

#endif // MOMDeviceEvent_h
