--- /dev/null
+# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT("myfiles" C)
+
+# Checks for all given modules
+INCLUDE(FindPkgConfig)
+pkg_check_modules(PKGS REQUIRED
+ elementary
+ capi-appfw-application
+ app-utils
+ pkgmgr-info
+ capi-appfw-package-manager
+ )
+
+IF(NOT DEFINED PACKAGE_NAME)
+ SET(PACKAGE_NAME "org.tizen.${PROJECT_NAME}")
+ENDIF(NOT DEFINED PACKAGE_NAME)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+IF(NOT DEFINED BINDIR)
+ SET(BINDIR "${PREFIX}/bin")
+ENDIF(NOT DEFINED BINDIR)
+IF(NOT DEFINED RESDIR)
+ SET(RESDIR "${PREFIX}/res")
+ENDIF(NOT DEFINED RESDIR)
+IF(NOT DEFINED EDJEDIR)
+ SET(EDJEDIR "${PREFIX}/res/edje")
+ENDIF(NOT DEFINED EDJEDIR)
+IF(NOT DEFINED IMGDIR)
+ SET(IMGDIR "${PREFIX}/res/images")
+ENDIF(NOT DEFINED IMGDIR)
+IF(NOT DEFINED PACKAGEDIR)
+ SET(PACKAGEDIR "${TZ_SYS_RO_SHARE}/packages")
+ENDIF(NOT DEFINED PACKAGEDIR)
+
+SET(SRCS
+ src/main.c
+ src/utils.c
+ src/view/view_base.c
+ )
+
+SET(TARGET_EDJ "${PROJECT_NAME}.edj")
+SET(THEME_EDJ "${PROJECT_NAME}-theme.edj")
+
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE_NAME}\"")
+ADD_DEFINITIONS("-DEDJEDIR=\"${EDJEDIR}\"")
+ADD_DEFINITIONS("-DEDJEFILE=\"${EDJEDIR}/${TARGET_EDJ}\"")
+ADD_DEFINITIONS("-DTHEMEFILE=\"${EDJEDIR}/${THEME_EDJ}\"")
+ADD_DEFINITIONS("-DIMGDIR=\"${IMGDIR}\"")
+
+FOREACH(flag ${PKGS_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror")
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS})
+
+CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION ${PACKAGEDIR})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION
+ ${IMGDIR})
+
+ADD_SUBDIRECTORY(res)
--- /dev/null
+Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
+
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __AIR_MYFILES_DEFINE_H__
+#define __AIR_MYFILES_DEFINE_H__
+
+/* View ID */
+#define VIEW_BASE "VIEW_BASE"
+#define VIEW_ACTION_MENU "VIEW_ACTION_MENU"
+
+/* Layout ID */
+#define LAYOUT_MYAPPS "LAYOUT_MYAPPS"
+
+/* Group for EDC */
+#define GRP_VIEW_BASE "grp.view.base"
+#define GRP_VIEW_ACTION_MENU "grp.view.action.menu"
+#define GRP_ACTION_MENU_CONTENTS "grp.action.menu.contents"
+#define GRP_ACTION_MENU_NO_FAVORITE "grp.action.menu.no.favorite"
+
+/* Part for EDC */
+#define PART_TOP_TITLE "part.top.title"
+#define PART_MENU "part.menu"
+#define PART_SORT "part.sort"
+#define PART_GENGRID "part.gengrid"
+#define PART_APP_COUNT "part.app.count"
+#define PART_CONTENTS_TEXT "part.contents.text"
+#define PART_THUMB_BG "part.thumb.bg"
+#define PART_THUMB_ICON "part.thumb.icon"
+#define PART_TEXT_BG "part.text.bg"
+#define PART_THUMB_TEXT "part.thumb.text"
+#define PART_THUMB_TEXT_BROWSER "part.thumb.text.browser"
+#define PART_TOP_BTN "part.top.button"
+#define PART_FAVORITE "part.favorite"
+#define PART_NO_FAVORITE "part.no.favorite"
+#define PART_BUTTON1 "button1"
+#define PART_BUTTON2 "button2"
+#define PART_POPUP_TITLE "title,text"
+#define PART_ACTION_MENU "part.action.menu"
+
+/* State for EDC */
+#define STATE_BROWSER "is_browser"
+#define STATE_NOT_BROWSER "not_browser"
+
+/* Style */
+#define STYLE_MENU_BTN "style.menu.button"
+#define STYLE_SORT_BTN "style.sort.button"
+#define STYLE_OPTION_BTN "style.option.button"
+#define STYLE_CTXPOPUP "style.ctxpopup"
+#define STYLE_MYAPP "style.myapp"
+#define STYLE_FAVORITE "style.favorite"
+#define STYLE_LIVETV_BTN "style.livetv.button"
+#define STYLE_MORE_BTN "style.more.button"
+#define STYLE_ACTION_MENU_FAV_BTN "style.action.menu.favorite.button"
+#define STYLE_ACTION_MENU_UNINSTALL_BTN "style.action.menu.uninstall.button"
+#define STYLE_TOAST "style.toast"
+
+/* Signal */
+#define SIG_FOCUSED "focused"
+#define SIG_UNFOCUSED "unfocused"
+#define SIG_SELECTED "selected"
+#define SIG_UNSELECTED "unselected"
+#define SIG_SOURCE_EDC "edc"
+#define SIG_FAVORITE "favorite"
+#define SIG_UNFAVORITE "unfavorite"
+#define SIG_VISIBLE "visible"
+#define SIG_INVISIBLE "invisible"
+#define SIG_DISABLE "elm,state,disabled"
+#define SIG_TOGGLE "toggle"
+#define SIG_TIMEOUT "timeout"
+#define SIG_SHOW "show"
+#define SIG_HIDE "hide"
+#define SIG_HIDE_DONE "hide.done"
+
+/* Signal Source */
+#define SRC_MYAPPS "source.myapps"
+#define SRC_MENU_BTN "source.menu.btn"
+#define SRC_SORT_BTN "source.sort.btn"
+#define SRC_LIVETV_BTN "source.livetv.btn"
+#define SRC_ACTION_BTN "source.action.btn"
+#define SRC_FAVORITE_ICON "source.favorite.icon"
+
+/* Font */
+#define FONT_TIZENSANS_REGULAR "BreezeSans"
+#define FONT_TIZENSANS_LIGHT "BreezeSans:style=Light"
+
+/* String */
+#define STR_APPS "Apps"
+#define STR_MYAPPS "My Apps"
+#define STR_APPSTORE "App Store"
+#define STR_RECENT "Recent"
+#define STR_A_TO_Z "A-Z"
+#define STR_Z_TO_A "Z-A"
+#define STR_NULL "(NULL)"
+#define STR_NO_CONTENTS "No Contents"
+#define STR_BROWSER "Web Browser"
+#define STR_NOT_SUPPORTED "Not Supported"
+#define STR_LIVETV "Live TV"
+#define STR_FAVORITE "Favorite"
+#define STR_UNINSTALL "Uninstall"
+#define STR_NO_FAVORITE "No favorite contents"
+#define STR_ADD_FAVORITE "Added to your favorite."
+#define STR_REMOVE_FAVORITE "Removed from your favorite."
+#define STR_WGT "wgt"
+#define STR_TPK "tpk"
+#define STR_OK "Ok"
+#define STR_CANCEL "Cancel"
+#define STR_MORE "More"
+
+/* Count */
+#define MENU_COUNT 1
+#define SORT_COUNT 3
+#define ACTION_MENU_COUNT 2
+
+/* Size */
+#define SIZE_MYAPPS_GRID_WIDTH (212 + 26)
+#define SIZE_MYAPPS_GRID_HEIGHT (294 + 26)
+#define SIZE_FAVORITE_GRID_WIDTH (210 + 20)
+#define SIZE_FAVORITE_GRID_HEIGHT (292 + 20)
+#define SIZE_STR 1024
+#define SIZE_MENU_BOX_PAD_H (40 + 40)
+#define SIZE_MENU_BOX_PAD_V 0
+#define SIZE_ICON_MAX 100
+#define SIZE_ACTION_TABLE_BORDER 0
+#define SIZE_COL_MAX 4
+#define SIZE_TOAST_TIMEOUT 5.0
+#define SIZE_FAVORITE_COL_MAX 2
+#define SIZE_SCROLLER_STEP 312
+
+/* Image */
+#define DEFAULT_APP_ICON_PNG IMGDIR"/ico_default.png"
+#define FAVORITE_ICON_PNG "ic_thumbnail_favorite_01.png"
+#define BROWSER_ICON_PNG IMGDIR"/ic_apps_web.png"
+#define ARROW_ICON_UP_PNG "btn_option_arrow_nor.png"
+#define ARROW_ICON_UP_FOC_PNG "btn_option_arrow_foc_up.png"
+#define ARROW_ICON_SEL_PNG "btn_option_arrow_sel.png"
+#define ARROW_ICON_DISABLE_PNG "btn_option_arrow_dis.png"
+#define ACTION_FAV_NOR_PNG "btn_menu_favorite_nor.png"
+#define ACTION_FAV_FOC_PNG "btn_menu_favorite_foc.png"
+#define ACTION_FAV_SEL_PNG "btn_menu_favorite_sel.png"
+#define ACTION_FAV_DIS_PNG "btn_menu_favorite_dis.png"
+#define ACTION_UNFAV_NOR_PNG "btn_menu_remote_favorite_nor.png"
+#define ACTION_UNFAV_FOC_PNG "btn_menu_remote_favorite_foc.png"
+#define ACTION_UNINSTALL_NOR_PNG "btn_menu_del_nor.png"
+#define ACTION_UNINSTALL_FOC_PNG "btn_menu_del_foc.png"
+#define ACTION_UNINSTALL_SEL_PNG "btn_menu_del_sel.png"
+#define ACTION_UNINSTALL_DIS_PNG "btn_menu_del_dis.png"
+
+/* Transition */
+#define TRANSITION_FOCUS DECELERATE 0.20
+#define TRANSITION_CLICK DECELERATE 0
+#define TRANSITION_MENU_SHOW SIN 0.45
+#define TRANSITION_MENU_HIDE DECEL 0.3
+
+/* Color */
+#define COLOR_ITEM_FOCUS 0 119 246 255
+
+#endif /* __AIR_MYFILES_DEFINE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __AIR_MYFILES_UTILS_H__
+#define __AIR_MYFILES_UTILS_H__
+
+#include <inputmgr.h>
+
+Evas_Object *utils_add_window(const char *name);
+Evas_Object *utils_add_layout(Evas_Object *parent, const char *group,
+ Eina_Bool win_resize);
+Evas_Object *utils_add_box(Evas_Object *parent, const char *part,
+ Eina_Bool horizontal, Evas_Coord padding_h,
+ Evas_Coord padding_v);
+Evas_Object *utils_add_button(Evas_Object *parent, const char *part,
+ const char *text, const char *style);
+Evas_Object *utils_add_gengrid(Evas_Object *parent, Eina_Bool horizontal,
+ int width, int height);
+Evas_Object *utils_add_table(Evas_Object *table, const char *part,
+ int padding_x, int padding_y);
+Evas_Object *utils_add_notify(Evas_Object *parent, const char *text,
+ const char *noti_style, const char *label_style,
+ int timeout);
+Evas_Object *utils_add_popup(Evas_Object *parent, const char *style,
+ const char *popup_title, const char *popup_text);
+Evas_Object *utils_add_ctxpopup(Evas_Object *parent, int opt_size, int *opt_id,
+ const char **opt_text, input_handler *opt_handler, void *data);
+Evas_Object *utils_add_scroller(Evas_Object *parent, const char *part,
+ Evas_Object *content);
+bool utils_launch_app(const char *appid, const char *key, const char *value);
+bool utils_uninstall_app(const char *pkgid, const char *pkgtype);
+
+#endif /* __AIR_MYFILES_UTILS_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __AIR_MYFILES_VIEW_H__
+#define __AIR_MYFILES_VIEW_H__
+
+view_class *view_base_get_vclass(void);
+view_class *view_action_menu_get_vclass(void);
+
+enum update_type {
+ UPDATE_ID = 0,
+ UPDATE_FAVORITE,
+ UPDATE_GRID,
+ UPDATE_SHOW_TOAST,
+};
+
+#endif /* __AIR_MYFILES_VIEW_H__ */
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="@PACKAGE_NAME@" version="@VERSION@" install-location="internal-only">
+ <label>My files</label>
+ <author email="kyuho.jo@samsung.com" href="www.samsung.com">Kyuho Jo</author>
+ <author email="rimi.kim@samsung.com" href="www.samsung.com">Hyerim Kim</author>
+ <description>My files application</description>
+ <ui-application appid="@PACKAGE_NAME@" exec="@BINDIR@/@PROJECT_NAME@" nodisplay="true" multiple="false" type="capp" taskmanage="true">
+ <label>My files</label>
+ <icon>@DESKTOP_ICON@</icon>
+ </ui-application>
+ <privileges>
+ <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+ </privileges>
+</manifest>
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+Name: org.tizen.myfiles
+Summary: Myfiles application for Tizen TV based on AirFlex UX
+Version: 0.1
+Release: 1
+Group: Applications/Core Applications
+License: Apache-2.0
+Source0: %{name}-%{version}.tar.gz
+Source1: %{name}.manifest
+
+BuildRequires: cmake
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(app-utils)
+BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires: pkgconfig(capi-appfw-package-manager)
+BuildRequires: pkgconfig(libtzplatform-config)
+
+%define _appdir %{TZ_SYS_RO_APP}/%{name}
+%define _bindir %{_appdir}/bin
+%define _resdir %{_appdir}/res
+%define _edjedir %{_resdir}/edje
+%define _imgdir %{_resdir}/images
+%define _pkgdir %{_datadir}/packages
+
+%description
+myfiles is an application for managing files in local storage or removable storage
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+
+%build
+cmake \
+ -DCMAKE_INSTALL_PREFIX=%{_appdir} \
+ -DPACKAGE_NAME=%{name} \
+ -DVERSION=%{version} \
+ -DBINDIR=%{_bindir} \
+ -DRESDIR=%{_resdir} \
+ -DEDJEDIR=%{_edjedir} \
+ -DIMGDIR=%{_imgdir} \
+ -DPACKAGEDIR=%{_pkgdir}
+
+make %{?jobs:-j%jobs}
+
+# Copies the executables to appropriate location
+%install
+%make_install
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_bindir}/*
+%{_resdir}/*
+%{_pkgdir}/%{name}.xml
--- /dev/null
+ADD_CUSTOM_TARGET(${TARGET_EDJ}
+ COMMAND edje_cc -id images
+ ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.edc
+ ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_EDJ}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} ${TARGET_EDJ})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_EDJ} DESTINATION ${EDJEDIR})
+
+ADD_CUSTOM_TARGET(${THEME_EDJ}
+ COMMAND edje_cc -id images -sd sounds
+ ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-theme.edc
+ ${CMAKE_CURRENT_BINARY_DIR}/${THEME_EDJ}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}-theme.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} ${THEME_EDJ})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${THEME_EDJ} DESTINATION ${EDJEDIR})
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "../include/define.h"
+
+collections {
+ base_scale, 2.0;
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "../include/define.h"
+
+collections {
+ base_scale, 2.0;
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <app.h>
+#include <Elementary.h>
+#include <viewmgr.h>
+#include <app_debug.h>
+#include <app_define.h>
+
+#include "define.h"
+#include "utils.h"
+#include "view.h"
+
+SET_TAG(PACKAGE);
+
+struct _appdata {
+ Evas_Object *win;
+ const char *name;
+};
+
+static bool _create(void *data)
+{
+ struct _appdata *ad;
+ Evas_Object *win;
+
+ if (!data) {
+ _ERR("Get data failed.");
+ return false;
+ }
+ ad = data;
+
+ elm_app_base_scale_set(APP_BASE_SCALE);
+
+ elm_theme_overlay_add(NULL, THEMEFILE);
+
+ win = utils_add_window(ad->name);
+ if (!win) {
+ _ERR("Add window failed.");
+ return false;
+ }
+
+ if (!viewmgr_create(win)) {
+ _ERR("Create viewmgr failed.");
+ goto err;
+ }
+
+ if (!viewmgr_add_view(view_base_get_vclass(), NULL)) {
+ _ERR("Add view failed.");
+ goto err;
+ }
+
+ ad->win = win;
+
+ return true;
+
+err:
+ evas_object_del(win);
+
+ return false;
+}
+
+static void _terminate(void *data)
+{
+ struct _appdata *ad;
+
+ if (!data) {
+ _ERR("Get data failed.");
+ return;
+ }
+ ad = data;
+
+ if (!viewmgr_remove_view(VIEW_BASE))
+ _ERR("Remove view failed.");
+
+ if (!viewmgr_remove_view(VIEW_ACTION_MENU))
+ _ERR("Remove view failed.");
+
+ if (!viewmgr_destroy())
+ _ERR("Destroy viewmgr failed.");
+
+ if (ad->win) {
+ evas_object_del(ad->win);
+ ad->win = NULL;
+ }
+}
+
+static void _app_control(app_control_h control, void *data)
+{
+ struct _appdata *ad;
+
+ if (!data) {
+ _ERR("Get data failed.");
+ return;
+ }
+ ad = data;
+
+ if (ad->win)
+ elm_win_activate(ad->win);
+
+ if (!viewmgr_push_view(VIEW_BASE))
+ _ERR("Push view failed.");
+}
+
+static void _pause(void *data)
+{
+ view_state state;
+
+ state = viewmgr_get_view_state(VIEW_ACTION_MENU);
+ if (state == VIEW_STATE_VISIBLE)
+ viewmgr_hide_view(VIEW_ACTION_MENU);
+
+ inputmgr_enable(EINA_FALSE);
+}
+
+static void _resume(void *data)
+{
+ inputmgr_enable(EINA_TRUE);
+}
+
+int main(int argc, char *argv[])
+{
+ struct _appdata ad;
+ ui_app_lifecycle_callback_s cbs = {
+ .create = _create,
+ .terminate = _terminate,
+ .app_control = _app_control,
+ .pause = _pause,
+ .resume = _resume,
+ };
+
+ memset(&ad, 0x00, sizeof(ad));
+ ad.name = PACKAGE;
+
+ return ui_app_main(argc, argv, &cbs, &ad);
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <Elementary.h>
+#include <app_control.h>
+#include <app_debug.h>
+#include <package_manager.h>
+
+#include "define.h"
+#include "utils.h"
+
+Evas_Object *utils_add_window(const char *name)
+{
+ Evas_Object *win;
+
+ if (!name) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ win = elm_win_add(NULL, name, ELM_WIN_BASIC);
+ if (!win) {
+ _ERR("elm_win_add failed.");
+ return NULL;
+ }
+
+ elm_win_title_set(win, name);
+ elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
+
+ evas_object_show(win);
+
+ return win;
+}
+
+Evas_Object *utils_add_layout(Evas_Object *parent, const char *group,
+ Eina_Bool win_resize)
+{
+ Evas_Object *layout;
+
+ if (!parent || !group) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ layout = elm_layout_add(parent);
+ if (!layout) {
+ _ERR("elm_layout_add failed.");
+ return NULL;
+ }
+
+ elm_layout_file_set(layout, EDJEFILE, group);
+
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+
+ if (win_resize)
+ elm_win_resize_object_add(parent, layout);
+
+ return layout;
+}
+
+Evas_Object *utils_add_box(Evas_Object *parent, const char *part,
+ Eina_Bool horizontal, Evas_Coord padding_h,
+ Evas_Coord padding_v)
+{
+ Evas_Object *box;
+
+ if (!parent) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ box = elm_box_add(parent);
+ if (!box) {
+ _ERR("elm_box_add failed.");
+ return NULL;
+ }
+
+ elm_box_horizontal_set(box, horizontal);
+ elm_box_padding_set(box, ELM_SCALE_SIZE(padding_h),
+ ELM_SCALE_SIZE(padding_v));
+
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ if (part)
+ elm_object_part_content_set(parent, part, box);
+ else
+ elm_object_content_set(parent, box);
+
+ evas_object_show(box);
+
+ return box;
+}
+
+Evas_Object *utils_add_button(Evas_Object *parent, const char *part,
+ const char *text, const char *style)
+{
+ Evas_Object *btn;
+
+ if (!parent) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ btn = elm_button_add(parent);
+ if (!btn) {
+ _ERR("elm_button_add failed.");
+ return NULL;
+ }
+
+ if (part)
+ elm_object_part_content_set(parent, part, btn);
+ if (text)
+ elm_object_text_set(btn, text);
+ if (style)
+ elm_object_style_set(btn, style);
+
+ evas_object_show(btn);
+
+ return btn;
+}
+
+Evas_Object *utils_add_gengrid(Evas_Object *parent, Eina_Bool horizontal,
+ int width, int height)
+{
+ Evas_Object *grid;
+
+ if (!parent) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ grid = elm_gengrid_add(parent);
+ if (!grid) {
+ _ERR("elm_gengrid_add failed.");
+ return NULL;
+ }
+
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ elm_gengrid_multi_select_set(grid, EINA_FALSE);
+ elm_gengrid_horizontal_set(grid, horizontal);
+ elm_gengrid_align_set(grid, 0.0, 0.0);
+ elm_gengrid_select_mode_set(grid, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ elm_gengrid_item_size_set(grid, ELM_SCALE_SIZE(width),
+ ELM_SCALE_SIZE(height));
+ elm_scroller_policy_set(grid, ELM_SCROLLER_POLICY_OFF,
+ ELM_SCROLLER_POLICY_OFF);
+
+ return grid;
+}
+
+Evas_Object *utils_add_table(Evas_Object *parent, const char *part,
+ int padding_x, int padding_y)
+{
+ Evas_Object *table;
+
+ if (!parent) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ table = elm_table_add(parent);
+ if (!table) {
+ _ERR("elm_table_add failed.");
+ return NULL;
+ }
+
+ elm_table_padding_set(table, ELM_SCALE_SIZE(padding_x),
+ ELM_SCALE_SIZE(padding_y));
+ evas_object_show(table);
+
+ if (part)
+ elm_object_part_content_set(parent, part, table);
+
+ return table;
+}
+
+static void _notify_timeout_cb(void *data, Evas_Object *obj, void *ei)
+{
+ if (!obj)
+ return;
+
+ evas_object_del(obj);
+}
+
+Evas_Object *utils_add_notify(Evas_Object *parent, const char *text,
+ const char *noti_style, const char *label_style, int timeout)
+{
+ Evas_Object *notify, *lbl;
+
+ if (!parent) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ notify = elm_notify_add(parent);
+ if (!notify) {
+ _ERR("elm_notify_add failed.");
+ return NULL;
+ }
+
+ evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_notify_align_set(notify, 0.0, 1.0);
+ elm_notify_timeout_set(notify, timeout);
+
+ if (noti_style)
+ elm_object_style_set(notify, noti_style);
+
+ lbl = elm_label_add(notify);
+ if (!lbl) {
+ _ERR("elm_label_add failed.");
+ evas_object_del(notify);
+ return NULL;
+ }
+
+ elm_object_content_set(notify, lbl);
+ evas_object_show(lbl);
+
+ if (label_style)
+ elm_object_style_set(lbl, label_style);
+
+ if (text)
+ elm_object_text_set(lbl, text);
+
+ evas_object_smart_callback_add(notify, SIG_TIMEOUT,
+ _notify_timeout_cb, NULL);
+ evas_object_show(notify);
+
+ return notify;
+}
+
+Evas_Object *utils_add_popup(Evas_Object *parent, const char *style,
+ const char *popup_title, const char *popup_text)
+{
+ Evas_Object *popup;
+
+ if (!parent) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ popup = elm_popup_add(parent);
+ if (!popup) {
+ _ERR("elm_popup_add failed.");
+ return NULL;
+ }
+
+ elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
+ evas_object_show(popup);
+
+ if (style)
+ elm_object_style_set(popup, style);
+
+ if (popup_title)
+ elm_object_part_text_set(popup, PART_POPUP_TITLE, popup_title);
+
+ if (popup_text)
+ elm_object_text_set(popup, popup_text);
+
+ return popup;
+}
+
+Evas_Object *utils_add_ctxpopup(Evas_Object *parent, int opt_size, int *opt_id,
+ const char **opt_text, input_handler *opt_handler, void *data)
+{
+ Evas_Object *ctxpopup, *box, *btn = NULL, *firstbtn = NULL;
+ int i;
+
+ if (!parent || opt_size <= 0 || !opt_text) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ ctxpopup = elm_ctxpopup_add(parent);
+ if (!ctxpopup) {
+ _ERR("elm_ctxpopup_add failed.");
+ return NULL;
+ }
+
+ box = utils_add_box(ctxpopup, NULL, EINA_FALSE, 0, 0);
+ if (!box) {
+ _ERR("Add box failed.");
+ evas_object_del(ctxpopup);
+ return NULL;
+ }
+
+ elm_object_style_set(ctxpopup, STYLE_CTXPOPUP);
+ elm_object_content_set(ctxpopup, box);
+ elm_ctxpopup_direction_priority_set(ctxpopup, 0, 0, 0, 0);
+ evas_object_show(ctxpopup);
+
+ for (i = 0; i < opt_size; i++) {
+ btn = utils_add_button(box, NULL, opt_text[i],
+ STYLE_OPTION_BTN);
+ if (!btn) {
+ _ERR("Add button failed.");
+ evas_object_del(ctxpopup);
+ return NULL;
+ }
+
+ elm_box_pack_end(box, btn);
+
+ if (opt_handler)
+ inputmgr_add_callback(btn, opt_id[i],
+ opt_handler, data);
+
+ if (i == 0)
+ firstbtn = btn;
+ }
+
+ elm_object_focus_next_object_set(firstbtn, btn, ELM_FOCUS_UP);
+ elm_object_focus_next_object_set(btn, firstbtn, ELM_FOCUS_DOWN);
+
+ return ctxpopup;
+}
+
+Evas_Object *utils_add_scroller(Evas_Object *parent, const char *part,
+ Evas_Object *content)
+{
+ Evas_Object *scr;
+
+ if (!parent) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ scr = elm_scroller_add(parent);
+ if (!scr) {
+ _ERR("elm_scroller_add failed.");
+ return NULL;
+ }
+
+ elm_scroller_policy_set(scr,
+ ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+ elm_object_focus_allow_set(scr, EINA_FALSE);
+
+ if (part)
+ elm_object_part_content_set(parent, part, scr);
+
+ if (content)
+ elm_object_content_set(scr, content);
+
+ return scr;
+}
+
+bool utils_launch_app(const char *appid, const char *key, const char *value)
+{
+ app_control_h app_ctrl;
+ int r;
+
+ if (!appid) {
+ _ERR("Invalid argument.");
+ return false;
+ }
+
+ r = app_control_create(&app_ctrl);
+ if (r != APP_CONTROL_ERROR_NONE) {
+ _ERR("App control handle create failed.");
+ return false;
+ }
+
+ r = app_control_set_operation(app_ctrl, APP_CONTROL_OPERATION_DEFAULT);
+ if (r != APP_CONTROL_ERROR_NONE) {
+ _ERR("App control set operation failed.");
+ app_control_destroy(app_ctrl);
+ return false;
+ }
+
+ if (key && value) {
+ r = app_control_add_extra_data(app_ctrl, key, value);
+ if (r != APP_CONTROL_ERROR_NONE) {
+ _ERR("App control set extra data failed.");
+ app_control_destroy(app_ctrl);
+ return false;
+ }
+ }
+
+ r = app_control_set_app_id(app_ctrl, appid);
+ if (r != APP_CONTROL_ERROR_NONE) {
+ _ERR("App control set app id failed.");
+ app_control_destroy(app_ctrl);
+ return false;
+ }
+
+ r = app_control_send_launch_request(app_ctrl, NULL, NULL);
+ if (r != APP_CONTROL_ERROR_NONE) {
+ _ERR("App control send launch request failed.");
+ app_control_destroy(app_ctrl);
+ return false;
+ }
+
+ app_control_destroy(app_ctrl);
+
+ return true;
+}
+
+bool utils_uninstall_app(const char *pkgid, const char *pkgtype)
+{
+ package_manager_request_h request_h;
+ int r, id;
+
+ if (!pkgid || !pkgtype) {
+ _ERR("Invalid argument.");
+ return false;
+ }
+
+ r = package_manager_request_create(&request_h);
+ if (r != PACKAGE_MANAGER_ERROR_NONE) {
+ _ERR("Request handle create failed.");
+ return false;
+ }
+
+ r = package_manager_request_set_type(request_h, pkgtype);
+ if (r != PACKAGE_MANAGER_ERROR_NONE) {
+ _ERR("Set pkg type failed.");
+ package_manager_request_destroy(request_h);
+ return false;
+ }
+
+ r = package_manager_request_set_mode(request_h,
+ PACKAGE_MANAGER_REQUEST_MODE_QUIET);
+ if (r != PACKAGE_MANAGER_ERROR_NONE) {
+ _ERR("Set request mode failed.");
+ package_manager_request_destroy(request_h);
+ return false;
+ }
+
+ r = package_manager_request_uninstall(request_h, pkgid, &id);
+ if (r != PACKAGE_MANAGER_ERROR_NONE) {
+ _ERR("Uninstall failed.");
+ package_manager_request_destroy(request_h);
+ return false;
+ }
+
+ package_manager_request_destroy(request_h);
+
+ return true;
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <app.h>
+#include <Elementary.h>
+#include <viewmgr.h>
+#include <inputmgr.h>
+#include <app_contents.h>
+#include <app_define.h>
+#include <app_debug.h>
+
+#include "define.h"
+#include "utils.h"
+#include "view.h"
+
+enum menu_type {
+ MENU_MYAPPS = 0,
+ MENU_APPSTORE,
+};
+
+const char *str_menu[] = {
+ STR_MYAPPS,
+ STR_APPSTORE,
+ NULL
+};
+
+
+const char *str_sort_opt[] = {
+ STR_RECENT,
+ STR_A_TO_Z,
+ STR_Z_TO_A,
+};
+
+struct _priv {
+ Evas_Object *win;
+ Evas_Object *base;
+ Evas_Object *menu_btn[MENU_COUNT];
+ Evas_Object *focused_menu;
+ Evas_Object *notify;
+ Elm_Object_Item *focused_item;
+};
+
+static void _mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj,
+ Evas_Event_Mouse_Move *ev)
+{
+ if (!obj) {
+ _ERR("Invalid argument.");
+ return;
+ }
+
+ if (!elm_object_focus_get(obj))
+ elm_object_focus_set(obj, EINA_TRUE);
+}
+
+static void _menu_focused_cb(int id, void *data, Evas_Object *obj,
+ Elm_Object_Item *item)
+{
+ struct _priv *priv;
+
+ if (!data || !obj) {
+ _ERR("Invalid argument.");
+ return;
+ }
+ priv = data;
+
+ if (priv->focused_menu == obj)
+ return;
+
+ if (priv->focused_menu)
+ elm_object_signal_emit(priv->focused_menu,
+ SIG_UNSELECTED, SRC_MENU_BTN);
+
+ switch (id) {
+ case MENU_MYAPPS:
+ elm_object_signal_emit(priv->base, SIG_VISIBLE, SRC_MYAPPS);
+ break;
+
+ case MENU_APPSTORE:
+ elm_object_signal_emit(priv->base, SIG_INVISIBLE, SRC_MYAPPS);
+ elm_object_part_text_set(priv->base, PART_CONTENTS_TEXT,
+ STR_NOT_SUPPORTED);
+ /* It will be implemented later. */
+ break;
+
+ default:
+ _ERR("Invalid menu type.");
+ return;
+ }
+
+ priv->focused_menu = obj;
+}
+
+static void _menu_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
+ Evas_Event_Key_Down *ev)
+{
+ if (!data || !obj || !ev) {
+ _ERR("Invalid argument.");
+ return;
+ }
+}
+
+static input_handler _menu_input_handler = {
+ .mouse_move = _mouse_move_cb,
+ .focused = _menu_focused_cb,
+ .key_down = _menu_key_down_cb
+};
+
+static bool _draw_top_area(struct _priv *priv)
+{
+ Evas_Object *box, *btn;
+ int i;
+
+ elm_object_part_text_set(priv->base, PART_TOP_TITLE, STR_APPS);
+
+ box = utils_add_box(priv->base, PART_MENU, EINA_TRUE,
+ SIZE_MENU_BOX_PAD_H, SIZE_MENU_BOX_PAD_V);
+ if (!box) {
+ _ERR("Add box failed.");
+ return false;
+ }
+
+ for (i = 0; i < MENU_COUNT; i++) {
+ btn = utils_add_button(priv->base, NULL, str_menu[i],
+ STYLE_MENU_BTN);
+ if (!btn) {
+ _ERR("elm_button_add failed.");
+ evas_object_del(box);
+ return false;
+ }
+
+ inputmgr_add_callback(btn, i, &_menu_input_handler, priv);
+
+ elm_box_pack_end(box, btn);
+
+ priv->menu_btn[i] = btn;
+ }
+
+ elm_object_focus_next_object_set(priv->menu_btn[0],
+ priv->menu_btn[MENU_COUNT - 1], ELM_FOCUS_LEFT);
+ elm_object_focus_next_object_set(priv->menu_btn[MENU_COUNT - 1],
+ priv->menu_btn[0], ELM_FOCUS_RIGHT);
+ elm_object_focus_next_object_set(priv->menu_btn[0], priv->menu_btn[0],
+ ELM_FOCUS_DOWN);
+
+ elm_object_focus_set(priv->menu_btn[0], EINA_TRUE);
+
+ return true;
+}
+
+static void _draw_view_content(struct _priv *priv)
+{
+ if (!_draw_top_area(priv)) {
+ _ERR("Draw top area failed.");
+ return;
+ }
+}
+
+static Evas_Object *_create(Evas_Object *win, void *data)
+{
+ struct _priv *priv;
+ Evas_Object *base;
+
+ if (!win) {
+ _ERR("Get window object failed.");
+ return NULL;
+ }
+
+ priv = calloc(1, sizeof(*priv));
+ if (!priv) {
+ _ERR("Calloc failed.");
+ return NULL;
+ }
+
+ base = utils_add_layout(win, GRP_VIEW_BASE, EINA_TRUE);
+ if (!base) {
+ _ERR("Add layout failed.");
+ free(priv);
+ return NULL;
+ }
+
+
+ priv->win = win;
+ priv->base = base;
+
+ if (!viewmgr_set_view_data(VIEW_BASE, priv)) {
+ _ERR("Set view data failed.");
+ goto end;
+ }
+
+ _draw_view_content(priv);
+
+ return base;
+
+end:
+ evas_object_del(base);
+ free(priv);
+
+ return NULL;
+}
+
+static void _show(void *data)
+{
+ struct _priv *priv;
+
+ if (!data) {
+ _ERR("Get data failed.");
+ return;
+ }
+ priv = data;
+
+ if (priv->base)
+ evas_object_show(priv->base);
+}
+
+static void _hide(void *data)
+{
+ struct _priv *priv;
+
+ if (!data) {
+ _ERR("Get data failed.");
+ return;
+ }
+ priv = data;
+
+ if (priv->base)
+ evas_object_hide(priv->base);
+}
+
+static void _update(void *view_data, int update_type, void *data)
+{
+ if (!view_data) {
+ _ERR("Get data failed.");
+ return;
+ }
+}
+
+static void _destroy(void *data)
+{
+ struct _priv *priv;
+
+ if (!data) {
+ _ERR("Get data failed.");
+ return;
+ }
+ priv = data;
+
+ if (priv->base)
+ evas_object_del(priv->base);
+
+ free(priv);
+}
+
+static view_class _vclass = {
+ .view_id = VIEW_BASE,
+ .create = _create,
+ .show = _show,
+ .hide = _hide,
+ .update = _update,
+ .destroy = _destroy,
+};
+
+view_class *view_base_get_vclass(void)
+{
+ return &_vclass;
+}