msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "اختر التاريخ"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "نسخ"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "الأسماء"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Tarixi təyin et"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Köçür"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Adlar"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Задаване на дата"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Копиране"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Телефонен указател"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Definir data"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copia"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contactes"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Nastavit datum"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopírovat"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontakty"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Angiv dato"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopiér"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontakter"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Datum einstellen"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopieren"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontakte"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Ορισμός ημερομηνίας"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Αντιγραφή"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Επαφές"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Set date"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copy"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contacts"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Set date"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copy"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contacts"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Set date"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copy"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contacts"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "FECHA"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copiar"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contactos"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Definir fecha"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copiar"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contactos"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Määra kuupäev"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopeeri"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontaktid"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Ezarri data"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopiatu"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontaktuak"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Aseta päivämäärä"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopioi"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Yhteystiedot"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Définir la date"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copier"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contacts"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Définir la date"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copier"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contacts"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Socraigh dáta"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Cóipeáil"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Teagmhálaithe"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Definir data"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copiar"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contactos"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "तिथि सेट करें"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "कॉपी करें"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "संपर्क"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Postavi datum"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopiraj"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Imenik"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Dátum beállítása"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Másol"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Névjegyek"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Դնել թվական"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Պատճենել"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Կոնտակտներ"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Veldu dag"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Afrita"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Tengiliðir"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Imposta data"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copia"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Rubrica"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "日付を設定"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "コピー"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "連絡先"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "თარიღის დაყენება"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "ასლი"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "კონტაქტები"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Күнді орнату"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Көшіру"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Контактілер"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "날짜 설정"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "복사"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "연락처"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Nustatykite datą"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopijuoti"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Adresatai"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Iestatīt datumu"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopēt"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontakti"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Одреди датум"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Копирај"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Именик"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Angi dato"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopier"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontakter"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Datum instellen"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopiëren"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contacten"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Ustaw datę"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopiuj"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontakty"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Definir data"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copiar"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contatos"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Definir data"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copiar"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contactos"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Setați data"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Copiere"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Contacte"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Выберите дату"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Копировать"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Контакты"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Nastavte dátum"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopírovať"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontakty"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Nastavite datum"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopiraj"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Imenik"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Podesi datum"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopiraj"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontakti"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Ställ in datum"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopiera"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontakter"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Tarihi ayarla"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Kopyala"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Rehber"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Оберіть дату"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Копіювати"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Контакти"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "Sana o‘rnatish"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "Nusxa olish"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "Kontaktlar"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "设置日期"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "复制"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "联系人"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "設定日期"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "複製"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "聯絡人"
msgid "IDS_TPLATFORM_HEADER_SET_DATE"
msgstr "設定日期"
+msgid "IDS_TPLATFORM_OPT_COPY"
+msgstr "複製"
+
msgid "IDS_PB_TAB_CONTACTS"
msgstr "聯絡人"
virtual Ux::SelectResult getDefaultResult() const override;
/**
+ * @see GenItem::onLongpressed()
+ */
+ virtual bool onLongpressed() override;
+
+ /**
* @see ContactField::UpdatedCallback
*/
virtual void onFieldUpdated(Model::ContactField &field, contacts_changed_e change);
private:
+ void onMenuDismissed(Evas_Object *obj, void *eventInfo);
+ void updateSelecting(bool isSelecting);
Model::ContactObject &m_Object;
Model::ContactField &m_Field;
+ bool m_IsSelecting;
};
}
}
#include "Contacts/Model/ContactTextField.h"
#include "Contacts/Common/Strings.h"
+#include "Ui/Menu.h"
+#include "Utils/Callback.h"
+
#include <app_i18n.h>
using namespace Contacts;
using namespace std::placeholders;
#define DATE_BUFFER_SIZE 32
+#define TEXT_BUFFER_SIZE 128
+#define TAG_BACKING "<backing=on><backing_color=#00ddff99>"
FieldItem::FieldItem(ContactObject &object)
- : m_Object(object), m_Field(*object.getField(0))
+ : m_Object(object), m_Field(*object.getField(0)), m_IsSelecting(false)
{
}
if (strcmp(part, "elm.text") == 0) {
switch (m_Field.getType()) {
case TypeText:
+ {
+ if (m_IsSelecting) {
+ char buffer[TEXT_BUFFER_SIZE];
+ snprintf(buffer, sizeof(buffer), TAG_BACKING "%s", m_Field.cast<ContactTextField>().getValue());
+ return strdup(buffer);
+ }
return Utils::safeDup(m_Field.cast<ContactTextField>().getValue());
+ }
case TypeDate:
{
tm date = m_Field.cast<ContactDateField>().getValue();
return { m_Object.getSubType(), m_Object.getRecordId() };
}
+bool FieldItem::onLongpressed()
+{
+ static bool isFieldCopyable[] = {
+ /* [FieldFavorite] = */ false,
+ /* [FieldDisplayName] = */ false,
+ /* [FieldImage] = */ false,
+ /* [FieldName] = */ false,
+ /* [FieldPhoneticName] = */ false,
+ /* [FieldCompany] = */ false,
+ /* [FieldNumber] = */ true,
+ /* [FieldEmail] = */ true,
+ /* [FieldAddress] = */ true,
+ /* [FieldUrl] = */ true,
+ /* [FieldMessenger] = */ true,
+ /* [FieldEvent] = */ false,
+ /* [FieldNote] = */ true,
+ /* [FieldNickname] = */ false,
+ /* [FieldRelationship] = */ false,
+ /* [FieldRingtone] = */ false
+ };
+
+ if (!isFieldCopyable[m_Object.getId()]) {
+ return false;
+ }
+
+ updateSelecting(true);
+
+ auto menu = new Ui::Menu();
+ menu->create(getParent()->getEvasObject());
+ menu->addItem("IDS_TPLATFORM_OPT_COPY", [this] {
+ const char *text = m_Field.cast<ContactTextField>().getValue();
+ if (text) {
+ elm_cnp_selection_set(getParent()->getEvasObject(), ELM_SEL_TYPE_CLIPBOARD,
+ ELM_SEL_FORMAT_TEXT, text, strlen(text));
+ }
+ });
+
+ int x, y, w, h;
+ Evas_Object *rect = elm_object_item_track(getObjectItem());
+ evas_object_geometry_get(rect, &x, &y, &w, &h);
+ elm_object_item_untrack(getObjectItem());
+
+ Evas_Object *obj = menu->getEvasObject();
+ evas_object_smart_callback_add(obj, "dismissed",
+ makeCallback(&FieldItem::onMenuDismissed), this);
+ elm_ctxpopup_horizontal_set(obj, EINA_TRUE);
+ elm_object_style_set(obj, "default");
+ evas_object_move(obj, x, y + h / 2);
+ evas_object_show(obj);
+
+ return true;
+}
+
void FieldItem::onFieldUpdated(ContactField &field, contacts_changed_e change)
{
if (&field == &m_Field) {
elm_genlist_item_fields_update(getObjectItem(), "elm.text", ELM_GENLIST_ITEM_FIELD_TEXT);
}
}
+
+void FieldItem::onMenuDismissed(Evas_Object *obj, void *eventInfo)
+{
+ updateSelecting(false);
+}
+
+void FieldItem::updateSelecting(bool isSelecting)
+{
+ if (m_IsSelecting != isSelecting) {
+ m_IsSelecting = isSelecting;
+ elm_genlist_item_fields_update(getObjectItem(), "elm.text", ELM_GENLIST_ITEM_FIELD_TEXT);
+ }
+}