Title: [90015] trunk/Source/WebKit/efl
Revision
90015
Author
[email protected]
Date
2011-06-29 07:12:54 -0700 (Wed, 29 Jun 2011)

Log Message

2011-06-29  Michal Pakula vel Rutka  <[email protected]>

        Reviewed by Kenneth Rohde Christiansen.

        [EFL] Add ewk_frame_text_selection_type_get function
        https://bugs.webkit.org/show_bug.cgi?id=63462

        Add a method to obtain current WebCore::VisibleSelection text
        selection type.

        * ewk/ewk_frame.cpp:
        (ewk_frame_text_selection_type_get):
        * ewk/ewk_frame.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (90014 => 90015)


--- trunk/Source/WebKit/efl/ChangeLog	2011-06-29 13:58:09 UTC (rev 90014)
+++ trunk/Source/WebKit/efl/ChangeLog	2011-06-29 14:12:54 UTC (rev 90015)
@@ -1,3 +1,17 @@
+2011-06-29  Michal Pakula vel Rutka  <[email protected]>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [EFL] Add ewk_frame_text_selection_type_get function
+        https://bugs.webkit.org/show_bug.cgi?id=63462
+
+        Add a method to obtain current WebCore::VisibleSelection text
+        selection type.
+
+        * ewk/ewk_frame.cpp:
+        (ewk_frame_text_selection_type_get):
+        * ewk/ewk_frame.h:
+
 2011-06-28  Michal Pakula vel Rutka  <[email protected]>
 
         Reviewed by Kenneth Rohde Christiansen.

Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.cpp (90014 => 90015)


--- trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2011-06-29 13:58:09 UTC (rev 90014)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2011-06-29 14:12:54 UTC (rev 90015)
@@ -1525,6 +1525,31 @@
     return sd->frame->eventHandler()->keyEvent(event);
 }
 
+/**
+ * Returns current text selection type.
+ *
+ * @param o a frame object to check selection type
+ * @return Current text selection type on success or no selection otherwise
+ */
+Ewk_Text_Selection_Type ewk_frame_text_selection_type_get(Evas_Object *o)
+{
+    EWK_FRAME_SD_GET_OR_RETURN(o, sd, EWK_TEXT_SELECTION_NONE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EWK_TEXT_SELECTION_NONE);
+
+    WebCore::FrameSelection* controller = sd->frame->selection();
+    if (!controller)
+        return EWK_TEXT_SELECTION_NONE;
+
+    switch (controller->selectionType()) {
+    case WebCore::VisibleSelection::CaretSelection:
+        return EWK_TEXT_SELECTION_CARET;
+    case WebCore::VisibleSelection::RangeSelection:
+        return EWK_TEXT_SELECTION_RANGE;
+    default:
+        return EWK_TEXT_SELECTION_NONE;
+    }
+}
+
 /* internal methods ****************************************************/
 
 /**

Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.h (90014 => 90015)


--- trunk/Source/WebKit/efl/ewk/ewk_frame.h	2011-06-29 13:58:09 UTC (rev 90014)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.h	2011-06-29 14:12:54 UTC (rev 90015)
@@ -154,6 +154,12 @@
     Ewk_Touch_Point_Type state; /**< state of the touch event */
 };
 
+typedef enum {
+    EWK_TEXT_SELECTION_NONE,
+    EWK_TEXT_SELECTION_CARET,
+    EWK_TEXT_SELECTION_RANGE
+} Ewk_Text_Selection_Type;
+
 EAPI Evas_Object *ewk_frame_view_get(const Evas_Object *o);
 
 EAPI Eina_Iterator *ewk_frame_children_iterator_new(Evas_Object *o);
@@ -225,7 +231,9 @@
 EAPI Eina_Bool    ewk_frame_feed_key_down(Evas_Object *o, const Evas_Event_Key_Down *ev);
 EAPI Eina_Bool    ewk_frame_feed_key_up(Evas_Object *o, const Evas_Event_Key_Up *ev);
 
+EAPI Ewk_Text_Selection_Type ewk_frame_text_selection_type_get(Evas_Object* o);
 
+
 #ifdef __cplusplus
 }
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to