Add overheat system popup 35/72835/4
authorchangjoo.lee <changjoo.lee@samsung.com>
Thu, 2 Jun 2016 14:19:50 +0000 (23:19 +0900)
committerchangjoo.lee <changjoo.lee@samsung.com>
Fri, 3 Jun 2016 05:47:20 +0000 (14:47 +0900)
Change-Id: I2d84e449e86f138dacfcaaa4ef0720aa4f4ca130
Signed-off-by: changjoo.lee <changjoo.lee@samsung.com>
CMakeLists.txt
packaging/system-servant.spec
src/CMakeLists.txt
src/overheat/edc_resource/popup_custom.edc [new file with mode: 0755]
src/overheat/overheat.c [new file with mode: 0755]
src/overheat/system-syspopup.edc [new file with mode: 0755]
src/po/en.po
src/po/en_PH.po
src/po/en_US.po

index dcb7dbf..1fa07ec 100644 (file)
@@ -59,4 +59,5 @@ ADD_SUBDIRECTORY(src/powerkey)
 ADD_SUBDIRECTORY(src/crash)
 ADD_SUBDIRECTORY(src/launcher)
 ADD_SUBDIRECTORY(src/po)
-ADD_SUBDIRECTORY(signal-sender)
\ No newline at end of file
+ADD_SUBDIRECTORY(signal-sender)
+ADD_SUBDIRECTORY(src/overheat)
\ No newline at end of file
index 04c2b1e..3de8cb7 100755 (executable)
@@ -32,7 +32,9 @@
 %define mmc_popup on
 %define usb_popup on
 %define watchdog_popup on
+%if %{?system_popup} == on
 %define overheat_popup on
+%endif
 %define storage_popup on
 %endif
 
 %define storage_popup on
 %define watchdog_popup on
 %define battery_popup on
+%if %{?system_popup} == on
 %define overheat_popup on
 %endif
+%endif
 
 %if "%{?profile}" == "tv"
 %define PROFILE tv
 #Main applications
 %define crash_popup on
+#sub-popups of system-popup
 %endif
 
 Name:       system-servant
@@ -88,6 +93,8 @@ BuildRequires:  pkgconfig(deviced)
 BuildRequires:  pkgconfig(feedback)
 BuildRequires:  pkgconfig(efl-extension)
 BuildRequires:  pkgconfig(libtzplatform-config)
+BuildRequires:  edje-bin
+
 %if %{with x}
 BuildRequires:  pkgconfig(ecore-x)
 BuildRequires:  pkgconfig(utilX)
@@ -201,6 +208,7 @@ cp %{SOURCE2003} .
                -DSTORAGE_POPUP=%{storage_popup} \
                -DUSB_POPUP=%{usb_popup} \
                -DWATCHDOG_POPUP=%{watchdog_popup} \
+               -DOVERHEAT_POPUP=%{overheat_popup} \
 
 make %{?jobs:-j%jobs}
 
@@ -299,6 +307,9 @@ rm -rf %{buildroot}
 %manifest org.tizen.system-syspopup.manifest
 %defattr(-,root,root,-)
 %{TZ_SYS_RO_APP}/org.tizen.system-syspopup/bin/system-syspopup
+%if %{overheat_popup} == on
+%{TZ_SYS_RO_APP}/org.tizen.system-syspopup/shared/res/system-syspopup.edj
+%endif
 %{TZ_SYS_RO_SHARE}/packages/org.tizen.system-syspopup.xml
 %endif
 
index ce9d539..f3058cf 100755 (executable)
@@ -47,6 +47,12 @@ IF(USB_POPUP STREQUAL on)
        ENDIF()
 ENDIF(USB_POPUP STREQUAL on)
 
+IF(OVERHEAT_POPUP STREQUAL on)
+       IF(PROFILE_MOBILE)
+               SET(SRCS ${SRCS} overheat/overheat.c)
+       ENDIF()
+ENDIF(OVERHEAT_POPUP STREQUAL on)
+
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/common)
 
@@ -57,6 +63,9 @@ SET(PREFIX "${CMAKE_INSTALL_PREFIX}/apps/${PKGNAME}")
 SET(BINDIR "${PREFIX}/bin")
 SET(RESDIR "${PREFIX}/res")
 SET(MANIFESTDIR "${CMAKE_INSTALL_PREFIX}/share/packages")
+IF(OVERHEAT_POPUP STREQUAL on)
+       SET(OVERHEAT_RES "${TZ_SYS_RO_APP}/${PKGNAME}/shared/res")
+ENDIF(OVERHEAT_POPUP STREQUAL on)
 
 SET(PKG_MODULES
                appcore-efl
@@ -87,7 +96,8 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O2 -g -Wall -fpie")
 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
 ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
-
+ADD_DEFINITIONS("-DOVERHEAT_RES=\"${OVERHEAT_RES}\"")
+ADD_DEFINITIONS("-DELM_OVERHEAT_EDC=\"${OVERHEAT_RES}/${PACKAGE}.edj\"")
 
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
 
@@ -97,6 +107,16 @@ TARGET_LINK_LIBRARIES(${PACKAGE} syspopup ${system_pkgs_LDFLAGS})
 
 INSTALL(TARGETS ${PACKAGE} DESTINATION ${BINDIR})
 
+IF(OVERHEAT_POPUP STREQUAL on)
+       ADD_CUSTOM_TARGET(${PACKAGE}.edj
+               COMMAND edje_cc -no-save ${CMAKE_SOURCE_DIR}/src/overheat/${PACKAGE}.edc ${CMAKE_BINARY_DIR}/${PACKAGE}.edj
+               DEPENDS ${CMAKE_SOURCE_DIR}/src/overheat/${PACKAGE}.edc
+               COMMENT "making edj file"
+       )
+       ADD_DEPENDENCIES(${PACKAGE} ${PACKAGE}.edj)
+       INSTALL(FILES ${CMAKE_BINARY_DIR}/${PACKAGE}.edj DESTINATION ${OVERHEAT_RES})
+ENDIF(OVERHEAT_POPUP STREQUAL on)
+
 # install manifest file
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/${PKGNAME}.xml DESTINATION ${MANIFESTDIR})
 ############## END ##############
