Update wrt-installer_0.0.54
[framework/web/wrt-installer.git] / src / jobs / widget_install / widget_install_popup.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    widget_install_popup.h
18  * @author  lke01.lee (lke01.lee@samsung.com)
19  * @version 1.0
20  * @brief   Implementation file for installer popup
21  */
22
23 #ifndef WIDGET_INSTALL_POPUP_H
24 #define WIDGET_INSTALL_POPUP_H
25
26 #include <Evas.h>
27 #include <Ecore_X.h>
28 #include <Elementary.h>
29
30
31 class InstallerContext;
32
33 namespace Jobs {
34 namespace WidgetInstall {
35
36 enum PopupType {
37     WIDGET_INSTALL_POPUP = 0,
38     WIDGET_FEATURE_INFO,  //sp-2390
39     WIDGET_WRONG_FEATURE_INFO,  //sp-3240
40     WIDGET_AUTHOR_INFO,
41     WIDGET_MIN_VERSION,  //sp-3240
42     WIDGET_UNRECOGNIZED
43 };
44
45 enum InfoPopupButton
46 {
47     WRT_POPUP_BUTTON = 0,
48     WRT_POPUP_BUTTON_OK,
49     WRT_POPUP_BUTTON_CANCEL
50 };
51
52
53 class WidgetInstallPopup
54 {
55     public :
56       explicit WidgetInstallPopup(InstallerContext &installContext);
57       virtual ~WidgetInstallPopup();
58
59       bool createPopup();
60       void destroyPopup();
61       void loadPopup(PopupType type, const std::string &label);
62       void showPopup();
63       bool addWin(const char *name);
64       bool addPopup();
65       void addTitle(PopupType type);
66       void addScrollLabel(const std::string &str);
67       void addContent(PopupType  type, const std::string &str);
68       void addButton(PopupType type);
69
70       static void userPermitCallback(void *data,
71       Evas_Object *obj,
72       void *event_info);
73       static void userCancelCallback(void *data,
74       Evas_Object *obj,
75       void *event_info);
76
77   protected :
78       Evas_Object *m_win;
79       Evas_Object *m_popup;
80       InstallerContext &m_installContext;
81       int m_installCancel;
82 };
83 }
84 }
85 #endif
86