/* * 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 "Input/SetTimeView.h" #include "Ui/Accessibility.h" #include using namespace Common::Model; using namespace Input; SetTimeView::SetTimeView(Alarm &alarm) : m_Title(nullptr), m_TimePicker(nullptr), m_Alarm(alarm) { } const TimePicker *SetTimeView::getTimePicker() const { return m_TimePicker; } Evas_Object *SetTimeView::onCreate(Evas_Object *parent) { Evas_Object *layout = elm_layout_add(parent); elm_layout_theme_set(layout, "layout", "circle", "datetime"); elm_object_translatable_part_text_set(layout, "elm.text", "WDS_ST_HEADER_SET_TIME_ABB"); m_TimePicker = new TimePicker(); m_TimePicker->create(layout); m_TimePicker->setTime(m_Alarm.getDate()); elm_object_part_content_set(layout, "elm.swallow.content", m_TimePicker->getEvasObject()); m_Title = Ui::createTextAccessObject(layout, "elm.text"); elm_atspi_accessible_can_highlight_set(layout, EINA_FALSE); return layout; } void SetTimeView::onNavigation(bool isCurrent) { eext_rotary_object_event_activated_set(m_TimePicker->getEvasObject(), isCurrent); elm_atspi_accessible_can_highlight_set(getEvasObject(), isCurrent); if (isCurrent) { elm_atspi_component_highlight_grab(m_Title); } }