[Title] Fix build error.
[profile/ivi/org.tizen.browser.git] / src / browser-policy-client / browser-policy-decision-maker.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *    http://www.tizenopensource.org/license
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18
19 #ifndef BROWSER_POLICY_DECISION_MAKER_H
20 #define BROWSER_POLICY_DECISION_MAKER_H
21
22 #include "browser-config.h"
23 #include "browser-view.h"
24
25 #include <string>
26
27 using namespace std;
28
29 class Browser_Common_View;
30
31 class Browser_Policy_Decision_Maker : public Browser_Common_View {
32 public:
33         Browser_Policy_Decision_Maker(Evas_Object *navi_bar, Browser_View *browser_view);
34         ~Browser_Policy_Decision_Maker(void);
35
36         void init(Evas_Object *ewk_view);
37         void deinit(void);
38         void pause(void);
39 private:
40         enum {
41                 policy_use,
42                 policy_download,
43                 policy_ignore
44         };
45
46         /* ewk view event callback functions */
47         static void __decide_policy_for_navigation_action(void *data, Evas_Object *obj, void *event_info);
48         static void __decide_policy_for_response_cb(void *data, Evas_Object *obj, void *event_info);
49
50         /* download client callback functions */
51         static void __download_did_start_cb(const char *download_url, void *user_data);
52
53         /* Elementary event callback functions */
54         static void __popup_response_cb(void *data, Evas_Object *obj, void *event_info);
55         static void __player_cb(void *data, Evas_Object *obj, void *event_info);
56         static void __internet_cb(void *data, Evas_Object *obj, void *event_info);
57         static bool __launch_matched_application_cb(service_h service, const char *package, void *data);
58
59         /* Warning : MUST free() returned char* */
60         void _request_download(Ewk_Policy_Decision *policy_decision);
61         Eina_Bool _launch_download_app(const char *url, const char *cookies = NULL);
62         string _get_extension_name_from_url(string &url);
63         Eina_Bool _show_app_list_popup(void);
64         const char *_get_app_name_from_pkg_name(string& pkg_name);
65         Eina_Bool _handle_exscheme(void);
66
67         Evas_Object *m_ewk_view;
68         Evas_Object *m_navi_bar;
69         Evas_Object *m_list_popup;
70         Evas_Object *m_app_list;
71         Browser_View *m_browser_view;
72         Eina_Bool m_found_matched_app;
73
74         string m_url;
75         string m_cookies;
76         string m_default_player_pkg_name;
77 };
78 #endif /* BROWSER_POLICY_DECISION_MAKER_H */
79