Refine source codes 68/208768/1
authorKiseok Chang <kiso.chang@samsung.com>
Fri, 28 Jun 2019 06:39:38 +0000 (15:39 +0900)
committerKiseok Chang <kiso.chang@samsung.com>
Fri, 28 Jun 2019 06:43:52 +0000 (15:43 +0900)
- change position and name of source codes
- fix some ui bugs

Change-Id: Id2775db14ea3419b70d7ad15d10ed73105e584a9
Signed-off-by: Kiseok Chang <kiso.chang@samsung.com>
48 files changed:
include/settings/sc_aboutdevice.h [new file with mode: 0644]
include/settings/sc_airplane.h [new file with mode: 0644]
include/settings/sc_apps.h [new file with mode: 0644]
include/settings/sc_battery.h [new file with mode: 0644]
include/settings/sc_bluetooth.h [new file with mode: 0644]
include/settings/sc_datausage.h [new file with mode: 0644]
include/settings/sc_datetime.h [new file with mode: 0644]
include/settings/sc_display.h [new file with mode: 0644]
include/settings/sc_sound.h [new file with mode: 0644]
include/settings/sc_storage.h [new file with mode: 0644]
include/settings/sc_wifi.h [new file with mode: 0644]
src/CMakeLists.txt
src/common/GenSettingMenu.cpp
src/common/GenSettingMenu.h
src/common/SCDebug.h [moved from src/common/sc-debug.h with 84% similarity]
src/common/SCReportMenu.cpp [moved from src/report/sc_report.cpp with 66% similarity]
src/common/SCReportMenu.h [new file with mode: 0644]
src/common/SCUtil.cpp [moved from src/settings/sc_common.cpp with 58% similarity]
src/common/SCUtil.h [new file with mode: 0644]
src/common/SettingCommand.cpp
src/common/SettingCommand.h
src/common/SettingMenu.cpp
src/common/SettingMenu.h
src/main.cpp [moved from src/sc_main.cpp with 67% similarity]
src/report/sc_report.h [deleted file]
src/settings/sc_aboutdevice.cpp
src/settings/sc_aboutdevice.h [deleted file]
src/settings/sc_airplane.cpp
src/settings/sc_airplane.h [deleted file]
src/settings/sc_apps.cpp
src/settings/sc_apps.h [deleted file]
src/settings/sc_battery.cpp
src/settings/sc_battery.h [deleted file]
src/settings/sc_bluetooth.cpp
src/settings/sc_bluetooth.h [deleted file]
src/settings/sc_common.h [deleted file]
src/settings/sc_datausage.cpp
src/settings/sc_datausage.h [deleted file]
src/settings/sc_datetime.cpp
src/settings/sc_datetime.h [deleted file]
src/settings/sc_display.cpp
src/settings/sc_display.h [deleted file]
src/settings/sc_sound.cpp
src/settings/sc_sound.h [deleted file]
src/settings/sc_storage.cpp
src/settings/sc_storage.h [deleted file]
src/settings/sc_wifi.cpp
src/settings/sc_wifi.h [deleted file]

