ClipboardHelper::ClipboardHelper(EwkViewImpl* viewImpl)
: m_viewImpl(viewImpl)
#if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
- , m_clipboardWindowOpened(false)
- , m_cbhmPropertyChangeHandler(0)
, m_selectionClearHandler(0)
, m_selectionNotifyHandler(0)
, m_clientMessageHandler(0)
+ , m_cbhmPropertyChangeHandler(0)
+ , m_clipboardWindowOpened(false)
#endif
{
#if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
{
Ecore_X_Atom dataType = 0;
- showSavedNotiPopup();
-
if (type == "PlainText" || type == "URIList" || type == "URL")
dataType = ecore_x_atom_get("UTF8_STRING");
else if (type == "Markup")
void ClipboardHelper::openClipboardWindow(bool isContentRichlyEditable)
{
- clearClipboardSelectionHandler();
+ if (!isClipboardWindowOpened())
+ clearClipboardSelectionHandler();
initializeAtomList();
if (isContentRichlyEditable)
else
return false;
+ if (dataType == ecore_x_atom_get("application/x-elementary-markup"))
+ *pData = String::fromUTF8(evas_textblock_text_markup_to_utf8(NULL, pData->utf8().data()));
+
return true;
}
else if (state == ECORE_X_ILLUME_CLIPBOARD_STATE_ON)
m_clipboardWindowOpened = true;
}
-
-void ClipboardHelper::showSavedNotiPopup()
-{
- bindtextdomain("WebKit", WEBKIT_TEXT_DIR);
-
- 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", dgettext("WebKit","IDS_COM_POP_COPIED_TO_CLIPBOARD"));
- elm_notify_timeout_set(notify, 2);
-
- evas_object_show(notify);
-}
#endif // TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD
}// namespace WebKit