</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactName="clock" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1520067052" name="Debug" parent="org.tizen.nativecore.config.sbi.gcc45.app.debug">
+ <configuration artifactName="clock" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1520067052" name="Debug" parent="org.tizen.nativecore.config.sbi.gcc45.app.debug">
<folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1520067052." name="/" resourcePath="">
<toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug.349018771" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.892802998" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
<option defaultValue="gnu.cpp.compiler.debugging.level.max" id="sbi.gnu.cpp.compiler.option.debugging.level.core.560740604" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
<option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.1289916342" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
<option id="sbi.gnu.cpp.compiler.option.1180801303" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="mobile-3.0-emulator.core.private_llvm36.i386.core.app"/>
+ <listOptionValue builtIn="false" value="mobile-3.0-device.core.private_llvm36.armel.core.app"/>
</option>
<option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.728385348" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
<listOptionValue builtIn="false" value=" -fPIE"/>
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
+ <listOptionValue builtIn="false" value="-mthumb"/>
</option>
<option id="gnu.cpp.compiler.option.include.paths.1668895094" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
<option id="sbi.gnu.cpp.compiler.option.frameworks.core.818453780" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
<listOptionValue builtIn="false" value="Native_API"/>
</option>
+ <option id="gnu.cpp.compiler.option.dialect.std.69724678" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.c++11" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.199822626" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool command="clang" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.2100102180" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
<option defaultValue="gnu.c.debugging.level.max" id="sbi.gnu.c.compiler.option.debugging.level.core.1101789042" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
<option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.207975531" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
<option id="sbi.gnu.c.compiler.option.600001807" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="mobile-3.0-emulator.core.private_llvm36.i386.core.app"/>
+ <listOptionValue builtIn="false" value="mobile-3.0-device.core.private_llvm36.armel.core.app"/>
</option>
<option id="sbi.gnu.c.compiler.option.frameworks_inc.core.2111102001" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
<listOptionValue builtIn="false" value=" -fPIE"/>
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
+ <listOptionValue builtIn="false" value="-mthumb"/>
</option>
<option id="gnu.c.compiler.option.include.paths.2001094680" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
<option id="sbi.gnu.c.compiler.option.frameworks.core.1925165632" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
<listOptionValue builtIn="false" value="Native_API"/>
</option>
+ <option id="gnu.c.compiler.option.dialect.std.6239317" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1367772119" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.127664922" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
- <tool command="i386-linux-gnueabi-as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.784950171" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
+ <tool command="arm-linux-gnueabi-as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.784950171" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1097107177" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="org.tizen.nativecore.tool.fnmapgen.1050341554" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactName="org.tizen.clock" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.release.574908128" name="Release" parent="org.tizen.nativecore.config.sbi.gcc45.app.release">
+ <configuration artifactName="org.tizen.clock" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.release.574908128" name="Release" parent="org.tizen.nativecore.config.sbi.gcc45.app.release">
<folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.release.574908128." name="/" resourcePath="">
<toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.release.1887310709" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.release">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.1532033279" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
<option id="gnu.cpp.compiler.option.optimization.level.2054731509" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option defaultValue="gnu.cpp.compiler.debugging.level.default" id="sbi.gnu.cpp.compiler.option.debugging.level.core.528013451" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
<option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.769356524" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
- <option id="sbi.gnu.cpp.compiler.option.977246393" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
+ <option id="sbi.gnu.cpp.compiler.option.977246393" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
<listOptionValue builtIn="false" value="mobile-3.0-emulator.core.private_llvm36.i386.core.app"/>
</option>
- <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.1940012844" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
+ <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.1940012844" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/dbus-1.0/include""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/glib-2.0/include""/>
</option>
- <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.1417993726" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
+ <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.1417993726" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
<listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
<listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
<listOptionValue builtIn="false" value=" -fPIE"/>
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
</option>
- <option id="gnu.cpp.compiler.option.include.paths.666940366" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <option id="gnu.cpp.compiler.option.include.paths.666940366" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
</option>
- <option id="sbi.gnu.cpp.compiler.option.frameworks.core.2022650640" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
+ <option id="sbi.gnu.cpp.compiler.option.frameworks.core.2022650640" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
<listOptionValue builtIn="false" value="Native_API"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2115671374" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1941787049" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
<option defaultValue="gnu.c.debugging.level.default" id="sbi.gnu.c.compiler.option.debugging.level.core.2114961681" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
<option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.1440158952" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
- <option id="sbi.gnu.c.compiler.option.1740904427" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
+ <option id="sbi.gnu.c.compiler.option.1740904427" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
<listOptionValue builtIn="false" value="mobile-3.0-emulator.core.private_llvm36.i386.core.app"/>
</option>
- <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.32910582" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
+ <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.32910582" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/dbus-1.0/include""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/glib-2.0/include""/>
</option>
- <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.304530067" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" valueType="stringList">
+ <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.304530067" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" valueType="stringList">
<listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
<listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
<listOptionValue builtIn="false" value=" -fPIE"/>
<listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
</option>
- <option id="gnu.c.compiler.option.include.paths.495970662" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <option id="gnu.c.compiler.option.include.paths.495970662" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
</option>
- <option id="sbi.gnu.c.compiler.option.frameworks.core.1173071384" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
+ <option id="sbi.gnu.c.compiler.option.frameworks.core.1173071384" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
<listOptionValue builtIn="false" value="Native_API"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1126445800" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
<tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.linker.2052119761" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
<option defaultValue="false" id="sbi.gnu.cpp.linker.option.shared_flag.core.1801951609" name="Linker.Shared" superClass="sbi.gnu.cpp.linker.option.shared_flag.core" valueType="boolean"/>
<option defaultValue="false" id="sbi.gnu.cpp.linker.option.noundefined.core.266415034" name="Report unresolved symbol references (-Wl,--no-undefined)" superClass="sbi.gnu.cpp.linker.option.noundefined.core" valueType="boolean"/>
- <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.782229630" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
+ <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.782229630" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
<listOptionValue builtIn="false" value="${TC_LINKER_MISC}"/>
<listOptionValue builtIn="false" value="${RS_LINKER_MISC}"/>
<listOptionValue builtIn="false" value="-pie -lpthread "/>
<listOptionValue builtIn="false" value="-L"${SBI_SYSROOT}/usr/lib""/>
<listOptionValue builtIn="false" value="$(RS_LIBRARIES)"/>
</option>
- <option id="gnu.cpp.link.option.paths.1263308626" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <option id="gnu.cpp.link.option.paths.1263308626" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1095844587" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<name>clock</name>
<comment></comment>
<projects>
- <project>ring</project>
- <project>clock-common</project>
</projects>
<buildSpec>
<buildCommand>
</natures>
<filteredResources>
<filter>
- <id>1469441105659</id>
+ <id>1470818697836</id>
<name></name>
<type>26</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1469441105662</id>
+ <id>1470818697840</id>
<name></name>
<type>6</type>
<matcher>
COMPILE_FLAGS = $(DEBUG_OP) $(OPTIMIZATION_OP) -Wall -c -fmessage-length=0
-CPP_COMPILE_FLAGS = $(CPP_DEBUG_OP) $(CPP_OPTIMIZATION_OP)
+CPP_COMPILE_FLAGS = $(CPP_DEBUG_OP) $(CPP_OPTIMIZATION_OP) -std=c++11
LINK_FLAGS =
--- /dev/null
+#ifndef __CLOCK_H__
+#define __CLOCK_H__
+
+#include <Elementary.h>
+#include "Controller/MainController.h"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "CLOCK"
+
+#if !defined(PACKAGE)
+#define PACKAGE "org.tizen.clock"
+#endif
+
+#define EDJ_FILE "edje/clock.edj"
+#define GRP_MAIN "main"
+
+/**
+ * @defgroup Models Models
+ */
+
+/**
+ * @defgroup Views Views
+ */
+
+/**
+ * @defgroup Controllers Controllers
+ */
+
+/**
+ * @defgroup main Main
+ */
+#endif /* __CLOCK_H__ */
--- /dev/null
+/*
+ * 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.
+ */
+
+#ifndef _CLOCK_MAIN_CONTROLLER_H_
+#define _CLOCK_MAIN_CONTROLLER_H_
+
+/**
+ * @file MainController.h
+ */
+
+/**
+ * @addtogroup Controllers
+ * @{
+ */
+
+/**
+ * @addtogroup Main
+ * @{
+ */
+
+namespace worldclock {
+ namespace controller {
+
+ /**
+ * @brief Application lifecycle main controller singleton class
+ * @remarks This is singleton class.
+ */
+ class MainController {
+ public:
+ /**
+ * @brief Retrieves singleton instance.
+ */
+ static MainController &GetInstance();
+
+ /**
+ * @brief Destructor.
+ */
+ ~MainController();
+
+ /**
+ * @brief Initializes application.
+ */
+ int Init();
+
+ /**
+ * @brief Denitializes application.
+ */
+ void Deinit();
+
+ /**
+ * @brief Pause application.
+ */
+ void Pause();
+
+ /**
+ * @brief Resume application.
+ */
+ void Resume();
+
+ /**
+ * @briefs Copies this class object instance.
+ * @remarks Customized for singleton purpose - make no effect.
+ */
+ MainController(MainController const&) = delete;
+
+ /**
+ * @briefs Overloads equation mark.
+ * @remarks Customized for singleton purpose - make no effect.
+ */
+ void operator=(MainController const&) = delete;
+
+ private:
+ /**
+ * @brief Constructs MainController class object.
+ */
+ MainController() {};
+ };
+
+ }
+}
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+#endif /* _CLOCK_MAIN_CONTROLLER_H_ */
--- /dev/null
+/*
+ * 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.
+ */
+
+#ifndef ALARMVIEW_H_
+#define ALARMVIEW_H_
+
+#include "View/PageView.h"
+#include "View/View.h"
+
+namespace worldclock {
+ namespace view {
+ class AlarmView : public IView{
+ public:
+ AlarmView();
+ Evas_Object *GetEvasObject(){return alarm_;};
+
+ private:
+ Evas_Object *alarm_;
+ };
+ }
+}
+
+
+#endif /* ALARMVIEW_H_ */
--- /dev/null
+/*
+ * 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.
+ */
+
+#ifndef _WINDOW_VIEW_H_
+#define _WINDOW_VIEW_H_
+
+#include <Evas.h>
+
+#include "View/PageView.h"
+#include "View/View.h"
+
+/**
+ * @file MainView.h
+ */
+
+/**
+ * @addtogroup View
+ * @{
+ */
+
+/**
+ * @addtogroup Main
+ * @{
+ */
+
+namespace worldclock {
+ namespace view {
+
+ /**
+ * @brief Application main view class
+ * @remarks This is singleton class.
+ */
+ class MainView : public IView {
+ public:
+
+ /**
+ * @brief Retrieves singleton instance.
+ */
+ static MainView &GetInstance();
+
+ /**
+ * @brief Destructor
+ */
+ ~MainView();
+
+ /**
+ * @brief Creates content of application
+ * @remarks It not creates base GUI
+ */
+ void CreateContent();
+
+ /**
+ * @brief Retrieves naviframe object.
+ */
+ Evas_Object *GetEvasObject();
+
+ /**
+ * @briefs Copies this class object instance.
+ * @remarks Customized for singleton purpose - make no effect.
+ */
+ MainView(MainView const&) = delete;
+ /**
+ * @briefs Overloads equation mark.
+ * @remarks Customized for singleton purpose - make no effect.
+ */
+ void operator=(MainView const&) = delete;
+ private:
+
+ /**
+ * @brief Constructs MainView class object
+ * @remarks Creates base GUI
+ */
+ MainView();
+
+ /**
+ * Adds conformant to window.
+ */
+ void ConformantAdd();
+
+ /**
+ * @brief Adds naviframe to conformant
+ * @remarks it also fills indicator_bg part in conformant
+ */
+ void NaviframeAdd();
+
+ /**
+ * @brief Creates content for Alarm, World Clock, Stopwatch and Timer pages
+ */
+ void CreatePages();
+
+ /**
+ * @brief Creates toolbar buttons.
+ */
+ void CreateToolbarButtons();
+
+ /**
+ * @brief Creates toolbar.
+ */
+ void CreateToolbar();
+
+ Evas_Object *window_;
+ Evas_Object *conformant_;
+ Evas_Object *naviframe_;
+
+ /* Content */
+ Evas_Object *toolbar_;
+
+ IView *alarm_;
+ IView *world_clock_;
+ IView *stop_watch_;
+ IView *timer_;
+ };
+ }
+}
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+#endif /* _WINDOW_VIEW_H_ */
--- /dev/null
+/*
+ * 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.
+ */
+
+
+#ifndef NAVIFRAME_PAGE_VIEW_H_
+#define NAVIFRAME_PAGE_VIEW_H_
+
+#include <Elementary.h>
+#include "View/View.h"
+
+/**
+ * @file pageView.h
+ */
+
+/**
+ * @addtogroup View
+ * @{
+ */
+
+namespace worldclock {
+ namespace view {
+
+ /*
+ * @brief Base class for pages(Alarm, World Clock, StopWatch and Timer)
+ */
+ class PageView : public view::IView {
+ public:
+
+ /**
+ * @brief Constructs class object.
+ */
+ PageView(const char *title_label, Evas_Object *left_button, Evas_Object *right_button, Evas_Object *content);
+ /**
+ * @brief Cleans all resources needed to be cleaned up.
+ */
+ ~PageView();
+
+ /**
+ * @brief Gets object of the page.
+ */
+ Evas_Object *GetEvasObject();
+
+ /**
+ * @brief Creates page content.
+ */
+ virtual void CreateContent(){};
+
+ /**
+ * @brief Requests data refresh.
+ */
+ virtual void RefreshContent(){};
+
+ /**
+ * @brief Creates new naviframe item page.
+ * @remarks Used to create "Add ..." pages in Alarm or World Clock
+ */
+ virtual void CreateNewNaviPage(){};
+
+ protected:
+
+ /**
+ * Requestes and retrives new naviframe item pushed to naviframe.
+ */
+ void PushNewNaviPage();
+
+ Elm_Object_Item *subpage_;
+ const char *title_label_;
+ Evas_Object *left_button_;
+ Evas_Object *right_button_;
+ Evas_Object *content_;
+ };
+ };
+};
+
+/**
+ * @}
+ */
+
+#endif /* NAVIFRAME_PAGE_VIEW_H_ */
--- /dev/null
+/*
+ * 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.
+ */
+
+#ifndef STOPWATCHVIEW_H_
+#define STOPWATCHVIEW_H_
+
+#include "View/PageView.h"
+#include "View/View.h"
+
+namespace worldclock {
+ namespace view {
+
+ class StopWatchView : public IView{
+ public:
+ StopWatchView();
+ Evas_Object *GetEvasObject(){return stopwatch_;};
+
+ private:
+ Evas_Object *stopwatch_;
+ };
+ }
+}
+
+
+#endif /* STOPWATCHVIEW_H_ */
--- /dev/null
+/*
+ * 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.
+ */
+
+#ifndef TIMERVIEW_H_
+#define TIMERVIEW_H_
+
+#include "View/PageView.h"
+#include "View/View.h"
+
+namespace worldclock {
+ namespace view {
+ class TimerView : public IView{
+ public:
+ TimerView();
+ Evas_Object *GetEvasObject(){return timer_;};
+
+ private:
+ Evas_Object *timer_;
+ };
+ }
+}
+
+
+#endif /* TIMERVIEW_H_ */
--- /dev/null
+#ifndef _CLOCK_UI_VIEW_H_
+#define _CLOCK_UI_VIEW_H_
+
+#include <Elementary.h>
+
+namespace worldclock {
+ namespace view {
+ class IView {
+ public:
+ virtual Evas_Object *GetEvasObject() = 0;
+ virtual ~IView(){};
+ };
+ };
+};
+
+#endif
--- /dev/null
+/*
+ * 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.
+ */
+
+#ifndef WORLDCLOCKVIEW_H_
+#define WORLDCLOCKVIEW_H_
+
+#include "View/PageView.h"
+#include "View/View.h"
+
+namespace worldclock {
+ namespace view {
+ class WorldClockView : public IView{
+ public:
+ WorldClockView();
+ Evas_Object *GetEvasObject(){return world_clock_;};
+
+ private:
+ Evas_Object *world_clock_;
+ };
+ }
+}
+
+
+#endif /* WORLDCLOCKVIEW_H_ */
+++ /dev/null
-#ifndef __clock_H__
-#define __clock_H__
-
-#include <app.h>
-#include <Elementary.h>
-#include <system_settings.h>
-#include <efl_extension.h>
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "clock"
-
-#if !defined(PACKAGE)
-#define PACKAGE "org.tizen.clock"
-#endif
-
-#define EDJ_FILE "edje/clock.edj"
-#define GRP_MAIN "main"
-
-
-#endif /* __clock_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2009-2014 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 __LOG_H__
+#define __LOG_H__
+
+#include <dlog.h>
+#include <app_i18n.h>
+
+/**
+ * @addtogroup Utils
+ * @{
+ */
+
+#ifdef LOG_TAG
+ #undef LOG_TAG
+#endif
+
+#define LOG_TAG "CLOCK"
+
+#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
+
+#if !defined(DBG)
+#define DBG(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(WRN)
+#define WRN(fmt, arg...) dlog_print(DLOG_WARN, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(ERR)
+#define ERR(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(INF)
+#define INF(fmt, arg...) dlog_print(DLOG_INFO, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg)
+#endif
+
+#if !defined(FATAL)
+#define FAT(fmt, arg...) dlog_print(DLOG_FATAL, LOG_TAG, "%s: %s[%d]\t " #fmt "\n", __FILENAME__, __func__, __LINE__, ##arg);
+#endif
+
+#undef _
+#define _(str) i18n_get_text(str)
+
+/**
+ * @}
+ */
+
+#endif
profile = mobile-3.0
# C Sources
-USER_SRCS = src/Clock.c src/Utils.cpp
-USER_SRCS_ABS =
+USER_SRCS = src/*.cpp src/Controller/*.cpp src/View/*.cpp
+USER_SRCS_ABS =
# EDC Sources
USER_EDCS =
USER_CPP_UNDEFS =
# User Libraries
-USER_LIBS = org.tizen.clock
+USER_LIBS =
# User Objects
-USER_OBJS =
+USER_OBJS =
USER_OBJS_ABS =
# User Includes
## C Compiler
-USER_INC_DIRS = $(workspace_loc)/common/inc inc
+USER_INC_DIRS = inc/
USER_INC_DIRS_ABS =
USER_INC_FILES =
USER_INC_FILES_ABS =
## C++ Compiler
-USER_CPP_INC_DIRS =
+USER_CPP_INC_DIRS =
USER_CPP_INC_DIRS_ABS =
-USER_CPP_INC_FILES =
-USER_CPP_INC_FILES_ABS =
+USER_CPP_INC_FILES =
+USER_CPP_INC_FILES_ABS =
# User Library Path
USER_LIB_DIRS = $(workspace_loc)/common/${BUILD_CONFIG}
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 0 0 255;
- }
+ part { name: "bg";
+ type: SWALLOW;
}
}
}
--- /dev/null
+/*
+ * 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 <dlog.h>
+
+#include "log.h"
+#include "app.h"
+#include "Clock.h"
+#include "Controller/MainController.h"
+
+using namespace worldclock::controller;
+
+
+static bool
+app_create(void *data)
+{
+ /* Hook to take necessary actions before main event loop starts
+ Initialize UI resources and application's data
+ If this function returns true, the main loop of application starts
+ If this function returns false, the application is terminated */
+
+ DBG("app_create");
+ MainController::GetInstance().Init();
+
+ return true;
+}
+
+static void
+app_control(app_control_h app_control, void *data)
+{
+ /* Handle the launch request. */
+}
+
+static void
+app_pause(void *data)
+{
+ /* Take necessary actions when application becomes invisible. */
+ MainController::GetInstance().Pause();
+}
+
+static void
+app_resume(void *data)
+{
+ /* Take necessary actions when application becomes visible. */
+ MainController::GetInstance().Resume();
+}
+
+static void
+app_terminate(void *data)
+{
+ /* Release all resources. */
+ MainController::GetInstance().Deinit();
+}
+
+static void
+ui_app_lang_changed(app_event_info_h event_info, void *user_data)
+{
+ /*APP_EVENT_LANGUAGE_CHANGED*/
+
+ int ret;
+ char *language;
+
+ ret = app_event_get_language(event_info, &language);
+ if (ret != APP_ERROR_NONE) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "app_event_get_language() failed. Err = %d.", ret);
+ return;
+ }
+
+ if (language != NULL) {
+ elm_language_set(language);
+ free(language);
+ }
+}
+
+static void
+ui_app_orient_changed(app_event_info_h event_info, void *user_data)
+{
+ /*APP_EVENT_DEVICE_ORIENTATION_CHANGED*/
+ return;
+}
+
+static void
+ui_app_region_changed(app_event_info_h event_info, void *user_data)
+{
+ /*APP_EVENT_REGION_FORMAT_CHANGED*/
+}
+
+static void
+ui_app_low_battery(app_event_info_h event_info, void *user_data)
+{
+ /*APP_EVENT_LOW_BATTERY*/
+}
+
+static void
+ui_app_low_memory(app_event_info_h event_info, void *user_data)
+{
+ /*APP_EVENT_LOW_MEMORY*/
+}
+
+int
+main(int argc, char *argv[])
+{
+ int ret = 0;
+
+ ui_app_lifecycle_callback_s event_callback = {0,};
+ app_event_handler_h handlers[5] = {NULL, };
+
+ event_callback.create = app_create;
+ event_callback.terminate = app_terminate;
+ event_callback.pause = app_pause;
+ event_callback.resume = app_resume;
+ event_callback.app_control = app_control;
+
+ ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, NULL);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, NULL);
+ ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, NULL);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, NULL);
+ ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, NULL);
+
+ ret = ui_app_main(argc, argv, &event_callback, NULL);
+ if (ret != APP_ERROR_NONE)
+ dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret);
+
+ return ret;
+}
--- /dev/null
+/*
+ * 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 "log.h"
+#include "View/MainView.h"
+#include "Controller/MainController.h"
+
+using namespace worldclock::controller;
+using namespace worldclock::view;
+
+MainController &MainController::GetInstance()
+{
+ static MainController instance;
+ return instance;
+}
+
+MainController::~MainController()
+{
+
+}
+
+void MainController::Pause()
+{
+
+}
+
+void MainController::Resume()
+{
+
+}
+
+int MainController::Init()
+{
+ DBG("Init()");
+
+ MainView::GetInstance();
+ MainView::GetInstance().CreateContent();
+
+ return 0;
+}
+
+void MainController::Deinit()
+{
+
+}
--- /dev/null
+/*
+ * 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 "View/AlarmView.h"
+#include "View/MainView.h"
+#include "Utils.h"
+
+using namespace worldclock::view;
+using namespace common::utils;
+
+AlarmView::AlarmView()
+{
+ /*Create content here and use main_layout_ as a parent*/
+
+ /*Temporary Code*/
+ alarm_ = elm_layout_add(MainView::GetInstance().GetEvasObject());
+
+ elm_layout_file_set(alarm_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, "edje/clock.edj"), "main");
+
+ evas_object_size_hint_align_set(alarm_, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(alarm_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ Evas_Object *label = elm_label_add(alarm_);
+
+ elm_object_text_set(label, "Alarm");
+ elm_layout_content_set(alarm_, "bg", label);
+}
--- /dev/null
+/*
+ * 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 <app.h>
+#include <Elementary.h>
+#include <efl_extension.h>
+
+#include "View/AlarmView.h"
+#include "View/StopWatchView.h"
+#include "View/TimerView.h"
+#include "View/WorldClockView.h"
+
+#include "View/MainView.h"
+#include "Clock.h"
+#include "Utils.h"
+#include "log.h"
+
+using namespace worldclock::view;
+using namespace common::utils;
+
+
+static void WinDeleteRequestCb(void *data, Evas_Object *obj, void *event_info)
+{
+ ui_app_exit();
+}
+
+static Eina_Bool naviframe_pop_cb(void *data, Elm_Object_Item *it)
+{
+ PageView *page = static_cast<PageView *>(data);
+
+ ui_app_exit();
+ return EINA_FALSE;
+}
+
+void toolbar_it_cb (void *data, Evas_Object *obj, void *event_info)
+{
+ PageView *page = static_cast<PageView *>(data);
+
+ /*TODO
+ * Send data refresh request
+ * e.g. page->RefreshContent();
+ */
+
+ Evas_Object *layout = elm_object_parent_widget_get(obj);
+ Evas_Object *navi = elm_object_parent_widget_get(layout);
+ Elm_Naviframe_Item *top = elm_naviframe_top_item_get(navi);
+
+ elm_naviframe_item_style_set(top, "tabbar/icon/notitle");
+
+ Evas_Object *prev = elm_object_item_content_unset(top);
+ evas_object_hide(prev);
+ evas_object_show(page->GetEvasObject());
+ elm_object_item_content_set(top, page->GetEvasObject());
+}
+
+
+MainView &MainView::GetInstance()
+{
+ static MainView instance;
+ return instance;
+}
+
+MainView::MainView()
+{
+ DBG("CreateBaseGui()");
+
+ window_ = elm_win_add(NULL, "CLOCK", ELM_WIN_BASIC);
+ if (!window_)
+ ERR("Window is NULL"); /*TODO use C++ logging function when it will be implemented*/
+
+ elm_win_alpha_set(window_, EINA_TRUE);
+ elm_win_conformant_set(window_, EINA_TRUE);
+ elm_win_autodel_set(window_, EINA_TRUE);
+ elm_win_indicator_mode_set(window_, ELM_WIN_INDICATOR_SHOW);
+ elm_win_indicator_opacity_set(window_, ELM_WIN_INDICATOR_OPAQUE);
+
+ evas_object_smart_callback_add(window_, "delete,request", WinDeleteRequestCb, NULL);
+
+ ConformantAdd();
+ NaviframeAdd();
+
+ evas_object_show(window_);
+
+}
+
+MainView::~MainView()
+{
+}
+
+void MainView::ConformantAdd()
+{
+ conformant_ = elm_conformant_add(window_);
+ evas_object_size_hint_weight_set(conformant_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(conformant_, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ elm_win_resize_object_add(window_, conformant_);
+
+ evas_object_show(conformant_);
+
+}
+
+
+void MainView::NaviframeAdd()
+{
+ naviframe_ = elm_naviframe_add(conformant_);
+ elm_naviframe_prev_btn_auto_pushed_set(naviframe_, EINA_TRUE);
+ elm_naviframe_content_preserve_on_pop_set(naviframe_, EINA_TRUE);
+
+ eext_object_event_callback_add(naviframe_, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
+ eext_object_event_callback_add(naviframe_, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL);
+
+ evas_object_show(naviframe_);
+
+ Evas_Object *indicator_bg_box;
+ indicator_bg_box = elm_box_add(naviframe_);
+ evas_object_size_hint_weight_set(indicator_bg_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(indicator_bg_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_part_content_set(conformant_, "elm.swallow.indicator_bg", indicator_bg_box);
+
+ elm_object_content_set(conformant_, naviframe_);
+
+ DBG("NaviframeAdd END");
+}
+
+
+void MainView::CreatePages()
+{
+ alarm_ = new AlarmView();
+ world_clock_ = new WorldClockView();
+ stop_watch_ = new StopWatchView();
+ timer_ = new TimerView();
+}
+
+
+void MainView::CreateToolbarButtons()
+{
+ elm_toolbar_item_append(toolbar_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE,
+ "edje/images/tabs/clock_tabs_ic_alarm.png"),
+ "Alarm", toolbar_it_cb, alarm_);
+ elm_toolbar_item_append(toolbar_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE,
+ "edje/images/tabs/clock_tabs_ic_worldclock.png"),
+ "World clock", toolbar_it_cb, world_clock_);
+ elm_toolbar_item_append(toolbar_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE,
+ "edje/images/tabs/clock_tabs_ic_stopwatch.png"),
+ "Stopwatch", toolbar_it_cb, stop_watch_);
+ elm_toolbar_item_append(toolbar_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE,
+ "edje/images/tabs/clock_tabs_ic_timer.png"),
+ "Timer", toolbar_it_cb, timer_);
+}
+
+void MainView::CreateToolbar()
+{
+ toolbar_ = elm_toolbar_add(naviframe_);
+ elm_object_style_set(toolbar_, "tabbar");
+ elm_toolbar_shrink_mode_set(toolbar_, ELM_TOOLBAR_SHRINK_EXPAND);
+ elm_toolbar_transverse_expanded_set(toolbar_, EINA_TRUE);
+
+ CreateToolbarButtons();
+
+ elm_toolbar_select_mode_set(toolbar_, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ evas_object_show(toolbar_);
+
+}
+
+void MainView::CreateContent()
+{
+ CreatePages();
+ CreateToolbar();
+
+ Elm_Object_Item *item = elm_naviframe_item_push(naviframe_, NULL, NULL, NULL, NULL,
+ "tabbar/icon/notitle");
+
+ elm_naviframe_item_pop_cb_set(item, naviframe_pop_cb, window_);
+
+ elm_object_item_part_content_set(item, "tabbar", toolbar_);
+ evas_object_show(alarm_->GetEvasObject());
+ elm_object_item_content_set(item, alarm_->GetEvasObject());
+
+}
+
+Evas_Object *MainView::GetEvasObject()
+{
+ return naviframe_;
+}
+
--- /dev/null
+/*
+ * 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 "Elementary.h"
+#include "View/MainView.h"
+#include "View/PageView.h"
+#include "Utils.h"
+#include "dlog.h"
+
+#include <stdlib.h>
+
+using namespace worldclock::view;
+using namespace common::utils;
+
+PageView::PageView(const char *title_label, Evas_Object *left_button, Evas_Object *right_button, Evas_Object *content) :
+ title_label_(title_label), left_button_(left_button), right_button_(right_button), content_(content)
+{
+ PushNewNaviPage();
+
+ if (title_label_)
+ elm_object_item_part_text_set(subpage_, "elm.text.title", title_label_);
+
+ if (left_button_)
+ elm_object_item_part_content_set(subpage_, "title_left_btn", left_button_);
+
+ if (right_button_)
+ elm_object_item_part_content_set(subpage_, "title_right_btn", right_button_);
+
+ if (content_)
+ elm_object_item_content_set(subpage_, content_);
+}
+
+PageView::~PageView()
+{
+ elm_naviframe_item_pop(subpage_);
+}
+
+Evas_Object *PageView::GetEvasObject()
+{
+ return content_;
+}
+
+void PageView::PushNewNaviPage()
+{
+ subpage_ = elm_naviframe_item_push(MainView::GetInstance().GetEvasObject(), NULL, NULL, NULL, NULL, NULL);
+}
--- /dev/null
+/*
+ * 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 "View/StopWatchView.h"
+#include "View/MainView.h"
+#include "Utils.h"
+
+using namespace worldclock::view;
+using namespace common::utils;
+
+StopWatchView::StopWatchView()
+{
+ /*Create content here and use main_layout_ as a parent*/
+
+ /*Temporary Code*/
+ stopwatch_ = elm_layout_add(MainView::GetInstance().GetEvasObject());
+
+ elm_layout_file_set(stopwatch_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, "edje/clock.edj"), "main");
+
+ evas_object_size_hint_align_set(stopwatch_, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(stopwatch_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ Evas_Object *label = elm_label_add(stopwatch_);
+
+ elm_object_text_set(label, "Stop Watch");
+ elm_layout_content_set(stopwatch_, "bg", label);
+}
--- /dev/null
+/*
+ * 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 "View/TimerView.h"
+#include "View/MainView.h"
+#include "Utils.h"
+
+using namespace worldclock::view;
+using namespace common::utils;
+
+
+TimerView::TimerView()
+{
+ /*Create content here and use main_layout_ as a parent*/
+
+ /*Temporary Code*/
+ timer_ = elm_layout_add(MainView::GetInstance().GetEvasObject());
+
+ elm_layout_file_set(timer_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, "edje/clock.edj"), "main");
+
+ evas_object_size_hint_align_set(timer_, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(timer_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ Evas_Object *label = elm_label_add(timer_);
+
+ elm_object_text_set(label, "Timer");
+ elm_layout_content_set(timer_, "bg", label);
+}
+
--- /dev/null
+/*
+ * 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 "View/WorldClockView.h"
+#include "View/MainView.h"
+#include "Utils.h"
+
+using namespace worldclock::view;
+using namespace common::utils;
+
+WorldClockView::WorldClockView()
+{
+ /*Create content here and use main_layout_ as a parent*/
+
+ /*Temporary Code*/
+ world_clock_ = elm_layout_add(MainView::GetInstance().GetEvasObject());
+
+ elm_layout_file_set(world_clock_, Utils::GetAppResourcePath(Utils::APP_DIR_RESOURCE, "edje/clock.edj"), "main");
+
+ evas_object_size_hint_align_set(world_clock_, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(world_clock_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ Evas_Object *label = elm_label_add(world_clock_);
+
+ elm_object_text_set(label, "World Clock");
+ elm_layout_content_set(world_clock_, "bg", label);
+}
+
+++ /dev/null
-#include "clock.h"
-
-typedef struct appdata{
- Evas_Object* win;
- Evas_Object* layout;
- Evas_Object* conform;
-} appdata_s;
-
-static void
-win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
-{
- ui_app_exit();
-}
-
-static void
-layout_back_cb(void *data, Evas_Object *obj, void *event_info)
-{
- appdata_s *ad = data;
- /* Let window go to hide state. */
- elm_win_lower(ad->win);
-}
-
-static void
-app_get_resource(const char *edj_file_in, char *edj_path_out, int edj_path_max)
-{
- char *res_path = app_get_resource_path();
- if (res_path) {
- snprintf(edj_path_out, edj_path_max, "%s%s", res_path, edj_file_in);
- free(res_path);
- }
-}
-
-static void
-create_base_gui(appdata_s *ad)
-{
- char edj_path[PATH_MAX] = {0, };
-
- /* Window */
- /* Create and initialize elm_win.
- elm_win is mandatory to manipulate window. */
- ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
- elm_win_conformant_set(ad->win, EINA_TRUE);
- elm_win_autodel_set(ad->win, EINA_TRUE);
-
- if (elm_win_wm_rotation_supported_get(ad->win)) {
- int rots[4] = { 0, 90, 180, 270 };
- elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
- }
-
- evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
-
- /* Conformant */
- /* Create and initialize elm_conformant.
- elm_conformant is mandatory for base gui to have proper size
- when indicator or virtual keypad is visible. */
- ad->conform = elm_conformant_add(ad->win);
- elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
- elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
- evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(ad->win, ad->conform);
- evas_object_show(ad->conform);
-
- /* Base Layout */
- /* Create an actual view of the base gui.
- Modify this part to change the view. */
- app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
- ad->layout = elm_layout_add(ad->win);
- elm_layout_file_set(ad->layout, edj_path, GRP_MAIN);
- evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- eext_object_event_callback_add(ad->layout, EEXT_CALLBACK_BACK, layout_back_cb, ad);
- elm_object_content_set(ad->conform, ad->layout);
-
- /* Show window after base gui is set up */
- evas_object_show(ad->win);
-
-}
-
-static bool
-app_create(void *data)
-{
- /* Hook to take necessary actions before main event loop starts
- Initialize UI resources and application's data
- If this function returns true, the main loop of application starts
- If this function returns false, the application is terminated */
- appdata_s *ad = data;
-
- create_base_gui(ad);
-
- return true;
-}
-
-static void
-app_control(app_control_h app_control, void *data)
-{
- /* Handle the launch request. */
-}
-
-static void
-app_pause(void *data)
-{
- /* Take necessary actions when application becomes invisible. */
-}
-
-static void
-app_resume(void *data)
-{
- /* Take necessary actions when application becomes visible. */
-}
-
-static void
-app_terminate(void *data)
-{
- /* Release all resources. */
-}
-
-static void
-ui_app_lang_changed(app_event_info_h event_info, void *user_data)
-{
- /*APP_EVENT_LANGUAGE_CHANGED*/
-
- int ret;
- char *language;
-
- ret = app_event_get_language(event_info, &language);
- if (ret != APP_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "app_event_get_language() failed. Err = %d.", ret);
- return;
- }
-
- if (language != NULL) {
- elm_language_set(language);
- free(language);
- }
-}
-
-static void
-ui_app_orient_changed(app_event_info_h event_info, void *user_data)
-{
- /*APP_EVENT_DEVICE_ORIENTATION_CHANGED*/
- return;
-}
-
-static void
-ui_app_region_changed(app_event_info_h event_info, void *user_data)
-{
- /*APP_EVENT_REGION_FORMAT_CHANGED*/
-}
-
-static void
-ui_app_low_battery(app_event_info_h event_info, void *user_data)
-{
- /*APP_EVENT_LOW_BATTERY*/
-}
-
-static void
-ui_app_low_memory(app_event_info_h event_info, void *user_data)
-{
- /*APP_EVENT_LOW_MEMORY*/
-}
-
-int
-main(int argc, char *argv[])
-{
- appdata_s ad = {0,};
- int ret = 0;
-
- ui_app_lifecycle_callback_s event_callback = {0,};
- app_event_handler_h handlers[5] = {NULL, };
-
- event_callback.create = app_create;
- event_callback.terminate = app_terminate;
- event_callback.pause = app_pause;
- event_callback.resume = app_resume;
- event_callback.app_control = app_control;
-
- ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
- ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
- ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
- ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
- ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
-
- ret = ui_app_main(argc, argv, &event_callback, &ad);
- if (ret != APP_ERROR_NONE) {
- dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret);
- }
-
- return ret;
-}
+++ /dev/null
-#ifndef _CLOCK_UI_VIEW_H_
-#define _CLOCK_UI_VIEW_H_
-
-#include <Elementary.h>
-
-namespace clock {
-namespace ui {
- class IView {
- public:
- virtual Evas_Object *GetEvasObject() = 0;
- };
-};
-};
-
-#endif