diff --git a/src/overheat/edc_resource/popup_custom.edc b/src/overheat/edc_resource/popup_custom.edc
new file mode 100755 (executable)
index 0000000..bc667d6
--- /dev/null
@@ -0,0 +1,1159 @@
+/*
+ * 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.
+ *
+ */
+
+#define POPUP_CONTENT_DEFAULT_PADDING_TOP_MIN_INC 27
+#define POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 15
+#define POPUP_CONTENT_DEFAULT_PADDING_RIGHT_MIN_INC 15
+#define POPUP_CONTENT_DEFAULT_PADDING_BOTTOM_MIN_INC 27
+#define POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC 96
+
+#define POPUP_IMAGE_VIEW_LAYOUT_BG_MIN_INC 0 112
+#define POPUP_IMAGE_SWALLOW_CONTENT_PADDING_BOTTOM_MIN_INC 0 20
+#define POPUP_DESCRIPTION_DEFAULT_TEXT_FONT_SIZE_INC 38
+#define POPUP_CHECK_VIEW_LAYOUT_CONTENT_MIN_INC 0 162
+#define POPUP_CHECK_VIEW_LAYOUT_BOTTOM_MIN_INC 0 90
+#define POPUP_CHECK_VIEW_SWALLOW_END_MIN_INC 50 50
+#define POPUP_CHECK_VIEW_LAYOUT_MIN_INC 0 252
+
+#define POPUP_TEXT_INPUTTEXT_VIEW_LAYOUT_BG_MIN_INC 480 159
+
+#define POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC 15 27
+#define POPUP_PROGRESSBAR_VIEW_LAYOUT_TEXT_FONT_SIZE_INC 0 38
+#define POPUP_PROGRESSBAR_VIEW_LAYOUT_BG_INC 0 69
+#define POPUP_PROGRESSBAR_VIEW_LAYOUT_BG_MIN_INC 0 161
+
+#define POPUP_PROGRESSBAR_2TEXT_VIEW_LAYOUT_BG_MIN_INC 0 193
+#define POPUP_PROGRESSBAR_VIEW_LAYOUT_SUBTEXT_FONT_SIZE_INC 0 32
+
+#define POPUP_GROUP_INDEX_BG_MIN_INC 0 52
+#define POPUP_GROUP_INDEX_PROCESSING_MIN_INC 28 28
+#define POPUP_GROUP_INDEX_PROCESSING_MAX_INC 28 28
+#define POPUP_GROUP_INDEX_PADDING_BEFORE_SWALLOW_MIN_INC 15 52
+#define POPUP_GROUP_INDEX_TEXT_MIN_INC 0 52
+
+#define POPUP_TEXT_SLIDER_VIEW_LAYOUT_MIN_INC 0 144
+#define POPUP_TEXT_SLIDER_PADDING_SIZE_INC 15 27
+#define POPUP_TEXT_SLIDER_TEXT_DISCRIPTION_MIN_INC 0 38
+#define POPUP_TEXT_SLIDER_BG_MIN_INC 0 42
+#define POPUP_SLIDER_PADDING_LEFT_MIN_INC 10 0
+
+#define POPUP_2TEXT_SLIDER_VIEW_LAYOUT_MIN_INC 0 176
+#define POPUP_TEXT_SLIDER_SUBTEXT_DISCRIPTION_MIN_INC 0 32
+
+#define POPUP_SCROLLABLE_TEXT_VIEW_BG_HEIGHT_INC 252
+
+#define POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_MIN_INC 36 36
+#define POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_MAX_INC 36 36
+#define POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_PADDING_AFTER_INC 15 90
+#define POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_TEXT_MIN_INC 0 90
+#define POPUP_PROCESSING_VIEW_LAYOUT_BG_MIN_INC 0 90
+#define OVERHEAT_POPUP_PROCESSING_VIEW_LAYOUT_BG_MIN_INC 0 180
+
+#define POPUP_TEXT_FONT_SIZE0 40
+#define POPUP_TEXT_FONT_SIZE1 30
+#define POPUP_TEXT_FONT_SIZE2 24
+#define POPUP_TEXT_FONT_SIZE3 27
+
+group { name: "popup_image_list_layout";
+   styles {
+      style { name: "popup_content_style";
+         base: "font=Tizen:style=Regular align=left font_size="POPUP_TEXT_FONT_SIZE1" color=#000000 wrap=mixed ellipsis=1.0 text_class=tizen";
+         tag: "br" "\n";
+         tag: "tab" "\t";
+      }
+   }
+   parts {
+      part { name: "bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_IMAGE_VIEW_LAYOUT_BG_MIN_INC;
+            fixed: 1 0;
+         }
+      }
+      part { name: "pad_l";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+            fixed: 1 0;
+            rel1.relative: 0.0 0.0;
+            rel2.relative: 0.0 1.0;
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "pad_r";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+            fixed: 1 0;
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 1.0 0.0;
+         }
+      }
+      part { name: "pad_t";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            align: 0.0 0.0;
+            min: 0 POPUP_CONTENT_DEFAULT_PADDING_TOP_MIN_INC;
+            fixed: 0 1;
+            rel1 {
+               relative: 1.0 0.0;to_x: "pad_l";
+            }
+            rel2 {
+               relative: 0.0 0.0;to_x: "pad_r";
+            }
+         }
+      }
+      part { name: "content_bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 1 0;
+            rel1 {
+               relative: 1.0 1.0;
+               to_x: "pad_l";
+               to_y: "pad_t";
+            }
+            rel2 {
+               relative: 0.0 0.0;
+               to_x: "pad_r";
+               to_y: "pad_b";
+            }
+            align: 0.5 0.5;
+         }
+      }
+      part { name: "elm.swallow.content";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 1 0;
+            rel1.to: "content_bg";
+            rel2.to: "content_bg";
+         }
+      }
+      part { name: "pad_b";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_IMAGE_SWALLOW_CONTENT_PADDING_BOTTOM_MIN_INC;
+            fixed: 0 1;
+            rel1 {
+               relative: 1.0 0.0;
+               to_x: "pad_l";
+               to_y: "elm.text";
+            }
+            rel2 {
+               relative: 0.0 0.0;
+               to_x: "pad_r";
+               to_y: "elm.text";
+            }
+            align: 0.0 1.0;
+         }
+      }
+      part { name: "elm.text";
+         type: TEXTBLOCK;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 POPUP_DESCRIPTION_DEFAULT_TEXT_FONT_SIZE_INC;
+            fixed: 0 1;
+            align: 0.0 1.0;
+            rel1 {
+               relative: 1.0 0.0;
+               to_x: "pad_l";
+               to_y: "pad_bottom";
+            }
+            rel2 {
+               relative: 0.0 0.0;
+               to_x: "pad_r";
+               to_y: "pad_bottom";
+            }
+            text {
+               style: "popup_content_style";
+               min: 0 1;
+            }
+            color: 0 0 0 255;
+         }
+      }
+      part { name: "pad_bottom";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            align: 0.0 1.0;
+            min: 0 POPUP_CONTENT_DEFAULT_PADDING_BOTTOM_MIN_INC;
+            fixed: 0 1;
+            rel1 {
+               relative: 1.0 1.0;
+               to_x: "pad_l";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r";
+            }
+         }
+      }
+   }
+}
+
+group { name: "popup_checkview_layout";
+   parts {
+      part { name: "bg";
+         scale: 1;
+         type: SPACER;
+         description { state: "default" 0.0;
+            min: POPUP_CHECK_VIEW_LAYOUT_MIN_INC;
+            fixed: 1 0;
+         }
+      }
+      part { name: "pad_l";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+            fixed: 1 0;
+            rel1.relative: 0.0 0.0;
+            rel2.relative: 0.0 1.0;
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "pad_r";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_RIGHT_MIN_INC 0;
+            fixed: 1 0;
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 1.0 0.0;
+         }
+      }
+      part { name: "elm.swallow.content";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 0 1;
+            min: POPUP_CHECK_VIEW_LAYOUT_CONTENT_MIN_INC;
+            align: 0.5 0.0;
+            rel2 {
+               relative: 1.0 0.0;
+               to: "pad_b";
+            }
+         }
+      }
+      part { name: "pad_b";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            align: 0.0 1.0;
+            min: POPUP_CHECK_VIEW_LAYOUT_BOTTOM_MIN_INC;
+            fixed: 0 1;
+            rel1.relative: 0.0 1.0;
+         }
+      }
+      part { name: "elm.swallow.end";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            align: 0.0 0.5;
+            min: POPUP_CHECK_VIEW_SWALLOW_END_MIN_INC;
+            fixed: 1 1;
+            rel1 {
+               relative: 1.0 1.0;
+               to_x: "pad_l";
+               to_y: "pad_b";
+            }
+            rel2 {
+               relative: 0.0 0.0;
+               to_x: "pad_r";
+               to_y: "pad_b";
+            }
+         }
+      }
+   }
+}
+
+group { name: "processing_view_layout";
+   styles {
+      style { name: "popup_processing_style";
+         base: "font=Tizen:style=Regular align=left font_size="POPUP_TEXT_FONT_SIZE1" color=#000000 wrap=mixed ellipsis=1.0 text_class=tizen";
+         tag:  "br" "\n";
+         tag:  "tab" "\t";
+      }
+   }
+   parts {
+      part { name: "bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROCESSING_VIEW_LAYOUT_BG_MIN_INC;
+            fixed: 1 0;
+         }
+      }
+      part { name: "pad_l";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+            fixed: 1 0;
+            rel1.relative: 0.0 0.0;
+            rel2.relative: 0.0 1.0;
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "pad_r";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+            fixed: 1 0;
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 1.0 0.0;
+         }
+      }
+      part { name: "processing";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 1 1;
+            min: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_MIN_INC;
+            max: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_MAX_INC;
+            rel1 {
+               relative: 1.0 0.0;
+               to_x: "pad_l";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r";
+            }
+            align: 0.0 0.5;
+         }
+      }
+      part { name: "pad_after_processing";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 1 1;
+            min: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_PADDING_AFTER_INC;
+            rel1 {
+               relative: 1.0 0.0;
+               to: "processing";
+            }
+            rel2.to: "processing";
+            align: 0.0 0.5;
+         }
+      }
+      part { name: "elm.text";
+         type: TEXTBLOCK;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_TEXT_MIN_INC;
+            fixed: 0 1;
+            rel1 {
+               relative: 1.0 0.0;
+               to: "pad_after_processing";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r";
+            }
+            align: 0.0 0.5;
+            text {
+               style: "popup_processing_style";
+               min: 0 1;
+            }
+         }
+      }
+   }
+}
+
+group { name: "overheat_view_layout";
+   styles {
+      style { name: "overheat_progress_style";
+         base: "font=Tizen:style=Regular align=left font_size="POPUP_TEXT_FONT_SIZE0" color=#000000 wrap=mixed text_class=tizen";
+         tag:  "br" "\n";
+         tag:  "tab" "\t";
+      }
+   }
+   parts {
+      part { name: "bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: OVERHEAT_POPUP_PROCESSING_VIEW_LAYOUT_BG_MIN_INC;
+         }
+      }
+      part { name: "pad_l";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+            fixed: 1 0;
+            rel1 {
+               relative: 0.0 0.0;
+               to: "bg";
+            }
+                       rel2 {
+               relative: 0.0 1.0;
+               to: "bg";
+            }
+            align: 0.0 0.5;
+         }
+      }
+      part { name: "pad_r";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+            fixed: 1 0;
+            rel1 {
+               relative: 1.0 0.0;
+               to: "bg";
+            }
+                       rel2 {
+               relative: 1.0 1.0;
+               to: "bg";
+            }
+            align: 1.0 0.5;
+         }
+      }
+      part { name: "processing";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_MIN_INC;
+            max: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_MAX_INC;
+            rel1 {
+               relative: 1.0 0.0;
+               to_x: "pad_l";
+            }
+            rel2 {
+               relative: 1.0 0.0;
+               to: "pad_after_processing";
+            }
+            align: 0.5 0.5;
+            fixed: 1 1;
+         }
+      }
+      part { name: "pad_after_processing";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 10;
+            rel1 {
+               to: "elm.text";
+               relative: 0.0 0.0;
+            }
+            rel2 {
+               to: "elm.text";
+               relative: 1.0 0.0;
+            }
+            align: 0.5 1.0;
+            fixed: 0 1;
+         }
+      }
+      part { name: "elm.text";
+         type: TEXTBLOCK;
+         scale: 1;
+         multiline: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROCESSING_SWALLOW_VIEW_LAYOUT_TEXT_MIN_INC;
+            rel1 {
+               relative: 1.0 1.0;
+               to_x: "pad_l";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r";
+            }
+            align: 0.5 1.0;
+            fixed: 0 1;
+            text {
+               style: "overheat_progress_style";
+               min: 0 1;
+            }
+         }
+      }
+   }
+}
+
+group { name: "popup_text_progressbar_view_layout";
+   styles {
+      style { name: "popup_progress_style";
+         base: "font=Tizen:style=Regular align=right font_size="14" color=#000000 wrap=mixed ellipsis=1.0 text_class=tizen";
+         tag:  "br" "\n";
+         tag:  "tab" "\t";
+      }
+   }
+   parts {
+      part { name: "bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROGRESSBAR_VIEW_LAYOUT_BG_MIN_INC;
+            fixed: 1 0;
+         }
+      }
+      part { name: "pad_l_t";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC;
+            max: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC;
+            fixed: 1 1;
+            rel2.relative: 0.0 0.0;
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "pad_r_t";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC;
+            max: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC;
+            fixed: 1 1;
+            rel1.relative: 1.0 1.0;
+            align: 1.0 1.0;
+         }
+      }
+      part { name: "elm.text.description";
+         type: TEXTBLOCK;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 0 1;
+            min: POPUP_PROGRESSBAR_VIEW_LAYOUT_TEXT_FONT_SIZE_INC;
+            rel1 {
+               relative: 1.0 1.0;
+               to: "pad_l_t";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r_t";
+               to_y: "pad_l_t";
+            }
+            text {
+               style: "popup_processing_style";
+               min: 0 1;
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "progressbar_bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 0 1;
+            min: POPUP_PROGRESSBAR_VIEW_LAYOUT_BG_INC;
+            rel1 {
+               relative: 1.0 1.0;
+               to_x: "pad_l_t";
+               to_y: "elm.text.description";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r_t";
+               to_y: "elm.text.description";
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "progressbar";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 0 1;
+            rel1.to: "progressbar_bg";
+            rel2.to: "progressbar_bg";
+         }
+      }
+   }
+}
+
+group { name: "popup_2text_progressbar_view_layout";
+   styles {
+      style { name: "popup_subtext_style";
+         base: "font=Tizen:style=Regular align=left font_size="POPUP_TEXT_FONT_SIZE2" color=#000000 wrap=mixed ellipsis=1.0 text_class=tizen";
+         tag:  "br" "\n";
+         tag:  "tab" "\t";
+      }
+   }
+   parts {
+      part { name: "bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROGRESSBAR_2TEXT_VIEW_LAYOUT_BG_MIN_INC;
+            fixed: 1 0;
+         }
+      }
+      part { name: "pad_l_t";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC;
+            max: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC;
+            fixed: 1 1;
+            rel2.relative: 0.0 0.0;
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "pad_r_t";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC;
+            max: POPUP_PROGRESSBAR_VIEW_LAYOUT_PADDING_INC;
+            fixed: 1 1;
+            rel1.relative: 1.0 1.0;
+            align: 1.0 1.0;
+         }
+      }
+      part { name: "elm.text.description";
+         type: TEXTBLOCK;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROGRESSBAR_VIEW_LAYOUT_TEXT_FONT_SIZE_INC;
+            fixed: 0 1;
+            rel1 {
+               relative: 1.0 1.0;
+               to: "pad_l_t";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r_t";
+               to_y: "pad_l_t";
+            }
+            text {
+               style: "popup_processing_style";
+               min: 0 1;
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "elm.subtext.description";
+         type: TEXTBLOCK;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_PROGRESSBAR_VIEW_LAYOUT_SUBTEXT_FONT_SIZE_INC;
+            fixed: 0 1;
+            rel1 {
+               relative: 1.0 1.0;
+               to_x: "pad_l_t";
+               to_y: "elm.text.description";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r_t";
+               to_y: "elm.text.description";
+            }
+            text {
+               style: "popup_subtext_style";
+               min: 0 1;
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "progressbar_bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 0 1;
+            min: POPUP_PROGRESSBAR_VIEW_LAYOUT_BG_INC;
+            rel1 {
+               relative: 1.0 1.0;
+               to_x: "pad_l_t";
+               to_y: "elm.subtext.description";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r_t";
+               to_y: "elm.subtext.description";
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "progressbar";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 0 1;
+            rel1.to: "progressbar_bg";
+            rel2.to: "progressbar_bg";
+         }
+      }
+   }
+}
+
+group { name: "popup_groupindex_view_layout";
+   styles {
+      style { name: "popup_groupindex_style";
+         base: "font=Tizen:style=Regular align=right font_size="POPUP_TEXT_FONT_SIZE3" color=#000000 wrap=mixed ellipsis=1.0 text_class=tizen";
+         tag:  "br" "\n";
+         tag:  "tab" "\t";
+      }
+   }
+   parts {
+      part { name: "bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+         }
+      }
+      part { name: "pad_l";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+            fixed: 1 0;
+            rel1.relative: 0.0 0.0;
+            rel2.relative: 0.0 1.0;
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "pad_r";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_RIGHT_MIN_INC 0;
+            fixed: 1 0;
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 1.0 0.0;
+         }
+      }
+      part { name: "index_bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_GROUP_INDEX_BG_MIN_INC;
+            fixed: 0 1;
+            rel1 {
+               relative: 1.0 0.0;
+               to: "pad_l";
+            }
+            rel2 {
+               relative: 0.0 0.0;
+               to: "pad_r";
+            }
+            align: 0.5 0.0;
+         }
+      }
+      part { name: "processing";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_GROUP_INDEX_PROCESSING_MIN_INC;
+            max: POPUP_GROUP_INDEX_PROCESSING_MAX_INC;
+            rel1 {
+               relative: 1.0 0.0;
+               to: "index_bg";
+            }
+            rel2.to: "index_bg";
+            align: 1.0 0.5;
+         }
+      }
+      part { name: "pad_before_swallow";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_GROUP_INDEX_PADDING_BEFORE_SWALLOW_MIN_INC;
+            rel1 {
+               relative: 0.0 0.0;
+               to: "processing";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to: "processing";
+            }
+            align: 1.0 0.5;
+         }
+      }
+      part { name: "elm.text";
+         type: TEXTBLOCK;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_GROUP_INDEX_TEXT_MIN_INC;
+            fixed: 0 1;
+            rel1 {
+               relative: 0.0 0.0;
+               to: "index_bg";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_before_swallow";
+               to_y: "index_bg";
+            }
+            align: 0.5 0.0;
+            text {
+               style: "popup_groupindex_style";
+               min: 0 1;
+            }
+         }
+      }
+      part { name: "genlist";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            rel1 {
+               relative: 0.0 1.0;
+               to_y: "index_bg";
+            }
+            align: 0.5 0.0;
+         }
+      }
+   }
+}
+
+group { name: "popup_text_slider_view_layout";
+   parts {
+      part { name: "bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_TEXT_SLIDER_VIEW_LAYOUT_MIN_INC;
+            fixed: 1 0;
+         }
+      }
+      part { name: "pad_l_t";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_TEXT_SLIDER_PADDING_SIZE_INC;
+            max: POPUP_TEXT_SLIDER_PADDING_SIZE_INC;
+            fixed: 1 1;
+            rel1 {
+               relative: 0.0 0.0;
+            }
+            rel2 {
+               relative: 0.0 0.0;
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "pad_r_t";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_TEXT_SLIDER_PADDING_SIZE_INC;
+            max: POPUP_TEXT_SLIDER_PADDING_SIZE_INC;
+            fixed: 1 1;
+            rel1.relative: 1.0 1.0;
+            rel2.relative: 1.0 1.0;
+            align: 1.0 1.0;
+         }
+      }
+      part { name: "elm.text.description";
+         type: TEXTBLOCK;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 0 1;
+            min: POPUP_TEXT_SLIDER_TEXT_DISCRIPTION_MIN_INC;
+            rel1 {
+               relative: 1.0 1.0;
+               to: "pad_l_t";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r_t";
+               to_y: "pad_l_t";
+            }
+            text {
+               style: "popup_processing_style";
+               min: 0 1;
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "slider";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 0 1;
+            min: POPUP_TEXT_SLIDER_BG_MIN_INC;
+            rel1 {
+               relative: 1.0 0.0;
+               to_y: "pad_r_t";
+               to_x: "pad_l_t";
+            }
+            rel2 {
+               relative: 0.0 0.0;
+               to: "pad_r_t";
+            }
+            align: 0.0 1.0;
+         }
+      }
+   }
+}
+
+group { name: "popup_2text_slider_view_layout";
+   parts {
+      part { name: "bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_2TEXT_SLIDER_VIEW_LAYOUT_MIN_INC;
+            fixed: 1 0;
+         }
+      }
+      part { name: "pad_l_t";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_TEXT_SLIDER_PADDING_SIZE_INC;
+            max: POPUP_TEXT_SLIDER_PADDING_SIZE_INC;
+            fixed: 1 1;
+            rel1 {
+               relative: 0.0 0.0;
+            }
+            rel2 {
+               relative: 0.0 0.0;
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "pad_r_t";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_TEXT_SLIDER_PADDING_SIZE_INC;
+            max: POPUP_TEXT_SLIDER_PADDING_SIZE_INC;
+            fixed: 1 1;
+            rel1.relative: 1.0 1.0;
+            rel2.relative: 1.0 1.0;
+            align: 1.0 1.0;
+         }
+      }
+      part { name: "elm.text.description";
+         type: TEXTBLOCK;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 0 1;
+            min: POPUP_TEXT_SLIDER_TEXT_DISCRIPTION_MIN_INC;
+            rel1 {
+               relative: 1.0 1.0;
+               to: "pad_l_t";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r_t";
+               to_y: "pad_l_t";
+            }
+            text {
+               style: "popup_processing_style";
+               min: 0 1;
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "elm.subtext.description";
+         type: TEXTBLOCK;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_TEXT_SLIDER_SUBTEXT_DISCRIPTION_MIN_INC;
+            fixed: 0 1;
+            rel1 {
+               relative: 1.0 1.0;
+               to_x: "pad_l_t";
+               to_y: "elm.text.description";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "pad_r_t";
+               to_y: "elm.text.description";
+            }
+            text {
+               style: "popup_subtext_style";
+               min: 0 1;
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "slider";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 0 1;
+            min: POPUP_TEXT_SLIDER_BG_MIN_INC;
+            rel1 {
+               relative: 1.0 0.0;
+               to_y: "pad_r_t";
+               to_x: "pad_l_t";
+            }
+            rel2 {
+               relative: 0.0 0.0;
+               to: "pad_r_t";
+            }
+            align: 0.0 1.0;
+         }
+      }
+   }
+}
+
+group { name: "popup_scrollable_text";
+   parts {
+      part { name: "bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 POPUP_SCROLLABLE_TEXT_VIEW_BG_HEIGHT_INC;
+            max: -1 POPUP_SCROLLABLE_TEXT_VIEW_BG_HEIGHT_INC;
+         }
+      }
+      part { name: "elm.swallow.content";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+         }
+      }
+   }
+}
+
+group { name: "popup_input_text";
+   parts {
+      part { name: "pad_l";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+            fixed: 1 0;
+            rel1.relative: 0.0 0.0;
+            rel2.relative: 0.0 1.0;
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "pad_r";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC 0;
+            fixed: 1 0;
+            rel1.relative: 1.0 0.0;
+            rel2.relative: 1.0 1.0;
+            align: 1.0 0.0;
+         }
+      }
+      part { name: "elm.swallow.content";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC;
+            max: -1 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC;
+            align: 0.5 0.5;
+            rel1{
+               relative: 1.0 0.0 ;
+               to_x: "pad_l";
+            }
+            rel2{
+               relative: 0.0 1.0;
+               to_x: "pad_r";
+            }
+         }
+      }
+   }
+}
+
+group { name: "popup_text_input_text";
+   styles {
+      style { name: "popup_input_style";
+         base: "font=Tizen:style=Regular align=left font_size="POPUP_TEXT_FONT_SIZE1" color=#000000 wrap=mixed text_class=tizen";
+         tag:  "br" "\n";
+         tag:  "tab" "\t";
+      }
+   }
+   parts {
+      part { name: "bg";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_TEXT_INPUTTEXT_VIEW_LAYOUT_BG_MIN_INC;
+         }
+      }
+      part { name: "pad_l_t";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC POPUP_CONTENT_DEFAULT_PADDING_TOP_MIN_INC;
+            max: POPUP_CONTENT_DEFAULT_PADDING_LEFT_MIN_INC POPUP_CONTENT_DEFAULT_PADDING_TOP_MIN_INC;
+            fixed: 1 1;
+            rel1.to: "bg";
+            rel2 {
+               relative: 0.0 0.0;
+               to: "bg";
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "pad_r_b";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_DEFAULT_PADDING_RIGHT_MIN_INC POPUP_CONTENT_DEFAULT_PADDING_TOP_MIN_INC;
+            max: POPUP_CONTENT_DEFAULT_PADDING_RIGHT_MIN_INC POPUP_CONTENT_DEFAULT_PADDING_TOP_MIN_INC;
+            fixed: 1 1;
+            rel1 {
+               relative: 1.0 1.0;
+               to: "bg";
+            }
+            rel2.to: "bg";
+            align: 1.0 1.0;
+         }
+      }
+      part { name: "elm.text.description";
+         type: TEXTBLOCK;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 POPUP_DESCRIPTION_DEFAULT_TEXT_FONT_SIZE_INC;
+            rel1 {
+               relative: 1.0 1.0;
+               to: "pad_l_t";
+            }
+            rel2 {
+               relative: 0.0 0.0;
+               to_x: "pad_r_b";
+               to_y: "elm.swallow.content";
+            }
+            text {
+               style: "popup_input_style";
+               min: 0 1;
+            }
+            align: 0.5 0.0;
+         }
+      }
+      part { name: "elm.swallow.content";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC;
+            max: -1 POPUP_EDITFIELD_LAYOUT_MINMAX_HEIGHT_INC;
+            fixed: 0 1;
+            align: 0.0 1.0;
+            rel1{
+               relative: 1.0 0.0 ;
+               to_x: "pad_l_t";
+               to_y: "pad_r_b";
+            }
+            rel2{
+               relative: 0.0 0.0;
+               to: "pad_r_b";
+            }
+         }
+      }
+   }
+}
diff --git a/src/overheat/overheat.c b/src/overheat/overheat.c
new file mode 100755 (executable)
index 0000000..0ac670c
--- /dev/null
@@ -0,0 +1,311 @@
+/*
+ *  system-popup
+ *
+ * Copyright (c) 2016 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 "popup-common.h"
+
+#define SYSTEMD_STOP_POWER_OFF 4
+
+#define POWER_BUS_NAME        "org.tizen.system.deviced"
+#define POWER_OBJECT_PATH     "/Org/Tizen/System/DeviceD/Power"
+#define POWER_INTERFACE_NAME  POWER_BUS_NAME".power"
+
+#define POWER_METHOD            "reboot"
+#define POWER_OPERATION_OFF     "poweroff"
+
+static const struct popup_ops overheat_ops;
+static const struct popup_ops overheat_poweroff_warning_ops;
+
+static void event_back_key_up(void *data, Evas_Object *obj, void *event_info);
+static void pm_state_changed(keynode_t *key, void *data);
+static void register_handlers(const struct popup_ops *ops);
+static void unregister_handlers(const struct popup_ops *ops);
+static void remove_popup(const struct popup_ops *ops);
+static void overheat_poweroff(const struct popup_ops *ops);
+static int overheat_launch(bundle *b, const struct popup_ops *ops);
+static void overheat_poweroff_warning_terminate(const struct popup_ops *ops);
+static __attribute__ ((constructor)) void overheat_register_popup(void);
+
+static char *items[] = {
+       "IDS_ST_BODY_OVERHEAT",
+       "IDS_QP_POP_YOUR_DEVICE_IS_OVERHEATING_IT_WILL_NOW_POWER_OFF_TO_COOL_DOWN",
+       "IDS_COM_TURN_OFF_NOW",
+};
+
+char* gl_text_get(int index)
+{
+       return strdup(_(items[index]));
+}
+
+static void
+_popup_turnoff_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       const struct popup_ops *ops = data;
+
+       overheat_poweroff(ops);
+ }
+
+static void
+_popup_cancel_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       const struct popup_ops *ops = data;
+       bundle *b = NULL;
+
+       unload_simple_popup(ops);
+       load_simple_popup(b, &overheat_poweroff_warning_ops);
+}
+
+static Eina_Bool
+progressbar_timer_cb(void *data)
+{
+       Evas_Object *popup = data;
+       Evas_Object *progressbar = evas_object_data_get(popup, "progressbar");
+       double value = 0.0;
+
+       value = elm_progressbar_value_get(progressbar);
+       if (value == 1.0) {
+               evas_object_data_del(popup, "timer");
+               evas_object_del(popup);
+               return ECORE_CALLBACK_CANCEL;
+       }
+       value = value + 0.01;
+       elm_progressbar_value_set(progressbar, value);
+
+       return ECORE_CALLBACK_RENEW;
+}
+
+static void
+progressbar_popup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       Ecore_Timer *timer = data;
+
+       ecore_timer_del(timer);
+}
+
+static void event_back_key_up(void *data, Evas_Object *obj, void *event_info)
+{
+       const struct popup_ops *ops = data;
+
+       if (ops)
+               remove_popup(ops);
+       terminate_if_no_popup();
+}
+
+static void pm_state_changed(keynode_t *key, void *data)
+{
+       const struct popup_ops *ops = data;
+
+       if (!key)
+               return;
+
+       if (vconf_keynode_get_int(key) != VCONFKEY_PM_STATE_LCDOFF)
+               return;
+
+       remove_popup(ops);
+}
+
+static void unregister_handlers(const struct popup_ops *ops)
+{
+       Evas_Object *win;
+
+       vconf_ignore_key_changed(VCONFKEY_PM_STATE, pm_state_changed);
+
+       win = get_window();
+       if (win)
+               eext_object_event_callback_del(win, EEXT_CALLBACK_BACK, event_back_key_up);
+}
+
+static void remove_popup(const struct popup_ops *ops)
+{
+       static bool terminating = false;
+
+       if (terminating)
+               return;
+
+       terminating = true;
+
+       unload_simple_popup(ops);
+       popup_terminate();
+}
+
+static void register_handlers(const struct popup_ops *ops)
+{
+       Evas_Object *win;
+
+       win = get_window();
+       if (win)
+               eext_object_event_callback_add(win, EEXT_CALLBACK_BACK, event_back_key_up, (void*)ops);
+       else
+           _D("Something wrong in win!");
+}
+
+static void overheat_poweroff(const struct popup_ops *ops)
+{
+       Evas_Object *rect, *win;
+       Evas_Coord w, h, size;
+       static int bPowerOff = 0;
+       char *param[2];
+       char data[8];
+       int ret;
+
+       if (bPowerOff == 1)
+               return;
+       bPowerOff = 1;
+
+       unload_simple_popup(ops);
+
+       win = get_window();
+       if (!win)
+               popup_terminate();
+
+       rect = evas_object_rectangle_add(evas_object_evas_get(win));
+       evas_object_geometry_get(win, NULL, NULL, &w, &h);
+       size = max(w, h);
+       evas_object_resize(rect, size, size);
+       evas_object_color_set(rect, 0, 0, 0, 255);
+       evas_object_show(rect);
+
+       param[0] = POWER_OPERATION_OFF;
+       snprintf(data, sizeof(data), "0");
+       param[1] = data;
+       ret = popup_dbus_method_sync(POWER_BUS_NAME,
+                       POWER_OBJECT_PATH,
+                       POWER_INTERFACE_NAME,
+                       POWER_METHOD,
+                       "si", param);
+       if (ret < 0)
+               _E("Failed to request poweroff to deviced (%d)", ret);
+}
+
+static int overheat_poweroff_warning_launch(bundle *b, const struct popup_ops *ops)
+{
+       register_handlers(ops);
+       return 0;
+}
+
+static int overheat_launch(bundle *b, const struct popup_ops *ops)
+{
+       register_handlers(ops);
+       return 0;
+}
+
+static void overheat_terminate(const struct popup_ops *ops)
+{
+       unregister_handlers(ops);
+}
+
+static void overheat_poweroff_warning_terminate(const struct popup_ops *ops)
+{
+       unregister_handlers(ops);
+}
+
+int overheat_popup(bundle *b, const struct popup_ops *ops)
+{
+       Evas_Object *popup;
+       Evas_Object *layout;
+       Evas_Object *btn;
+       Evas_Object *progressbar;
+       Evas_Object *win;
+       Ecore_Timer *timer;
+       struct object_ops *obj;
+       int ret;
+
+       ret = get_object_by_ops(ops, &obj);
+       if (ret < 0) {
+               _E("Failed to get object (%d)", ret);
+               return -EINVAL;
+       }
+
+       win = get_window();
+       if (!win)
+               return -ENOMEM;
+
+       evas_object_show(win);
+
+       popup = elm_popup_add(win);
+       if (!popup)
+               return -ENOMEM;
+
+       elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
+       elm_object_part_text_set(popup, "title,text", gl_text_get(0));
+       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       /* cancel button */
+       btn = elm_button_add(popup);
+       elm_object_style_set(btn, "bottom");
+       elm_object_text_set(btn, "Cancel");
+       elm_object_part_content_set(popup, "button1", btn);
+       evas_object_smart_callback_add(btn, "clicked", _popup_cancel_btn_clicked_cb, ops);
+
+       /* turn off button */
+       btn = elm_button_add(popup);
+       elm_object_style_set(btn, "bottom");
+       elm_object_text_set(btn, gl_text_get(2));
+       elm_object_part_content_set(popup, "button2", btn);
+       evas_object_smart_callback_add(btn, "clicked", _popup_turnoff_btn_clicked_cb, ops);
+
+       /* layout */
+       layout = elm_layout_add(popup);
+       _D("ELM_OVERHEAT_EDC = %s", ELM_OVERHEAT_EDC);
+       elm_layout_file_set(layout, ELM_OVERHEAT_EDC, "overheat_view_layout");
+       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_part_text_set(layout, "elm.text", gl_text_get(1));
+
+       progressbar = elm_progressbar_add(layout);
+       elm_object_style_set(progressbar, "process_medium");
+       evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5);
+       evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_progressbar_pulse(progressbar, EINA_TRUE);
+       elm_object_part_content_set(layout, "processing", progressbar);
+       timer = ecore_timer_add(0.3, progressbar_timer_cb, popup);
+
+       elm_object_content_set(popup, layout);
+
+       evas_object_data_set(popup, "progressbar", progressbar);
+       evas_object_data_set(popup, "timer", timer);
+       evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, progressbar_popup_del_cb, timer);
+
+       evas_object_show(popup);
+       obj->popup = popup;
+
+       return 0;
+}
+
+static const struct popup_ops overheat_ops = {
+       .name           = "overheat", //overheat first popup
+       .show           = overheat_popup,
+       .pre            = overheat_launch,
+       .terminate  = overheat_terminate,
+};
+
+static const struct popup_ops overheat_poweroff_warning_ops = {
+       .name           = "overheat_poweroff_warning", //overheat second popup
+       .show           = load_simple_popup,
+       .title          = "IDS_ST_BODY_OVERHEAT_POWEROFF",
+       .content        = "IDS_COM_POP_OVERHEAT_PHONE_WILL_SHUT_DOWN",
+       .left_text      = "IDS_COM_SK_OK",
+       .pre            = overheat_poweroff_warning_launch,
+       .terminate  = overheat_poweroff_warning_terminate,
+};
+
+/* Constructor to register lowbattery button */
+static __attribute__ ((constructor)) void overheat_register_popup(void)
+{
+       register_popup(&overheat_ops);
+       register_popup(&overheat_poweroff_warning_ops);
+}
diff --git a/src/overheat/system-syspopup.edc b/src/overheat/system-syspopup.edc
new file mode 100755 (executable)
index 0000000..b78858f
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ *
+ */
+
+collections {
+   base_scale: 2.6;
+   #include "edc_resource/popup_custom.edc"
+}
+
index 5ec200b..3fe4174 100755 (executable)
@@ -238,6 +238,18 @@ msgstr "HDMI cable connected."
 msgid "IDS_VPL_POP_HDMI_CABLE_DISCONNECTED"
 msgstr "HDMI cable disconnected."
 
