summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Olshevskyi <i.olshevskyi@samsung.com>2017-08-17 12:17:25 +0300
committerIgor Olshevskyi <i.olshevskyi@samsung.com>2017-10-05 13:15:39 +0300
commit7f6d8a84a2ec87ab97c6a8e2a324d17280001382 (patch)
treed465c310a6e8b237ad188c83f50cf2a9e0e0e91e
parent9aa501f54271d963e1914fcb449b530bffe1744f (diff)
downloadcall-setting-7f6d8a84a2ec87ab97c6a8e2a324d17280001382.tar.gz
call-setting-7f6d8a84a2ec87ab97c6a8e2a324d17280001382.tar.bz2
call-setting-7f6d8a84a2ec87ab97c6a8e2a324d17280001382.zip
TizenRefApp-9149 [Call Setting] Implement KeypadPresenter
Change-Id: I1f4881e8d1d513f34394ab955c5a1c2ba7936399
-rw-r--r--call-setting/presenters/misc/KeypadPresenter.cpp322
-rw-r--r--call-setting/presenters/misc/KeypadPresenter.h90
-rw-r--r--call-setting/resources.cpp5
-rw-r--r--call-setting/resources.h2
-rw-r--r--call-setting/view/KeypadBackspaceBtn.cpp66
-rw-r--r--call-setting/view/KeypadBackspaceBtn.h51
-rw-r--r--call-setting/view/KeypadEntry.cpp166
-rw-r--r--call-setting/view/KeypadEntry.h62
-rw-r--r--call-setting/view/KeypadNumberBtn.cpp87
-rw-r--r--call-setting/view/KeypadNumberBtn.h67
-rw-r--r--call-setting/view/TouchParser.cpp185
-rw-r--r--call-setting/view/TouchParser.h70
-rw-r--r--call-setting/view/common.h3
-rw-r--r--edc/buttons.edc606
-rw-r--r--edc/colors.h14
-rw-r--r--edc/images.edc4
-rw-r--r--edc/images/dialer_button_bg.pngbin0 -> 15738 bytes
-rw-r--r--edc/images/dialer_fadeout.#.pngbin0 -> 145 bytes
-rw-r--r--edc/images/keypad_0.pngbin0 -> 19126 bytes
-rw-r--r--edc/images/keypad_1.pngbin0 -> 19678 bytes
-rw-r--r--edc/images/keypad_2.pngbin0 -> 19028 bytes
-rw-r--r--edc/images/keypad_3.pngbin0 -> 19072 bytes
-rw-r--r--edc/images/keypad_4.pngbin0 -> 19703 bytes
-rw-r--r--edc/images/keypad_5.pngbin0 -> 19156 bytes
-rw-r--r--edc/images/keypad_6.pngbin0 -> 19690 bytes
-rw-r--r--edc/images/keypad_7.pngbin0 -> 19091 bytes
-rw-r--r--edc/images/keypad_8.pngbin0 -> 19078 bytes
-rw-r--r--edc/images/keypad_9.pngbin0 -> 19699 bytes
-rw-r--r--edc/images/screen_reader_focus.#.pngbin0 -> 1093 bytes
-rw-r--r--edc/images/screen_reader_focus_ef.#.pngbin0 -> 1480 bytes
-rw-r--r--edc/images/w_call_button_press_circle.pngbin0 -> 3075 bytes
-rw-r--r--edc/images/w_call_numeric_btn_cancel.pngbin0 -> 1609 bytes
-rw-r--r--edc/images/w_call_numeric_btn_check.pngbin0 -> 1455 bytes
-rw-r--r--edc/includes.h1
-rw-r--r--edc/layouts.edc145
-rw-r--r--project_def.prop2
-rw-r--r--res/edje/theme.edc8
37 files changed, 1949 insertions, 7 deletions
diff --git a/call-setting/presenters/misc/KeypadPresenter.cpp b/call-setting/presenters/misc/KeypadPresenter.cpp
new file mode 100644
index 0000000..ebca959
--- /dev/null
+++ b/call-setting/presenters/misc/KeypadPresenter.cpp
@@ -0,0 +1,322 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 "KeypadPresenter.h"
+
+#include <feedback.h>
+
+#include "call-setting/view/KeypadNumberBtn.h"
+
+#include "call-setting/resources.h"
+
+#include "call-setting/presenters/common.h"
+
+namespace call_setting { namespace { namespace impl {
+
+ constexpr LayoutTheme LAYOUT_KEYPAD_WIDGET {
+ "layout", "callsetting", "keypad"};
+
+ constexpr ElmStyle STYLE_BTN_CONFIRM {"callsetting/confirm"};
+
+ constexpr EdjePart PART_CONFIRM_BTN {"swl.confirm"};
+ constexpr EdjePart PART_BACKSPACE_BTN {"swl.backspace"};
+ constexpr EdjePart PART_ENTRY {"swl.entry"};
+ constexpr EdjePart PART_GUIDE_TXT {"txt.guide"};
+
+ constexpr EoDataKey BTN_DATA_KEY {"__btn_data__"};
+
+ constexpr EdjeSignal SIGNAL_SHOW_GUIDE_TXT {"guide.txt.show"};
+ constexpr EdjeSignal SIGNAL_HIDE_GUIDE_TXT {"guide.txt.hide"};
+ constexpr EdjeSignalSrc SIGNAL_SRC_KEYPAD {"keypad"};
+
+ struct BtnInfo {
+ KeypadNumberBtn::Info info;
+ EdjePart part;
+ };
+
+ const BtnInfo BtnInfoList[] = {
+ {{ElmStyle {"callsetting/keypad_00"}, "0", nullptr, nullptr,
+ KeypadNumberBtn::SymbolState::HIDDEN}, EdjePart {"swl.btn.0"}},
+ {{ElmStyle {"callsetting/keypad_01"}, "1", nullptr, nullptr,
+ KeypadNumberBtn::SymbolState::HIDDEN}, EdjePart {"swl.btn.1"}},
+ {{ElmStyle {"callsetting/keypad_02"}, "2", "ABC", nullptr,
+ KeypadNumberBtn::SymbolState::HIDDEN}, EdjePart {"swl.btn.2"}},
+ {{ElmStyle {"callsetting/keypad_03"}, "3", "DFE", "#",
+ KeypadNumberBtn::SymbolState::BELOW}, EdjePart {"swl.btn.3"}},
+ {{ElmStyle {"callsetting/keypad_04"}, "4", "GHI", nullptr,
+ KeypadNumberBtn::SymbolState::HIDDEN}, EdjePart {"swl.btn.4"}},
+ {{ElmStyle {"callsetting/keypad_05"}, "5", "JKL", "+",
+ KeypadNumberBtn::SymbolState::RIGHT}, EdjePart {"swl.btn.5"}},
+ {{ElmStyle {"callsetting/keypad_06"}, "6", "MNO", nullptr,
+ KeypadNumberBtn::SymbolState::HIDDEN}, EdjePart {"swl.btn.6"}},
+ {{ElmStyle {"callsetting/keypad_07"}, "7", "PQRS", "*",
+ KeypadNumberBtn::SymbolState::BELOW}, EdjePart {"swl.btn.7"}},
+ {{ElmStyle {"callsetting/keypad_08"}, "8", "TUV", nullptr,
+ KeypadNumberBtn::SymbolState::HIDDEN}, EdjePart {"swl.btn.8"}},
+ {{ElmStyle {"callsetting/keypad_09"}, "9", "WXYZ", nullptr,
+ KeypadNumberBtn::SymbolState::HIDDEN}, EdjePart {"swl.btn.9"}}
+ };
+
+ constexpr int BTNS_COUNT = sizeof(BtnInfoList) / sizeof(BtnInfoList[0]);
+
+ void *asData(const int index)
+ {
+ return reinterpret_cast<void *>(static_cast<intptr_t>(index));
+ }
+
+ int asIndex(void *const data)
+ {
+ return static_cast<int>(
+ reinterpret_cast<intptr_t>(data));
+ }
+
+ int getIndex(const Widget &widget)
+ {
+ return asIndex(widget.getData(BTN_DATA_KEY));
+ }
+
+}}}
+
+namespace call_setting {
+
+ using ucl::Layout;
+
+ // KeypadPresenter::Builder //
+
+ KeypadPresenter::Builder::Builder()
+ {
+ }
+
+ KeypadPresenter::Builder &
+ KeypadPresenter::Builder::setNumber(std::string number)
+ {
+ m_number = std::move(number);
+ return *this;
+ }
+
+ KeypadPresenter::Builder &
+ KeypadPresenter::Builder::setCompleteHandler(NotiHandler handler)
+ {
+ m_completeHandler = std::move(handler);
+ return *this;
+ }
+
+ KeypadPresenter::Builder &
+ KeypadPresenter::Builder::setParentWidget(ElmWidgetSRef parentWidget)
+ {
+ m_parentWidget = std::move(parentWidget);
+ return *this;
+ }
+
+ KeypadPresenterSRef
+ KeypadPresenter::Builder::build(GuiPresenter &parent) const
+ {
+ if (!m_parentWidget || !m_completeHandler) {
+ LOG_RETURN_VALUE(RES_INVALID_ARGUMENTS,
+ {},
+ "Not all main parameters are set is NULL!");
+ }
+
+ auto result = makeShared<KeypadPresenter>(
+ m_completeHandler,
+ PRIVATE);
+ FAIL_RETURN_VALUE(result->prepare(parent,
+ *m_parentWidget,
+ m_number),
+ {}, "result->prepare() failed!");
+
+ return result;
+ }
+
+ // KeypadPresenter //
+
+ KeypadPresenter::KeypadPresenter(IRefCountObj &rc,
+ NotiHandler handler,
+ Private):
+ GuiPresenter(rc),
+ m_completeHandler(std::move(handler))
+ {
+ }
+
+ Result KeypadPresenter::prepare(GuiPresenter &parent,
+ ElmWidget &parentWidget,
+ const std::string &number)
+ {
+ FAIL_RETURN(GuiPresenter::prepare(parent),
+ "Presenter::prepare() failed!");
+
+ FAIL_RETURN(createWidget(parentWidget),
+ "createWidget() failed!");
+
+ FAIL_RETURN(createConfirmButton(),
+ "createConfirmButton() failed!");
+
+ FAIL_RETURN(createEntry(number),
+ "createEntry() failed!");
+
+ FAIL_RETURN(createBackspaceButton(),
+ "createBackspaceButton() failed!");
+
+ FAIL_RETURN(createNumberButtons(),
+ "createNumberButtons() failed!");
+
+ return RES_OK;
+ }
+
+ std::string KeypadPresenter::getNumber() const
+ {
+ return m_entry->getNumber();
+ }
+
+ Widget &KeypadPresenter::getWidget()
+ {
+ return *m_widget;
+ }
+
+ Result KeypadPresenter::createWidget(ElmWidget &parent)
+ {
+ m_widget = Layout::Builder().
+ setTheme(impl::LAYOUT_KEYPAD_WIDGET).
+ build(parent);
+ if (!m_widget) {
+ LOG_RETURN(RES_FAIL, "Layout::build() failed!");
+ }
+
+ m_widget->setText(STR_KEYPAD_GUIDE_TEXT,
+ impl::PART_GUIDE_TXT);
+
+ return RES_OK;
+ }
+
+ Result KeypadPresenter::createConfirmButton()
+ {
+ auto eo = elm_button_add(*m_widget);
+ if (!eo) {
+ LOG_RETURN(RES_FAIL, "eo is NULL");
+ }
+ auto confirmBtn = makeShared<StyledWidget>(eo, false);
+ m_widget->setContent(*confirmBtn, impl::PART_CONFIRM_BTN);
+
+ confirmBtn->setStyle(impl::STYLE_BTN_CONFIRM);
+ confirmBtn->addEventHandler(BTN_CLICKED,
+ WEAK_DELEGATE_THIS(onConfirmBtnClicked));
+
+ return RES_OK;
+ }
+
+ void KeypadPresenter::onConfirmBtnClicked(Widget &widget,
+ void *eventInfo)
+ {
+ if (const auto handler = m_completeHandler.lock()) {
+ handler();
+ }
+ }
+
+ Result KeypadPresenter::createBackspaceButton()
+ {
+ auto backspaceBtn = KeypadBackspaceBtn::newInstance(*m_widget);
+ if (!backspaceBtn) {
+ LOG_RETURN(RES_FAIL, "m_backspaceBtn is NULL");
+ }
+ m_widget->setContent(*backspaceBtn, impl::PART_BACKSPACE_BTN);
+ backspaceBtn->setIsOwner(false);
+
+ backspaceBtn->addEventHandler(BTN_CLICKED,
+ WEAK_DELEGATE_THIS(onBackspaceBtnClicked));
+
+ backspaceBtn->addEventHandler(CS_BTN_LONGPRESSED,
+ WEAK_DELEGATE_THIS(onBackspaceLongPressed));
+
+ return RES_OK;
+ }
+
+ void KeypadPresenter::onBackspaceBtnClicked(Widget &widget,
+ void *eventInfo)
+ {
+ m_entry->erase();
+ }
+
+ void KeypadPresenter::onBackspaceLongPressed(Widget &widget,
+ void *eventInfo)
+ {
+ m_entry->clear();
+ }
+
+ Result KeypadPresenter::createEntry(const std::string &number)
+ {
+ m_entry = KeypadEntry::newInstance(*m_widget);
+ if (!m_entry) {
+ LOG_RETURN(RES_FAIL, "m_entry is NULL");
+ }
+
+ m_entry->addEventHandler(ENTRY_CHANGED,
+ WEAK_DELEGATE_THIS(onEntryChanged));
+
+ m_widget->setContent(*m_entry, impl::PART_ENTRY);
+
+ if (!number.empty()) {
+ m_entry->setNumber(number);
+ }
+
+ return RES_OK;
+ }
+
+ void KeypadPresenter::onEntryChanged(Widget &widget, void *eventInfo)
+ {
+ if (m_entry->getNumber().empty()) {
+ m_widget->emit(impl::SIGNAL_SHOW_GUIDE_TXT,
+ impl::SIGNAL_SRC_KEYPAD);
+ } else {
+ m_widget->emit(impl::SIGNAL_HIDE_GUIDE_TXT,
+ impl::SIGNAL_SRC_KEYPAD);
+ }
+ }
+
+ Result KeypadPresenter::createNumberButtons()
+ {
+ for (int i = 0; i < impl::BTNS_COUNT; i++) {
+ auto btn = KeypadNumberBtn::newInstance(*m_widget,
+ impl::BtnInfoList[i].info);
+ if (!btn) {
+ LOG_RETURN(RES_FAIL, "btn is NULL");
+ }
+
+ btn->setData(impl::BTN_DATA_KEY, impl::asData(i));
+ m_widget->setContent(*btn, impl::BtnInfoList[i].part);
+
+ btn->addEventHandler(BTN_CLICKED,
+ WEAK_DELEGATE_THIS(onNumberBtnClicked));
+
+ btn->addEventHandler(CS_BTN_LONGPRESSED,
+ WEAK_DELEGATE_THIS(onNumberBtnLongPressed));
+ }
+
+ return RES_OK;
+ }
+
+ void KeypadPresenter::onNumberBtnClicked(Widget &widget,
+ void *eventInfo)
+ {
+ m_entry->insert(impl::BtnInfoList[impl::getIndex(widget)].info.digit);
+ }
+
+ void KeypadPresenter::onNumberBtnLongPressed(Widget &widget,
+ void *eventInfo)
+ {
+ m_entry->insert(impl::BtnInfoList[impl::getIndex(widget)].info.symbol);
+ }
+
+}
diff --git a/call-setting/presenters/misc/KeypadPresenter.h b/call-setting/presenters/misc/KeypadPresenter.h
new file mode 100644
index 0000000..c36e70a
--- /dev/null
+++ b/call-setting/presenters/misc/KeypadPresenter.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 __CALL_SETTING_PRESENTERS_MISC_KEYPAD_PRESENTER_H__
+#define __CALL_SETTING_PRESENTERS_MISC_KEYPAD_PRESENTER_H__
+
+#include "ucl/mvp/GuiPresenter.h"
+
+#include "ucl/gui/Layout.h"
+#include "ucl/gui/StyledWidget.h"
+#include "ucl/misc/Timeout.h"
+
+#include "call-setting/view/KeypadEntry.h"
+#include "call-setting/view/KeypadBackspaceBtn.h"
+
+#include "call-setting/presenters/types.h"
+
+namespace call_setting {
+
+ UCL_DECLARE_REF_ALIASES(KeypadPresenter);
+
+ class KeypadPresenter final : public ucl::GuiPresenter {
+ public:
+ class Builder {
+ public:
+ Builder();
+ Builder &setNumber(std::string number);
+ Builder &setCompleteHandler(NotiHandler handler);
+ Builder &setParentWidget(ucl::ElmWidgetSRef parentWidget);
+ KeypadPresenterSRef build(ucl::GuiPresenter &parent) const;
+
+ private:
+ std::string m_number;
+ NotiHandler m_completeHandler;
+ ucl::ElmWidgetSRef m_parentWidget;
+ };
+
+ public:
+ std::string getNumber() const;
+
+ ucl::Widget &getWidget();
+
+ private:
+ KeypadPresenter(ucl::IRefCountObj &rc,
+ NotiHandler handler,
+ Private);
+ ~KeypadPresenter() = default;
+
+ ucl::Result prepare(GuiPresenter &parent,
+ ucl::ElmWidget &parentWidget,
+ const std::string &number);
+
+ ucl::Result createWidget(ucl::ElmWidget &parent);
+ ucl::Result createConfirmButton();
+ ucl::Result createBackspaceButton();
+ ucl::Result createNumberButtons();
+ ucl::Result createEntry(const std::string &number);
+
+ void onNumberBtnClicked(ucl::Widget &widget, void *eventInfo);
+ void onNumberBtnLongPressed(ucl::Widget &widget, void *eventInfo);
+ void onBackspaceBtnClicked(ucl::Widget &widget, void *eventInfo);
+ void onBackspaceLongPressed(ucl::Widget &widget, void *eventInfo);
+ void onEntryChanged(ucl::Widget &widget, void *eventInfo);
+ void onConfirmBtnClicked(ucl::Widget &widget, void *eventInfo);
+
+ private:
+ ucl::LayoutSRef m_widget;
+ const NotiHandler m_completeHandler;
+
+ KeypadEntrySRef m_entry;
+
+ friend class ucl::ReffedObj<KeypadPresenter>;
+ };
+
+}
+
+#endif // __CALL_SETTING_PRESENTERS_MISC_KEYPAD_PRESENTER_H__
diff --git a/call-setting/resources.cpp b/call-setting/resources.cpp
index 62ecb42..8a04ba7 100644
--- a/call-setting/resources.cpp
+++ b/call-setting/resources.cpp
@@ -66,4 +66,7 @@ namespace call_setting {
const TString STR_NETWORK_OR_SIM_ERROR_TOAST_MESSAGE {
"WDS_CST_TPOP_CANT_CONNECT_TO_NETWORK_OR_SIM_NOT_AVAILABLE",
TEXT_DOMAIN};
-} \ No newline at end of file
+
+ const TString STR_KEYPAD_GUIDE_TEXT {
+ "WDS_CST_BODY_VOICEMAIL_NUMBER", TEXT_DOMAIN};
+}
diff --git a/call-setting/resources.h b/call-setting/resources.h
index 36a8bd9..3ca1b52 100644
--- a/call-setting/resources.h
+++ b/call-setting/resources.h
@@ -53,6 +53,8 @@ namespace call_setting {
extern const ucl::TString STR_CALL_WAITING_ITEM_TITLE;
extern const ucl::TString STR_UPDATE_SETTINGS_TOAST_MESSAGE;
extern const ucl::TString STR_NETWORK_OR_SIM_ERROR_TOAST_MESSAGE;
+
+ extern const ucl::TString STR_KEYPAD_GUIDE_TEXT;
}
#endif // __CALL_SETTING_RESOURCES_H__
diff --git a/call-setting/view/KeypadBackspaceBtn.cpp b/call-setting/view/KeypadBackspaceBtn.cpp
new file mode 100644
index 0000000..064a240
--- /dev/null
+++ b/call-setting/view/KeypadBackspaceBtn.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 "call-setting/view/KeypadBackspaceBtn.h"
+
+#include "common.h"
+
+namespace call_setting { namespace { namespace impl {
+
+ constexpr ElmStyle STYLE_BTN_BACKSPACE {"callsetting/backspace"};
+
+ constexpr EdjeSignal SIGNAL_CANCEL_CLICK {"cancel,click"};
+ constexpr EdjeSignalSrc SIGNAL_SRC_KEYPAD_BTN {"keypad_btn"};
+
+}}}
+
+namespace call_setting {
+
+ KeypadBackspaceBtnSRef KeypadBackspaceBtn::newInstance(ElmWidget &parent)
+ {
+ Evas_Object *eo = elm_button_add(parent);
+ if (!eo) {
+ LOG_RETURN_VALUE(RES_FAIL, {}, "eo is NULL");
+ }
+
+ return makeShared<KeypadBackspaceBtn>(eo, PRIVATE);
+ }
+
+ KeypadBackspaceBtn::KeypadBackspaceBtn(IRefCountObj &rc,
+ Evas_Object *eo,
+ Private):
+ ElmWidget(&rc, eo, false),
+ m_button(makeShared<StyledWidget>(eo, false).get())
+ {
+ prepare();
+ }
+
+ void KeypadBackspaceBtn::prepare()
+ {
+ m_button->setStyle(impl::STYLE_BTN_BACKSPACE);
+
+ m_touchParser = makeShared<TouchParser>(*m_button);
+ m_touchParser->setTapAndHoldHandler(WEAK_DELEGATE_THIS(onTapAndHold));
+ }
+
+ void KeypadBackspaceBtn::onTapAndHold(int x, int y)
+ {
+ m_button->emit(impl::SIGNAL_CANCEL_CLICK,
+ impl::SIGNAL_SRC_KEYPAD_BTN);
+ m_button->callEvent(CS_BTN_LONGPRESSED);
+ }
+
+}
diff --git a/call-setting/view/KeypadBackspaceBtn.h b/call-setting/view/KeypadBackspaceBtn.h
new file mode 100644
index 0000000..7805420
--- /dev/null
+++ b/call-setting/view/KeypadBackspaceBtn.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 __CALL_SETTING_VIEW_KEYPAD_BACKSPACE_BUTTON_H__
+#define __CALL_SETTING_VIEW_KEYPAD_BACKSPACE_BUTTON_H__
+
+#include "ucl/gui/StyledWidget.h"
+
+#include "TouchParser.h"
+
+namespace call_setting {
+
+ UCL_DECLARE_REF_ALIASES(KeypadBackspaceBtn);
+
+ class KeypadBackspaceBtn final: public ucl::ElmWidget {
+ public:
+ static KeypadBackspaceBtnSRef newInstance(ucl::ElmWidget &parent);
+
+ protected:
+ KeypadBackspaceBtn(ucl::IRefCountObj &rc,
+ Evas_Object *eo,
+ Private);
+ virtual ~KeypadBackspaceBtn() = default;
+
+ void prepare();
+
+ void onTapAndHold(int x, int y);
+
+ private:
+ ucl::StyledWidget *m_button;
+ TouchParserSRef m_touchParser;
+
+ friend class ucl::ReffedObj<KeypadBackspaceBtn>;
+ };
+
+}
+
+#endif // __CALL_SETTING_VIEW_KEYPAD_BACKSPACE_BUTTON_H__
diff --git a/call-setting/view/KeypadEntry.cpp b/call-setting/view/KeypadEntry.cpp
new file mode 100644
index 0000000..60acdb1
--- /dev/null
+++ b/call-setting/view/KeypadEntry.cpp
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 "call-setting/view/KeypadEntry.h"
+
+#include "common.h"
+
+namespace call_setting { namespace { namespace impl {
+
+ constexpr auto TEXT_MIN_SIZE = 23;
+ constexpr auto TEXT_MAX_SIZE = 34;
+ constexpr auto STYLE_BUFFER_SIZE = 256;
+
+}}}
+
+namespace call_setting {
+
+ using ucl::nz;
+
+ KeypadEntrySRef KeypadEntry::newInstance(ucl::ElmWidget &parent)
+ {
+ auto eo = elm_entry_add(parent);
+ if (!eo) {
+ LOG_RETURN_VALUE(RES_FAIL, {}, "eo is NULL");
+ }
+
+ auto result = makeShared<KeypadEntry>(eo, PRIVATE);
+ result->bindToEo();
+
+ return result;
+ }
+
+ KeypadEntry::KeypadEntry(IRefCountObj &rc,
+ Evas_Object *eo,
+ Private):
+ ElmWidget(&rc, eo, false),
+ m_entry(makeShared<StyledWidget>(eo, false).get()),
+ m_fontSize(impl::TEXT_MAX_SIZE)
+ {
+ prepare();
+ }
+
+ void KeypadEntry::prepare()
+ {
+ static Elm_Entry_Filter_Accept_Set digitsFilterData;
+ digitsFilterData.accepted = "0123456789*#+";
+ digitsFilterData.rejected = nullptr;
+
+ elm_entry_single_line_set(*m_entry, EINA_TRUE);
+ elm_entry_editable_set(*m_entry, EINA_FALSE);
+ elm_entry_scrollable_set(*m_entry, EINA_TRUE);
+ elm_entry_markup_filter_append(*m_entry,
+ elm_entry_filter_accept_set, &digitsFilterData);
+
+ m_entry->addEventHandler(ENTRY_CHANGED,
+ WEAK_DELEGATE_THIS(onChanged));
+
+ m_entry->addEventHandler(WidgetEvent::RESIZE,
+ WEAK_DELEGATE_THIS(onResize));
+
+ applyFontSize();
+ }
+
+ std::string KeypadEntry::getNumber() const
+ {
+ return nz(elm_entry_entry_get(*m_entry));
+ }
+
+ void KeypadEntry::setNumber(const std::string &number)
+ {
+ elm_entry_entry_set(*m_entry, number.c_str());
+ elm_entry_cursor_line_end_set(*m_entry);
+ }
+
+ void KeypadEntry::insert(const char *c)
+ {
+ elm_entry_entry_insert(*m_entry, c);
+ }
+
+ void KeypadEntry::erase()
+ {
+ if (!elm_entry_selection_get(*m_entry)) {
+ int pos = elm_entry_cursor_pos_get(*m_entry);
+ if (pos > 0) {
+ elm_entry_select_region_set(*m_entry, pos - 1, pos);
+ }
+ }
+ elm_entry_entry_insert(*m_entry, "");
+ }
+
+ void KeypadEntry::clear()
+ {
+ elm_entry_entry_set(*m_entry, "");
+ }
+
+ int KeypadEntry::calcFontSize() const
+ {
+ int entryWidth = 0;
+ int textWidth = 0;
+ auto textblock = elm_entry_textblock_get(*m_entry);
+ m_entry->getGeometry(nullptr, nullptr, &entryWidth, nullptr);
+ evas_object_textblock_size_native_get(textblock, &textWidth, nullptr);
+
+ int fontSize = impl::TEXT_MAX_SIZE;
+ if (textWidth > 0) {
+ fontSize = (m_fontSize * entryWidth) / textWidth;
+ if (fontSize < impl::TEXT_MIN_SIZE) {
+ fontSize = impl::TEXT_MIN_SIZE;
+ } else if (fontSize > impl::TEXT_MAX_SIZE) {
+ fontSize = impl::TEXT_MAX_SIZE;
+ }
+ }
+
+ return fontSize;
+ }
+
+ void KeypadEntry::applyFontSize()
+ {
+ char buffer[impl::STYLE_BUFFER_SIZE];
+ snprintf(buffer, sizeof(buffer),
+ "DEFAULT='font=Tizen:style=Regular"
+ " font_size=%d color=#ffffff align=center'", m_fontSize);
+ elm_entry_text_style_user_pop(*m_entry);
+ elm_entry_text_style_user_push(*m_entry, buffer);
+ }
+
+ void KeypadEntry::onChanged(Widget &widget, void *eventInfo)
+ {
+ std::string newText = nz(elm_entry_entry_get(*m_entry));
+
+ // XXX This check is used to avoid recursive font
+ // size recalculation when entry text does not changed
+ if (m_rawText != newText) {
+ m_rawText = std::move(newText);
+ updateFontSize();
+ }
+ }
+
+ void KeypadEntry::onResize(Widget &widget, void *eventInfo)
+ {
+ updateFontSize();
+ }
+
+ void KeypadEntry::updateFontSize()
+ {
+ auto newFontSize = calcFontSize();
+ if (m_fontSize != newFontSize) {
+ m_fontSize = newFontSize;
+ applyFontSize();
+ }
+ }
+
+}
diff --git a/call-setting/view/KeypadEntry.h b/call-setting/view/KeypadEntry.h
new file mode 100644
index 0000000..ce362af
--- /dev/null
+++ b/call-setting/view/KeypadEntry.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 __CALL_SETTING_VIEW_KEYPAD_ENTRY_H__
+#define __CALL_SETTING_VIEW_KEYPAD_ENTRY_H__
+
+#include "ucl/gui/ElmWidget.h"
+
+#include "types.h"
+
+namespace call_setting {
+
+ UCL_DECLARE_REF_ALIASES(KeypadEntry);
+
+ class KeypadEntry final: public ucl::ElmWidget {
+ public:
+ static KeypadEntrySRef newInstance(ucl::ElmWidget &parent);
+
+ std::string getNumber() const;
+ void setNumber(const std::string &number);
+ void insert(const char *c);
+ void erase();
+ void clear();
+
+ private:
+ KeypadEntry(ucl::IRefCountObj &rc,
+ Evas_Object *eo,
+ Private);
+ virtual ~KeypadEntry() = default;
+
+ void prepare();
+ int calcFontSize() const;
+ void applyFontSize();
+ void updateFontSize();
+
+ void onChanged(ucl::Widget &widget, void *eventInfo);
+ void onResize(ucl::Widget &widget, void *eventInfo);
+
+ private:
+ ElmWidget *m_entry;
+ int m_fontSize;
+ std::string m_rawText;
+
+ friend class ucl::ReffedObj<KeypadEntry>;
+ };
+
+}
+
+#endif // __CALL_SETTING_VIEW_KEYPAD_ENTRY_H__
diff --git a/call-setting/view/KeypadNumberBtn.cpp b/call-setting/view/KeypadNumberBtn.cpp
new file mode 100644
index 0000000..f82f6db
--- /dev/null
+++ b/call-setting/view/KeypadNumberBtn.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 "call-setting/view/KeypadNumberBtn.h"
+
+#include "common.h"
+
+namespace call_setting { namespace { namespace impl {
+
+ constexpr EdjePart PART_DIGIT {"text.digit"};
+ constexpr EdjePart PART_LETTERS {"text.letters"};
+ constexpr EdjePart PART_SYMBOL {"text.symbol"};
+ constexpr EdjePart PART_SYMBOL_ALT {"text.symbol.alt"};
+
+ constexpr EdjeSignal SIGNAL_CANCEL_CLICK {"cancel,click"};
+ constexpr EdjeSignalSrc SIGNAL_SRC_KEYPAD_BTN {"keypad_btn"};
+
+}}}
+
+namespace call_setting {
+
+ KeypadNumberBtnSRef KeypadNumberBtn::newInstance(ucl::ElmWidget &parent,
+ const Info &info)
+ {
+ Evas_Object *eo = elm_button_add(parent);
+ if (!eo) {
+ LOG_RETURN_VALUE(RES_FAIL, {}, "eo is NULL");
+ }
+
+ return makeShared<KeypadNumberBtn>(eo, info, PRIVATE);
+ }
+
+ KeypadNumberBtn::KeypadNumberBtn(ucl::IRefCountObj &rc,
+ Evas_Object *eo,
+ const Info &info,
+ Private):
+ ElmWidget(&rc, eo, false),
+ m_button(makeShared<StyledWidget>(eo, false).get())
+ {
+ prepare(info);
+ }
+
+ void KeypadNumberBtn::prepare(const Info &info)
+ {
+ m_button->setStyle(info.style);
+ m_button->setText(info.digit, impl::PART_DIGIT);
+ m_button->setText(info.letters, impl::PART_LETTERS);
+
+ switch (info.symbolState) {
+ case SymbolState::BELOW:
+ m_button->setText(info.symbol, impl::PART_SYMBOL);
+ break;
+ case SymbolState::RIGHT:
+ m_button->setText(info.symbol, impl::PART_SYMBOL_ALT);
+ break;
+ default:
+ break;
+ }
+
+ if (info.symbol) {
+ m_touchParser = makeShared<TouchParser>(*m_button);
+ m_touchParser->setTapAndHoldHandler(
+ WEAK_DELEGATE_THIS(onTapAndHold));
+ }
+ }
+
+ void KeypadNumberBtn::onTapAndHold(int x, int y)
+ {
+ m_button->emit(impl::SIGNAL_CANCEL_CLICK,
+ impl::SIGNAL_SRC_KEYPAD_BTN);
+ m_button->callEvent(CS_BTN_LONGPRESSED);
+ }
+
+}
diff --git a/call-setting/view/KeypadNumberBtn.h b/call-setting/view/KeypadNumberBtn.h
new file mode 100644
index 0000000..b585384
--- /dev/null
+++ b/call-setting/view/KeypadNumberBtn.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 __CALL_SETTING_VIEW_KEYPAD_NUMBER_BUTTON_H__
+#define __CALL_SETTING_VIEW_KEYPAD_NUMBER_BUTTON_H__
+
+#include "ucl/gui/StyledWidget.h"
+
+#include "TouchParser.h"
+
+namespace call_setting {
+
+ UCL_DECLARE_REF_ALIASES(KeypadNumberBtn);
+
+ class KeypadNumberBtn final: public ucl::ElmWidget {
+ public:
+ enum class SymbolState {
+ HIDDEN,
+ BELOW,
+ RIGHT
+ };
+
+ struct Info {
+ ucl::ElmStyle style;
+ const char *digit;
+ const char *letters;
+ const char *symbol;
+ SymbolState symbolState;
+ };
+
+ public:
+ static KeypadNumberBtnSRef newInstance(ucl::ElmWidget &parent,
+ const Info &info);
+
+ protected:
+ KeypadNumberBtn(ucl::IRefCountObj &rc,
+ Evas_Object *eo,
+ const Info &info,
+ Private);
+ virtual ~KeypadNumberBtn() = default;
+
+ void prepare(const Info &info);
+ void onTapAndHold(int x, int y);
+
+ private:
+ ucl::StyledWidget *m_button;
+ TouchParserSRef m_touchParser;
+
+ friend class ucl::ReffedObj<KeypadNumberBtn>;
+ };
+
+}
+
+#endif // __CALL_SETTING_VIEW_KEYPAD_BUTTON_H__
diff --git a/call-setting/view/TouchParser.cpp b/call-setting/view/TouchParser.cpp
new file mode 100644
index 0000000..68b8aad
--- /dev/null
+++ b/call-setting/view/TouchParser.cpp
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 "call-setting/view/TouchParser.h"
+
+#include "common.h"
+
+namespace call_setting { namespace { namespace impl {
+
+ constexpr auto TAP_MOVE_THRESHOLD = 30;
+ constexpr auto FAST_TAP_DISTANCE = 60;
+ constexpr auto FAST_TAP_DELAY_MS = 300;
+ constexpr auto TAP_AND_HOLD_DELAY_SEC = (500.0 / 1000.0);
+}}}
+
+namespace call_setting {
+
+ TouchParser::TouchParser(IRefCountObj &rc, Widget &eventSource) :
+ RefCountAware(&rc),
+ m_holdTimer(nullptr),
+ m_downTime(0),
+ m_downX(0),
+ m_downY(0),
+ m_tapCounter(0),
+ m_isMouseDown(false),
+ m_isTapPossible(false)
+ {
+ eventSource.addEventHandler(WidgetEvent::MOUSE_DOWN,
+ WEAK_DELEGATE_THIS(onMouseDown));
+
+ eventSource.addEventHandler(WidgetEvent::MOUSE_UP,
+ WEAK_DELEGATE_THIS(onMouseUp));
+
+ eventSource.addEventHandler(WidgetEvent::MOUSE_MOVE,
+ WEAK_DELEGATE_THIS(onMouseMove));
+ }
+
+ TouchParser::~TouchParser()
+ {
+ stopHoldTimer();
+ }
+
+ void TouchParser::setTapHandler(TapHandler handler)
+ {
+ m_tapHandler = std::move(handler);
+ }
+
+ void TouchParser::setDoubleTapHandler(TapHandler handler)
+ {
+ m_doubleTapHandler = std::move(handler);
+ }
+
+ void TouchParser::setTapAndHoldHandler(TapHandler handler)
+ {
+ m_tapAndHoldHandler = std::move(handler);
+ }
+
+ void TouchParser::onMouseDown(Widget &widget, void *eventInfo)
+ {
+ if (m_isMouseDown) {
+ return;
+ }
+ m_isMouseDown = true;
+
+ const auto e = static_cast<Evas_Event_Mouse_Down *>(eventInfo);
+
+ if (!isFastTap(e->timestamp, e->canvas.x, e->canvas.y)) {
+ m_tapCounter = 0;
+ restartHoldTimer();
+ } else if (m_tapCounter == 1) {
+ if (const auto handler = m_doubleTapHandler.lock()) {
+ handler(m_downX, m_downY);
+ }
+ }
+
+ m_downTime = e->timestamp;
+ m_downX = e->canvas.x;
+ m_downY = e->canvas.y;
+ m_isTapPossible = true;
+ }
+
+ void TouchParser::onMouseUp(Widget &widget, void *eventInfo)
+ {
+ if (!m_isMouseDown) {
+ return;
+ }
+ m_isMouseDown = false;
+
+ const auto e = static_cast<Evas_Event_Mouse_Up *>(eventInfo);
+
+ stopHoldTimer();
+ updateIsTapPossible(e->event_flags, e->canvas.x, e->canvas.y);
+
+ if (!m_isTapPossible) {
+ m_tapCounter = 0;
+ return;
+ }
+
+ ++m_tapCounter;
+
+ if (const auto handler = m_tapHandler.lock()) {
+ handler(e->canvas.x, e->canvas.y);
+ }
+ }
+
+ void TouchParser::onMouseMove(Widget &widget, void *eventInfo)
+ {
+ if (!m_isMouseDown || !m_isTapPossible) {
+ return;
+ }
+
+ const auto e = static_cast<Evas_Event_Mouse_Move *>(eventInfo);
+
+ updateIsTapPossible(e->event_flags, e->cur.canvas.x, e->cur.canvas.y);
+
+ if (!m_isTapPossible) {
+ stopHoldTimer();
+ }
+ }
+
+ void TouchParser::updateIsTapPossible(const int flags,
+ const int curX, const int curY)
+ {
+ if (!m_isTapPossible) {
+ return;
+ }
+ if ((flags & EVAS_EVENT_FLAG_ON_HOLD) || (calcDownDistance(curX, curY) >
+ ELM_SCALE_SIZE(impl::TAP_MOVE_THRESHOLD))) {
+ m_isTapPossible = false;
+ }
+ }
+
+ bool TouchParser::isFastTap(const UInt curTime,
+ const int curX, const int curY) const
+ {
+ return (((curTime - m_downTime) <= impl::FAST_TAP_DELAY_MS) &&
+ (calcDownDistance(curX, curY) <=
+ ELM_SCALE_SIZE(impl::FAST_TAP_DISTANCE)));
+ }
+
+ double TouchParser::calcDownDistance(int curX, int curY) const
+ {
+ const auto dx = (curX - m_downX);
+ const auto dy = (curY - m_downY);
+
+ return sqrt(1.0 * dx * dx + 1.0 * dy * dy);
+ }
+
+ void TouchParser::restartHoldTimer()
+ {
+ stopHoldTimer();
+ m_holdTimer = ecore_timer_add(impl::TAP_AND_HOLD_DELAY_SEC,
+ CALLBACK_A(TouchParser::onHoldTimer), this);
+ }
+
+ void TouchParser::stopHoldTimer()
+ {
+ if (m_holdTimer) {
+ ecore_timer_del(m_holdTimer);
+ m_holdTimer = nullptr;
+ }
+ }
+
+ Eina_Bool TouchParser::onHoldTimer()
+ {
+ m_holdTimer = nullptr;
+ if (const auto handler = m_tapAndHoldHandler.lock()) {
+ handler(m_downX, m_downY);
+ }
+ return ECORE_CALLBACK_CANCEL;
+ }
+}
diff --git a/call-setting/view/TouchParser.h b/call-setting/view/TouchParser.h
new file mode 100644
index 0000000..4904aeb
--- /dev/null
+++ b/call-setting/view/TouchParser.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 __CALL_SETTING_VIEW_TOUCH_PARSER_H__
+#define __CALL_SETTING_VIEW_TOUCH_PARSER_H__
+
+#include "ucl/gui/Widget.h"
+
+#include "types.h"
+
+namespace call_setting {
+
+ UCL_DECLARE_REF_ALIASES(TouchParser);
+
+ class TouchParser final : public ucl::RefCountAware {
+ public:
+ using TapHandler = ucl::WeakDelegate<void(int x, int y)>;
+
+ public:
+ TouchParser(ucl::IRefCountObj &rc, ucl::Widget &eventSource);
+
+ void setTapHandler(TapHandler handler);
+ void setDoubleTapHandler(TapHandler handler);
+ void setTapAndHoldHandler(TapHandler handler);
+
+ private:
+ ~TouchParser();
+ void onMouseDown(ucl::Widget &widget, void *eventInfo);
+ void onMouseUp(ucl::Widget &widget, void *eventInfo);
+ void onMouseMove(ucl::Widget &widget, void *eventInfo);
+
+ void updateIsTapPossible(int flags, int curX, int curY);
+
+ bool isFastTap(ucl::UInt curTime, int curX, int curY) const;
+ double calcDownDistance(int curX, int curY) const;
+
+ void restartHoldTimer();
+ void stopHoldTimer();
+ Eina_Bool onHoldTimer();
+
+ private:
+ TapHandler m_tapHandler;
+ TapHandler m_doubleTapHandler;
+ TapHandler m_tapAndHoldHandler;
+ Ecore_Timer *m_holdTimer;
+ ucl::UInt m_downTime;
+ int m_downX;
+ int m_downY;
+ int m_tapCounter;
+ bool m_isMouseDown;
+ bool m_isTapPossible;
+
+ friend class ucl::ReffedObj<TouchParser>;
+ };
+}
+
+#endif // __CALL_SETTING_VIEW_TOUCH_PARSER_H__
diff --git a/call-setting/view/common.h b/call-setting/view/common.h
index 3dff2cc..8d9b80f 100644
--- a/call-setting/view/common.h
+++ b/call-setting/view/common.h
@@ -48,6 +48,9 @@ namespace call_setting {
constexpr ucl::SmartEvent BTN_CLICKED {"clicked"};
constexpr ucl::SmartEvent POPUP_DISMISSED {"dismissed"};
+ constexpr ucl::SmartEvent ENTRY_CHANGED {"changed"};
+
+ constexpr ucl::SmartEvent CS_BTN_LONGPRESSED {"callsetting,btn,longpress"};
}
#endif // __CALL_SETTING_VIEW_COMMON_H__
diff --git a/edc/buttons.edc b/edc/buttons.edc
new file mode 100644
index 0000000..120c054
--- /dev/null
+++ b/edc/buttons.edc
@@ -0,0 +1,606 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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.
+ */
+
+#define CS_KEYPAD_ACTION_BTN_ICON_SIZE 60 60
+
+#define CS_KEYPAD_BTN_EFF_DEFAULT_SIZE 160 160
+#define CS_KEYPAD_BTN_EFF_PRESSED_SIZE 144 144
+
+#define CS_KEYPAD_NUMBER_BTN_LETTERS_T 8
+#define CS_KEYPAD_NUMBER_BTN_LETTERS_H 24
+#define CS_KEYPAD_NUMBER_BTN_SYMBOL_T 6
+#define CS_KEYPAD_NUMBER_BTN_SYMBOL_H 26
+#define CS_KEYPAD_NUMBER_BTN_SYMBOL_ALT_W 14
+#define CS_KEYPAD_NUMBER_BTN_SYMBOL_ALT_H 34
+
+#define CS_KEYPAD_NUMBER_BTN_DIGIT_W 50
+#define CS_KEYPAD_NUMBER_BTN_DIGIT_H 45
+
+plugins {
+ plugin { name: "key_back";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_KEY_BACK";
+ }
+ plugin { name: "keypad_00";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_KEY0";
+ }
+ plugin { name: "keypad_01";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_KEY1";
+ }
+ plugin { name: "keypad_02";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_KEY2";
+ }
+ plugin { name: "keypad_03";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_KEY3";
+ }
+ plugin { name: "keypad_04";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_KEY4";
+ }
+ plugin { name: "keypad_05";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_KEY5";
+ }
+ plugin { name: "keypad_06";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_KEY6";
+ }
+ plugin { name: "keypad_07";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_KEY7";
+ }
+ plugin { name: "keypad_08";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_KEY8";
+ }
+ plugin { name: "keypad_09";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_KEY9";
+ }
+}
+
+styles {
+ style {
+ name: "keypad_btn_digit";
+ base: "font=Tizen:style=Regular font_size=34 align=center color=#ffffff ellipsis=-1.0";
+ }
+ style {
+ name: "keypad_btn_letters";
+ base: "font=Tizen:style=Regular font_size=18 align=center color=#ffffffb2 ellipsis=-1.0";
+ }
+ style {
+ name: "keypad_btn_symbol";
+ base: "font=Tizen:style=Regular font_size=20 align=center color=#ffffffb2 ellipsis=-1.0";
+ }
+ style {
+ name: "keypad_btn_symbol_alt";
+ base: "font=Tizen:style=Regular font_size=26 align=left color=#ffffffb2 ellipsis=-1.0";
+ }
+}
+
+group { "elm/button/base/callsetting/confirm";
+ images {
+ image: "w_call_button_press_circle.png" COMP;
+ image: "w_call_numeric_btn_check.png" COMP;
+ }
+ parts {
+ spacer { "sizer";
+ scale;
+ desc { "default";
+ max: CS_KEYPAD_ACTION_BTN_ICON_SIZE;
+ }
+ }
+ image { "image.effect";
+ nomouse;
+ scale;
+ desc { "default";
+ fixed: 1 1;
+ rel.to: "icon";
+ min: CS_KEYPAD_BTN_EFF_DEFAULT_SIZE;
+ image.normal: "w_call_button_press_circle.png";
+ color: CS_COLOR_KEYPAD_BTN_EFF_NORMAL;
+ }
+ desc { "pressed_effect";
+ inherit: "default";
+ min: CS_KEYPAD_BTN_EFF_PRESSED_SIZE;
+ color: CS_COLOR_KEYPAD_BTN_EFF_PRESSED;
+ }
+ desc { "pressed";
+ inherit: "pressed_effect";
+ min: CS_KEYPAD_BTN_EFF_DEFAULT_SIZE;
+ }
+ }
+ image { "icon";
+ scale;
+ clip: "icon.clipper";
+ desc { "default";
+ rel1 { relative: 0.0 0.0; to: "sizer"; }
+ rel2 { relative: 1.0 1.0; to: "sizer"; }
+ min: CS_KEYPAD_ACTION_BTN_ICON_SIZE;
+ max: CS_KEYPAD_ACTION_BTN_ICON_SIZE;
+ image.normal: "w_call_numeric_btn_check.png";
+ }
+ }
+ rect { "icon.clipper";
+ scale;
+ desc { "default";
+ rel.to: "icon";
+ color: CS_COLOR_WHITE;
+ }
+ desc { "pressed";
+ inherit: "default";
+ color: CS_COLOR_KEYPAD_BTN_ICON_PRESSED;
+ }
+ }
+ rect { "rect.event";
+ scale;
+ desc { "default";
+ fixed: 1 1;
+ rel.to: "sizer";
+ color: CS_COLOR_TRANSPARENT;
+ }
+ desc { "disabled";
+ inherit: "default";
+ hid;
+ }
+ }
+ }
+ programs {
+ program { "pressed";
+ signal: "mouse,down,1*";
+ source: "rect.event";
+ action: SIGNAL_EMIT "elm,action,press" "";
+ after: "on_pressed";
+ }
+ program { "unpressed";
+ signal: "mouse,up,1*";
+ source: "rect.event";
+ action: SIGNAL_EMIT "elm,action,unpress" "";
+ after: "on_unpressed";
+ }
+ program { "clicked";
+ signal: "mouse,clicked,1";
+ source: "rect.event";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ after: "on_clicked";
+ }
+ program { "on_pressed";
+ sequence {
+ action: STATE_SET "pressed";
+ target: "icon.clipper";
+ action: STATE_SET "pressed_effect";
+ target: "image.effect";
+ action: STATE_SET "pressed";
+ target: "image.effect";
+ transition: CS_BUTTON_PRESS_EFFECT_TRANSITION_GLIDE(0.3);
+ }
+ }
+ program { "on_unpressed";
+ sequence {
+ action: STATE_SET "default";
+ target: "icon.clipper";
+ action: STATE_SET "default";
+ target: "image.effect";
+ transition: LINEAR 0.535;
+ }
+ }
+ program { "on_clicked";
+ action: RUN_PLUGIN "touch_sound";
+ }
+ }
+}
+
+group { "elm/button/base/callsetting/backspace";
+ images {
+ image: "w_call_button_press_circle.png" COMP;
+ image: "w_call_numeric_btn_cancel.png" COMP;
+ }
+ parts {
+ spacer { "sizer";
+ scale;
+ desc { "default";
+ max: CS_KEYPAD_ACTION_BTN_ICON_SIZE;
+ }
+ }
+ image { "image.effect";
+ nomouse;
+ scale;
+ desc { "default";
+ fixed: 1 1;
+ rel.to: "icon";;
+ min: CS_KEYPAD_BTN_EFF_DEFAULT_SIZE;
+ image.normal: "w_call_button_press_circle.png";
+ color: CS_COLOR_KEYPAD_BTN_EFF_NORMAL;
+ }
+ desc { "pressed_effect";
+ inherit: "default";
+ min: CS_KEYPAD_BTN_EFF_PRESSED_SIZE;
+ color: CS_COLOR_KEYPAD_BTN_EFF_PRESSED;
+ }
+ desc { "pressed";
+ inherit: "pressed_effect";
+ min: CS_KEYPAD_BTN_EFF_DEFAULT_SIZE;
+ }
+ }
+ image { "icon";
+ scale;
+ clip: "icon.clipper";
+ desc { "default";
+ rel1 { relative: 0.0 0.0; to: "sizer"; }
+ rel2 { relative: 1.0 1.0; to: "sizer"; }
+ min: CS_KEYPAD_ACTION_BTN_ICON_SIZE;
+ max: CS_KEYPAD_ACTION_BTN_ICON_SIZE;
+ image.normal: "w_call_numeric_btn_cancel.png";
+ }
+ }
+ rect { "icon.clipper";
+ scale;
+ desc { "default";
+ rel.to: "icon";
+ color: CS_COLOR_WHITE;
+ }
+ desc { "pressed";
+ inherit: "default";
+ color: CS_COLOR_KEYPAD_BTN_ICON_PRESSED;
+ }
+ }
+ rect { "rect.event";
+ scale;
+ desc { "default";
+ fixed: 1 1;
+ rel.to: "sizer";
+ color: CS_COLOR_TRANSPARENT;
+ }
+ desc { "disabled";
+ inherit: "default";
+ hid;
+ }
+ }
+ }
+ programs {
+ script {
+ public isClickCanceled;
+ }
+ program { "pressed";
+ signal: "mouse,down,1*";
+ source: "rect.event";
+ action: SIGNAL_EMIT "elm,action,press" "";
+ after: "on_pressed";
+ }
+ program { "unpressed";
+ signal: "mouse,up,1*";
+ source: "rect.event";
+ action: SIGNAL_EMIT "elm,action,unpress" "";
+ after: "on_unpressed";
+ }
+ program { "clicked";
+ signal: "mouse,clicked,1";
+ source: "rect.event";
+ script {
+ if (get_int(isClickCanceled) == 0) {
+ run_program(PROGRAM:"emit_click");
+ }
+ }
+ }
+ program { "emit_click";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program { "cancel,click";
+ signal: "cancel,click";
+ source: "keypad_btn";
+ script {
+ set_int(isClickCanceled, 1);
+ }
+ }
+ program { "on_pressed";
+ script {
+ set_int(isClickCanceled, 0);
+ run_program(PROGRAM:"on_pressed2");
+ }
+ }
+ program { "on_pressed2";
+ sequence {
+ action: RUN_PLUGIN "key_back";
+ action: STATE_SET "pressed";
+ target: "icon.clipper";
+ action: STATE_SET "pressed_effect";
+ target: "image.effect";
+ action: STATE_SET "pressed";
+ target: "image.effect";
+ transition: CS_BUTTON_PRESS_EFFECT_TRANSITION_GLIDE(0.3);
+ }
+ }
+ program { "on_unpressed";
+ sequence {
+ action: STATE_SET "default";
+ target: "icon.clipper";
+ action: STATE_SET "default";
+ target: "image.effect";
+ transition: LINEAR 0.535;
+ }
+ }
+ }
+}
+
+#define CS_BTN_KEYPAD_NUMBER_IMPL(_name, _icon, _digit_x, _digit_y, _effect_x, _effect_y) \
+group { "elm/button/base/callsetting/"_name; \
+ data.item: "access_highlight" "on"; \
+ images { \
+ image: "w_call_button_press_circle.png" COMP; \
+ image: "screen_reader_focus.#.png" COMP; \
+ image: "screen_reader_focus_ef.#.png" COMP; \
+ image: _icon COMP; \
+ } \
+ parts { \
+ spacer { "spacer.effect"; \
+ scale; \
+ desc { "default"; \
+ fixed: 1 1; \
+ rel1.relative: CS_REL_X(_effect_x) CS_REL_Y(_effect_y); \
+ rel2.relative: CS_REL_X(_effect_x) CS_REL_Y(_effect_y); \
+ } \
+ } \
+ image { "image.effect"; \
+ scale; \
+ nomouse; \
+ desc { "default"; \
+ fixed: 1 1; \
+ min: CS_KEYPAD_BTN_EFF_DEFAULT_SIZE; \
+ rel1 { relative: 0.5 0.5; to: "spacer.effect"; } \
+ rel2 { relative: 0.5 0.5; to: "spacer.effect"; } \
+ image.normal: "w_call_button_press_circle.png"; \
+ color: CS_COLOR_KEYPAD_BTN_EFF_NORMAL; \
+ } \
+ desc { "pressed_effect"; \
+ inherit: "default"; \
+ min: CS_KEYPAD_BTN_EFF_PRESSED_SIZE; \
+ color: CS_COLOR_KEYPAD_BTN_EFF_PRESSED; \
+ } \
+ desc { "pressed"; \
+ inherit: "pressed_effect"; \
+ min: CS_KEYPAD_BTN_EFF_DEFAULT_SIZE; \
+ } \
+ } \
+ textblock { "text.digit"; \
+ scale; \
+ desc { "default"; \
+ fixed: 1 1; \
+ rel1.relative: CS_REL_X(_digit_x) CS_REL_Y(_digit_y); \
+ rel2.relative: CS_REL_X((_digit_x+CS_KEYPAD_NUMBER_BTN_DIGIT_W)) \
+ CS_REL_Y((_digit_y+CS_KEYPAD_NUMBER_BTN_DIGIT_H)); \
+ text.style: "keypad_btn_digit"; \
+ } \
+ } \
+ spacer { "spacer.letters.top"; \
+ scale; \
+ desc { "default"; \
+ fixed: 0 1; \
+ min: 0 CS_KEYPAD_NUMBER_BTN_LETTERS_T; \
+ align: 0.5 1.0; \
+ rel1 { relative: 0.0 1.0; to: "text.digit"; } \
+ rel2 { relative: 1.0 1.0; to: "text.digit"; } \
+ } \
+ } \
+ textblock { "text.letters"; \
+ scale; \
+ desc { "default"; \
+ fixed: 0 1; \
+ min: 0 CS_KEYPAD_NUMBER_BTN_LETTERS_H; \
+ align: 0.5 0.0; \
+ rel1 { relative: 0.0 0.0; to: "spacer.letters.top"; } \
+ rel2 { relative: 1.0 0.0; to: "spacer.letters.top"; } \
+ text.style: "keypad_btn_letters"; \
+ } \
+ } \
+ spacer { "spacer.symbol.top"; \
+ scale; \
+ desc { "default"; \
+ fixed: 0 1; \
+ min: 0 CS_KEYPAD_NUMBER_BTN_SYMBOL_T; \
+ align: 0.5 1.0; \
+ rel1 { relative: 0.0 1.0; to: "text.letters"; } \
+ rel2 { relative: 1.0 1.0; to: "text.letters"; } \
+ } \
+ } \
+ textblock { "text.symbol"; \
+ scale; \
+ desc { "default"; \
+ min: 0 CS_KEYPAD_NUMBER_BTN_SYMBOL_H; \
+ align: 0.5 0.0; \
+ rel1 { relative: 0.0 0.0; to: "spacer.symbol.top"; } \
+ rel2 { relative: 1.0 0.0; to: "spacer.symbol.top"; } \
+ text.style: "keypad_btn_symbol"; \
+ } \
+ } \
+ textblock { "text.symbol.alt"; \
+ scale; \
+ desc { "default"; \
+ fixed: 1 0; \
+ min: CS_KEYPAD_NUMBER_BTN_SYMBOL_ALT_W CS_KEYPAD_NUMBER_BTN_SYMBOL_ALT_H; \
+ align: 1.0 0.5; \
+ rel1 { relative: 1.0 0.5; to: "text.letters"; } \
+ rel2 { relative: 1.0 0.5; to: "text.letters"; } \
+ text.style: "keypad_btn_symbol_alt"; \
+ } \
+ } \
+ image { "image_mask"; \
+ precise; \
+ nomouse; \
+ desc { "default"; \
+ image.normal: _icon; \
+ } \
+ } \
+ rect { "rect.event"; \
+ clip_to: "image_mask"; \
+ desc { "default"; \
+ color: CS_COLOR_TRANSPARENT; \
+ } \
+ } \
+ rect { "highlight_base"; \
+ clip_to: "highlight_clip"; \
+ nomouse; \
+ desc { "default"; \
+ rel1 { relative: 0.0 0.0; to: "text.digit"; } \
+ rel2 { relative: 1.0 1.0; to: "text.digit"; } \
+ hid; \
+ } \
+ } \
+ rect { "highlight_clip"; \
+ scale; \
+ nomouse; \
+ desc { "default"; \
+ color: CS_COLOR_WHITE; \
+ rel.to: "highlight_base"; \
+ } \
+ } \
+ image { "highlight_glow"; \
+ scale; \
+ repeat; \
+ nomouse; \
+ clip: "highlight_clip"; \
+ desc { "default"; \
+ image.normal: "screen_reader_focus.#.png"; \
+ fill.smooth: 0; \
+ color: CS_COLOR_KEYPAD_BTN_HIGHLIGHT_GLOW; \
+ rel.to: "highlight_base"; \
+ hid; \
+ } \
+ desc { "visible"; \
+ inherit: "default" 0.0; \
+ vis; \
+ } \
+ } \
+ image { "highlight_glow_ef"; \
+ scale; \
+ repeat; \
+ nomouse; \
+ clip: "highlight_clip"; \
+ desc { "default"; \
+ image.normal: "screen_reader_focus_ef.#.png"; \
+ fill.smooth: 0; \
+ color: CS_COLOR_KEYPAD_BTN_HIGHLIGHT_GLOW_EFF; \
+ rel.to: "highlight_base"; \
+ hid; \
+ } \
+ desc { "visible"; \
+ inherit: "default" 0.0; \
+ vis; \
+ } \
+ } \
+ } \
+ programs { \
+ script { \
+ public isMouseIn; \
+ public isClickCanceled; \
+ } \
+ program { name: "button_mouse_in"; \
+ signal: "mouse,in"; \
+ source: "rect.event"; \
+ script { \
+ set_int(isMouseIn, 1); \
+ } \
+ } \
+ program { name: "button_mouse_out"; \
+ signal: "mouse,out"; \
+ source: "rect.event"; \
+ script { \
+ set_int(isMouseIn, 0); \
+ } \
+ } \
+ program { "pressed"; \
+ signal: "mouse,down,1*"; \
+ source: "rect.event"; \
+ action: SIGNAL_EMIT "elm,action,press" ""; \
+ after: "on_pressed"; \
+ } \
+ program { "unpressed"; \
+ signal: "mouse,up,1*"; \
+ source: "rect.event"; \
+ action: SIGNAL_EMIT "elm,action,unpress" ""; \
+ after: "on_unpressed"; \
+ } \
+ program { "clicked"; \
+ signal: "mouse,clicked,1"; \
+ source: "rect.event"; \
+ in: 0.0001 0.0; \
+ script { \
+ if (get_int(isMouseIn) == 1 && get_int(isClickCanceled) == 0) { \
+ run_program(PROGRAM:"emit_click"); \
+ } \
+ } \
+ } \
+ program { "emit_click"; \
+ action: SIGNAL_EMIT "elm,action,click" ""; \
+ } \
+ program { "cancel,click"; \
+ signal: "cancel,click"; \
+ source: "keypad_btn"; \
+ script { \
+ set_int(isClickCanceled, 1); \
+ } \
+ } \
+ program { "on_pressed"; \
+ script { \
+ set_int(isClickCanceled, 0); \
+ run_program(PROGRAM:"on_pressed2"); \
+ } \
+ } \
+ program { "on_pressed2"; \
+ sequence { \
+ action: RUN_PLUGIN _name; \
+ action: STATE_SET "pressed_effect"; \
+ target: "image.effect"; \
+ action: STATE_SET "pressed"; \
+ target: "image.effect"; \
+ transition: CS_BUTTON_PRESS_EFFECT_TRANSITION_GLIDE(0.3); \
+ } \
+ } \
+ program { "on_unpressed"; \
+ sequence { \
+ action: STATE_SET "default"; \
+ target: "image.effect"; \
+ transition: LINEAR 0.535; \
+ } \
+ } \
+ program { name: "show_new_highlight"; \
+ signal: "elm,action,access_highlight,show"; \
+ source: "elm"; \
+ action: STATE_SET "visible" 0.0; \
+ targets: "highlight_glow" "highlight_glow_ef"; \
+ } \
+ program { name: "hide_new_highlight"; \
+ signal: "elm,action,access_highlight,hide"; \
+ source: "elm"; \
+ action: STATE_SET "default" 0.0; \
+ targets: "highlight_glow" "highlight_glow_ef"; \
+ } \
+ } \
+}
+
+CS_BTN_KEYPAD_NUMBER_IMPL("keypad_00", "keypad_0.png", 155, 12, 180, 35)
+CS_BTN_KEYPAD_NUMBER_IMPL("keypad_01", "keypad_1.png", 240, 41, 265, 63)
+CS_BTN_KEYPAD_NUMBER_IMPL("keypad_02", "keypad_2.png", 292, 106, 318, 135)
+CS_BTN_KEYPAD_NUMBER_IMPL("keypad_03", "keypad_3.png", 292, 196, 318, 225)
+CS_BTN_KEYPAD_NUMBER_IMPL("keypad_04", "keypad_4.png", 240, 265, 265, 297)
+CS_BTN_KEYPAD_NUMBER_IMPL("keypad_05", "keypad_5.png", 155, 292, 180, 325)
+CS_BTN_KEYPAD_NUMBER_IMPL("keypad_06", "keypad_6.png", 70, 264, 95, 297)
+CS_BTN_KEYPAD_NUMBER_IMPL("keypad_07", "keypad_7.png", 18, 194, 42, 225)
+CS_BTN_KEYPAD_NUMBER_IMPL("keypad_08", "keypad_8.png", 18, 104, 42, 135)
+CS_BTN_KEYPAD_NUMBER_IMPL("keypad_09", "keypad_9.png", 70, 30, 95, 63)
diff --git a/edc/colors.h b/edc/colors.h
index 8d37ee9..23a3ce9 100644
--- a/edc/colors.h
+++ b/edc/colors.h
@@ -17,6 +17,18 @@
#ifndef __CALL_SETTING_EDC_COLORS_H__
#define __CALL_SETTING_EDC_COLORS_H__
-#define CALL_SETTING_COLOR_WHITE 255 255 255 255
+#define CS_COLOR_WHITE 255 255 255 255
+#define CS_COLOR_BLACK 0 0 0 255
+#define CS_COLOR_TRANSPARENT 0 0 0 0
+
+#define CS_COLOR_KEYPAD_BG 0 37 51 255
+
+#define CS_COLOR_KEYPAD_BTN_EFF_NORMAL 255 255 255 0
+#define CS_COLOR_KEYPAD_BTN_EFF_PRESSED 255 255 255 33
+
+#define CS_COLOR_KEYPAD_BTN_ICON_PRESSED 255 255 255 128
+
+#define CS_COLOR_KEYPAD_BTN_HIGHLIGHT_GLOW 255 145 0 255
+#define CS_COLOR_KEYPAD_BTN_HIGHLIGHT_GLOW_EFF 255 145 0 255
#endif // __CALL_SETTING_EDC_COLORS_H__
diff --git a/edc/images.edc b/edc/images.edc
index 7bb461e..30e0eaf 100644
--- a/edc/images.edc
+++ b/edc/images.edc
@@ -35,6 +35,6 @@
#define RES_SQUARE_IMAGE(FILE_NAME, SIZE, COLOR) \
RES_IMAGE(FILE_NAME, SIZE, SIZE, COLOR)
-RES_SQUARE_IMAGE("call_ic_no_item.png", 98, CALL_SETTING_COLOR_WHITE)
+RES_SQUARE_IMAGE("call_ic_no_item.png", 98, CS_COLOR_WHITE)
-RES_SQUARE_IMAGE("callsetting_more_opt_delete.png", 68, CALL_SETTING_COLOR_WHITE)
+RES_SQUARE_IMAGE("callsetting_more_opt_delete.png", 68, CS_COLOR_WHITE)
diff --git a/edc/images/dialer_button_bg.png b/edc/images/dialer_button_bg.png
new file mode 100644
index 0000000..7d3849d
--- /dev/null
+++ b/edc/images/dialer_button_bg.png
Binary files differ
diff --git a/edc/images/dialer_fadeout.#.png b/edc/images/dialer_fadeout.#.png
new file mode 100644
index 0000000..3689544
--- /dev/null
+++ b/edc/images/dialer_fadeout.#.png
Binary files differ
diff --git a/edc/images/keypad_0.png b/edc/images/keypad_0.png
new file mode 100644
index 0000000..606ce7b
--- /dev/null
+++ b/edc/images/keypad_0.png
Binary files differ
diff --git a/edc/images/keypad_1.png b/edc/images/keypad_1.png
new file mode 100644
index 0000000..d1f352d
--- /dev/null
+++ b/edc/images/keypad_1.png
Binary files differ
diff --git a/edc/images/keypad_2.png b/edc/images/keypad_2.png
new file mode 100644
index 0000000..9ab8699
--- /dev/null
+++ b/edc/images/keypad_2.png
Binary files differ
diff --git a/edc/images/keypad_3.png b/edc/images/keypad_3.png
new file mode 100644
index 0000000..76116d8
--- /dev/null
+++ b/edc/images/keypad_3.png
Binary files differ
diff --git a/edc/images/keypad_4.png b/edc/images/keypad_4.png
new file mode 100644
index 0000000..c2f26a6
--- /dev/null
+++ b/edc/images/keypad_4.png
Binary files differ
diff --git a/edc/images/keypad_5.png b/edc/images/keypad_5.png
new file mode 100644
index 0000000..2aa1b78
--- /dev/null
+++ b/edc/images/keypad_5.png
Binary files differ
diff --git a/edc/images/keypad_6.png b/edc/images/keypad_6.png
new file mode 100644
index 0000000..8afe43e
--- /dev/null
+++ b/edc/images/keypad_6.png
Binary files differ
diff --git a/edc/images/keypad_7.png b/edc/images/keypad_7.png
new file mode 100644
index 0000000..7820b5e
--- /dev/null
+++ b/edc/images/keypad_7.png
Binary files differ
diff --git a/edc/images/keypad_8.png b/edc/images/keypad_8.png
new file mode 100644
index 0000000..d7edefe
--- /dev/null
+++ b/edc/images/keypad_8.png
Binary files differ
diff --git a/edc/images/keypad_9.png b/edc/images/keypad_9.png
new file mode 100644
index 0000000..06e0c05
--- /dev/null
+++ b/edc/images/keypad_9.png
Binary files differ
diff --git a/edc/images/screen_reader_focus.#.png b/edc/images/screen_reader_focus.#.png
new file mode 100644
index 0000000..2ea2eab
--- /dev/null
+++ b/edc/images/screen_reader_focus.#.png
Binary files differ
diff --git a/edc/images/screen_reader_focus_ef.#.png b/edc/images/screen_reader_focus_ef.#.png
new file mode 100644
index 0000000..79cb51e
--- /dev/null
+++ b/edc/images/screen_reader_focus_ef.#.png
Binary files differ
diff --git a/edc/images/w_call_button_press_circle.png b/edc/images/w_call_button_press_circle.png
new file mode 100644
index 0000000..aeeb84e
--- /dev/null
+++ b/edc/images/w_call_button_press_circle.png
Binary files differ
diff --git a/edc/images/w_call_numeric_btn_cancel.png b/edc/images/w_call_numeric_btn_cancel.png
new file mode 100644
index 0000000..2a117a2
--- /dev/null
+++ b/edc/images/w_call_numeric_btn_cancel.png
Binary files differ
diff --git a/edc/images/w_call_numeric_btn_check.png b/edc/images/w_call_numeric_btn_check.png
new file mode 100644
index 0000000..aac529f
--- /dev/null
+++ b/edc/images/w_call_numeric_btn_check.png
Binary files differ
diff --git a/edc/includes.h b/edc/includes.h
index 73edc8d..46c0ab8 100644
--- a/edc/includes.h
+++ b/edc/includes.h
@@ -20,5 +20,6 @@
#include "colors.h"
#include "images.edc"
#include "layouts.edc"
+#include "buttons.edc"
#endif // __CALL_SETTING_EDC_INCLUDES_H__
diff --git a/edc/layouts.edc b/edc/layouts.edc
index d7364b7..dd0b47e 100644
--- a/edc/layouts.edc
+++ b/edc/layouts.edc
@@ -14,6 +14,19 @@
* limitations under the License.
*/
+#define CS_SWL_NUMBER_BUTTON(_name) \
+ swallow { _name; \
+ scale; \
+ desc { "default"; \
+ } \
+ } \
+
+styles {
+ style { name: "keypad_guide";
+ base: "font=Tizen font_weight=Normal font_width=Condensed font_size=30 align=center valign=center color=#ffffffff wrap=mixed ellipsis=1.0";
+ }
+}
+
group { "elm/layout/callsetting/fake_access_object";
data.item: "access_highlight" "on";
}
@@ -40,10 +53,10 @@ group { "elm/layout/callsetting/proccessing";
rect { "bg";
norepeat;
desc { "default";
- color: 0 0 0 0;
+ color: CS_COLOR_TRANSPARENT;
}
desc { "visible";
- color: 0 0 0 255;
+ color: CS_COLOR_BLACK;
}
}
swallow { "callsetting.swallow.progress";
@@ -181,3 +194,131 @@ group { "elm/layout/callsetting/popup_icon";
}
}
}
+
+group { "elm/layout/callsetting/keypad";
+ images {
+ image: "dialer_button_bg.png" COMP;
+ image: "dialer_fadeout.#.png" COMP;
+ }
+ parts {
+ image { "image.bg";
+ scale;
+ desc { "default";
+ color: CS_COLOR_KEYPAD_BG;
+ image.normal: "dialer_button_bg.png";
+ }
+ }
+ spacer { "spacer.number.left";
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 70 0;
+ align: 0.0 0.5;
+ rel2.relative: 0.0 1.0;
+ }
+ }
+ spacer { "spacer.number.right";
+ scale;
+ desc { "default";
+ fixed: 1 0;
+ min: 70 0;
+ align: 1.0 0.5;
+ rel1.relative: 1.0 0.0;
+ }
+ }
+ swallow { "swl.entry";
+ scale;
+ clip: "clipper.number";
+ desc { "default";
+ fixed: 0 1;
+ min: 0 66;
+ rel1 { relative: 1.0 0.5; to_x: "spacer.number.left"; }
+ rel2 { relative: 0.0 0.5; to_x: "spacer.number.right"; }
+ hid;
+ }
+ desc { "visible";
+ inherit: "default";
+ vis;
+ }
+ }
+ image { "clipper.number";
+ scale;
+ desc { "default";
+ rel.to: "swl.entry";
+ image.normal: "dialer_fadeout.#.png";
+ hid;
+ }
+ desc { "visible";
+ inherit: "default";
+ vis;
+ }
+ }
+ textblock { "txt.guide";
+ scale;
+ desc { "default";
+ fixed: 1 1;
+ min: 208 78;
+ max: 208 78;
+ text {
+ align: 0.5 0.5;
+ min: 0 1;
+ style: "keypad_guide";
+ }
+ }
+ desc { "hide";
+ inherit: "default";
+ hid;
+ }
+ }
+ CS_SWL_NUMBER_BUTTON("swl.btn.0")
+ CS_SWL_NUMBER_BUTTON("swl.btn.1")
+ CS_SWL_NUMBER_BUTTON("swl.btn.2")
+ CS_SWL_NUMBER_BUTTON("swl.btn.3")
+ CS_SWL_NUMBER_BUTTON("swl.btn.4")
+ CS_SWL_NUMBER_BUTTON("swl.btn.5")
+ CS_SWL_NUMBER_BUTTON("swl.btn.6")
+ CS_SWL_NUMBER_BUTTON("swl.btn.7")
+ CS_SWL_NUMBER_BUTTON("swl.btn.8")
+ CS_SWL_NUMBER_BUTTON("swl.btn.9")
+ swallow { "swl.confirm";
+ scale;
+ desc { "default";
+ fixed: 1 1;
+ align: 0.5 1.0;
+ rel1 { relative: 0.5 0.0; to_y: "swl.entry"; }
+ rel2 { relative: 0.5 0.0; to_y: "swl.entry"; }
+ }
+ }
+ swallow { "swl.backspace";
+ scale;
+ desc { "default";
+ fixed: 1 1;
+ align: 0.5 0.0;
+ rel1 { relative: 0.5 1.0; to_y: "swl.entry"; }
+ rel2 { relative: 0.5 1.0; to_y: "swl.entry"; }
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "guide.txt.show";
+ source: "keypad";
+ sequence {
+ action: STATE_SET "default";
+ target: "txt.guide";
+ action: STATE_SET "default";
+ targets: "swl.entry" "clipper.number";
+ }
+ }
+ program {
+ signal: "guide.txt.hide";
+ source: "keypad";
+ sequence {
+ action: STATE_SET "hide";
+ target: "txt.guide";
+ action: STATE_SET "visible";
+ targets: "swl.entry" "clipper.number";
+ }
+ }
+ }
+}
diff --git a/project_def.prop b/project_def.prop
index 5c5fb33..9f8c8d4 100644
--- a/project_def.prop
+++ b/project_def.prop
@@ -9,7 +9,7 @@ type = app
profile = wearable-4.0
# C/CPP Sources
-USER_SRCS = ucl/source/gui/Genlist.cpp call-setting/model/impl/BlockedNumbersImpl.cpp ucl/source/gui/Window.cpp call-setting/model/impl/BlockUnknownCallersImpl.cpp call-setting/model/impl/telephony/BaseTelRequestListener.cpp ucl/source/gui/Layout.cpp call-setting/resources.cpp call-setting/presenters/misc/ProcessingPresenter.cpp call-setting/presenters/misc/helpers.cpp ucl/source/appfw/UIApp.cpp call-setting/model/impl/CallWaitingImpl.cpp ucl/source/gui/WidgetItem.cpp call-setting/presenters/pages/NoContentPage.cpp call-setting/presenters/pages/BlockedNumbersPage.cpp call-setting/model/BlockUnknownCallers.cpp ucl/source/util/types/Result.cpp call-setting/model/CallSetting.cpp call-setting/presenters/pages/MainPage.cpp call-setting/presenters/misc/SelectModePresenter.cpp call-setting/model/impl/misc/ContactNameProvider.cpp call-setting/presenters/items/BlockUnknownCallersItem.cpp ucl/source/appfw/InstanceManagerBase.cpp call-setting/model/BlockedNumbers.cpp call-setting/model/impl/misc/BlockListManager.cpp ucl/source/gui/NaviItem.cpp ucl/source/appfw/helpers.cpp call-setting/presenters/dialogs/ListOptionDialog.cpp call-setting/model/impl/settings/SettingsManager.cpp call-setting/presenters/items/CallWaitingItem.cpp call-setting/presenters/InstanceManager.cpp ucl/source/gui/Widget.cpp call-setting/model/impl/telephony/TelRequestListener.cpp call-setting/model/Voicemail.cpp call-setting/presenters/items/SimpleListItem.cpp ucl/source/misc/Timeout.cpp call-setting/presenters/pages/BlockListPage.cpp call-setting/presenters/items/base/ListOptionItem.cpp ucl/source/mvp/GuiPresenter.cpp call-setting/presenters/dialogs/base/Dialog.cpp call-setting/view/helpers.cpp call-setting/model/StateManager.cpp ucl/source/util/logging.cpp ucl/source/gui/Naviframe.cpp ucl/source/gui/RadioBox.cpp ucl/source/util/types/classTypes.cpp call-setting/main.cpp call-setting/presenters/items/base/CheckOptionItem.cpp call-setting/model/CallWaiting.cpp call-setting/types.cpp ucl/source/appfw/SysEventProvider.cpp ucl/source/mvp/ListPresenter.cpp ucl/source/misc/Variant.cpp call-setting/presenters/items/RadioOptionItem.cpp call-setting/presenters/misc/MoreOptionsPresenter.cpp call-setting/model/impl/VoicemailImpl.cpp call-setting/presenters/items/CallerIdItem.cpp call-setting/model/CallerId.cpp call-setting/view/PageContent.cpp call-setting/model/impl/CallSettingImpl.cpp call-setting/presenters/pages/base/Page.cpp call-setting/model/impl/telephony/TelephonyManager.cpp call-setting/presenters/dialogs/ToastDialog.cpp ucl/source/mvp/ListItemPresenter.cpp ucl/source/gui/ElmWidget.cpp call-setting/model/impl/CallerIdImpl.cpp ucl/source/gui/EdjeWidget.cpp call-setting/presenters/Instance.cpp
+USER_SRCS = ucl/source/gui/Genlist.cpp call-setting/model/impl/BlockedNumbersImpl.cpp call-setting/presenters/misc/KeypadPresenter.cpp ucl/source/gui/Window.cpp call-setting/model/impl/BlockUnknownCallersImpl.cpp call-setting/view/TouchParser.cpp call-setting/model/impl/telephony/BaseTelRequestListener.cpp ucl/source/gui/Layout.cpp call-setting/resources.cpp call-setting/presenters/misc/ProcessingPresenter.cpp call-setting/presenters/misc/helpers.cpp ucl/source/appfw/UIApp.cpp call-setting/model/impl/CallWaitingImpl.cpp ucl/source/gui/WidgetItem.cpp call-setting/presenters/pages/NoContentPage.cpp call-setting/presenters/pages/BlockedNumbersPage.cpp call-setting/model/BlockUnknownCallers.cpp ucl/source/util/types/Result.cpp call-setting/model/CallSetting.cpp call-setting/presenters/pages/MainPage.cpp call-setting/view/KeypadEntry.cpp call-setting/presenters/misc/SelectModePresenter.cpp call-setting/model/impl/misc/ContactNameProvider.cpp call-setting/presenters/items/BlockUnknownCallersItem.cpp ucl/source/appfw/InstanceManagerBase.cpp call-setting/model/BlockedNumbers.cpp call-setting/model/impl/misc/BlockListManager.cpp ucl/source/gui/NaviItem.cpp ucl/source/appfw/helpers.cpp call-setting/presenters/dialogs/ListOptionDialog.cpp call-setting/model/impl/settings/SettingsManager.cpp call-setting/presenters/items/CallWaitingItem.cpp call-setting/presenters/InstanceManager.cpp ucl/source/gui/Widget.cpp call-setting/model/impl/telephony/TelRequestListener.cpp call-setting/model/Voicemail.cpp call-setting/presenters/items/SimpleListItem.cpp ucl/source/misc/Timeout.cpp call-setting/presenters/pages/BlockListPage.cpp call-setting/presenters/items/base/ListOptionItem.cpp ucl/source/mvp/GuiPresenter.cpp call-setting/presenters/dialogs/base/Dialog.cpp call-setting/view/KeypadNumberBtn.cpp call-setting/view/helpers.cpp call-setting/model/StateManager.cpp ucl/source/util/logging.cpp ucl/source/gui/Naviframe.cpp ucl/source/gui/RadioBox.cpp ucl/source/util/types/classTypes.cpp call-setting/main.cpp call-setting/presenters/items/base/CheckOptionItem.cpp call-setting/model/CallWaiting.cpp call-setting/types.cpp ucl/source/appfw/SysEventProvider.cpp ucl/source/mvp/ListPresenter.cpp ucl/source/misc/Variant.cpp call-setting/presenters/items/RadioOptionItem.cpp call-setting/presenters/misc/MoreOptionsPresenter.cpp call-setting/model/impl/VoicemailImpl.cpp call-setting/presenters/items/CallerIdItem.cpp call-setting/model/CallerId.cpp call-setting/view/PageContent.cpp call-setting/model/impl/CallSettingImpl.cpp call-setting/presenters/pages/base/Page.cpp call-setting/model/impl/telephony/TelephonyManager.cpp call-setting/presenters/dialogs/ToastDialog.cpp ucl/source/mvp/ListItemPresenter.cpp ucl/source/gui/ElmWidget.cpp call-setting/model/impl/CallerIdImpl.cpp ucl/source/gui/EdjeWidget.cpp call-setting/view/KeypadBackspaceBtn.cpp call-setting/presenters/Instance.cpp
# EDC Sources
USER_EDCS =
diff --git a/res/edje/theme.edc b/res/edje/theme.edc
index e490cc2..8c029f6 100644
--- a/res/edje/theme.edc
+++ b/res/edje/theme.edc
@@ -14,6 +14,14 @@
* limitations under the License.
*/
+#define CS_WIN_W 360
+#define CS_WIN_H 360
+
+#define CS_REL_X(val) (val/CS_WIN_W)
+#define CS_REL_Y(val) (val/CS_WIN_H)
+
+#define CS_BUTTON_PRESS_EFFECT_TRANSITION_GLIDE(duration) CUBIC_BEZIER (duration) 0.25 0.46 0.45 1.0
+
collections {
base_scale: 1.3;