summaryrefslogtreecommitdiff
path: root/lib/ct-front/ct-front-main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ct-front/ct-front-main.cpp')
-rwxr-xr-xlib/ct-front/ct-front-main.cpp229
1 files changed, 0 insertions, 229 deletions
diff --git a/lib/ct-front/ct-front-main.cpp b/lib/ct-front/ct-front-main.cpp
deleted file mode 100755
index 980376b..0000000
--- a/lib/ct-front/ct-front-main.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright 2012 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * 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 <ui-gadget-module.h>
-
-#include "phone.h"
-#include "phone-common.h"
-#include "contacts-ug.h"
-#include "ct-front.h"
-#include "ct-front-view.h"
-
-static int cfront_parse_bundle(ct_front_data *cfront_d, service_h service)
-{
- PH_TRACE;
- char* val = NULL;
-
- cfront_d->view_visible[CT_VIEW_CONTACT] = true;
- cfront_d->view_visible[CT_VIEW_GROUP] = true;
- cfront_d->view_visible[CT_VIEW_FAVORITE] = true;
-
- if (service)
- {
- service_get_extra_data(service, PH_UG_BUNDLE_TYPE, &val);
- if (val)
- cfront_d->ug_request = atoi(val);
- PH_DBG("type = %d", cfront_d->ug_request);
- free(val);
- }
-
- switch (cfront_d->ug_request)
- {
- case PH_UG_REQUEST_SELECT:
- case PH_UG_REQUEST_SELECT_NUMBER:
- case PH_UG_REQUEST_SELECT_EMAIL:
- cfront_d->view_visible[CT_VIEW_LOG] = true;
- break;
- case PH_UG_REQUEST_SET_WITH_NUM:
- service_get_extra_data(service, CT_UG_BUNDLE_NUM,
- &cfront_d->ug_data);
- break;
- case PH_UG_REQUEST_SET_WITH_EMAIL:
- service_get_extra_data(service, CT_UG_BUNDLE_EMAIL,
- &cfront_d->ug_data);
- break;
- case PH_UG_REQUEST_SET_WITH_WEB:
- service_get_extra_data(service, CT_UG_BUNDLE_WEB,
- &cfront_d->ug_data);
- break;
- case PH_UG_REQUEST_SET_WITH_IMG:
- case PH_UG_REQUEST_SET_WITH_RINGTONE:
- service_get_extra_data(service, CT_UG_BUNDLE_PATH,
- &cfront_d->ug_data);
- break;
- case PH_UG_REQUEST_CHECK:
- case PH_UG_REQUEST_CHECK_FOR_NUMBER:
- case PH_UG_REQUEST_CHECK_FOR_EMAIL:
- case PH_UG_REQUEST_CHECK_FOR_NUMBER_OR_EMAIL:
- cfront_d->view_visible[CT_VIEW_LOG] = true;
- val = NULL;
- service_get_extra_data(service, CT_UG_BUNDLE_MAX, &val);
- if (val)
- cfront_d->cnt_max = atoi(val);
- free(val);
- default:
- break;
- }
- return 0;
-}
-
-void *ct_tabui_on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
-{
- PH_TRACE;
- if (!ug || !priv)
- return NULL;
-
- bindtextdomain(PACKAGE, LOCALEDIR);
-
- ct_front_data *cfront_d = (ct_front_data *) priv;
- int ret = cfront_parse_bundle(cfront_d, service);
- p_retvm_if(-1 == ret, NULL, "ph_front_view_parse_bundle() Failed");
-
- Evas_Object *parent = (Evas_Object *) ug_get_parent_layout(ug);
- if (!parent)
- return NULL;
-
- cfront_d = (ct_front_data *) priv;
- cfront_d->win = (Evas_Object *) ug_get_window();
-
- cfront_d->select_tab = CT_VIEW_NONE;
- cfront_d->ug = ug;
-
- bool success = cfront_d->initialize(cfront_d->win, parent);
- check_if(!success, return NULL);
-
- success = ct_front_view_create_toolbar(*cfront_d) != NULL;
- check_if(!success, return NULL);
-
- int err = contacts_connect2();
- p_retvm_if(CONTACTS_ERROR_NONE != err, NULL,
- "contacts_connect2() Failed(%d)", err);
-
- return cfront_d->getContent();
-}
-
-void ct_tabui_on_start(ui_gadget_h ug, service_h service, void *priv)
-{
- PH_TRACE;
- ct_front_data *cfront_d = (ct_front_data *) priv;
-
- elm_toolbar_select_mode_set(cfront_d->tabbar,
- ELM_OBJECT_SELECT_MODE_ALWAYS);
-
- cfront_d->timer = ecore_timer_add(3.0, ctui_front_view_load_timer,
- cfront_d);
-}
-
-void ct_tabui_on_pause(ui_gadget_h ug, service_h service, void *priv)
-{
- PH_TRACE;
-}
-
-void ct_tabui_on_resume(ui_gadget_h ug, service_h service, void *priv)
-{
- PH_TRACE;
-}
-
-void ct_tabui_on_destroy(ui_gadget_h ug, service_h service, void *priv)
-{
- PH_TRACE;
- int err = CONTACTS_ERROR_NONE;
- ct_front_data *cfront_d = (ct_front_data *) priv;
-
- if (!ug)
- return;
-
- free(cfront_d->ug_data);
-
- if (cfront_d->ug)
- {
- evas_object_del((Evas_Object *) ug_get_layout(ug));
- }
- err = contacts_disconnect2();
- p_warn_if(CONTACTS_ERROR_NONE != err, "contacts_disconnect2() Failed(%d)",
- err);
-}
-
-void ct_tabui_on_message(ui_gadget_h ug, service_h msg, service_h service,
- void *priv)
-{
- PH_TRACE;
-}
-
-void ct_tabui_on_event(ui_gadget_h ug, enum ug_event event, service_h service,
- void *priv)
-{
- PH_TRACE;
- ct_front_data *cfront_d = (ct_front_data *) priv;
- switch (event)
- {
- case UG_EVENT_REGION_CHANGE:
- ctui_front_view_region_changed(cfront_d);
- break;
- case UG_EVENT_ROTATE_PORTRAIT:
- case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN:
- break;
- case UG_EVENT_ROTATE_LANDSCAPE:
- case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN:
- break;
- case UG_EVENT_LANG_CHANGE:
- ctui_front_view_language_changed(cfront_d);
- break;
- default:
- break;
- }
-}
-
-void ct_tabui_on_key_event(ui_gadget_h ug, enum ug_key_event event,
- service_h service, void *priv)
-{
- PH_TRACE;
-}
-
-extern "C" API int UG_MODULE_INIT(struct ug_module_ops *ops)
-{
- PH_TRACE;
- if (!ops)
- return -1;
-
- ct_front_data *cfront_d = new ct_front_data();
- if (!cfront_d)
- return -1;
-
- ops->create = ct_tabui_on_create;
- ops->start = ct_tabui_on_start;
- ops->pause = ct_tabui_on_pause;
- ops->resume = ct_tabui_on_resume;
- ops->destroy = ct_tabui_on_destroy;
- ops->message = ct_tabui_on_message;
- ops->event = ct_tabui_on_event;
- ops->key_event = ct_tabui_on_key_event;
- ops->priv = cfront_d;
- ops->opt = UG_OPT_INDICATOR_ENABLE;
-
- return 0;
-}
-
-extern "C" API void UG_MODULE_EXIT(struct ug_module_ops *ops)
-{
- PH_TRACE;
- if (!ops)
- return;
-
- free(ops->priv);
- ops->priv = NULL;
-}
-