./src/setting-common-general-func.c
./src/setting-common-init.c
./src/setting-common-view.c
+ ./src/controls/confirm-popup.c
)
TARGET_LINK_LIBRARIES(${LIB_SETTING_COMMON} ${pkgs_common_data_LDFLAGS})
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * 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 CONFIRM_POPUP_H
+#define CONFIRM_POPUP_H
+
+#include <Elementary.h>
+
+/**
+ * @brief Creates new confirm popup widget, with title, content text
+ * and two buttons: "confirm", "reject"
+ *
+ * --------------------------------
+ * | Title |
+ * |------------------------------|
+ * | |
+ * | Text |
+ * | |
+ * |-------------- ---------------|
+ * ||Reject button||Confirm button|
+ * --------------------------------
+ *
+ * Usage:
+ *
+ * Evas_Object *cp = confirm_popup_create(window);
+ *
+ * confirm_popup_title_set(cp, "Confirmation");
+ * confirm_popup_text_set(cp, "Remove all files?");
+ * confirm_popup_accept_text_set(cp, "Remove");
+ * confirm_popup_reject_text_set(cp, "Cancel");
+ *
+ * evas_object_smart_callback_add(cp, "confirmed", accepted_cb, NULL);
+ * evas_object_smart_callback_add(cp, "rejected", rejected_cb, NULL);
+ *
+ * evas_object_show(cp);
+ */
+Evas_Object *confirm_popup_create(Evas_Object *parent);
+
+void confirm_popup_title_set(Evas_Object *confirm_popup, const char *title);
+
+void confirm_popup_text_set(Evas_Object *confirm_popup, const char *text);
+
+void confirm_popup_confirm_text_set(Evas_Object *confirm_popup, const char *text);
+
+void confirm_popup_reject_text_set(Evas_Object *confirm_popup, const char *text);
+
+#endif /* end of include guard: CONFIRM_POPUP_H */
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * 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 "setting-common-general-func.h"
+#include "controls/confirm-popup.h"
+
+static void _on_reject_clicked(void *data, Evas_Object *obj, void *event_info)
+{
+ Evas_Object *popup = data;
+ evas_object_smart_callback_call(popup, "rejected", NULL);
+}
+
+static void _on_confirm_clicked(void *data, Evas_Object *obj, void *event_info)
+{
+ Evas_Object *popup = data;
+ evas_object_smart_callback_call(popup, "confirmed", NULL);
+}
+
+EXPORT_PUBLIC
+Evas_Object *confirm_popup_create(Evas_Object *parent)
+{
+ Evas_Object *popup = elm_popup_add(parent);
+
+ elm_popup_align_set(popup, 0.5, 1.0);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ Evas_Object *btn = elm_button_add(popup);
+ elm_object_style_set(btn, "popup");
+ evas_object_smart_callback_add(btn, "clicked", _on_reject_clicked, popup);
+ elm_object_part_content_set(popup, "button1", btn);
+
+ Evas_Object *btn2 = elm_button_add(popup);
+ elm_object_style_set(btn2, "popup");
+ evas_object_smart_callback_add(btn2, "clicked", _on_confirm_clicked, popup);
+ elm_object_part_content_set(popup, "button2", btn2);
+
+ return popup;
+}
+
+EXPORT_PUBLIC
+void confirm_popup_title_set(Evas_Object *confirm_popup, const char *title)
+{
+ elm_object_part_text_set(confirm_popup, "title,text", title);
+}
+
+EXPORT_PUBLIC
+void confirm_popup_text_set(Evas_Object *confirm_popup, const char *text)
+{
+ elm_object_text_set(confirm_popup, text);
+}
+
+EXPORT_PUBLIC
+void confirm_popup_confirm_text_set(Evas_Object *confirm_popup, const char *text)
+{
+ Evas_Object *btn = elm_object_part_content_get(confirm_popup, "button2");
+ elm_object_text_set(btn, text);
+}
+
+EXPORT_PUBLIC
+void confirm_popup_reject_text_set(Evas_Object *confirm_popup, const char *text)
+{
+ Evas_Object *btn = elm_object_part_content_get(confirm_popup, "button1");
+ elm_object_text_set(btn, text);
+}
./src/setting-reset-factory-reset.c
./src/setting-reset-network.c
./src/setting-reset-settings.c
- ./src/controls/confirm-popup.c
)
TARGET_LINK_LIBRARIES(${PROJECT_SETTING_RESET} -L${CMAKE_BINARY_DIR}/${SETTING_COMMON} -lsetting-common)
+++ /dev/null
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * 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 CONFIRM_POPUP_H
-#define CONFIRM_POPUP_H
-
-#include <Elementary.h>
-
-/**
- * @brief Creates new confirm popup widget, with title, content text
- * and two buttons: "confirm", "reject"
- *
- * --------------------------------
- * | Title |
- * |------------------------------|
- * | |
- * | Text |
- * | |
- * |-------------- ---------------|
- * ||Reject button||Confirm button|
- * --------------------------------
- *
- * Usage:
- *
- * Evas_Object *cp = confirm_popup_create(window);
- *
- * confirm_popup_title_set(cp, "Confirmation");
- * confirm_popup_text_set(cp, "Remove all files?");
- * confirm_popup_accept_text_set(cp, "Remove");
- * confirm_popup_reject_text_set(cp, "Cancel");
- *
- * evas_object_smart_callback_add(cp, "confirmed", accepted_cb, NULL);
- * evas_object_smart_callback_add(cp, "rejected", rejected_cb, NULL);
- *
- * evas_object_show(cp);
- */
-Evas_Object *confirm_popup_create(Evas_Object *parent);
-
-void confirm_popup_title_set(Evas_Object *confirm_popup, const char *title);
-
-void confirm_popup_text_set(Evas_Object *confirm_popup, const char *text);
-
-void confirm_popup_confirm_text_set(Evas_Object *confirm_popup, const char *text);
-
-void confirm_popup_reject_text_set(Evas_Object *confirm_popup, const char *text);
-
-#endif /* end of include guard: CONFIRM_POPUP_H */
+++ /dev/null
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * 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 "controls/confirm-popup.h"
-
-static void _on_reject_clicked(void *data, Evas_Object *obj, void *event_info)
-{
- Evas_Object *popup = data;
- evas_object_smart_callback_call(popup, "rejected", NULL);
-}
-
-static void _on_confirm_clicked(void *data, Evas_Object *obj, void *event_info)
-{
- Evas_Object *popup = data;
- evas_object_smart_callback_call(popup, "confirmed", NULL);
-}
-
-Evas_Object *confirm_popup_create(Evas_Object *parent)
-{
- Evas_Object *popup = elm_popup_add(parent);
-
- elm_popup_align_set(popup, 0.5, 1.0);
- evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
- Evas_Object *btn = elm_button_add(popup);
- elm_object_style_set(btn, "popup");
- evas_object_smart_callback_add(btn, "clicked", _on_reject_clicked, popup);
- elm_object_part_content_set(popup, "button1", btn);
-
- Evas_Object *btn2 = elm_button_add(popup);
- elm_object_style_set(btn2, "popup");
- evas_object_smart_callback_add(btn2, "clicked", _on_confirm_clicked, popup);
- elm_object_part_content_set(popup, "button2", btn2);
-
- return popup;
-}
-
-void confirm_popup_title_set(Evas_Object *confirm_popup, const char *title)
-{
- elm_object_part_text_set(confirm_popup, "title,text", title);
-}
-
-void confirm_popup_text_set(Evas_Object *confirm_popup, const char *text)
-{
- elm_object_text_set(confirm_popup, text);
-}
-
-void confirm_popup_confirm_text_set(Evas_Object *confirm_popup, const char *text)
-{
- Evas_Object *btn = elm_object_part_content_get(confirm_popup, "button2");
- elm_object_text_set(btn, text);
-}
-
-void confirm_popup_reject_text_set(Evas_Object *confirm_popup, const char *text)
-{
- Evas_Object *btn = elm_object_part_content_get(confirm_popup, "button1");
- elm_object_text_set(btn, text);
-}