Initial Layout Created 85/99285/1 tizen
authorshubham kumar <shubham.srib@samsung.com>
Tue, 22 Nov 2016 09:44:05 +0000 (15:14 +0530)
committershubham kumar <shubham.srib@samsung.com>
Tue, 22 Nov 2016 09:44:42 +0000 (15:14 +0530)
Change-Id: If66d6196bdb933c04aeb1214157c405cc39ab249
Signed-off-by: shubham kumar <shubham.srib@samsung.com>
15 files changed:
Debug/.ninja_deps [new file with mode: 0644]
Debug/.ninja_log [new file with mode: 0644]
Debug/build.ninja [new file with mode: 0644]
Debug/compile_commands.json [new file with mode: 0644]
Debug/rules.ninja [new file with mode: 0644]
Debug/src/subdir.ninja [new file with mode: 0644]
Debug/target.ninja [new file with mode: 0644]
inc/Logger.h [new file with mode: 0644]
inc/MainUIController.h [new file with mode: 0644]
inc/voicerecorder.h [new file with mode: 0644]
project_def.prop [new file with mode: 0644]
shared/res/voicerecorder.png [new file with mode: 0644]
src/MainUIController.cpp [new file with mode: 0644]
src/voicerecorder.c [new file with mode: 0644]
tizen-manifest.xml [new file with mode: 0644]

