#ifndef WKConnectionRef_h
#define WKConnectionRef_h
#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*WKConnectionDidReceiveMessageCallback)(WKConnectionRef connection, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo);
typedef void (*WKConnectionDidCloseCallback)(WKConnectionRef connection, const void* clientInfo);
typedef struct WKConnectionClientBase {
int version;
const void * clientInfo;
} WKConnectionClientBase;
typedef struct WKConnectionClientV0 {
WKConnectionClientBase base;
WKConnectionDidReceiveMessageCallback didReceiveMessage;
WKConnectionDidCloseCallback didClose;
} WKConnectionClientV0;
enum { WKConnectionClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0 };
typedef struct WKConnectionClient {
int version;
const void * clientInfo;
WKConnectionDidReceiveMessageCallback didReceiveMessage;
WKConnectionDidCloseCallback didClose;
} WKConnectionClient WK_C_DEPRECATED("Use an explicit versioned struct instead");
WK_EXPORT WKTypeID WKConnectionGetTypeID();
WK_EXPORT void WKConnectionSetConnectionClient(WKConnectionRef connection, const WKConnectionClientBase* client);
WK_EXPORT void WKConnectionPostMessage(WKConnectionRef connection, WKStringRef messageName, WKTypeRef messageBody);
#ifdef __cplusplus
}
#endif
#endif // WKConnectionRef_h