tizen 2.3 release
[apps/home/settings.git] / setting-fileview / src / setting-fileview-main.c
index afaf623..6a6bdb8 100755 (executable)
@@ -1,18 +1,22 @@
 /*
  * setting
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  *
- * Licensed under the Flora License, Version 1.1 (the License);
+ * 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://floralicense.org/license/
+ * 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,
+ * 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 <setting-fileview-main.h>
 
@@ -35,18 +39,7 @@ setting_view setting_view_fileview_main = {
  *basic func
  *
  ***************************************************/
-#if DISABLED_CODE
-static Eina_Bool __web_on_idle(void *data)
-{
-       SETTING_TRACE_BEGIN;
-       SettingFileviewUG *ad = (SettingFileviewUG *) data;
-       if (ad->progress_bar) {
-               evas_object_del(ad->progress_bar);
-               ad->progress_bar = NULL;
-       }
-       return FALSE;
-}
-#endif
+
 static void __setting_fileview_policy_navigation_decide(void *data, Evas_Object *webview, void *event_info)
 {
        SETTING_TRACE_BEGIN;
@@ -74,8 +67,7 @@ static int setting_fileview_create(void *cb)
 
        SettingFileviewUG *ad = (SettingFileviewUG *) cb;
 
-       Evas_Object *scroller;
-       //ad->progress_bar = setting_create_popup_with_progressbar(ad, ad->win_get, "pending_list", NULL, NULL, NULL, 0, TRUE, TRUE);
+       Evas_Object *scroller = NULL;
 
        ad->ly_main = setting_create_layout_navi_bar_scroller(ad->win_main_layout,
                                        ad->win_get,
@@ -86,28 +78,32 @@ static int setting_fileview_create(void *cb)
                                        NULL, ad, &scroller,
                                        &(ad->navi_bar));
 
+
+
        Evas *evas = evas_object_evas_get(ad->win_get);
        Evas_Object *webview = ewk_view_add(evas);
+
        ad->webkit = webview;
 
        SETTING_TRACE("ad->input_file:%s", ad->input_file);
-       ewk_view_url_set(webview, ad->input_file);
+       ewk_view_url_set(ad->webkit, ad->input_file);
 
        elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_FALSE);
+       elm_object_content_set(scroller, ad->webkit);
 
-       elm_object_content_set(scroller, webview);
-       evas_object_show(webview);
-       //ecore_idler_add(__web_on_idle, ad);
+       elm_access_object_register(     ad->webkit,ad->win_get);
+       evas_object_show(ad->webkit);
+       ad->scroller = scroller;
 
-       evas_object_smart_callback_add(webview, "policy,navigation,decide", __setting_fileview_policy_navigation_decide, ad);
+       evas_object_smart_callback_add(ad->webkit, "policy,navigation,decide", __setting_fileview_policy_navigation_decide, ad);
 
-       service_h svc;
-       if (service_create(&svc)) {
+       app_control_h svc;
+       if (app_control_create(&svc)) {
                return SETTING_RETURN_FAIL;
        }
 
        setting_view_fileview_main.is_create = 1;
-       service_destroy(svc);
+       app_control_destroy(svc);
 
        return SETTING_RETURN_SUCCESS;
 }
@@ -121,13 +117,15 @@ static int setting_fileview_destroy(void *cb)
        evas_object_smart_callback_del(ad->webkit, "policy,navigation,decide", __setting_fileview_policy_navigation_decide);
 
        if (ad->webkit) {
+
+               elm_object_content_unset(ad->webkit);
                evas_object_del(ad->webkit);
                ad->webkit = NULL;
        }
 
-       if (ad->progress_bar) {
-               evas_object_del(ad->progress_bar);
-               ad->progress_bar = NULL;
+       if (ad->scroller) {
+               evas_object_del(ad->scroller);
+               ad->scroller = NULL;
        }
 
        if (ad->ly_main != NULL) {