#import <Cordova/CDV.h>
#import <WacomDevice/WacomDeviceFramework.h>
#import "MyGestureRecognizer.h"

@interface SignoSoft : CDVPlugin <WacomDiscoveryCallback, WacomStylusEventCallback, MyGestureRecognizerDelegate> 
//, UIPopoverControllerDelegate>

//start is called from ionic to initialize everything ... 
- (void) start:(CDVInvokedUrlCommand*)command;

//getDeviceInfo is called from the app to get full info about a device. 
//input: UUID of device
- (void) getDeviceInfo:(CDVInvokedUrlCommand*)command;

//getDeviceTable is called from the app to get full info about all discovered devices. 
- (void) getDeviceTable:(CDVInvokedUrlCommand*)command;

//selectDevice is called from the app to connect to specific device
//input: UUID of device
- (void) selectDevice:(CDVInvokedUrlCommand*)command;

//stopDeviceDiscovery is called from the app to stop device discovery
- (void) stopDeviceDiscovery:(CDVInvokedUrlCommand*)command;

//toggleTouchRejection is called from the app to toggle touch rejection on/off
//input: On/Off
- (void) setTouchRejection:(CDVInvokedUrlCommand*)command;

//WacomDiscoveryCallback

///notification method for when a device is connected.
- (void) deviceConnected:(WacomDevice *)device;

///notification method for when a device is disconnected.
- (void) deviceDisconnected:(WacomDevice *)device;

///notification method for when a device is discovered.
- (void) deviceDiscovered:(WacomDevice *)device;

///notification method for when device discovery is not possible because bluetooth is powered off.
///this allows one to pop up a warning dialog to let the user know to turn on bluetooth.
- (void) discoveryStatePoweredOff;

//WacomStylusEventCallback

///notification method for when a new stylus event is ready.
-(void)stylusEvent:(WacomStylusEvent *)stylusEvent;

//for MyGestureRecognizerDelegate protocol
- (void) gestureRecognizer:(UIGestureRecognizer *)gr beganWithTouches:(NSSet*)touches andEvent:(UIEvent *)event;
- (void) gestureRecognizer:(UIGestureRecognizer *)gr movedWithTouches:(NSSet*)touches andEvent:(UIEvent *)event;
- (void) gestureRecognizer:(UIGestureRecognizer *)gr endedWithTouches:(NSSet*)touches andEvent:(UIEvent *)event;
- (void) gestureRecognizer:(UIGestureRecognizer *)gr cancelledWithTouches:(NSSet*)touches andEvent:(UIEvent *)event;
- (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
- (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;

- (void) recognizerFired:(UIGestureRecognizer *)recognizer;
@end

