/*---------------------------------------------------------------------------*/
/* Forms.h                                                                   */
/* copyright (c) innovaphone 2015                                            */
/*                                                                           */
/*---------------------------------------------------------------------------*/

@class Forms;

@protocol FormsDelegate

- (void) formsSetFormsProperty:(NSString *)name value:(NSString *)value;
- (void) formsSetLanguage;
- (void) formsWebserverStarted:(NSString *)url_to_load user_agent:(NSString *)user_agent webserver_url:(NSString *)webserver_url start_fix_cert_url:(NSString *)start_fix_cert_url;
- (void) formsAddLocalNotification:(NSString *)ref type:(int)type title:(NSString *)title text:(NSString *)text smallIcon:(NSString *)smallIcon largeIcon:(NSString *)largeIcon
    soundUrl:(NSString *)soundUrl buttonTitle:(NSString *)buttonTitle acceptTitle:(NSString *)acceptTitle rejectTitle:(NSString *)rejectTitle link:(NSString *)link;
- (void) formsRemoveLocalNotification:(NSString *)ref;
- (void) formsSetBadgeCount:(NSString *)ref count:(int)count text:(NSString *)text;
- (void) formsDetectWebcams:(NSString *)context;
- (void) formsStartWebcam:(NSString *)id context:(NSString *)context width:(int)width height:(int)height hdVideo:(bool)hdVideo;
- (void) formsStopWebcam:(NSString *)id;
- (void) formsWebcamFullIntraRequest:(NSString *)id;
- (void) formsKeyboardEvent:(int)code keyDown:(bool)keyDown;
- (void) formsMouseEvent:(int)x y:(int)y right:(bool)right keyDown:(bool)keyDown;
- (void) formsMouseWheelEvent:(bool)direction;
- (void) formsSetFocus:(NSString *)app title:(NSString *)title;
- (void) formsSetResize:(NSString *)app width:(int)width height:(int)height;
- (void) formsAppWindowOpened:(NSString *)app title:(NSString *)title;
- (void) formsSetAutostart:(bool)autostart;
- (void) formsSetOffline:(int)offline;
- (void) formsSetHotkey:(int)type hotkey:(NSString *)hotkey;
- (void) formsSetDesktopNotifications:(bool)show;
- (void) formsStartExternalApp:(NSString *)app param:(NSString *)param;
- (void) formsSetDocking:(int)docking;
- (void) formsContactsSearch:(NSString *)ref pattern:(NSString *)pattern;
- (void) formsContactsSearchMore;
- (void) formsContactsLookup:(NSString *)ref number:(NSString *)number prefixIntl:(NSString *)prefixIntl prefixNtl:(NSString *)prefixNtl prefixSubs:(NSString *)prefixSubs areaCode:(NSString *)areaCode countryCode:(NSString *)countryCode;
- (void) formsWebserverGet:(NSString *)context resourceName:(NSString *)resourceName;
- (void) formsWebserverGetSent:(NSString *)context;
- (void) formsVideoTranscode:(int)sessionID timestamp:(int)timestamp duration:(int)duration sequenceDiff:(short)sequenceDiff frame:(byte *)frame length:(int)length width:(int)width height:(int)height stride:(int)stride flags:(int)flags from:(int)from to:(int)to;
- (void) formsCxUse:(bool)use ringtone:(NSString *)ringtone supportsVideo:(bool)supportsVideo maximumCallGroups:(int)maximumCallGroups maximumCallsPerCallGroup:(int)maximumCallsPerCallGroup;
- (void) formsCxReportNewIncomingCall:(NSString *)uuid_string number:(NSString *)number name:(NSString *)name transfer:(NSString *)transfer called:(NSString *)called flags:(int)flags;
- (void) formsCxReportOutgoingCallConnecting:(NSString *)uuid_string;
- (void) formsCxReportOutgoingCallConnected:(NSString *)uuid_string;
- (void) formsCxReportCallUpdated:(NSString *)uuid_string number:(NSString *)number name:(NSString *)name transfer:(NSString *)transfer called:(NSString *)called flags:(int)flags;
- (void) formsCxReportCallEnded:(NSString *)uuid_string reason:(int)reason;
- (void) formsCxRequestStartCall:(NSString *)uuid_string number:(NSString *)number name:(NSString *)name video:(bool)video;
- (void) formsCxRequestEndCall:(NSString *)uuid_string;
- (void) formsCxRequestSetHeldCall:(NSString *)uuid_string held:(bool)held;
- (void) formsCxRequestSetMutedCall:(NSString *)uuid_string muted:(bool)muted;
- (void) formsCxRequestSetGroupCall:(NSString *)uuid_string with:(NSString *)with;
- (void) formsCxRequestPlayDTMF:(NSString *)uuid_string digits:(NSString *)digits;
- (void) formsStartScreenCapture;
- (void) formsStopScreenCapture;
- (void) formsSetConnInfo:(bool)up standby:(bool)standby cur:(NSString *)cur pri:(NSString *)pri sec:(NSString *)sec master:(NSString *)master;
#if TARGET_OS_IPHONE
- (void) formsCPCreate:(int)new_id;
#endif

@end
@interface Forms : FormsObject

@property (nonatomic) IosEvent *ios_event;
@property (nonatomic) int missed_msgs;
@property (nonatomic) int missed_calls;
@property (nonatomic) int voice_msgs;
@property (nonatomic) int active_calls;
@property (nonatomic) int queued_calls;
@property (nonatomic) NSMutableArray *localized_texts;
@property (nonatomic,weak) id <FormsDelegate> formsDelegate;

@property (copy) int (^new_id)(FormsObject *obj);
@property (copy) void (^free_id)(int obj_id);
@property (copy) FormsObject *(^id_obj)(int obj_id);
@property (copy) void (^set_id_obj)(int obj_id, FormsObject *obj);
@property (copy) FormsObject *(^get_id_obj)(int obj_id);
@property (copy) NSString *(^localized_texts_get)(int index);
@property (copy) void (^event_headset_plugged)(bool plugged);
@property (copy) void (^event_headset_hook)();
@property (copy) void (^event_dial_number)(NSString *number, NSString *name, int video_mode);
@property (copy) void (^event_dial_sip)(NSString *sip, NSString *name, int video_mode);
@property (copy) void (^event_start_chat)(NSString *sip);
@property (copy) void (^event_transfer_to_number)(NSString *number);
@property (copy) void (^event_pbx_innovaphone_data_mobility)(NSString *xml);
@property (copy) void (^event_pause_subscriptions)(bool pause);
@property (copy) void (^event_push_token)(NSData *token, NSData *token_voip);
@property (copy) void (^trc)(NSString *text);
@property (copy) void (^event_new_message)();
@property (copy) void (^event_phonelist_import)(int more);

+ (id) formsWithId:(int)new_id ios_event:(IosEvent *)ios_event;

- (id) initWithId:(int)new_id ios_event:(IosEvent *)ios_event;

@end
