--- /dev/null
+/*
+ * Task Manager
+ * Copyright (c) 2013 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.
+ */
+
+collections {
+ base_scale : 1.3;
+ color_classes{
+ color_class{
+ name: "AT013";
+ color: 255 255 255 255;
+ }
+ }
+ styles {
+ style {
+ name: "style_no_apps";
+ base: "font="TIZEN":style=Regular text_class="AT013" font_size=28 align=center color=#FFFFFF wrap=mixed color_class=AT013";
+ tag: "br" "\n";
+ tag: "hilight" "+ color=#ffff";
+ tag: "b" "+ color=#ffff";
+ tag: "tab" "\t";
+ }
+ }
+ group {
+ name : "taskmanager-layout";
+ images {
+ image : "tw_bottom_btn_bg.png" COMP;
+ }
+ parts {
+ part {
+ name : "bg";
+ type : RECT;
+ description {
+ state : "default" 0.0;
+ color : 0 0 0 255;
+ }
+ }
+ part {
+ name : "color_clipper";
+ type : RECT;
+ description {
+ state : "default" 0.0;
+ color : 255 255 255 255;
+ }
+ description {
+ state : "closeall" 0.0;
+ color : 255 255 255 0;
+ }
+ }
+ part { name: "swl.bg";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ visible: 1;
+ }
+ description { state: "hide" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part {
+ name : "swl.list";
+ type : SWALLOW;
+ scale : 1;
+ description {
+ state : "default" 0.0;
+ rel1 {
+ relative : 0.0 0.0;
+ to : "bg";
+ }
+ rel2 {
+ relative : 1.0 1.0;
+ to : "bg";
+ }
+ }
+ }
+ part {
+ name : "swl.index";
+ type : SWALLOW;
+ clip_to : "color_clipper";
+ scale : 1;
+ repeat_events: 1;
+ description {
+ state : "default" 0.0;
+ }
+ }
+ part {
+ name: "close_all_bg";
+ type: IMAGE;
+ scale: 1;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.5 1.0; to: "bg"; }
+ rel2 { relative: 0.5 1.0; to: "bg"; }
+ image {
+ normal: "tw_bottom_btn_bg.png";
+ }
+ align: 0.5 1.0;
+ fixed : 1 1;
+ min : 360 100;
+ max : 360 100;
+ color: 51 51 51 178;
+ visible: 0;
+ }
+ description {
+ state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ color: 75 75 75 178;
+ visible: 1;
+ }
+ description {
+ state: "show" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 33 33 33 255;
+ visible: 1;
+ }
+ }
+ part {
+ name: "close_all_text";
+ type: TEXTBLOCK;
+ scale: 1;
+ repeat_events: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; to: "close_all_bg"; }
+ rel2 { relative: 1.0 1.0; to: "close_all_bg"; }
+ min : 160 42;
+ max : 160 42;
+ align: 0.5 0.5;
+ fixed: 1 1;
+ visible: 0;
+ text {
+ text_class: "AT013";
+ style : style_no_apps;
+ min : 0 1;
+ align : 0.5 0.5;
+ }
+ }
+ description {
+ state: "pressed" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ description {
+ state: "show" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ description {
+ state: "disabled" 0.0;
+ inherit: "default" 0.0;
+ color: 33 33 33 255;
+ visible: 1;
+ }
+ }
+ }
+ programs {
+ program {
+ name : "show_bg";
+ signal : "show_bg";
+ source : "*";
+ action : STATE_SET "default" 0.0;
+ target : "swl.bg";
+ }
+ program {
+ name : "hide_bg";
+ signal : "hide_bg";
+ source : "*";
+ action : STATE_SET "hide" 0.0;
+ target : "swl.bg";
+ }
+ program {
+ name : "close,clicked";
+ signal : "mouse,clicked,1";
+ source : "close_all_bg";
+ action : SIGNAL_EMIT "close_button,clicked" "clicked";
+ }
+ program {
+ name : "close,pressed";
+ signal : "mouse,down,1";
+ source : "close_all_bg";
+ action : STATE_SET "pressed" 0.0;
+ target : "close_all_text";
+ target : "close_all_bg";
+ }
+ program {
+ name : "close,unpressed";
+ signal : "mouse,up,1";
+ source : "close_all_bg";
+ action : STATE_SET "show" 0.0;
+ target : "close_all_text";
+ target : "close_all_bg";
+ transition : LINEAR 0.15;
+ }
+ program {
+ name : "show_close";
+ signal : "show_close";
+ source : "*";
+ action : STATE_SET "show" 0.0;
+ target : "close_all_text";
+ target : "close_all_bg";
+ }
+ program {
+ name : "hide_close";
+ signal : "hide_close";
+ source : "*";
+ action : STATE_SET "default" 0.0;
+ target : "close_all_text";
+ target : "close_all_bg";
+ }
+ program {
+ name : "closeall";
+ signal : "closeall";
+ source : "bg";
+ action : STATE_SET "closeall" 0.0;
+ target : "color_clipper";
+ // transition : LINEAR 0.35;
+ }
+ }
+ }
+} //collections
+++ /dev/null
-collections {
- group { name: "main";
- parts {
- part { name: "txt_title";
- type: TEXT;
- mouse_events: 0;
- description { state: "default" 0.0;
- text { text: "Hello Tizen"; font: "Tizen:style=regular"; size: 20; min: 1 1; align: 0.5 0; ellipsis: -1; }
- color: 0 255 255 255;
- }
- }
- }
- }
-}
{
class Window;
class TaskMngrService;
+ class MainController;
class App
{
private:
static App m_AppInst;
Window *m_pWindow;
+ MainController *m_pRootController;
};
}
--- /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 MainController_h_
+#define MainController_h_
+
+#include "MainLayout.h"
+
+namespace TaskMngr
+{
+ class MainController
+ : public MainLayout
+ {
+ public:
+ MainController(Evas_Object *parent);
+ virtual ~MainController();
+
+ private:
+ // MainLayout:
+ void onCloseAllButtonClicked() override;
+ };
+}
+
+#endif /* MainController_h_ */
--- /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 MainLayout_h_
+#define MainLayout_h_
+
+#include "View.h"
+
+namespace TaskMngr
+{
+ class MainLayout
+ : public View
+ {
+ public:
+ MainLayout(Evas_Object *parent);
+ virtual ~MainLayout();
+
+ void setList(Evas_Object *obj);
+ void setIndex(Evas_Object *obj);
+ void showNoContents(bool show);
+ void showCloseButton(bool show);
+
+ protected:
+ virtual void onCloseAllButtonClicked() {};
+
+ private:
+ Evas_Object *m_pNoContent;
+ };
+}
+
+#endif /* MainLayout_h_ */
#define EDJ_PATH "edje"
#define IMAGE_PATH "images"
+#define MAINT_LAYOUT_EDJ EDJ_PATH"/main_layout.edj"
+
#endif /* RESOURCE_H_ */
#include "Logger.h"
#include "Callback.h"
#include "Window.h"
+#include "MainController.h"
using namespace TaskMngr;
App::App()
: m_pWindow(nullptr)
+ , m_pRootController(nullptr)
{
}
m_pWindow = new Window;
m_pWindow->show();
+ m_pRootController = new MainController(m_pWindow->getHostEvasObject());
+ m_pWindow->setContent(*m_pRootController);
+ m_pRootController->showCloseButton(true);
+
return true;
}
--- /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 "MainController.h"
+#include "Logger.h"
+
+using namespace TaskMngr;
+
+MainController::MainController(Evas_Object *parent)
+ : MainLayout(parent)
+{
+}
+
+MainController::~MainController()
+{
+}
+
+void MainController::onCloseAllButtonClicked()
+{
+ LOG("");
+}
--- /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 "MainLayout.h"
+#include "Resource.h"
+
+using namespace TaskMngr;
+
+MainLayout::MainLayout(Evas_Object *parent)
+ : m_pNoContent(nullptr)
+{
+ setEo(View::addLayout(parent, MAINT_LAYOUT_EDJ, "taskmanager-layout"));
+ addSignalCb
+ (
+ "close_button,clicked",
+ "clicked",
+ [](void *data, Evas_Object *obj, const char *emission, const char *source)
+ {
+ static_cast<MainLayout*>(data)->onCloseAllButtonClicked();
+ }, this);
+ showCloseButton(true);
+ setText("CLOSE ALL", "close_all_text"); // TODO: localization
+}
+
+MainLayout::~MainLayout()
+{
+}
+
+void MainLayout::setList(Evas_Object *obj)
+{
+ setContent(obj, "swl.list");
+}
+
+void MainLayout::setIndex(Evas_Object *obj)
+{
+ setContent(obj, "swl.index");
+}
+
+void MainLayout::showNoContents(bool show)
+{
+ if (show && !m_pNoContent)
+ {
+ m_pNoContent = elm_layout_add(getEo());
+ elm_layout_theme_set(getEo(), "layout", "nocontents", "text");
+ setContent(m_pNoContent, "swl.bg");
+ }
+
+ const char *sig = show ? "show_bg" : "hide_bg";
+ emitSignal(sig, "*");
+}
+
+void MainLayout::showCloseButton(bool show)
+{
+ const char *sig = show ? "show_close" : "hide_close";
+ emitSignal(sig, "*");
+}