diff --git a/include/settings/sc_aboutdevice.h b/include/settings/sc_aboutdevice.h
new file mode 100644 (file)
index 0000000..7ba647b
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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 __SC_ABOUTDEVICE_H_
+#define __SC_ABOUTDEVICE_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_ad(GenSettingMenu *menu);
+
+#endif         /* __SC_ABOUTDEVICE_H_ */
diff --git a/include/settings/sc_airplane.h b/include/settings/sc_airplane.h
new file mode 100644 (file)
index 0000000..2fd7bf3
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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 __SC_AIRPLANE_H_
+#define __SC_AIRPLANE_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_am(GenSettingMenu *menu);
+
+#endif         /* __SC_AIRPLANE_H_ */
diff --git a/include/settings/sc_apps.h b/include/settings/sc_apps.h
new file mode 100644 (file)
index 0000000..884eec4
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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 __SC_APPS_H_
+#define __SC_APPS_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_apps(GenSettingMenu *menu);
+
+#endif         /* __SC_APPS_H_ */
diff --git a/include/settings/sc_battery.h b/include/settings/sc_battery.h
new file mode 100644 (file)
index 0000000..4ef0790
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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 __SC_BATTERY_H_
+#define __SC_BATTERY_H_
+
+#include <GenSettingMenu.h>
+
+MENURUN_ERROR menufunc_ba(int argc, char *argv[], GenSettingMenu *menu);
+
+#endif         /* __SC_BATTERY_H_ */
diff --git a/include/settings/sc_bluetooth.h b/include/settings/sc_bluetooth.h
new file mode 100644 (file)
index 0000000..c3e6461
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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 __SC_BLUETOOTH_H_
+#define __SC_BLUETOOTH_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_bt(GenSettingMenu *menu);
+
+#endif         /* __SC_BLUETOOTH_H_ */
diff --git a/include/settings/sc_datausage.h b/include/settings/sc_datausage.h
new file mode 100644 (file)
index 0000000..7f0bf85
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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 __SC_DATEUSAGE_H_
+#define __SC_DATEUSAGE_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_du(GenSettingMenu *menu);
+
+#endif         /* __SC_DATEUSAGE_H_ */
diff --git a/include/settings/sc_datetime.h b/include/settings/sc_datetime.h
new file mode 100644 (file)
index 0000000..3aeda19
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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 __SC_DATETIME_H_
+#define __SC_DATETIME_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_dt(GenSettingMenu *menu);
+
+#endif         /* __SC_DATETIME_H_ */
diff --git a/include/settings/sc_display.h b/include/settings/sc_display.h
new file mode 100644 (file)
index 0000000..240930c
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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 __SC_DISPLAY_H_
+#define __SC_DISPLAY_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_di(GenSettingMenu *menu);
+
+#endif         /* __SC_DISPLAY_H_ */
diff --git a/include/settings/sc_sound.h b/include/settings/sc_sound.h
new file mode 100644 (file)
index 0000000..92acaea
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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 __SC_SOUND_H_
+#define __SC_SOUND_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_so(GenSettingMenu *menu);
+
+#endif         /* __SC_SOUND_H_ */
diff --git a/include/settings/sc_storage.h b/include/settings/sc_storage.h
new file mode 100644 (file)
index 0000000..4a24f04
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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 __SC_STORAGE_H_
+#define __SC_STORAGE_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_st(GenSettingMenu *menu);
+
+#endif         /* __SC_STORAGE_H_ */
diff --git a/include/settings/sc_wifi.h b/include/settings/sc_wifi.h
new file mode 100644 (file)
index 0000000..9fa4da9
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 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 __SC_WIFI_H_
+#define __SC_WIFI_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_wf(GenSettingMenu *menu);
+
+#endif         /* __SC_WIFI_H_ */
index 6cc2631..7f1f633 100644 (file)
@@ -1,4 +1,4 @@
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/settings)
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs_main REQUIRED
@@ -60,11 +60,12 @@ ADD_DEFINITIONS("-DXP_UNIX")
 SET(BIN_NAME "setting-cmd")
 
 ADD_EXECUTABLE(${BIN_NAME}
-       ./sc_main.cpp
+       ./main.cpp
        common/SettingCommand.cpp
        common/SettingMenu.cpp
        common/GenSettingMenu.cpp
-       settings/sc_common.cpp
+       common/SCUtil.cpp
+       common/SCReportMenu.cpp
        settings/sc_aboutdevice.cpp
        settings/sc_sound.cpp
        settings/sc_display.cpp
@@ -76,7 +77,6 @@ ADD_EXECUTABLE(${BIN_NAME}
        settings/sc_storage.cpp
        settings/sc_battery.cpp
        settings/sc_datausage.cpp
-       report/sc_report.cpp
        )
 
 # dmalloc
index 0e167a2..80119f2 100644 (file)
@@ -1,36 +1,52 @@
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
-#include <sc-debug.h>
+#include <SCDebug.h>
 
 using namespace std;
 
 
-GenSettingMenu::GenSettingMenu(const char * optstr, const char * namestr, MenuGetString getstringptr, MenuFunc funcptr, MenuPreCreate precreateptr)
-       :strOpt(optstr), strName(namestr), ptrGetString(getstringptr), ptrFunc(funcptr), ptrPrecreate(precreateptr)
+GenSettingMenu::GenSettingMenu(const char * optstr, const char * namestr, SCFuncValue valuefunc, SCFuncExecute executefunc, SCFuncPrecreate precreatefunc)
+       :strOpt(optstr), strName(namestr), funcValue(valuefunc), funcExecute(executefunc), funcPrecreate(precreatefunc)
 {
 }
 
 bool GenSettingMenu::create()
 {
        eprintf("entered in GenSettingMenu::create() of %s\n", name());
-       if(ptrPrecreate)
-               (*ptrPrecreate)(this);
+       if(funcPrecreate)
+               (*funcPrecreate)(this);
 
        return SettingMenu::create();
 }
 
 
-MENURUN_ERROR GenSettingMenu::func(string &title, int argc, char *argv[])
+MENURUN_ERROR GenSettingMenu::execute(string &title, int argc, char *argv[])
 {
-       eprintf("func() of %s, %p, %p, %p\n", name(), ptrFunc, ptrPrecreate, ptrGetString);
-       if (ptrFunc) {
+       eprintf("execute() of %s, %p, %p, %p\n", name(), funcExecute, funcPrecreate, funcValue);
+       if (funcExecute) {
                printf("%s\n\n", title.c_str());
-               return (*ptrFunc)(argc, argv, this);
+               return (*funcExecute)(argc, argv, this);
        }
-       else if (ptrGetString) {
+       else if (funcValue) {
                printf("%s\n\n", title.c_str());
 
                string resultstr;
-               MENURUN_ERROR ret = (*ptrGetString)(resultstr, argc, argv, this);
+               MENURUN_ERROR ret = (*funcValue)(resultstr, argc, argv, this);
                if (ret != MENURUN_ERR_NONE)
                        resultstr = "[Failed]";
                printf("    %s : %s\n", name(), resultstr.c_str());
@@ -40,20 +56,20 @@ MENURUN_ERROR GenSettingMenu::func(string &title, int argc, char *argv[])
        return MENURUN_ERR_NONE;
 }
 
-MENURUN_ERROR GenSettingMenu::getstring(string &resultstr, int argc, char *argv[])
+MENURUN_ERROR GenSettingMenu::value(string &resultstr, int argc, char *argv[])
 {
-       eprintf("getstring() of %s, %p, %p, %p\n", name(), ptrFunc, ptrPrecreate, ptrGetString);
-       if (ptrGetString) {
-               return (*ptrGetString)(resultstr, argc, argv, this);
+       eprintf("value() of %s, %p, %p, %p\n", name(), funcExecute, funcPrecreate, funcValue);
+       if (funcValue) {
+               return (*funcValue)(resultstr, argc, argv, this);
        }
 
-       return SettingMenu::getstring(resultstr, argc, argv);
+       return SettingMenu::value(resultstr, argc, argv);
 }
 
 
 bool GenSettingMenu::isImplemented()
 {
-       if (ptrFunc == nullptr && ptrGetString == nullptr && subMenus.empty()) return false;
+       if (funcExecute == nullptr && funcValue == nullptr && subMenus.empty()) return false;
        return true;
 }
 
@@ -67,14 +83,14 @@ const char *GenSettingMenu::name()
        return strName;
 }
 
-void GenSettingMenu::addSubmenu(const char * optstr, const char * namestr, MenuGetString getstringptr, MenuFunc funcptr, MenuPreCreate precreateptr)
+void GenSettingMenu::addSubmenu(const char * optstr, const char * namestr, SCFuncValue valuefunc, SCFuncExecute executefunc, SCFuncPrecreate precreatefunc)
 {
-       subMenus.push_back(new GenSettingMenu(optstr, namestr, getstringptr, funcptr, precreateptr));
+       subMenus.push_back(new GenSettingMenu(optstr, namestr, valuefunc, executefunc, precreatefunc));
 }
 
 void GenSettingMenu::addSubmenu(MenuItem item)
 {
-       addSubmenu(item.optstr, item.namestr, item.getstringptr, item.funcptr, item.precreateptr);
+       addSubmenu(item.optstr, item.namestr, item.valuefunc, item.executefunc, item.precreatefunc);
 }
 
 void GenSettingMenu::addSubmenus(MenuItem *items, int count)
index 40637db..7901eb4 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2019 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 __GENSETTINGMENU_H_
 #define __GENSETTINGMENU_H_
 
 
 class GenSettingMenu;
 
-typedef  MENURUN_ERROR(*MenuGetString)(std::string &resultstr, int argc, char *argv[], GenSettingMenu *menu);
-typedef  MENURUN_ERROR (*MenuFunc)(int argc, char *argv[], GenSettingMenu *menu);
-typedef  void (*MenuPreCreate)(GenSettingMenu  *menu);
+typedef  MENURUN_ERROR (*SCFuncValue)(std::string &resultstr, int argc, char *argv[], GenSettingMenu *menu);
+typedef  MENURUN_ERROR (*SCFuncExecute)(int argc, char *argv[], GenSettingMenu *menu);
+typedef  void (*SCFuncPrecreate)(GenSettingMenu  *menu);
 
 typedef struct {
        const char *optstr;
        const char *namestr;
 
-       MenuGetString getstringptr;
-       MenuFunc funcptr;
-       MenuPreCreate precreateptr;
+       SCFuncValue valuefunc;
+       SCFuncExecute executefunc;
+       SCFuncPrecreate precreatefunc;
 } MenuItem;
 
 class GenSettingMenu : public SettingMenu
 {
 public:
-       GenSettingMenu(const char * optstr, const char * namestr, MenuGetString getstringptr = nullptr, MenuFunc funcptr = nullptr, MenuPreCreate precreateptr = nullptr);
+       GenSettingMenu(const char * optstr, const char * namestr, SCFuncValue valuefunc = nullptr, SCFuncExecute executefunc = nullptr, SCFuncPrecreate precreatefunc = nullptr);
 
 public:
        bool create();
 
-       MENURUN_ERROR func(std::string &title, int argc, char *argv[]);
-       MENURUN_ERROR getstring(std::string &resultstr, int argc, char *argv[]);
+       MENURUN_ERROR execute(std::string &title, int argc, char *argv[]);
+       MENURUN_ERROR value(std::string &resultstr, int argc, char *argv[]);
        bool isImplemented();
 
        const char *opt();
        const char *name();
 
-       void addSubmenu(const char * optstr, const char * namestr, MenuGetString getstringptr = nullptr, MenuFunc funcptr = nullptr, MenuPreCreate precreateptr = nullptr);
+       void addSubmenu(const char * optstr, const char * namestr, SCFuncValue valuefunc = nullptr, SCFuncExecute executefunc = nullptr, SCFuncPrecreate precreatefunc = nullptr);
        void addSubmenu(MenuItem item);
        void addSubmenus(MenuItem *items, int count);
 
@@ -44,9 +60,9 @@ private:
        const char * strOpt;
        const char * strName;
 
-       MenuGetString ptrGetString;
-       MenuFunc ptrFunc;
-       MenuPreCreate ptrPrecreate;
+       SCFuncValue funcValue;
+       SCFuncExecute funcExecute;
+       SCFuncPrecreate funcPrecreate;
 };
 
 #endif //__GENSETTINGMENU_H_
similarity index 84%
rename from src/common/sc-debug.h
rename to src/common/SCDebug.h
index 29b075f..cb44069 100644 (file)
@@ -1,26 +1,21 @@
-/*
- * setting
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * Contact: MyoungJune Park <mj2004.park@samsung.com>
- *
- * 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 _SETTINGCMD_DEBUG_H_
-#define _SETTINGCMD_DEBUG_H_
+ /*
+  * Copyright (c) 2019 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 __SCDEBUG_H_
+#define __SCDEBUG_H_
 
 #include <glib.h>
 
 #define eprintf(...) do {} while (0)
 #endif
 
-#endif /* _SETTINGCMD_DEBUG_H_ */
+#endif /* __SCDEBUG_H_ */
similarity index 66%
rename from src/report/sc_report.cpp
rename to src/common/SCReportMenu.cpp
index b8117d4..c619b60 100644 (file)
-#include "sc_report.h"
+/*
+ * Copyright (c) 2019 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 "SCReportMenu.h"
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
 
-#include <sc-debug.h>
-#include <stdio.h>
+using namespace std;
 
-#include <string>
 
-using namespace std;
+SCReportMenu::SCReportMenu()
+{
+}
+
+bool SCReportMenu::create()
+{
+
+}
+
+
+#define MAX_TEMPLATEBUFFER     30000
+static char reportTemplate[MAX_TEMPLATEBUFFER];
+
+MENURUN_ERROR SCReportMenu::execute(std::string &title, int argc, char *argv[])
+{
+       if (argc < 1) {
+               eprintf("argc : %d\n", argc);
+               printf("Please give a path of file with report template\n   > setting-cmd report [ template file ]\n\n");
+               return MENURUN_ERR_NORMAL;
+       }
+
+       FILE *pfile = fopen(argv[0], "rb");
+       if (pfile == NULL) {
+               eprintf("fopen failed : %s !\n", argv[0]);
+               return MENURUN_ERR_NORMAL;
+       }
+       fseek(pfile, 0, SEEK_END);
+       int fsize = ftell(pfile);
+       fseek(pfile, 0, SEEK_SET);
+
+       eprintf("fsize : %d\n", fsize);
+
+       int numread = fread(reportTemplate, sizeof(char), fsize, pfile);
+       if (numread != fsize) {
+               eprintf("numread != fsize : %d\n", numread);
+               fclose(pfile);
+               return MENURUN_ERR_NORMAL;
+       }
+       fclose(pfile);
+
+       printf("\n\n*************** Template Start *******************\n");
+       printf(reportTemplate);
+       printf("\n*************** Template End   *******************\n\n");
+
+       string reportString;
+       MENURUN_ERROR result = getReportString(reportString, reportTemplate, argc, argv);
+       if (result == MENURUN_ERR_NONE) {
+               printf("\n\n*************** Report Start *******************\n");
+               printf(reportString.c_str());
+               printf("\n*************** Report End   *******************\n\n");
+               return MENURUN_ERR_NONE;
+       }
+       return MENURUN_ERR_NORMAL;
+}
 
-void MainMemu_Precreate(GenSettingMenu *menu);
 
 
-string getString(string& commandstr, GenSettingMenu *rootmenu, int argc, char *argv[])
+string SCReportMenu::getString(string& commandstr, SettingMenu *rootmenu, int argc, char *argv[])
 {
        string title("report");
        SettingCommand settingcommands(title, commandstr);
 
        string resultstr;
-       MENURUN_ERROR result = rootmenu->get(resultstr, settingcommands, argc, argv);
+       MENURUN_ERROR result = rootmenu->query(resultstr, settingcommands, argc, argv);
        if (result != MENURUN_ERR_NONE) {
                resultstr = "[Failed]";
        }
        return resultstr;
 }
 
-
-bool isSeperator(char ch)
+bool SCReportMenu::isSeperator(char ch)
 {
        if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n' || ch == '\0')
                return true;
        return false;
 }
 
-MENURUN_ERROR getReportString(string &reportStr, const string &templateStr, int argc, char *argv[])
+extern void MainMemu_Precreate(GenSettingMenu *menu);
+
+MENURUN_ERROR SCReportMenu::getReportString(string &reportStr, const string &templateStr, int argc, char *argv[])
 {
        GenSettingMenu mainMenu("setting-cmd", "Main Menu", nullptr, nullptr, MainMemu_Precreate);
 
@@ -80,49 +150,6 @@ MENURUN_ERROR getReportString(string &reportStr, const string &templateStr, int
 }
 
 
-#define MAX_TEMPLATEBUFFER     30000
-//char reportTemplate[MAX_TEMPLATEBUFFER] = "[About Device]\r\n\r\n   - Name : @ad/name\r\n   - Model: @ad/mn\r\n   - Tizen version: @ad/ver\n";
-char reportTemplate[MAX_TEMPLATEBUFFER];
-
-
-MENURUN_ERROR menufunc_report(int argc, char *argv[], GenSettingMenu *menu)
-{
-       if (argc < 1) {
-               eprintf("argc : %d\n", argc);
-               printf("Please give a path of file with report template\n   > setting-cmd report [ template file ]\n\n");
-               return MENURUN_ERR_NORMAL;
-       }
-
-       FILE *pfile  = fopen(argv[0],"rb");
-       if (pfile == NULL) {
-               eprintf("fopen failed : %s !\n", argv[0]);
-               return MENURUN_ERR_NORMAL;
-       }
-       fseek(pfile, 0, SEEK_END);
-       int fsize = ftell(pfile);
-       fseek(pfile, 0, SEEK_SET);
-
-       eprintf("fsize : %d\n", fsize);
 
-       int numread = fread(reportTemplate, sizeof(char), fsize, pfile);
-       if (numread != fsize) {
-               eprintf("numread != fsize : %d\n", numread);
-               fclose(pfile);
-               return MENURUN_ERR_NORMAL;
-       }
-       fclose(pfile);
 
-       printf("\n\n*************** Template Start *******************\n");
-       printf(reportTemplate);
-       printf("\n*************** Template End   *******************\n\n");
 
-       string reportString;
-       MENURUN_ERROR result = getReportString(reportString, reportTemplate, argc, argv);
-       if (result == MENURUN_ERR_NONE) {
-               printf("\n\n*************** Report Start *******************\n");
-               printf(reportString.c_str());
-               printf("\n*************** Report End   *******************\n\n");
-               return MENURUN_ERR_NONE;
-       }
-       return MENURUN_ERR_NORMAL;
-}
diff --git a/src/common/SCReportMenu.h b/src/common/SCReportMenu.h
new file mode 100644 (file)
index 0000000..ee63284
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2019 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 __SCREPORTMENU_H_
+#define __SCREPORTMENU_H_
+
+#include <SettingMenu.h>
+
+#include <string>
+
+class SCReportMenu : public SettingMenu
+{
+public:
+       SCReportMenu();
+
+public:
+       bool create();
+
+       MENURUN_ERROR execute(std::string &title, int argc, char *argv[]);
+
+       bool isImplemented() { return true; }
+       const char *opt() { return "report"; }
+       const char *name() { return "Report"; }
+
+private:
+       std::string getString(std::string& commandstr, SettingMenu *rootmenu, int argc, char *argv[]);
+       bool isSeperator(char ch);
+       MENURUN_ERROR getReportString(std::string &reportStr, const std::string &templateStr, int argc, char *argv[]);
+};
+
+#endif //__SCREPORTMENU_H_
similarity index 58%
rename from src/settings/sc_common.cpp
rename to src/common/SCUtil.cpp
index 5e30396..c006b0b 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_common.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <SCUtil.h>
+#include <SCDebug.h>
 
 #include <stdio.h>
 #include <string.h>
diff --git a/src/common/SCUtil.h b/src/common/SCUtil.h
new file mode 100644 (file)
index 0000000..4e6dc67
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2019 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 __SCUTIL_H_
+#define __SCUTIL_H_
+
+enum profile {
+       MOBILE_PROFILE = 1,
+       WEARABLE_PROFILE,
+       TV_PROFILE,
+       COMMON_PROFILE,
+       MAX_PROFILE
+};
+
+
+int getProfile();
+#endif /* __SCUTIL_H_ */
index 8e1f983..e34fd92 100644 (file)
@@ -1,5 +1,21 @@
+/*
+ * Copyright (c) 2019 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 "SettingCommand.h"
-#include <sc-debug.h>
+#include <SCDebug.h>
 
 #include <sstream>
 
index d15bb3a..84cb723 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2019 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 __SETTINGCOMMAND_H__
 #define __SETTINGCOMMAND_H__
 
@@ -26,5 +42,4 @@ private:
        int curPos;
 };
 
-
 #endif // __SETTINGCOMMAND_H__
index 0a9ce1b..d04d6b4 100644 (file)
@@ -1,5 +1,21 @@
+/*
+ * Copyright (c) 2019 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 "SettingMenu.h"
-#include <sc-debug.h>
+#include <SCDebug.h>
 
 #include <algorithm>
 #include <list>
@@ -32,15 +48,15 @@ void SettingMenu::destroy()
        }
 }
 
-MENURUN_ERROR SettingMenu::func(string &title, int argc, char *argv[])
+MENURUN_ERROR SettingMenu::execute(string &title, int argc, char *argv[])
 {
-       eprintf("func() of %s\n", name());
+       eprintf("execute() of %s\n", name());
        return MENURUN_ERR_NONE;
 }
 
-MENURUN_ERROR SettingMenu::getstring(string &resultstr, int argc, char *argv[])
+MENURUN_ERROR SettingMenu::value(string &resultstr, int argc, char *argv[])
 {
-       eprintf("getstring() of %s\n", name());
+       eprintf("value() of %s\n", name());
        resultstr = string("[N/A]");
        return MENURUN_ERR_NONE;
 }
@@ -50,7 +66,7 @@ MENURUN_ERROR SettingMenu::run(SettingCommand &settingcmds, string &title, int a
        eprintf("run() of %s\n", name());
 
        title += string(" - ") + name();
-       MENURUN_ERROR result = func(title, argc, argv);
+       MENURUN_ERROR result = execute(title, argc, argv);
        if (result != MENURUN_ERR_NONE) return result;
 
        if (subMenus.empty()) return MENURUN_ERR_NONE;
@@ -81,12 +97,12 @@ MENURUN_ERROR SettingMenu::run(SettingCommand &settingcmds, string &title, int a
        return result;
 }
 
-MENURUN_ERROR SettingMenu::get(string &resultstr, SettingCommand &settingcmds, int argc, char *argv[])
+MENURUN_ERROR SettingMenu::query(string &resultstr, SettingCommand &settingcmds, int argc, char *argv[])
 {
-       eprintf("get() of %s\n", name());
+       eprintf("query() of %s\n", name());
 
        if (subMenus.empty()) {
-               MENURUN_ERROR result = getstring(resultstr, argc, argv);
+               MENURUN_ERROR result = value(resultstr, argc, argv);
                if (result != MENURUN_ERR_NONE) return result;
                return MENURUN_ERR_NONE;
        }
@@ -109,7 +125,7 @@ MENURUN_ERROR SettingMenu::get(string &resultstr, SettingCommand &settingcmds, i
 
        eprintf("command %s is founded.\n", curcmd.c_str());
 
-       MENURUN_ERROR result = ((*it)->get)(resultstr, settingcmds, argc, argv);
+       MENURUN_ERROR result = ((*it)->query)(resultstr, settingcmds, argc, argv);
        settingcmds.prev();
        return result;
 }
@@ -117,8 +133,13 @@ MENURUN_ERROR SettingMenu::get(string &resultstr, SettingCommand &settingcmds, i
 void SettingMenu::printUsage(SettingCommand &settingcmds)
 {
        const char *notimplemented_str = "[Not implemented]";
-
-       printf("Usage : %s/[opt]\n", settingcmds.curCommands().c_str());
+       
+       if (settingcmds.count() <= 1) {
+               printf("Usage : %s [opt]\n", settingcmds.curCommands().c_str());
+       }
+       else {
+               printf("Usage : %s/[opt]\n", settingcmds.curCommands().c_str());
+       }
        printf("\t[opt] : [Functionality]\n");
 
        for_each(subMenus.begin(), subMenus.end(),
index a5925f5..7821ec8 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2019 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 __SETTINGMENU_H_
 #define __SETTINGMENU_H_
 
@@ -24,11 +40,11 @@ public:
        virtual bool create();
        virtual void destroy();
 
-       virtual MENURUN_ERROR func(std::string &title, int argc, char *argv[]);
-       virtual MENURUN_ERROR getstring(std::string &resultstr, int argc, char *argv[]);
-
        virtual MENURUN_ERROR run(SettingCommand &settingcmds, std::string &title, int argc, char *argv[]);
-       virtual MENURUN_ERROR get(std::string &resultstr, SettingCommand &settingcmds, int argc, char *argv[]);
+       virtual MENURUN_ERROR query(std::string &resultstr, SettingCommand &settingcmds, int argc, char *argv[]);
+
+       virtual MENURUN_ERROR execute(std::string &title, int argc, char *argv[]);
+       virtual MENURUN_ERROR value(std::string &resultstr, int argc, char *argv[]);
 
        virtual bool isImplemented() { return false; }
 
similarity index 67%
rename from src/sc_main.cpp
rename to src/main.cpp
index 2778ed0..227e64d 100644 (file)
@@ -1,23 +1,42 @@
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
-#include "settings/sc_common.h"
-#include "settings/sc_aboutdevice.h"
-#include "settings/sc_sound.h"
-#include "settings/sc_display.h"
-#include "settings/sc_apps.h"
-#include "settings/sc_datetime.h"
-#include "settings/sc_wifi.h"
-#include "settings/sc_bluetooth.h"
-#include "settings/sc_airplane.h"
-#include "settings/sc_storage.h"
-#include "settings/sc_datausage.h"
-#include "settings/sc_battery.h"
-#include "report/sc_report.h"
+#include <SCDebug.h>
+
+
+#include <SCUtil.h>
+
+#include <settings/sc_aboutdevice.h>
+#include <settings/sc_sound.h>
+#include <settings/sc_display.h>
+#include <settings/sc_apps.h>
+#include <settings/sc_datetime.h>
+#include <settings/sc_wifi.h>
+#include <settings/sc_bluetooth.h>
+#include <settings/sc_airplane.h>
+#include <settings/sc_storage.h>
+#include <settings/sc_datausage.h>
+#include <settings/sc_battery.h>
+
+#include <SCReportMenu.h>
 
 #include <stdio.h>
 #include <string>
-
+#include <sstream>
 
 using namespace std;
 
@@ -81,24 +100,26 @@ void MainMemu_Precreate(GenSettingMenu *menu)
 
 int main(int argc, char *argv[])
 {
-       GenSettingMenu mainMenu("setting-cmd", "Main Menu", nullptr, nullptr, MainMemu_Precreate);
+       string execstr(argv[0]);
+       string token = execstr;
+       stringstream ss_exec(execstr);
+       while (getline(ss_exec, token, '/')) {}
+       execstr = token;
 
-       mainMenu.addSubmenu("report", "Report", nullptr, menufunc_report);
+       string commandstr;
+       if (argc >= 2)
+               commandstr = argv[1];
+       SettingCommand settingcommands(execstr, commandstr);
+
+       GenSettingMenu mainMenu(execstr.c_str(), "Main Menu", nullptr, nullptr, MainMemu_Precreate);
+       mainMenu.subMenus.push_back(new SCReportMenu());
 
        if (!mainMenu.create()) {
                eprintf("Main Menu failed to create\n");
                return 0;
        }
 
-       string execstr(argv[0]);
-       string commandstr;
-       if (argc >= 2)
-               commandstr = argv[1];
-
-       SettingCommand settingcommands(execstr, commandstr);
-
        string title = "\nSeting Command\n";
-
        MENURUN_ERROR result = mainMenu.run(settingcommands, title, argc - 2, &argv[2]);
        if (result != MENURUN_ERR_NONE) {
                SettingMenu::printError(result);
diff --git a/src/report/sc_report.h b/src/report/sc_report.h
deleted file mode 100644 (file)
index 88acc41..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_REPORT_H_
-#define __SC_REPORT_H_
-
-#include <GenSettingMenu.h>
-
-MENURUN_ERROR menufunc_report(int argc, char *argv[], GenSettingMenu *menu);
-
-#endif         /* __SC_REPORT_H_ */
index 7c44e8c..dbcfb58 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_aboutdevice.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
+#include <SCDebug.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <telephony.h>
 #include <bluetooth.h>
 #include <wifi-manager.h>
-
 #include <storage.h>
 
-#include <sc-debug.h>
-
 
 using namespace std;
 
diff --git a/src/settings/sc_aboutdevice.h b/src/settings/sc_aboutdevice.h
deleted file mode 100644 (file)
index 9a9beee..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_ABOUTDEVICE_H_
-#define __SC_ABOUTDEVICE_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_ad(GenSettingMenu *menu);
-
-#endif         /* __SC_ABOUTDEVICE_H_ */
index 135040b..88c88f2 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_airplane.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
+#include <SCDebug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/settings/sc_airplane.h b/src/settings/sc_airplane.h
deleted file mode 100644 (file)
index 79bc868..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_AIRPLANE_H_
-#define __SC_AIRPLANE_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_am(GenSettingMenu *menu);
-
-#endif         /* __SC_AIRPLANE_H_ */
index 03726a1..ca33d8e 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_apps.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
+#include <SCDebug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/settings/sc_apps.h b/src/settings/sc_apps.h
deleted file mode 100644 (file)
index 06d2da6..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_APPS_H_
-#define __SC_APPS_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_apps(GenSettingMenu *menu);
-
-#endif         /* __SC_APPS_H_ */
index 541052c..6e9f566 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_battery.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
+#include <SCDebug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/settings/sc_battery.h b/src/settings/sc_battery.h
deleted file mode 100644 (file)
index 1ce805f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_BATTERY_H_
-#define __SC_BATTERY_H_
-
-#include <GenSettingMenu.h>
-
-MENURUN_ERROR menufunc_ba(int argc, char *argv[], GenSettingMenu *menu);
-
-#endif         /* __SC_BATTERY_H_ */
index 21c7c2c..08df796 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_bluetooth.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
+#include <SCDebug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/settings/sc_bluetooth.h b/src/settings/sc_bluetooth.h
deleted file mode 100644 (file)
index 9e4511f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_BLUETOOTH_H_
-#define __SC_BLUETOOTH_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_bt(GenSettingMenu *menu);
-
-#endif         /* __SC_BLUETOOTH_H_ */
diff --git a/src/settings/sc_common.h b/src/settings/sc_common.h
deleted file mode 100644 (file)
index f4f71a2..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __SC_COMMON_H_
-#define __SC_COMMON_H_
-
-enum profile {
-       MOBILE_PROFILE = 1,
-       WEARABLE_PROFILE,
-       TV_PROFILE,
-       COMMON_PROFILE,
-       MAX_PROFILE
-};
-
-
-int getProfile();
-#endif /* __SC_COMMON_H_ */
index 87d7c57..4f0cda6 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_datausage.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
+#include <SCDebug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -11,7 +27,6 @@
 #include <app_preference.h>
 #include <stc_internal.h>
 
-#include <sc-debug.h>
 
 #define TH_POSTFIX_IDX 0
 
@@ -927,7 +942,7 @@ static MENURUN_ERROR menufunc_du_smwl(int argc, char *argv[], GenSettingMenu *me
        char *subscriber_id[2]; /* Subscriber ID numbers of sim cards*/
 
 
-       for (int i = 0; i < tel_h_list.count ; i++) {
+       for (int i = 0; i < (int)tel_h_list.count ; i++) {
                ret = telephony_sim_get_state(tel_h_list.handle[i], &sim_state);
                if (TELEPHONY_ERROR_NONE == ret &&
                                TELEPHONY_SIM_STATE_AVAILABLE == sim_state) {
@@ -1030,7 +1045,7 @@ static MENURUN_ERROR menufunc_du_mo(int argc, char *argv[], GenSettingMenu *menu
        char *subscriber_id[2]; /* Subscriber ID numbers of sim cards*/
 
 
-       for (int i = 0; i < tel_h_list.count; i++) {
+       for (int i = 0; i < (int)tel_h_list.count; i++) {
                ret = telephony_sim_get_state(tel_h_list.handle[i], &sim_state);
                if (TELEPHONY_ERROR_NONE == ret &&
                        TELEPHONY_SIM_STATE_AVAILABLE == sim_state) {
diff --git a/src/settings/sc_datausage.h b/src/settings/sc_datausage.h
deleted file mode 100644 (file)
index a55116a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_DATEUSAGE_H_
-#define __SC_DATEUSAGE_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_du(GenSettingMenu *menu);
-
-#endif         /* __SC_DATEUSAGE_H_ */
index b4155df..a640ae8 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_datetime.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
+#include <SCDebug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/settings/sc_datetime.h b/src/settings/sc_datetime.h
deleted file mode 100644 (file)
index c994622..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_DATETIME_H_
-#define __SC_DATETIME_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_dt(GenSettingMenu *menu);
-
-#endif         /* __SC_DATETIME_H_ */
index 020700f..345e51c 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_display.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
+#include <SCDebug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/settings/sc_display.h b/src/settings/sc_display.h
deleted file mode 100644 (file)
index 1db9c46..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_DISPLAY_H_
-#define __SC_DISPLAY_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_di(GenSettingMenu *menu);
-
-#endif         /* __SC_DISPLAY_H_ */
index 2f37aa2..474fc0d 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_sound.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
+#include <SCDebug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/settings/sc_sound.h b/src/settings/sc_sound.h
deleted file mode 100644 (file)
index 0d662df..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_SOUND_H_
-#define __SC_SOUND_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_so(GenSettingMenu *menu);
-
-#endif         /* __SC_SOUND_H_ */
index 6b0cd58..7bb3823 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_wifi.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
+#include <SCDebug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/settings/sc_storage.h b/src/settings/sc_storage.h
deleted file mode 100644 (file)
index ef74034..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_STORAGE_H_
-#define __SC_STORAGE_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_st(GenSettingMenu *menu);
-
-#endif         /* __SC_STORAGE_H_ */
index f2e6b85..25f8127 100644 (file)
@@ -1,5 +1,21 @@
-#include "sc_wifi.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 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 <GenSettingMenu.h>
+#include <SCDebug.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/settings/sc_wifi.h b/src/settings/sc_wifi.h
deleted file mode 100644 (file)
index c2790eb..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __SC_WIFI_H_
-#define __SC_WIFI_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_wf(GenSettingMenu *menu);
-
-#endif         /* __SC_WIFI_H_ */