src/data/datamgr.c
src/data/data_home.c
src/data/data_recent.c
+ src/data/data_user.c
src/view/view_user.c
src/view/view_recent.c
src/view/view_home.c)
--- /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_HOME_DATA_USER_H__
+#define __AIR_HOME_DATA_USER_H__
+
+#include <datamgr.h>
+
+struct data_class *datamgr_user_get_dclass(void);
+
+#endif /* __AIR_HOME_DATA_USER_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 <app_debug.h>
+#include <Eina.h>
+#include <stdbool.h>
+
+#include "data_user.h"
+#include "datamgr.h"
+
+static void _select(struct datamgr_item *di)
+{
+ /* It should be implemented later */
+}
+
+static Eina_List *_get_items(struct datamgr *dm)
+{
+ if (!dm) {
+ _ERR("Invalid argument");
+ return NULL;
+ }
+
+ return dm->list;
+}
+
+static void _fini(struct datamgr *dm)
+{
+ /* It should be implemented later */
+}
+
+static bool _init(struct datamgr *dm)
+{
+ /* It should be implemented later */
+
+ return true;
+}
+
+static struct data_class dclass = {
+ .init = _init,
+ .fini = _fini,
+ .get_items = _get_items,
+ .select = _select
+};
+
+struct data_class *datamgr_user_get_dclass(void)
+{
+ return &dclass;
+}
+
#include "defs.h"
#include "view_user.h"
+#include "data_user.h"
#include "datamgr.h"
#include "utils.h"
struct _priv {
Evas_Object *win;
Evas_Object *base;
+
+ struct datamgr *dm;
};
static Evas_Object *_create(Evas_Object *win, void *data)
{
struct _priv *priv;
+ struct datamgr *dm;
Evas_Object *base;
if (!win) {
return NULL;
}
+ dm = datamgr_init(datamgr_user_get_dclass(), VIEW_USER);
+ if (!dm) {
+ _ERR("failed to initialize datamgr");
+ free(priv);
+ return NULL;
+ }
+
base = utils_add_layout(win, GRP_USER, false, NULL);
if (!base) {
_ERR("failed to create base");
+ datamgr_fini(dm);
free(priv);
return NULL;
}
priv->win = win;
priv->base = base;
+ priv->dm = dm;
viewmgr_set_view_data(VIEW_USER, priv);
}
priv = data;
+
+ datamgr_fini(priv->dm);
evas_object_del(priv->base);
free(priv);
}