Added ewk_frame_can_show_mime_type() API
authorYuni Jeong <yhnet.jung@samsung.com>
Mon, 27 Aug 2012 14:26:06 +0000 (23:26 +0900)
committerYuni Jeong <yhnet.jung@samsung.com>
Tue, 28 Aug 2012 02:48:35 +0000 (11:48 +0900)
[Title] Added ewk_frame_can_show_mime_type() API
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution] N/A

Change-Id: Icc7d304c69b56576602b8c7c40544b7fe4789667

Source/WebKit2/UIProcess/API/efl/ewk_frame.cpp
Source/WebKit2/UIProcess/API/efl/ewk_frame.h

index 5ae8f57..d50dfda 100755 (executable)
@@ -23,6 +23,7 @@
 #include "WKAPICast.h"
 #include "WKFrame.h"
 #include "WKPage.h"
+#include "WKRetainPtr.h"
 #include "WKString.h"
 #include <wtf/text/CString.h>
 
@@ -76,3 +77,12 @@ Eina_Bool ewk_frame_source_get(Ewk_Frame_Ref frame, Ewk_Frame_Source_Get_Callbac
     return true;
 }
 
+Eina_Bool ewk_frame_can_show_mime_type(Ewk_Frame_Ref frame, char* mimeType)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(frame, false);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(mimeType, false);
+
+    WKFrameRef wkFrame = static_cast<WKFrameRef>(frame);
+    WKRetainPtr<WKStringRef> mimeTypeRef(AdoptWK, WKStringCreateWithUTF8CString(mimeType));
+    return WKFrameCanShowMIMEType(wkFrame, mimeTypeRef.get());
+}
\ No newline at end of file
index 2b41a23..c724d77 100755 (executable)
@@ -58,6 +58,16 @@ EAPI Ewk_Frame_Ref ewk_frame_parent_get(Ewk_Frame_Ref frame);
  */
 EAPI Eina_Bool ewk_frame_source_get(Ewk_Frame_Ref frame, Ewk_Frame_Source_Get_Callback callback, void* user_data);
 
+/**
+ * Returns that Whether or not a MIME type can be displayed.
+ *
+ * @param frame frame object
+ * @param mime_type a mime type
+ *
+ * @return @c EINA_TRUE if the MIME type can be displayed or @c EINA_FALSE otherwise
+ */
+EAPI Eina_Bool ewk_frame_can_show_mime_type(Ewk_Frame_Ref frame, char* mime_type);
+
 #ifdef __cplusplus
 }
 #endif