#ifndef WKBundleAPICast_h
#define WKBundleAPICast_h
#include "WKSharedAPICast.h"
#include "WKBundlePage.h"
#include "WKBundlePagePrivate.h"
#include "WKBundlePrivate.h"
#include <WebCore/EditorInsertAction.h>
#include <WebCore/TextAffinity.h>
namespace WebCore {
class CSSStyleDeclaration;
}
namespace WebKit {
class InjectedBundle;
class InjectedBundleBackForwardList;
class InjectedBundleBackForwardListItem;
class InjectedBundleDOMWindowExtension;
class InjectedBundleHitTestResult;
class InjectedBundleNavigationAction;
class InjectedBundleNodeHandle;
class InjectedBundleRangeHandle;
class InjectedBundleScriptWorld;
class PageBanner;
class PageOverlay;
class WebFrame;
class WebInspector;
class WebPage;
class WebPageGroupProxy;
WK_ADD_API_MAPPING(WKBundleBackForwardListItemRef, InjectedBundleBackForwardListItem)
WK_ADD_API_MAPPING(WKBundleBackForwardListRef, InjectedBundleBackForwardList)
WK_ADD_API_MAPPING(WKBundleCSSStyleDeclarationRef, WebCore::CSSStyleDeclaration)
WK_ADD_API_MAPPING(WKBundleDOMWindowExtensionRef, InjectedBundleDOMWindowExtension)
WK_ADD_API_MAPPING(WKBundleFrameRef, WebFrame)
WK_ADD_API_MAPPING(WKBundleHitTestResultRef, InjectedBundleHitTestResult)
WK_ADD_API_MAPPING(WKBundleInspectorRef, WebInspector)
WK_ADD_API_MAPPING(WKBundleNavigationActionRef, InjectedBundleNavigationAction)
WK_ADD_API_MAPPING(WKBundleNodeHandleRef, InjectedBundleNodeHandle)
WK_ADD_API_MAPPING(WKBundlePageBannerRef, PageBanner)
WK_ADD_API_MAPPING(WKBundlePageGroupRef, WebPageGroupProxy)
WK_ADD_API_MAPPING(WKBundlePageOverlayRef, PageOverlay)
WK_ADD_API_MAPPING(WKBundlePageRef, WebPage)
WK_ADD_API_MAPPING(WKBundleRangeHandleRef, InjectedBundleRangeHandle)
WK_ADD_API_MAPPING(WKBundleRef, InjectedBundle)
WK_ADD_API_MAPPING(WKBundleScriptWorldRef, InjectedBundleScriptWorld)
inline WKInsertActionType toAPI(WebCore::EditorInsertAction action)
{
switch (action) {
case WebCore::EditorInsertActionTyped:
return kWKInsertActionTyped;
case WebCore::EditorInsertActionPasted:
return kWKInsertActionPasted;
case WebCore::EditorInsertActionDropped:
return kWKInsertActionDropped;
}
ASSERT_NOT_REACHED();
return kWKInsertActionTyped;
}
inline WKAffinityType toAPI(WebCore::EAffinity affinity)
{
switch (affinity) {
case WebCore::UPSTREAM:
return kWKAffinityUpstream;
case WebCore::DOWNSTREAM:
return kWKAffinityDownstream;
}
ASSERT_NOT_REACHED();
return kWKAffinityUpstream;
}
}
#endif // WKBundleAPICast_h