Files
phonegap-plugins/Android/Torch/Torch.js
Arne de Bree 31af7b806b Phonegap plugin for Android to enable Torch functionality
Initial commit of Phonegap plugin for Android to enable Torch
functionality
2011-10-19 00:52:51 +02:00

61 lines
1.3 KiB
JavaScript

/**
* Phonegap Torch plugin
* Copyright (c) Arne de Bree 2011
*
*/
/**
*
* @return Object literal singleton instance of Torch
*/
var Torch = function() {};
/**
* @param success The callback for success
* @param error The callback for error
*/
Torch.prototype.isCapable = function( success, error )
{
return PhoneGap.exec( success, error, "Torch", "isCapable", [] );
};
/**
* @param success The callback for success
* @param error The callback for error
*/
Torch.prototype.isOn = function( success, error )
{
return PhoneGap.exec( success, error, "Torch", "isOn", [] );
};
/**
* @param success The callback for success
* @param error The callback for error
*/
Torch.prototype.turnOn = function( success, error )
{
return PhoneGap.exec( success, error, "Torch", "turnOn", [] );
};
/**
* @param success The callback for success
* @param error The callback for error
*/
Torch.prototype.turnOff = function( success, error )
{
return PhoneGap.exec( success, error, "Torch", "turnOff", [] );
};
/**
* @param success The callback for success
* @param error The callback for error
*/
Torch.prototype.toggle = function( success, error )
{
return PhoneGap.exec( success, error, "Torch", "toggle", [] );
};
PhoneGap.addConstructor( function()
{
PhoneGap.addPlugin( "Torch", new Torch() );
} );