1100493777a2aa7d79cbbfae4208f07e0a3db497
[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  * Video - RSTP is handled by video player.
48  *
49  * File scheme - FILE scheme has to be handled by WRT
50  *
51  * WS-1510/20/30/40/50 - All remaining cases are always handled by appsvc
52  */
53
54 // TIZEN
55 const UriAction g_tizenActionMap[Scheme::COUNT][SchemeActionMap::COUNT] = {
56     //  TOP_LEVEL           FRAME_LEVEL         NEW_WINDOW
57     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // FILE
58     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // SMS
59     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // SMSTO
60     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // MMSTO
61     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // MAILTO
62     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },        // DATA
63     { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // TEL
64     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // HTTP
65     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // HTTPS
66     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // WIDGET
67 #ifdef APP_SCHEME_ENABLED
68     { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // APP
69 #endif
70     { URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO }      // RTSP
71 };
72
73 }
74 }