The license change version 1.0 to version 1.1
[apps/home/wrt-setting.git] / webapp-detail / detailview.h
1 /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   *
4   * Licensed under the Flora License, Version 1.1 (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://floralicense.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 #ifndef WEB_SRC_SETTING_WEBAPP_DETAIL_DETAILVIEW_H_
18 #define WEB_SRC_SETTING_WEBAPP_DETAIL_DETAILVIEW_H_
19
20 #include <Evas.h>
21 #include <ui-gadget.h>
22
23 #undef None
24 #include <dpl/wrt-dao-rw/widget_dao.h>
25 #include <dpl/scoped_ptr.h>
26
27 #include "view.h"
28
29 namespace WebAppDetailSetting {
30
31 class AdvancedView;
32
33 typedef struct {
34     std::string license;
35     std::string href;
36     Evas_Object* evasObj;
37 } LicenseInfo;
38
39 class DetailView : public View
40 {
41     enum WebkitVersion {
42         WEBKIT_VERSION_WK1,
43         WEBKIT_VERSION_WK2,
44         WEBKIT_VERSION_UNKNOWN
45     };
46
47     Evas_Object *m_naviframe;
48     Evas_Object *m_parent;
49     Evas_Object *m_bx;
50     Evas_Object *check_webkit;
51     Evas_Object *check_login;
52     Evas_Object *m_gl;
53     ui_gadget_h m_ug;
54     DPL::ScopedPtr<WrtDB::WidgetDAO> m_dao;
55     WrtDB::WidgetLocalizedInfo m_localizedInfo;
56     DPL::String m_appID;
57     LicenseInfo *m_licenseInfo;
58     DPL::ScopedPtr<AdvancedView> m_advancedView;
59
60     void getLocalizedInfo(void);
61     static void onBackBtnClicked(void *data,
62                                     Evas_Object *obj,
63                                     void *event_info);
64     bool pushToNaviFrame(void);
65   public:
66     DetailView(Evas_Object* naviframe, ui_gadget_h ug, DPL::String appID);
67     ~DetailView(void);
68
69     Evas_Object *loadView(void);
70 };
71
72 class DetailData
73 {
74   public:
75     DetailView *m_detailView;
76     std::string m_title;
77     std::string m_subtitle;
78     int m_dataType;
79     DetailData(DetailView *detailView,
80               const char *title,
81               const char *subtitle) :
82         m_detailView(detailView),
83         m_title(title),
84         m_subtitle(subtitle) { };
85
86     ~DetailData(void) { };
87 };
88
89 } /* WebAppDetailSetting */
90
91 #endif /* WEB_SRC_SETTING_WEBAPP_DETAIL_DETAILVIEW_H_ */