name: BUTTON_COLOR_CLASS_PRESSED;
color: 48 139 153 255;
}
+ color_class { //W023 (Input Color 1)
+ name: "icon_expand";
+ color: 61 185 204 255;
+ }
}
<tool id="org.tizen.nativecore.tool.ast.cpp.1667914133" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
<tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.1732270539" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
<tool id="org.tizen.nativecore.tool.sbi.po.compiler.144173857" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
- <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.1336766367" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler"/>
+ <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.1336766367" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler">
+ <option id="sbi.gnu.edc.compiler.option.misc.id.1879286091" superClass="sbi.gnu.edc.compiler.option.misc.id" valueType="stringList">
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/res}""/>
+ </option>
+ </tool>
</toolChain>
</folderInfo>
<sourceEntries>
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef CONTACTS_INPUT_CONTACT_COMPOUND_FIELD_ITEM_H
+#define CONTACTS_INPUT_CONTACT_COMPOUND_FIELD_ITEM_H
+
+#include "Contacts/Input/ContactFieldItem.h"
+
+namespace Contacts
+{
+ namespace Input
+ {
+ /**
+ * @brief Genlist item representing ContactCompoundObject.
+ */
+ class ContactCompoundFieldItem : public ContactFieldItem
+ {
+ public:
+ using ContactFieldItem::ContactFieldItem;
+
+ private:
+ /**
+ * @see GenlistItem::getContent()
+ */
+ virtual Evas_Object *getContent(Evas_Object *parent, const char *part) override;
+
+ /**
+ * @brief Disables auto-expansion.
+ * @see ContactFieldItem::onInserted()
+ */
+ virtual void onInserted() override { }
+
+ /**
+ * @see GenlistItem::onExpanded()
+ */
+ virtual void onExpanded() override;
+
+ /**
+ * @see GenlistItem::onContracted()
+ */
+ virtual void onContracted() override;
+
+ void onButtonPressed(Evas_Object *button, void *eventInfo);
+ };
+ }
+}
+
+#endif /* CONTACTS_INPUT_CONTACT_COMPOUND_FIELD_ITEM_H */
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef CONTACTS_INPUT_CONTACT_COMPOUND_OBJECT_CONTROL_H
+#define CONTACTS_INPUT_CONTACT_COMPOUND_OBJECT_CONTROL_H
+
+#include "Ui/Editfield.h"
+
+namespace Contacts
+{
+ namespace Model
+ {
+ class ContactCompoundObject;
+ }
+
+ namespace Input
+ {
+ /**
+ * @brief UI Control for editing ContactCompoundObject
+ */
+ class ContactCompoundObjectControl : public Ui::Editfield
+ {
+ public:
+ /**
+ * @brief Create control
+ * @param[in] object Contact compound object
+ */
+ ContactCompoundObjectControl(Model::ContactCompoundObject *object);
+
+ private:
+ virtual void onCreated() override;
+ void onUnfocused(Evas_Object *entry, void *eventInfo);
+
+ Model::ContactCompoundObject *m_Object;
+ };
+ }
+}
+
+#endif /* CONTACTS_INPUT_CONTACT_COMPOUND_OBJECT_CONTROL_H */
/**
* @return ContactObject associated with the item.
*/
- const Model::ContactObject &getObject() const;
+ Model::ContactObject &getObject() const;
protected:
friend class ContactFieldSubItem;
/**
* @return ContactField associated with the item.
*/
- const Model::ContactField &getField() const;
+ Model::ContactField &getField() const;
private:
friend class ContactFieldItem;
#define PART_BUTTON_3 "swallow.button.3"
#define PART_BUTTON_4 "swallow.button.4"
+#define GROUP_ICON_EXPAND "icon_expand"
+#define GROUP_ICON_CONTRACT "icon_contract"
+
#endif /* INPUT_ITEM_LAYOUT_H */
#define INPUT_ICON_ADD_NOTE INPUT_IMG_DIR"contacts_circle_btn_ic_note.png"
#define INPUT_ICON_ADD_MORE INPUT_IMG_DIR"contacts_circle_btn_ic_more.png"
+#define INPUT_ICON_EXPAND INPUT_IMG_DIR"core_icon_expand_close.png"
+#define INPUT_ICON_CONTRACT INPUT_IMG_DIR"core_icon_expand_open.png"
+
#endif /* INPUT_PATH_H */
#include "InputItemLayout.h"
#include "InputItemLayoutMetrics.h"
+#include "../../../../lib-common/res/common/edje/common-colors.edc"
+#include "../../../../lib-common/res/common/edje/common-utils.edc"
+
collections
{
base_scale: 2.6;
+ IMAGE_WITH_COLOR(GROUP_ICON_EXPAND, INPUT_ICON_EXPAND, "icon_expand")
+ IMAGE_WITH_COLOR(GROUP_ICON_CONTRACT, INPUT_ICON_CONTRACT, "icon_expand")
+
group {
name: "elm/genlist/item/"INPUT_ITEM_STYLE"/default";
alias: "elm/genlist/item_compress/"INPUT_ITEM_STYLE"/default";
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "Contacts/Input/ContactCompoundFieldItem.h"
+#include "Contacts/Input/ContactCompoundObjectControl.h"
+#include "Contacts/Model/ContactObject.h"
+
+#include "App/Path.h"
+#include "Utils/Callback.h"
+
+#include "InputItemLayout.h"
+
+using namespace Contacts::Input;
+using namespace Contacts::Model;
+
+namespace
+{
+ const std::string layoutPath = App::getResourcePath(INPUT_ITEM_LAYOUT_EDJ);
+}
+
+Evas_Object *ContactCompoundFieldItem::getContent(Evas_Object *parent, const char *part)
+{
+ if (strcmp(part, PART_RIGHT) == 0) {
+ Evas_Object *button = elm_button_add(parent);
+ /* FIXME: Request standard style for expand open/close buttons */
+ elm_object_style_set(button, "floatingbutton/default");
+ evas_object_smart_callback_add(button, "clicked",
+ makeCallback(&ContactCompoundFieldItem::onButtonPressed), this);
+
+ Evas_Object *image = elm_image_add(button);
+ elm_image_file_set(image, layoutPath.c_str(), isExpanded() ? GROUP_ICON_CONTRACT : GROUP_ICON_EXPAND);
+ elm_object_part_content_set(button, "elm.swallow.content", image);
+
+ return button;
+ } else if (!isExpanded() && strcmp(part, PART_MIDDLE) == 0) {
+ Ui::Control *control = new ContactCompoundObjectControl(&getObject().cast<ContactCompoundObject>());
+ return control->create(parent);
+ } else {
+ return ContactFieldItem::getContent(parent, part);
+ }
+}
+
+void ContactCompoundFieldItem::onExpanded()
+{
+ ContactFieldItem::onExpanded();
+ elm_genlist_item_update(getObjectItem());
+}
+
+void ContactCompoundFieldItem::onContracted()
+{
+ ContactFieldItem::onContracted();
+ elm_genlist_item_update(getObjectItem());
+}
+
+void ContactCompoundFieldItem::onButtonPressed(Evas_Object *button, void *eventInfo)
+{
+ elm_genlist_item_expanded_set(getObjectItem(), !isExpanded());
+}
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "Contacts/Input/ContactCompoundObjectControl.h"
+#include "Contacts/Model/ContactCompoundObject.h"
+#include "Contacts/Common/Strings.h"
+#include "Utils/Callback.h"
+
+using namespace Contacts::Input;
+using namespace Contacts::Model;
+
+ContactCompoundObjectControl::ContactCompoundObjectControl(ContactCompoundObject *object)
+ : m_Object(object)
+{
+}
+
+void ContactCompoundObjectControl::onCreated()
+{
+ setGuideText(Common::getContactFieldName(ContactFieldId(m_Object->getId())));
+
+ Evas_Object *entry = getEntry();
+ elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_WORD);
+ evas_object_smart_callback_add(entry, "unfocused",
+ makeCallback(&ContactCompoundObjectControl::onUnfocused), this);
+
+ char *text = elm_entry_utf8_to_markup(m_Object->getValue().c_str());
+ elm_entry_entry_set(entry, text);
+ free(text);
+}
+
+void ContactCompoundObjectControl::onUnfocused(Evas_Object *entry, void *eventInfo)
+{
+ char *text = elm_entry_markup_to_utf8(elm_entry_entry_get(getEntry()));
+ m_Object->setValue(text);
+ free(text);
+}
#include "Contacts/Input/ContactFieldSubItem.h"
#include "Contacts/Model/ContactObject.h"
#include "Utils/Callback.h"
+#include "Utils/Logger.h"
#include "InputItemLayout.h"
m_OnRemove = std::move(callback);
}
-const ContactObject &ContactFieldItem::getObject() const
+ContactObject &ContactFieldItem::getObject() const
{
return m_Object->cast<ContactObject>();
}
{
}
-const ContactField &ContactFieldSubItem::getField() const
+ContactField &ContactFieldSubItem::getField() const
{
return *m_Field;
}
#include "Contacts/Input/InputView.h"
#include "Contacts/Input/AddFieldsItem.h"
#include "Contacts/Input/ContactTypedFieldItem.h"
+#include "Contacts/Input/ContactCompoundFieldItem.h"
#include "Contacts/Model/ContactArray.h"
#include "App/Path.h"
ContactFieldItem *item = nullptr;
if (field->getSubType() & ObjectTyped) {
item = new ContactTypedFieldItem(std::move(field));
+ } else if (field->getSubType() & ObjectCompound) {
+ item = new ContactCompoundFieldItem(std::move(field));
} else {
item = new ContactFieldItem(std::move(field));
}