--- /dev/null
+/*
+* Copyright 2016 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 ACCESSIBILITY_H_
+#define ACCESSIBILITY_H_
+
+#include <string>
+
+namespace utils {
+
+class Accessibility {
+
+public:
+ /**
+ * @brief Sets text to read of the label part in layout object
+ *
+ * This method finds part of the layout being textblock and sets its
+ * description to passed as argument text.
+ *
+ * @param[in] obj The layout object
+ * @param[in] part Part of the layout
+ * @param[in] text Text to be set
+ */
+ static void SetLabelPartDescription(Evas_Object *obj, const char *part, std::string text);
+
+ /**
+ * @brief Sets accessibility name of the object
+ *
+ * @param[in] obj Object to be named
+ * @param[in] name Name of the object
+ *
+ */
+ static void SetName(Evas_Object *obj, std::string name);
+};
+
+}
+
+#endif //ACCESSIBILITY_H_
color: 255 255 255 255;
}
}
- textblock{ "text.main"; scale;
+ spacer { "bg.upper.half";
desc { "default";
rel1 { relative: 0.0 0.0; }
rel2 { relative: 1.0 0.5; }
+ }
+ }
+ spacer { "bg.lower.half"; scale;
+ desc { "default";
+ rel1 { relative: 0.0 0.5; }
+ rel2 { relative: 1.0 1.0; }
+ }
+ }
+ textblock{ "text.main"; scale;
+ desc { "default";
+ rel1 {
+ relative: 0.0 0.0;
+ to: "bg.upper.half";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ to: "bg.upper.half";
+ }
+ align: 0.5 1.0;
text {
align: 0.5 1.0;
style: "label_style";
+ min: 0 1;
+ max: 0 1;
ellipsis: -1;
}
}
}
textblock{ "text.sub"; scale;
desc { "default";
- rel1 { relative: 0.0 0.5; }
- rel2 { relative: 1.0 1.0; }
+ rel1 {
+ relative: 0.0 0.0;
+ to: "bg.lower.half";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ to: "bg.lower.half";
+ }
+ align: 0.5 0.0;
text {
- align: 0.5 0.0;
+ align: 0.5 1.0;
style: "label_style";
+ min: 0 1;
+ max: 0 1;
ellipsis: -1;
}
}
msgid "IDS_CLOCK_BODY_AFTER_YOU_CREATE_ALARMS_THEY_WILL_BE_SHOWN_HERE"
msgstr "After you create alarms, they will be shown here."
+msgid "IDS_CLOCK_BODY_ADD_ALARM"
+msgstr "Add alarm"
+
msgid "IDS_COM_BODY_STOPWATCH"
msgstr "Stopwatch"
--- /dev/null
+/*
+* Copyright 2016 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 <string>
+#include <Elementary.h>
+
+#include "Utils/Accessibility.h"
+
+namespace utils {
+
+void Accessibility::SetLabelPartDescription(Evas_Object *obj, const char *part, std::string text)
+{
+ Evas_Object *label = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(obj), part);
+ Evas_Object *atspi_label = elm_access_object_register(label, obj);
+ elm_atspi_accessible_role_set(atspi_label, ELM_ATSPI_ROLE_LABEL);
+ elm_atspi_accessible_name_set(atspi_label, text.c_str());
+}
+
+void Accessibility::SetName(Evas_Object *obj, std::string name)
+{
+ elm_atspi_accessible_name_set(obj, name.c_str());
+}
+
+}
+
#include "Utils/Log.h"
#include "Utils/PopupManager.h"
#include "Utils/ThemeExtension.h"
+#include "Utils/Translate.h"
+#include "Utils/Accessibility.h"
using namespace view;
using namespace model;
/* Floating Button */
Evas_Object *fb = eext_floatingbutton_add(content_);
elm_object_part_content_set(content_, "elm.swallow.floatingbutton", fb);
-
/* Floating Button 1 */
Evas_Object *btn = elm_button_add(fb);
evas_object_smart_callback_add(btn, "clicked", AlarmView::ButtonClicked, this);
elm_object_part_content_set(fb, "button1", btn);
+ Accessibility::SetName(btn, Translate::Sprintf("IDS_CLOCK_BODY_ADD_ALARM"));
+
ThemeExtension::AddTheme(TizenAppUtils::GetResourcePath(TizenAppUtils::APP_DIR_RESOURCE, "edje/alarm.edj"));
eext_object_event_callback_add(content_, EEXT_CALLBACK_MORE,
evas_object_size_hint_align_set(label_, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(label_);
+ Accessibility::SetLabelPartDescription(label_, "text.main",
+ Translate::Sprintf("IDS_CLOCK_NPBODY_NO_ALARMS"));
+ Accessibility::SetLabelPartDescription(label_, "text.sub",
+ Translate::Sprintf("IDS_CLOCK_BODY_AFTER_YOU_CREATE_ALARMS_THEY_WILL_BE_SHOWN_HERE"));
+
// unload genlist
elm_object_content_unset(content_);
evas_object_hide(genlist_);