--- /dev/null
+/*
+ * Copyright (c) 2015 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_APPS_APP_H__
+#define __AIR_APPS_APP_H__
+
+#include <Elementary.h>
+
+struct app_data;
+
+Eina_List *get_app_list(void);
+char *get_app_id(struct app_data *adata);
+char *get_app_name(struct app_data *adata);
+char *get_app_icon(struct app_data *adata);
+void free_app_list(Eina_List *list);
+
+#endif /* __AIR_APPS_APP_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2015 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 <pkgmgr-info.h>
+#include <app_contents.h>
+#include <app_debug.h>
+
+#include "data/app.h"
+
+struct app_data {
+ char *appid;
+ char *name;
+ char *icon;
+ bool is_locked;
+ bool is_favorite;
+};
+
+static int _get_app_data_foreach(pkgmgrinfo_appinfo_h handle, void *data)
+{
+ Eina_List **list;
+ struct app_data *adata;
+ char *appid, *name, *icon;
+ bool is_favorite;
+ int r;
+
+ if (!data)
+ return -1;
+
+ list = (Eina_List **)data;
+
+ if (pkgmgrinfo_appinfo_get_appid(handle, &appid) != PMINFO_R_OK)
+ return -1;
+
+ if (pkgmgrinfo_appinfo_get_label(handle, &name) != PMINFO_R_OK)
+ return -1;
+
+ if (pkgmgrinfo_appinfo_get_icon(handle, &icon) != PMINFO_R_OK)
+ return -1;
+
+ r = app_contents_favorite_check(CONTENTS_APP, appid, &is_favorite);
+ if (r != APP_CONTENTS_ERROR_NONE)
+ return -1;
+
+ adata = calloc(1, sizeof(*adata));
+ if (!adata) {
+ _ERR("Calloc failed.");
+ return -1;
+ }
+
+ if (appid)
+ adata->appid = strdup(appid);
+ if (name)
+ adata->name = strdup(name);
+ if (icon)
+ adata->icon = strdup(icon);
+
+ adata->is_favorite = is_favorite;
+
+ *list = eina_list_append(*list, adata);
+
+ return 0;
+}
+
+Eina_List *get_app_list(void)
+{
+ Eina_List *list = NULL;
+
+ pkgmgrinfo_appinfo_get_usr_installed_list(_get_app_data_foreach,
+ getuid(), &list);
+
+ return list;
+}
+
+char *get_app_id(struct app_data *adata)
+{
+ if (!adata) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ return adata->appid;
+}
+
+char *get_app_name(struct app_data *adata)
+{
+ if (!adata) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ return adata->name;
+}
+
+char *get_app_icon(struct app_data *adata)
+{
+ if (!adata) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ return adata->icon;
+}
+
+void free_app_list(Eina_List *list)
+{
+ struct app_data *adata;
+
+ if (!list)
+ return;
+
+ EINA_LIST_FREE(list, adata) {
+ if (!adata)
+ continue;
+
+ free(adata->appid);
+ free(adata->name);
+ free(adata->icon);
+ free(adata);
+
+ adata = NULL;
+ }
+}