diff --git a/Debug/.ninja_deps b/Debug/.ninja_deps
new file mode 100644 (file)
index 0000000..2afb5cc
Binary files /dev/null and b/Debug/.ninja_deps differ
diff --git a/Debug/.ninja_log b/Debug/.ninja_log
new file mode 100644 (file)
index 0000000..363c7ee
--- /dev/null
@@ -0,0 +1,13 @@
+# ninja log v5
+0      38      0       clean_sa        76a13415d65bd290
+39     44      0       clean   d59b6dac04fa9b5d
+0      51      0       clean_sa        76a13415d65bd290
+51     56      0       clean   d59b6dac04fa9b5d
+0      2       0       clean_sa        76a13415d65bd290
+2      4       0       clean   d59b6dac04fa9b5d
+0      2       0       clean_sa        76a13415d65bd290
+2      5       0       clean   d59b6dac04fa9b5d
+0      2       0       clean_sa        76a13415d65bd290
+2      5       0       clean   d59b6dac04fa9b5d
+0      2       0       clean_sa        76a13415d65bd290
+2      6       0       clean   d59b6dac04fa9b5d
diff --git a/Debug/build.ninja b/Debug/build.ninja
new file mode 100644 (file)
index 0000000..fb06a8e
--- /dev/null
@@ -0,0 +1,26 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+ninja_required_version = 1.5
+include rules.ninja
+include target.ninja
+
+shell = 
+builddir = ../Debug
+sareportdir = ../SA_Report
+sa_checkers = alpha,cplusplus,core,deadcode,resourceLeak,security,unix
+coveragedir = ../Coverage_Report
+
+subninja ../Debug/src/subdir.ninja
+
+targettool = clang++
+targetflags =  -L"../lib" -target i386-tizen-linux-gnueabi -gcc-toolchain /home/shubham.srib/tizen-studio/tools/i386-linux-gnueabi-gcc-4.9/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Xlinker --as-needed  -pie -lpthread --sysroot="/home/shubham.srib/tizen-studio/tools/smart-build-interface/../../platforms/tizen-3.0/mobile/rootstraps/mobile-3.0-emulator.core" -Xlinker --version-script="../.exportMap"  -Xlinker -rpath="/opt/usr/apps/org.tizen.voicerecorder/lib" -Werror-implicit-function-declaration
+
+build voicerecorder: build_target src/voicerecorder.o src/MainUIController.o 
+build ast: phony src/voicerecorder.o.ast src/MainUIController.o.ast
+build externalFnMap.txt: fast_ext_fn src/voicerecorder.o.ast src/MainUIController.o.ast
+build sa: phony $sareportdir/src/voicerecorder.o.xml $sareportdir/src/MainUIController.o.xml
+build apichecker: unusedapi_rule src/voicerecorder.o.txt src/MainUIController.o.txt
+build cov: cov_report $coveragedir/src/voicerecorder.o.cov $coveragedir/src/MainUIController.o.cov
+
diff --git a/Debug/compile_commands.json b/Debug/compile_commands.json
new file mode 100644 (file)
index 0000000..ee1cdf8
--- /dev/null
@@ -0,0 +1,8 @@
+[
+  { "directory": "../Debug",
+    "command": "clang -I\"../inc\" -O0 -g3 -Wall -c -fmessage-length=0 -I\"/home/shubham.srib/tizen-studio/tools/smart-build-interface/../../platforms/tizen-3.0/mobile/rootstraps/mobile-3.0-emulator.core/usr/include/libxml2\" $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIE --sysroot=\"$(SBI_SYSROOT)\" -Werror-implicit-function-declaration \"../src/voicerecorder.c\"",
+    "file": "../src/voicerecorder.c" },
+  { "directory": "../Debug",
+    "command": "clang++ -I\"../inc\" -O0 -g3 -Wall -c -fmessage-length=0 -target i386-tizen-linux-gnueabi -gcc-toolchain /home/shubham.srib/tizen-studio/tools/i386-linux-gnueabi-gcc-4.9/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu -fPIE --sysroot=\"/home/shubham.srib/tizen-studio/tools/smart-build-interface/../../platforms/tizen-3.0/mobile/rootstraps/mobile-3.0-emulator.core\" -I\"/home/shubham.srib/tizen-studio/tools/smart-build-interface/../../platforms/tizen-3.0/mobile/rootstraps/mobile-3.0-emulator.core/usr/include/libxml2\" \"../src/MainUIController.cpp\"",
+    "file": "../src/MainUIController.cpp" },
+]
diff --git a/Debug/rules.ninja b/Debug/rules.ninja
new file mode 100644 (file)
index 0000000..69f72ad
--- /dev/null
@@ -0,0 +1,321 @@
+#################################################################################
+# C/ CPP Compilation Rules
+#################################################################################
+
+rule build_c
+  command = $ctool -MMD -MT $out -MF $out.d $pchInc $cflags $otherflags -c $in -o $out
+  description = Building $out
+  depfile = $out.d
+  deps = gcc
+
+rule build_long_c
+  command = $ctool -MMD -MT $out -MF $out.d @$out.rsp -c $in -o $out
+  description = Building $out
+  depfile = $out.d
+  deps = gcc
+  rspfile = $out.rsp
+  rspfile_content = $pchInc $cflags
+
+rule build_cpp
+  command = $cpptool -MMD -MT $out -MF $out.d $pchInc $cppflags $otherflags -c $in -o $out
+  description = Building $out
+  depfile = $out.d
+
+rule build_long_cpp
+  command = $cpptool -MMD -MT $out -MF $out.d @$out.rsp -c $in -o $out
+  description = Building $out
+  depfile = $out.d
+  rspfile = $out.rsp
+  rspfile_content = $pchInc $cppflags
+
+#################################################################################
+# Unsupported Compilation Rules
+#################################################################################
+
+rule build_unsupported
+  command = echo "Ignoring unsupported extension"
+  description = Building $in not supported
+
+rule build_long_unsupported
+  command = echo "Ignoring unsupported extension"
+  description = Building $in not supported
+
+
+#################################################################################
+# Link Rules
+#################################################################################
+
+rule build_target
+  command = $targettool -o $out $in $userobj $libs $targetflags $otherflags
+  description = Linking $out
+
+rule build_long_target
+  command = $targettool -o $out @$out.rsp
+  description = Linking $out
+  rspfile = $out.rsp
+  rspfile_content = $in $userobj $libs $targetflags
+
+build main-build: phony all
+
+#################################################################################
+# Prebuild/ Postbuild Rules
+#################################################################################
+
+rule pre_build
+  command = $bashshell $prebuildcmd
+  description = Executing Prebuild Steps
+  pool = console
+
+rule post_build
+  command = $bashshell $postbuildcmd
+  description = Executing Postbuild Steps
+  pool = console
+
+rule build_pch
+  command = $pchtool -x c-header -MMD -MT $out -MF $out.d $pchflags -c $in -o $out
+  description = Building $out
+  depfile = $out.d
+
+rule build_long_pch
+  command = $pchtool -x c-header -MMD -MT $out -MF $out.d $pchflags -c $in -o $out
+  description = Building $out
+  depfile = $out.d
+  rspfile = $out.rsp
+  rspfile_content = $pchflags
+
+build pre-build: pre_build
+build post-build: post_build | main_build
+
+#################################################################################
+# Secondary Output  Rules
+#################################################################################
+
+rule build_edc
+  command = $edctool $edje-cc-options $out.d $edcflags $in $out
+  description = Building $out
+  depfile = $out.d
+  deps = gcc
+
+rule build_long_edc
+  command = $edctool $edje-cc-options $out.d @$out.rsp $in $out
+  description = Building $out
+  depfile = $out.d
+  deps = gcc
+  rspfile = $out.rsp
+  rspfile_content = $edcflags
+
+rule build_po
+  command = $potool -o $out $in
+  description = Building $out
+
+rule build_long_po
+  command = $potool -o $out @$out.rsp
+  description = Building $out
+  rspfile = $out.rsp
+  rspfile_content = $in
+
+
+#################################################################################
+# APIChecker Rules
+#################################################################################
+
+rule build_c_api
+  command = APIChecker $apichecker-options $in -o $out -- $pchInc $cflags -w -fretain-comments-from-system-headers
+  description = Building $out
+
+rule build_long_c_api
+  command = APIChecker $apichecker-options $in -o $out -- @$out.rsp -w -fretain-comments-from-system-headers
+  description = Building $out
+  rspfile = $out.rsp
+  rspfile_content = $pchInc $cflags
+
+rule build_cpp_api
+  command = APIChecker $apichecker-options $in -o $out -- $pchInc $cppflags -w -fretain-comments-from-system-headers
+  description = Building $out
+
+rule build_long_cpp_api
+  command = APIChecker $apichecker-options $in -o $out -- @$out.rsp -w -fretain-comments-from-system-headers
+  description = Building $out
+  rspfile = $out.rsp
+  rspfile_content = $pchInc $cppflags
+
+#################################################################################
+# APIChecker Unused Privilege Rules
+#################################################################################
+
+rule unusedapi_rule
+  command = APIChecker -o $out $in $apichecker-misc-options $apichecker-options --
+  description = Running Unused Privilege Check $out
+
+#################################################################################
+# AST Rules
+#################################################################################
+
+rule build_c_ast
+  command = $ctool -emit-ast -c $in -o $out $pchInc $cflags
+  description = Building $out
+
+rule build_long_c_ast
+  command = $ctool -emit-ast -c $in -o $out @$out.rsp
+  description = Building $out
+  rspfile = $out.rsp
+  rspfile_content = $pchInc $cflags
+
+rule build_cpp_ast
+  command = $cpptool -emit-ast -c $in -o $out $pchInc $cppflags
+  description = Building $out
+
+rule build_long_cpp_ast
+  command = $cpptool -emit-ast -c $in -o $out @$out.rsp
+  description = Building $out
+  rspfile = $out.rsp
+  rspfile_content = $pchInc $cppflags
+
+#################################################################################
+# FN Map Rules
+#################################################################################
+
+rule build_c_fn
+  command = clangFnMapGen -o $out -ast $in $in --
+  description = Building $out
+
+rule build_long_c_fn
+  command = clangFnMapGen -o $out -ast $in $in --
+  description = Building $out
+
+rule build_cpp_fn
+  command = clangFnMapGen -o $out -ast $in $in --
+  description = Building $out
+
+rule build_long_cpp_fn
+  command = clangFnMapGen -o $out -ast $in $in --
+  description = Building $out
+
+rule ext_fn
+  command = $shell cat $in > $sareportdir/externalFnMap.txt
+  description = Generating External Function Map
+  pool = console
+
+rule fast_ext_fn
+  command = clangFnMapGen -o $out $in --
+  description = Generating External Function Map
+  pool = console
+
+#################################################################################
+# SA Rules
+#################################################################################
+
+rule build_c_sa
+  command = $ctool --analyze --analyzer-no-default-checks $in -Xclang -analyzer-purge=block -Xclang -analyzer-checker=$sa_checkers -o $sareportdir $pchInc $cflags
+  description = Building $out
+
+rule build_long_c_sa
+  command = $ctool --analyze --analyzer-no-default-checks $in -Xclang -analyzer-purge=block -Xclang -analyzer-checker=$sa_checkers -o $sareportdir @$out.rsp
+  description = Building $out
+  rspfile = $out.rsp
+  rspfile_content = $pchInc $cflags
+
+rule build_cpp_sa
+  command = $cpptool --analyze --analyzer-no-default-checks $in -Xclang -analyzer-purge=block -Xclang -analyzer-checker=$sa_checkers -o $sareportdir $pchInc $cppflags
+  description = Building $out
+
+rule build_long_cpp_sa
+  command = $cpptool --analyze --analyzer-no-default-checks $in -Xclang -analyzer-purge=block -Xclang -analyzer-checker=$sa_checkers -o $sareportdir @$out.rsp
+  description = Building $out
+  rspfile = $out.rsp
+  rspfile_content = $pchInc $cppflags
+
+#################################################################################
+# FAST AST Rules
+#################################################################################
+
+rule build_c_fast_ast
+  command = $ctool -emit-ast -Xclang -fmust-emit-func-decls -c $in -o $out $pchInc $cflags
+  description = Building $out
+
+rule build_long_c_fast_ast
+  command = $ctool -emit-ast -Xclang -fmust-emit-func-decls -c $in -o $out @$out.rsp
+  description = Building $out
+  rspfile = $out.rsp
+  rspfile_content = $pchInc $cflags
+
+rule build_cpp_fast_ast
+  command = $cpptool -emit-ast -Xclang -fmust-emit-func-decls -c $in -o $out $pchInc $cppflags
+  description = Building $out
+
+rule build_long_cpp_fast_ast
+  command = $cpptool -emit-ast -Xclang -fmust-emit-func-decls -c $in -o $out @$out.rsp
+  description = Building $out
+  rspfile = $out.rsp
+  rspfile_content = $pchInc $cppflags
+
+#################################################################################
+# FAST SA Rules
+#################################################################################
+
+ast_deps_prefix = Importing AST for File:
+rule build_c_fast_sa
+  command = $ctool --analyze --analyzer-no-default-checks $in -Xanalyzer -analyzer-purge=block -Xanalyzer -analyzer-checker=$sa_checkers -Xanalyzer -emit-ast-deps -o $out
+  description = Analyzing $in
+  deps = ast
+
+rule build_long_c_fast_sa
+  command = $ctool --analyze --analyzer-no-default-checks $in -Xanalyzer -analyzer-purge=block -Xanalyzer -analyzer-checker=$sa_checkers -Xanalyzer -emit-ast-deps -o $out
+  description = Analyzing $in
+  deps = ast
+
+rule build_cpp_fast_sa
+  command = $cpptool --analyze --analyzer-no-default-checks $in -Xanalyzer -analyzer-purge=block -Xanalyzer -analyzer-checker=$sa_checkers -Xanalyzer -emit-ast-deps -o $out
+  description = Analyzing $in
+  deps = ast
+
+rule build_long_cpp_fast_sa
+  command = $cpptool --analyze --analyzer-no-default-checks $in -Xanalyzer -analyzer-purge=block -Xanalyzer -analyzer-checker=$sa_checkers -Xanalyzer -emit-ast-deps -o $out
+  description = Analyzing $in
+  deps = ast
+
+#################################################################################
+# Coverage Rules
+#################################################################################
+
+rule build_cov
+  command = llvm-cov show $binaryName -instr-profile=coverage.profdata $in -outfile=$out
+  description = Generating coverage file $out
+
+rule cov_report
+  command = llvm-cov report $binaryName -tizen-cov -instr-profile=coverage.profdata ../src/* -outfile=$coveragedir/report.txt
+  description = Generating coverage report $out
+
+
+#################################################################################
+# Clean Rules
+#################################################################################
+
+rule clean_all
+  command = ninja -t clean
+  description = Cleaning build files ...
+build clean: clean_all || clean_sa
+
+rule sa_report_clean
+  command = rm -rf $sareportdir/*.xml rm -rf $sareportdir/src
+  description = Cleaning SA Report files ..
+
+build clean_sa: sa_report_clean
+
+rule cov_report_clean
+  command = rm -rf $coveragedir/src rm -rf $coveragedir/report.txt
+  description = Cleaning Coverage Reports..
+
+build clean_cov: cov_report_clean
+
+#################################################################################
+# Compilation DB Step
+#################################################################################
+
+rule compdb_json
+  command = $shell ninja -t compdb cc cxx > $out
+  description = Generating $out
+build $builddir/compile_commands.json: compdb_json
+build compdb: phony $builddir/compile_commands.json
+
+
diff --git a/Debug/src/subdir.ninja b/Debug/src/subdir.ninja
new file mode 100644 (file)
index 0000000..2eb5a94
--- /dev/null
@@ -0,0 +1,22 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+
+ctool = clang
+cflags = -I"../inc" -O0 -g3 -Wall -c -fmessage-length=0 -I"/home/shubham.srib/tizen-studio/tools/smart-build-interface/../../platforms/tizen-3.0/mobile/rootstraps/mobile-3.0-emulator.core/usr/include/libxml2" -target i386-tizen-linux-gnueabi -gcc-toolchain /home/shubham.srib/tizen-studio/tools/i386-linux-gnueabi-gcc-4.9/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu  -fPIE --sysroot="/home/shubham.srib/tizen-studio/tools/smart-build-interface/../../platforms/tizen-3.0/mobile/rootstraps/mobile-3.0-emulator.core" -Werror-implicit-function-declaration
+
+build src/voicerecorder.o: build_c ../src/voicerecorder.c 
+build src/voicerecorder.o.ast: build_c_fast_ast ../src/voicerecorder.c 
+build $sareportdir/src/voicerecorder.o.xml: build_c_fast_sa src/voicerecorder.o.ast || externalFnMap.txt
+build src/voicerecorder.o.txt: build_c_api ../src/voicerecorder.c 
+build $coveragedir/src/voicerecorder.o.cov: build_cov ../src/voicerecorder.c 
+
+cpptool = clang++
+cppflags = -I"../inc" -O0 -g3 -Wall -c -fmessage-length=0 -target i386-tizen-linux-gnueabi -gcc-toolchain /home/shubham.srib/tizen-studio/tools/i386-linux-gnueabi-gcc-4.9/ -ccc-gcc-name i386-linux-gnueabi-g++ -march=i386 -Wno-gnu -fPIE --sysroot="/home/shubham.srib/tizen-studio/tools/smart-build-interface/../../platforms/tizen-3.0/mobile/rootstraps/mobile-3.0-emulator.core" -I"/home/shubham.srib/tizen-studio/tools/smart-build-interface/../../platforms/tizen-3.0/mobile/rootstraps/mobile-3.0-emulator.core/usr/include/libxml2"
+
+build src/MainUIController.o: build_cpp ../src/MainUIController.cpp 
+build src/MainUIController.o.ast: build_cpp_fast_ast ../src/MainUIController.cpp 
+build $sareportdir/src/MainUIController.o.xml: build_cpp_fast_sa src/MainUIController.o.ast || externalFnMap.txt
+build src/MainUIController.o.txt: build_cpp_api ../src/MainUIController.cpp 
+build $coveragedir/src/MainUIController.o.cov: build_cov ../src/MainUIController.cpp 
diff --git a/Debug/target.ninja b/Debug/target.ninja
new file mode 100644 (file)
index 0000000..9a9b5ac
--- /dev/null
@@ -0,0 +1,5 @@
+build main_build: phony voicerecorder
+build all: phony main_build
+default all
+edje-cc-options = -deps
+binaryName = voicerecorder
diff --git a/inc/Logger.h b/inc/Logger.h
new file mode 100644 (file)
index 0000000..d68326b
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Logger.h
+ *
+ *  Created on: Nov 21, 2016
+ *      Author: ch.kumar
+ */
+
+#ifndef LOGGER_H_
+#define LOGGER_H_
+
+#include <dlog.h>
+#include <dlog-internal.h>
+#include "voicerecorder.h"
+
+#define FUNC_ENTER() \
+       do {\
+               dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s(%d) >  <<<< BEGIN >>>>", __MODULE__, __func__, __LINE__);\
+       } while (0)
+
+
+#define FUNC_EXIT() \
+       do {\
+               dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s(%d) >  >>>> END <<<<", __MODULE__, __func__, __LINE__);\
+       } while (0)
+
+#define MSG_ERR(fmt, ...)\
+       do {\
+               dlog_print(DLOG_ERROR, LOG_TAG,"%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##__VA_ARGS__);\
+       } while (0)
+
+#define MSG_WARN(fmt, ...)\
+       do {\
+               dlog_print(DLOG_WARN, LOG_TAG,"%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##__VA_ARGS__);\
+       } while (0)
+
+#define MSG_DBG(fmt, ...)\
+       do {\
+               dlog_print(DLOG_DEBUG, LOG_TAG,"%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##__VA_ARGS__);\
+       } while (0)
+
+#define MSG_INFO(fmt, ...)\
+       do {\
+               dlog_print(DLOG_INFO, LOG_TAG,"%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##__VA_ARGS__);\
+       } while (0)
+
+#endif /* LOGGER_H_ */
diff --git a/inc/MainUIController.h b/inc/MainUIController.h
new file mode 100644 (file)
index 0000000..c782c0f
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * MainUIController.h
+ *
+ *  Created on: Nov 21, 2016
+ *      Author: ch.kumar
+ */
+
+#ifndef MAINUICONTROLLER_H_
+#define MAINUICONTROLLER_H_
+
+#include <glib.h>
+#include <Elementary.h>
+#include <string>
+#include "Logger.h"
+
+namespace VoiceRecorder{
+
+class MainUIController {
+public:
+       MainUIController();
+       virtual ~MainUIController();
+
+public:
+       void AppCreate();
+       void OnAppTerminate();
+
+       void OnAppResume();
+       void OnAppPause();
+       void OnAppLowMemory();
+       void OnAppLowBattery();
+
+       void AppSystemLangChanged();
+       void AppSystemTimeChanged();
+       void OnAppTriggerToForeground();
+       void OnSetupLayout();
+       Evas_Object *GetMainWindow();
+       Evas_Object *GetNaviframe();
+
+private:
+       void SetUpAppInfo();
+
+       Evas_Object* CreateWindow();
+       Evas_Object* CreateBackGround(Evas_Object* window);
+       Evas_Object* CreateMainLayout(Evas_Object* backGround);
+
+private:
+       Evas_Object* __pMainWindow;
+       Evas_Object* __pMainLayout;
+       Evas_Object* __pBackGround;
+       std::string __pAppIDStr;
+       Evas_Object* __pConformant;
+       Evas_Object* __pIndicatorBg;
+       Evas_Object* __pNaviFrame;
+};
+
+} // namespace VoiceRecorder
+
+#endif /* MAINUICONTROLLER_H_ */
diff --git a/inc/voicerecorder.h b/inc/voicerecorder.h
new file mode 100644 (file)
index 0000000..c643074
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef __voicerecorder_H__
+#define __voicerecorder_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 "VOICE_RECORDER"
+
+#if !defined(PACKAGE)
+#define PACKAGE "org.tizen.voicerecorder"
+#endif
+
+#endif /* __voicerecorder_H__ */
diff --git a/project_def.prop b/project_def.prop
new file mode 100644 (file)
index 0000000..84005d9
--- /dev/null
@@ -0,0 +1,11 @@
+APPNAME = voicerecorder
+
+type = app
+profile = mobile-3.0
+
+USER_SRCS = src/voicerecorder.c
+USER_DEFS =
+USER_INC_DIRS = inc
+USER_OBJS =
+USER_LIBS =
+USER_EDCS =
diff --git a/shared/res/voicerecorder.png b/shared/res/voicerecorder.png
new file mode 100644 (file)
index 0000000..51fa034
Binary files /dev/null and b/shared/res/voicerecorder.png differ
diff --git a/src/MainUIController.cpp b/src/MainUIController.cpp
new file mode 100644 (file)
index 0000000..3d664ac
--- /dev/null
@@ -0,0 +1,239 @@
+/*
+ * MainUIController.cpp
+ *
+ *  Created on: Nov 21, 2016
+ *      Author: ch.kumar
+ */
+
+#include <vector>
+
+#include "MainUIController.h"
+#include <app_common.h>
+#include <app_control.h>
+
+using namespace std;
+
+namespace VoiceRecorder
+{
+
+MainUIController::MainUIController()
+{
+       __pMainWindow = NULL;
+       __pMainLayout = NULL;
+       __pBackGround = NULL;
+       __pConformant = NULL;
+       __pIndicatorBg = NULL;
+       __pNaviFrame = NULL;
+}
+
+MainUIController::~MainUIController()
+{
+
+}
+
+void MainUIController::AppCreate()
+{
+       FUNC_ENTER();
+
+       SetUpAppInfo();
+
+       __pMainWindow = CreateWindow();
+
+       if (__pMainWindow == NULL) {
+               MSG_ERR("[Failed] Create Window");
+               FUNC_EXIT();
+               return;
+       }
+
+       OnSetupLayout();
+
+       FUNC_EXIT();
+       return;
+}
+
+
+void MainUIController::OnAppTerminate()
+{
+       FUNC_ENTER();
+       FUNC_EXIT();
+}
+
+void MainUIController::OnAppResume()
+{
+       FUNC_ENTER();
+       FUNC_EXIT();
+}
+
+void MainUIController::OnAppPause()
+{
+       FUNC_ENTER();
+       FUNC_EXIT();
+}
+
+void MainUIController::OnAppLowMemory()
+{
+       FUNC_ENTER();
+       FUNC_EXIT();
+}
+
+void MainUIController::OnAppLowBattery()
+{
+       FUNC_ENTER();
+       FUNC_EXIT();
+}
+
+void MainUIController::AppSystemLangChanged()
+{
+       FUNC_ENTER();
+       FUNC_EXIT();
+}
+
+void MainUIController::AppSystemTimeChanged()
+{
+       FUNC_ENTER();
+       FUNC_EXIT();
+}
+
+void MainUIController::OnAppTriggerToForeground()
+{
+       FUNC_ENTER();
+
+       if (__pMainWindow != NULL) {
+               elm_win_raise(__pMainWindow);
+       } else {
+               MSG_ERR("[Failed] Invalid Window Object");
+       }
+
+       return;
+       FUNC_EXIT();
+}
+
+
+void MainUIController::OnSetupLayout()
+{
+       FUNC_ENTER();
+
+       __pBackGround = CreateBackGround(__pMainWindow);
+       if (__pBackGround == NULL) {
+               MSG_ERR("[Failed] Create BackGround");
+               FUNC_EXIT();
+               return;
+       }
+
+       __pMainLayout = CreateMainLayout(__pBackGround);
+
+       if (__pMainLayout == NULL) {
+               MSG_ERR("[Failed] Create Main Layout");
+               FUNC_EXIT();
+               return;
+       }
+
+       __pNaviFrame = elm_naviframe_add(__pMainLayout);
+
+       if (__pNaviFrame == NULL) {
+               MSG_ERR("[Failed] Create NaviFrame");
+               FUNC_EXIT();
+               return;
+       }
+
+       elm_object_part_content_set(__pMainLayout, "elm.swallow.content", __pNaviFrame);
+
+       FUNC_EXIT();
+       return;
+}
+
+Evas_Object *MainUIController::GetMainWindow()
+{
+       return __pMainWindow;
+}
+
+Evas_Object *MainUIController::GetNaviframe()
+{
+       return __pNaviFrame;
+}
+
+void MainUIController::SetUpAppInfo()
+{
+       FUNC_ENTER();
+//     elm_theme_extension_add(NULL, <edje_file_name>);
+
+       //Set App ID String
+       char* appId = NULL;
+       app_get_id(&appId);
+
+       if (appId != NULL) {
+               __pAppIDStr = appId;
+               free(appId);
+       }
+
+       FUNC_EXIT();
+}
+
+Evas_Object* MainUIController::CreateWindow()
+{
+       FUNC_ENTER();
+       Evas_Object *pWindow = NULL;
+
+       if (pWindow == NULL) {
+               pWindow = elm_win_add(NULL, PACKAGE, ELM_WIN_BASIC);
+               if (!pWindow) {
+                       MSG_ERR("elm_win_add");
+                       return NULL;
+               }
+       }
+
+       evas_object_show(pWindow);
+       elm_win_conformant_set(pWindow, EINA_TRUE);
+
+       elm_win_title_set(pWindow, PACKAGE);
+       elm_win_autodel_set(pWindow, EINA_TRUE);
+
+       FUNC_EXIT();
+       return pWindow;
+}
+
+Evas_Object* MainUIController::CreateBackGround(Evas_Object* pWindow)
+{
+       // Conformant
+       if (__pConformant == NULL) {
+               __pConformant = elm_conformant_add(pWindow);
+               elm_object_signal_emit(__pConformant, "elm,state,virtualkeypad,disable", "");
+               elm_object_signal_emit(__pConformant, "elm,state,clipboard,disable", "");
+               elm_win_indicator_mode_set(pWindow, ELM_WIN_INDICATOR_SHOW);
+               elm_win_indicator_opacity_set(pWindow, ELM_WIN_INDICATOR_OPAQUE);
+               evas_object_size_hint_weight_set(__pConformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+               elm_win_resize_object_add(pWindow, __pConformant);
+       }
+       evas_object_show(__pConformant);
+
+       //Indicator BG
+       if (__pIndicatorBg == NULL) {
+               __pIndicatorBg = elm_bg_add(__pConformant);
+               elm_object_style_set(__pIndicatorBg, "indicator/headerbg");
+               evas_object_color_set(__pIndicatorBg, 0, 0, 0, 255);
+               elm_object_part_content_set(__pConformant, "elm.swallow.indicator_bg", __pIndicatorBg);
+       }
+       evas_object_show(__pIndicatorBg);
+
+       return __pConformant;
+}
+
+Evas_Object* MainUIController::CreateMainLayout(Evas_Object* backGround)
+{
+       Evas_Object *mainLayout = NULL;
+       mainLayout = elm_layout_add(backGround);
+
+       if (mainLayout == NULL) {
+               MSG_ERR("Failed elm_layout_add.");
+               return NULL;
+       }
+
+       elm_layout_theme_set(mainLayout, "layout", "application", "default");
+       evas_object_size_hint_weight_set(mainLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_show(mainLayout);
+
+       elm_object_content_set(backGround, mainLayout);
+       return mainLayout;
+}
+
+}
diff --git a/src/voicerecorder.c b/src/voicerecorder.c
new file mode 100644 (file)
index 0000000..4d3e1b8
--- /dev/null
@@ -0,0 +1,149 @@
+#include "voicerecorder.h"
+#include "MainUIController.h"
+
+static void
+win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       ui_app_exit();
+}
+
+static void
+win_back_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       VoiceRecorder::MainUIController* pMainController = (VoiceRecorder::MainUIController*)data;
+       elm_win_lower(pMainController->GetMainWindow());
+
+       return;
+}
+
+static bool
+app_create(void *data)
+{
+       FUNC_ENTER();
+       elm_config_preferred_engine_set("opengl_x11");
+
+       VoiceRecorder::MainUIController* pMainController = (VoiceRecorder::MainUIController*)data;
+       pMainController->AppCreate();
+
+       FUNC_EXIT();
+       return true;
+}
+
+static void
+app_control(app_control_h app_control, void *data)
+{
+       /* Handle the launch request. */
+}
+
+static void
+app_pause(void *data)
+{
+       VoiceRecorder::MainUIController* pMainController = (VoiceRecorder::MainUIController*)data;
+       pMainController->OnAppPause();
+}
+
+static void
+app_resume(void *data)
+{
+       VoiceRecorder::MainUIController* pMainController = (VoiceRecorder::MainUIController*)data;
+       pMainController->OnAppResume();
+}
+
+static void
+app_terminate(void *data)
+{
+       VoiceRecorder::MainUIController* pMainController = (VoiceRecorder::MainUIController*)data;
+       pMainController->OnAppTerminate();
+}
+
+static void
+ui_app_lang_changed(app_event_info_h event_info, void *user_data)
+{
+       /*APP_EVENT_LANGUAGE_CHANGED*/
+
+
+       VoiceRecorder::MainUIController* pMainController = (VoiceRecorder::MainUIController*)data;
+       pMainController->AppSystemLangChanged();
+
+       int ret = 0;
+       char *language = NULL;
+
+
+#if 0
+       system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &language);
+       if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "app_event_get_language() failed. Err = %d.", ret);
+               return;
+       }
+
+
+#else
+       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;
+       }
+#endif
+
+       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)
+{
+       VoiceRecorder::MainUIController* pMainController = (VoiceRecorder::MainUIController*)data;
+       pMainController->AppSystemTimeChanged();
+}
+
+static void
+ui_app_low_battery(app_event_info_h event_info, void *user_data)
+{
+       VoiceRecorder::MainUIController* pMainController = (VoiceRecorder::MainUIController*)data;
+       pMainController->OnAppLowBattery();
+}
+
+static void
+ui_app_low_memory(app_event_info_h event_info, void *user_data)
+{
+       VoiceRecorder::MainUIController* pMainController = (VoiceRecorder::MainUIController*)data;
+       pMainController->OnAppLowMemory();
+}
+
+int
+main(int argc, char *argv[])
+{
+       VoiceRecorder::MainUIController* mainController = new VoiceRecorder::MainUIController();
+       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, mainController);
+       ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, mainController);
+       ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, mainController);
+       ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, mainController);
+       ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, mainController);
+
+       ret = ui_app_main(argc, argv, &event_callback, mainController);
+       if (ret != APP_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "app_main() is failed. err = %d", ret);
+       }
+
+       return ret;
+}
diff --git a/tizen-manifest.xml b/tizen-manifest.xml
new file mode 100644 (file)
index 0000000..aa49c8b
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.voicerecorder" version="1.0.0">
+    <profile name="mobile"/>
+    <ui-application appid="org.tizen.voicerecorder" exec="voicerecorder" launch_mode="single" multiple="false" nodisplay="false" taskmanage="true" type="capp">
+        <label>voicerecorder</label>
+        <icon>voicerecorder.png</icon>
+    </ui-application>
+    <privileges>
+        <privilege>http://tizen.org/privilege/mediastorage</privilege>
+        <privilege>http://tizen.org/privilege/recorder</privilege>
+        <privilege>http://tizen.org/privilege/externalstorage</privilege>
+        <privilege>http://tizen.org/privilege/content.write</privilege>
+    </privileges>
+</manifest>