/*****************************************************************************
 * $LastChangedDate: 2010-02-03 19:48:51 -0500 (Wed, 03 Feb 2010) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Joystick device class (Windows).
 *//*
 * LEGAL:   COPYRIGHT (C) 2007 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#if OS_WINDOWS
#ifndef INPUT_DEVICE_JOYSTICK_WINDOWS_HH
#define INPUT_DEVICE_JOYSTICK_WINDOWS_HH 1

#include "input/device_joystick.hh"

namespace input {

////////////////////////////////////////////////////////////////////////////////
/// @brief Windows joystick class.
///
/// This is a private implementation of JoystickDevice.
///
class JoystickDeviceWindows : public JoystickDevice
{
PREVENT_COPYING(JoystickDeviceWindows)
friend class JoystickDevice;
private:
                    JoystickDeviceWindows( void );
    virtual         ~JoystickDeviceWindows();

// Abstract methods to implement:
    virtual bool    EnableDevice( void ) { return Open(); }
    virtual bool    PollJoystickDevice( JoystickEvent& event /*OUT*/ );
    virtual void    PrintStatus( void );

// Specific:
    bool            Open( void );
    void            Close( void );
    bool            PollAxisEvent( JoystickEvent& event /*OUT*/, const uint axisNum );
    bool            PollButtonEvent( JoystickEvent& event /*OUT*/ );

private:
    bool            mOpened;
    uint            mAxisCount;     ///< how many axises joystick has
};

} // namespace input

#endif // INPUT_DEVICE_JOYSTICK_WINDOWS_HH
#endif // OS_WINDOWS
