8537f932dd165a8aacb5d8b8ae6fb12b363e5b6d
[platform/framework/web/wrt.git] / src / view / common / scheme_action_map_data.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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  * @file       scheme_action_map_data.h
18  * @author     Tae-Jeong Lee (taejeong.lee@samsung.com)
19  * @version    1.0
20  */
21
22 #include "scheme_action_map.h"
23 #include <scheme.h>
24
25 namespace ViewModule {
26 namespace {
27 enum UriAction {
28     URI_ACTION_WRT,       // load in WRT
29     URI_ACTION_APPSVC,    // launch in APPSVC
30     URI_ACTION_VIDEO,     // launch in VIDEO player
31     URI_ACTION_ERROR
32 };
33
34 /**
35  * WS-1501 - No top-level window navigation outside the widget. Deafult browser
36  *           should be used instead. Frames/iframes are allowed to navigate.
37  *           This requirement can't be applied to tizen hosted app as in its
38  *           case the whole widget is "outside".
39  *
40  * WS-1502 - When calling window.open() with scheme HTTP/HTTPS and target
41  *           attribute set to "_blank" WRT should open default browser. At the
42  *           moment we can't distinguish target attributes, therefore all new
43  *           windows are opened in the browser regardless of the attribute (the
44  *           value "_new" is also treated this way). Tizen won't satisfy this
45  *           requirement. It should open new windows in WRT.
46  *
47  * Multiview - Not supported in WAC application. Therefore opening WIDGET scheme
48  *           in new window will result in launching appssvc, which won't be able
49  *           to handle it. The correct behaviour has to be defined. In case of
50  *           Tizen, new window will be opened in WRT.
51  *
52  * Video - RSTP is handled by video player.
53  *
54  * File scheme - FILE scheme has to be handled by WRT with exception to new
55  *           window in WAC application (no support for multiple views)
56  *
57  * WS-1510/20/30/40/50 - All remaining cases are always handled by appsvc
58  */
59
60 // TIZEN
61 const UriAction g_tizenActionMap[Scheme::COUNT][SchemeActionMap::COUNT] = {
62     //  TOP_LEVEL           FRAME_LEVEL         NEW_WINDOW
63     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // FILE
64     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // SMS
65     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // MMSTO
66     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // MAILTO
67     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },        // DATA
68     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // TEL
69     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // HTTP
70     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // HTTPS
71     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // WIDGET
72 #ifdef APP_SCHEME_ENABLED
73     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // APP
74 #endif
75     { URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO }      // RTSP
76 };
77
78 // WAC
79 const UriAction g_wacActionMap[Scheme::COUNT][SchemeActionMap::COUNT] = {
80     //  TOP_LEVEL           FRAME_LEVEL         NEW_WINDOW
81     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_APPSVC },        // FILE
82     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // SMS
83     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // MMSTO
84     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // MAILTO
85     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },        // DATA
86     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // TEL
87     { URI_ACTION_APPSVC, URI_ACTION_WRT, URI_ACTION_APPSVC },     // HTTP
88     { URI_ACTION_APPSVC, URI_ACTION_WRT, URI_ACTION_APPSVC },     // HTTPS
89     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_APPSVC },        // WIDGET
90 #ifdef APP_SCHEME_ENABLED
91     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_APPSVC },        // APP
92 #endif
93     { URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO }      // RTSP
94 };
95 }
96 }