Show notification popup when excuting copy function.
authorTaeyun An <ty.an@samsung.com>
Sun, 14 Apr 2013 04:52:30 +0000 (13:52 +0900)
committerTaeyun An <ty.an@samsung.com>
Sun, 14 Apr 2013 05:33:52 +0000 (14:33 +0900)
[Title] Show notification popup when excuting copy function.
[Issue#] P130412-5414
[Problem] Users can't know exactly, copy function is excuted successfully.
[Cause] There is no notification when excuting copy function
[Solution] Show notification popup when excuting copy function.

Change-Id: Ia34f4c9f3ffde15423e9d80db94654794d1a0a70

Source/WebKit2/UIProcess/API/efl/tizen/ClipboardHelper.cpp
Source/WebKit2/UIProcess/API/efl/tizen/ClipboardHelper.h

index 37476e4..2d6d8c8 100755 (executable)
@@ -211,6 +211,8 @@ void ClipboardHelper::setData(const String& data, const String& type)
 {
     Ecore_X_Atom dataType = 0;
 
+    showSavedNotiPopup();
+
     if (type == "PlainText" || type == "URIList" || type == "URL")
         dataType = ecore_x_atom_get("UTF8_STRING");
     else if (type == "Markup")
@@ -806,6 +808,36 @@ void ClipboardHelper::updateClipboardWindowState(Ecore_X_Event_Window_Property*
         m_clipboardWindowOpened = true;
 }
 
+void ClipboardHelper::showSavedNotiPopup()
+{
+    Evas_Object* parent = elm_object_parent_widget_get(m_viewImpl->view());
+    Evas_Object* notify = elm_notify_add(parent);
+    if (!notify) {
+        TIZEN_LOGE("elm_notify_add failed");
+        return;
+    }
+    elm_notify_align_set(notify, 0.5, 1.0);
+    evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(notify, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+    Evas_Object* notifyLayout = elm_layout_add(notify);
+    if (!notifyLayout) {
+        TIZEN_LOGE("elm_layout_add failed");
+        return;
+    }
+
+    if (elm_win_rotation_get(parent) % 180)
+        elm_layout_theme_set(notifyLayout, "standard", "selectioninfo", "horizontal/bottom_64");
+    else
+        elm_layout_theme_set(notifyLayout, "standard", "selectioninfo", "vertical/bottom_64");
+    evas_object_size_hint_weight_set(notifyLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(notifyLayout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    elm_object_content_set(notify, notifyLayout);
+    edje_object_part_text_set(elm_layout_edje_get(notifyLayout), "elm.text", "Saved!");
+    elm_notify_timeout_set(notify, 2);
+
+    evas_object_show(notify);
+}
 #endif // TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD
 }// namespace WebKit
 
index 700bb7c..501828e 100755 (executable)
@@ -123,6 +123,7 @@ private:
     bool setClipboardItem(Ecore_X_Atom dataType, const String& data);
     String getCbhmReply(Ecore_X_Window xwin, Ecore_X_Atom property, Ecore_X_Atom* pDataType);
     bool retrieveClipboardItem(int index, int* format, String* pData);
+    void showSavedNotiPopup();
 #endif
 
     EwkViewImpl* m_viewImpl;