+msgid "IDS_COM_TURN_OFF_NOW"
+msgstr "Turn off now"
+
+msgid "IDS_ST_BODY_OVERHEAT"
+msgstr "Phone overheating"
+
+msgid "IDS_ST_BODY_OVERHEAT_POWEROFF"
+msgstr "Phone powering off"
+
+msgid "IDS_COM_POP_OVERHEAT_PHONE_WILL_SHUT_DOWN"
+msgstr "Your device is overheating. It may power off without warning to prevent damage.\n\nOverheating can be caused by:\n- Using graphics-intensive apps, such as video games and navigation apps, for long periods of time\n- Transferring large files\n- Using your device in a hot environment"
+
 msgid "IDS_ST_BODY_PS_HAS_CLOSED_UNEXPECTEDLY"
 msgstr "%s has closed unexpectedly."
 
index 7755b0a..bbbec25 100755 (executable)
@@ -238,6 +238,18 @@ msgstr "HDMI cable connected."
 msgid "IDS_VPL_POP_HDMI_CABLE_DISCONNECTED"
 msgstr "HDMI cable disconnected."
 
+msgid "IDS_COM_TURN_OFF_NOW"
+msgstr "Turn off now"
+
+msgid "IDS_ST_BODY_OVERHEAT"
+msgstr "Phone overheating"
+
+msgid "IDS_ST_BODY_OVERHEAT_POWEROFF"
+msgstr "Device powering off"
+
+msgid "IDS_COM_POP_OVERHEAT_PHONE_WILL_SHUT_DOWN"
+msgstr "Your device is overheating. It may power off without warning to prevent damage.\n\nOverheating can be caused by:\n- Using graphics-intensive apps, such as video games and navigation apps, for long periods of time\n- Transferring large files\n- Using your device in a hot environment"
+
 msgid "IDS_ST_BODY_PS_HAS_CLOSED_UNEXPECTEDLY"
 msgstr "%s has closed unexpectedly."
 
index 0e9e5a1..71df9f3 100755 (executable)
@@ -238,6 +238,18 @@ msgstr "HDMI cable connected."
 msgid "IDS_VPL_POP_HDMI_CABLE_DISCONNECTED"
 msgstr "HDMI cable disconnected."
 
+msgid "IDS_COM_TURN_OFF_NOW"
+msgstr "Turn off now"
+
+msgid "IDS_ST_BODY_OVERHEAT"
+msgstr "Phone overheating"
+
+msgid "IDS_ST_BODY_OVERHEAT_POWEROFF"
+msgstr "Device powering off"
+
+msgid "IDS_COM_POP_OVERHEAT_PHONE_WILL_SHUT_DOWN"
+msgstr "Your device is overheating. It may power off without warning to prevent damage.\n\nOverheating can be caused by:\n- Using graphics-intensive apps, such as video games and navigation apps, for long periods of time\n- Transferring large files\n- Using your device in a hot environment"
+
 msgid "IDS_ST_BODY_PS_HAS_CLOSED_UNEXPECTEDLY"
 msgstr "%s has closed unexpectedly."