Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.extensions.inputevt
Class RemoteControlExtensionProvider

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.extensions.inputevt.RemoteControlExtensionProvider
All Implemented Interfaces:
org.jivesoftware.smack.provider.PacketExtensionProvider

public class RemoteControlExtensionProvider
extends Object
implements org.jivesoftware.smack.provider.PacketExtensionProvider

This class parses incoming remote-control XML element and extracts input events such as keyboard and mouse ones.

Author:
Sebastien Vincent

Field Summary
static String ELEMENT_KEY_PRESS
          The name of the remote-info XML element key-press.
static String ELEMENT_KEY_RELEASE
          The name of the remote-info XML element key-release.
static String ELEMENT_KEY_TYPE
          The name of the remote-info XML element key-type.
static String ELEMENT_MOUSE_MOVE
          The name of the remote-info XML element mouse-move.
static String ELEMENT_MOUSE_PRESS
          The name of the remote-info XML element mouse-press.
static String ELEMENT_MOUSE_RELEASE
          The name of the remote-info XML element mouse-release.
static String ELEMENT_MOUSE_WHEEL
          The name of the remote-info XML element mouse-wheel.
static String ELEMENT_REMOTE_CONTROL
          The name of the remote-info XML element remote-control.
static String NAMESPACE
          Namespace of this extension.
 
Constructor Summary
RemoteControlExtensionProvider()
          Constructor.
 
Method Summary
static String getKeyPressedXML(int keycode)
          Build a key-press remote-control XML element.
static String getKeyReleasedXML(int keycode)
          Build a key-release remote-control XML element.
static String getKeyTypedXML(int keycode)
          Build a key-typed remote-control XML element.
static String getMouseMovedXML(double x, double y)
          Build a remote-info mouse-move remote-control XML element.
static String getMousePressedXML(int btns)
          Build a mouse-press remote-control XML element.
static String getMouseReleasedXML(int btns)
          Build a remote-info mouse-release remote-control XML element.
static String getMouseWheelXML(int notch)
          Build a remote-info mouse-wheel remote-control XML element.
 org.jivesoftware.smack.packet.PacketExtension parseExtension(org.xmlpull.v1.XmlPullParser parser)
          Parses the extension and returns a PacketExtension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_REMOTE_CONTROL

public static final String ELEMENT_REMOTE_CONTROL
The name of the remote-info XML element remote-control.

See Also:
Constant Field Values

ELEMENT_MOUSE_MOVE

public static final String ELEMENT_MOUSE_MOVE
The name of the remote-info XML element mouse-move.

See Also:
Constant Field Values

ELEMENT_MOUSE_WHEEL

public static final String ELEMENT_MOUSE_WHEEL
The name of the remote-info XML element mouse-wheel.

See Also:
Constant Field Values

ELEMENT_MOUSE_PRESS

public static final String ELEMENT_MOUSE_PRESS
The name of the remote-info XML element mouse-press.

See Also:
Constant Field Values

ELEMENT_MOUSE_RELEASE

public static final String ELEMENT_MOUSE_RELEASE
The name of the remote-info XML element mouse-release.

See Also:
Constant Field Values

ELEMENT_KEY_PRESS

public static final String ELEMENT_KEY_PRESS
The name of the remote-info XML element key-press.

See Also:
Constant Field Values

ELEMENT_KEY_RELEASE

public static final String ELEMENT_KEY_RELEASE
The name of the remote-info XML element key-release.

See Also:
Constant Field Values

ELEMENT_KEY_TYPE

public static final String ELEMENT_KEY_TYPE
The name of the remote-info XML element key-type.

See Also:
Constant Field Values

NAMESPACE

public static final String NAMESPACE
Namespace of this extension.

See Also:
Constant Field Values
Constructor Detail

RemoteControlExtensionProvider

public RemoteControlExtensionProvider()
Constructor.

Method Detail

parseExtension

public org.jivesoftware.smack.packet.PacketExtension parseExtension(org.xmlpull.v1.XmlPullParser parser)
                                                             throws Exception
Parses the extension and returns a PacketExtension.

Specified by:
parseExtension in interface org.jivesoftware.smack.provider.PacketExtensionProvider
Parameters:
parser - XML parser
Returns:
a PacketExtension that represents a remote-control element.
Throws:
Exception - if an error occurs during XML parsing

getKeyPressedXML

public static String getKeyPressedXML(int keycode)
Build a key-press remote-control XML element.

Parameters:
keycode - keyboard's code
Returns:
raw XML bytes

getKeyReleasedXML

public static String getKeyReleasedXML(int keycode)
Build a key-release remote-control XML element.

Parameters:
keycode - keyboard's code
Returns:
raw XML bytes

getKeyTypedXML

public static String getKeyTypedXML(int keycode)
Build a key-typed remote-control XML element.

Parameters:
keycode - keyboard's code
Returns:
raw XML bytes

getMousePressedXML

public static String getMousePressedXML(int btns)
Build a mouse-press remote-control XML element.

Parameters:
btns - button mask
Returns:
raw XML bytes

getMouseReleasedXML

public static String getMouseReleasedXML(int btns)
Build a remote-info mouse-release remote-control XML element.

Parameters:
btns - button mask
Returns:
raw XML bytes

getMouseMovedXML

public static String getMouseMovedXML(double x,
                                      double y)
Build a remote-info mouse-move remote-control XML element.

Parameters:
x - x position of the mouse
y - y position of the mouse
Returns:
raw XML bytes

getMouseWheelXML

public static String getMouseWheelXML(int notch)
Build a remote-info mouse-wheel remote-control XML element.

Parameters:
notch - wheel notch
Returns:
raw XML bytes

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.