--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+#ifndef UI_PROCESS_POPUP_H
+#define UI_PROCESS_POPUP_H
+
+#include "Ui/Popup.h"
+
+namespace Ui
+{
+ class EXPORT_API ProcessPopup : public Popup
+ {
+ public:
+ enum Size
+ {
+ SizeSmall,
+ SizeMedium
+ };
+
+ /**
+ * @brief Create popup.
+ * @param[in] size Popup size
+ */
+ explicit ProcessPopup(Size size = SizeMedium);
+
+ /**
+ * @brief Allows method overload instead of shadowing
+ */
+ using Control::create;
+
+ /**
+ * @brief Create process popup with text.
+ * @param[in] parent Popup parent
+ * @param[in] text Popup text
+ * @param[in] size Popup size
+ * @return Created popup
+ */
+ static ProcessPopup *create(Evas_Object *parent, const char *text, Size size = SizeMedium);
+
+ /**
+ * @brief Set Popup text.
+ * @param[in] text Popup text
+ */
+ void setText(const char *text);
+
+ protected:
+ virtual Evas_Object *onCreate(Evas_Object *parent) override;
+
+ private:
+ Size m_Size;
+ Evas_Object *m_Layout;
+ };
+}
+
+#endif /* UI_PROCESS_POPUP_H */
# EDC Flags
USER_EXT_EDC_KEYS = EDC0
-USER_EXT_EDC0_EDCS = res/apps-common/edje/apps-common-thumbnail.edc res/apps-common/edje/apps-common-progressbar-layout.edc res/apps-common/edje/apps-common-buttons.edc
+USER_EXT_EDC0_EDCS = res/apps-common/edje/apps-common-thumbnail.edc res/apps-common/edje/apps-common-progressbar-layout.edc res/apps-common/edje/apps-common-popup.edc res/apps-common/edje/apps-common-buttons.edc
USER_EXT_EDC0_EDCS_IMAGE_DIRS = res
USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS =
USER_EXT_EDC0_EDCS_SOUND_DIRS = edje/sounds
-set(EDCFILES apps-common-thumbnail.edc apps-common-buttons.edc apps-common-progressbar-layout.edc)
+set(EDCFILES apps-common-thumbnail.edc apps-common-buttons.edc apps-common-progressbar-layout.edc apps-common-popup.edc)
set(EDJDIR "${RES_DIR}/apps-common/edje")
foreach(EDCFILE ${EDCFILES})
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+#ifndef APPS_COMMON_POPUP_H
+#define APPS_COMMON_POPUP_H
+
+#include "AppsCommonPath.h"
+
+#define APPS_COMMON_POPUP_EDJ APPS_COMMON_EDJ_DIR"apps-common-popup.edj"
+
+#define GROUP_PROCESS_SMALL "process_small"
+#define GROUP_PROCESS_MEDIUM "process_medium"
+
+#endif /* APPS_COMMON_POPUP_H */
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+#include "AppsCommonPopup.h"
+
+#define PROCESS_SMALL_POPUP_H 78
+#define PROCESS_SMALL_PROGRESS_LR 32
+#define PROCESS_SMALL_PROGRESS_WH 44
+#define PROCESS_SMALL_TEXT_SIZE 40
+
+#define PROCESS_MEDIUM_POPUP_H 120
+#define PROCESS_MEDIUM_PROGRESS_LR 32
+#define PROCESS_MEDIUM_PROGRESS_W 56
+#define PROCESS_MEDIUM_TEXT_SIZE 40
+
+styles {
+ style {
+ name: "process_small";
+ base: "font=Tizen:style=Light font_size="PROCESS_SMALL_TEXT_SIZE" align=right color=#3db9ccff";
+ }
+ style {
+ name: "process_medium";
+ base: "font=Tizen:style=Light font_size="PROCESS_MEDIUM_TEXT_SIZE" align=left color=#000000ff";
+ }
+}
+
+collections {
+ base_scale: 2.6;
+
+ group { GROUP_PROCESS_SMALL;
+ parts {
+ spacer { "spacer.base"; scale;
+ desc { "default";
+ min: 0 PROCESS_SMALL_POPUP_H;
+ }
+ }
+ spacer { "spacer.progress_right"; scale;
+ desc { "default";
+ min: PROCESS_SMALL_PROGRESS_LR 0;
+ align: 1.0 0.5;
+ rel1.relative: 1.0 0.0;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ swallow { "elm.swallow.content"; scale;
+ desc { "default";
+ min: PROCESS_SMALL_PROGRESS_WH PROCESS_SMALL_PROGRESS_WH;
+ align: 1.0 0.5;
+ rel1 { relative: 0.0 0.5; to_x: "spacer.progress_right"; }
+ rel2 { relative: 0.0 0.5; to_x: "spacer.progress_right"; }
+ }
+ }
+ spacer { "spacer.text_right"; scale;
+ desc { "default";
+ min: PROCESS_SMALL_PROGRESS_LR 0;
+ align: 1.0 0.5;
+ rel1 { relative: 0.0 0.0; to_x: "elm.swallow.content"; }
+ rel2 { relative: 0.0 1.0; to_x: "elm.swallow.content"; }
+ }
+ }
+ textblock { "elm.text"; scale;
+ desc { "default";
+ align: 0.0 0.5;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 0.0 1.0; to_x: "spacer.text_right"; }
+ text.style: "process_small";
+ }
+ }
+ }
+ }
+
+ group { GROUP_PROCESS_MEDIUM;
+ parts {
+ spacer { "spacer.base"; scale;
+ desc { "default";
+ min: 0 PROCESS_MEDIUM_POPUP_H;
+ }
+ }
+ spacer { "spacer.progress_left"; scale;
+ desc { "default";
+ min: PROCESS_MEDIUM_PROGRESS_LR 0;
+ align: 0.0 0.5;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 0.0 1.0;
+ }
+ }
+ swallow { "elm.swallow.content"; scale;
+ desc { "default";
+ min: PROCESS_MEDIUM_PROGRESS_W 0;
+ align: 0.0 0.5;
+ rel1 { relative: 1.0 0.5; to_x: "spacer.progress_left"; }
+ rel2 { relative: 1.0 0.5; to_x: "spacer.progress_left"; }
+ }
+ }
+ spacer { "spacer.text_left"; scale;
+ desc { "default";
+ min: PROCESS_MEDIUM_PROGRESS_LR 0;
+ align: 0.0 0.5;
+ rel1 { relative: 1.0 0.0; to_x: "elm.swallow.content"; }
+ rel2 { relative: 1.0 1.0; to_x: "elm.swallow.content"; }
+ }
+ }
+ textblock { "elm.text"; scale;
+ desc { "default";
+ align: 0.0 0.5;
+ rel1 { relative: 1.0 0.0; to_x: "spacer.text_left"; }
+ rel2 { relative: 1.0 1.0; }
+ text.style: "process_medium";
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+#include "Ui/ProcessPopup.h"
+#include "Ui/Window.h"
+
+#include "App/Path.h"
+#include "AppsCommonPopup.h"
+
+#include <efl_extension.h>
+
+using namespace Ui;
+
+ProcessPopup::ProcessPopup(Size size)
+ : m_Size(size), m_Layout(nullptr)
+{
+ setBackCallback([]{ return false; });
+}
+
+ProcessPopup *ProcessPopup::create(Evas_Object *parent, const char *text, Size size)
+{
+ ProcessPopup *popup = new ProcessPopup(size);
+ popup->create(parent);
+ popup->setText(text);
+ return popup;
+}
+
+void ProcessPopup::setText(const char *text)
+{
+ elm_object_translatable_part_text_set(m_Layout, "elm.text", text);
+}
+
+Evas_Object *ProcessPopup::onCreate(Evas_Object *parent)
+{
+ static struct {
+ const char *layout;
+ const char *progress;
+ } styles[] = {
+ /* SizeSmall = */ { GROUP_PROCESS_SMALL, "process_small" },
+ /* SizeMedium = */ { GROUP_PROCESS_MEDIUM, "process_medium" }
+ };
+
+ Evas_Object *popup = Popup::onCreate(parent);
+ auto &style = styles[m_Size];
+
+ m_Layout = elm_layout_add(popup);
+ elm_layout_file_set(m_Layout, App::getResourcePath(APPS_COMMON_POPUP_EDJ).c_str(), style.layout);
+ elm_object_content_set(popup, m_Layout);
+
+ Evas_Object *progressbar = elm_progressbar_add(m_Layout);
+ elm_object_style_set(progressbar, style.progress);
+ elm_progressbar_pulse_set(progressbar, EINA_TRUE);
+ elm_progressbar_pulse(progressbar, EINA_TRUE);
+ elm_object_content_set(m_Layout, progressbar);
+
+ return popup;
+}