File encryption method reading whole files into a dynamic stack buffer.
[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 class InstallerContext;
31
32 namespace Jobs {
33 namespace WidgetInstall {
34 enum PopupType {
35     WIDGET_INSTALL_POPUP = 0,
36     WIDGET_FEATURE_INFO,  //sp-2390
37     WIDGET_WRONG_FEATURE_INFO,  //sp-3240
38     WIDGET_AUTHOR_INFO,
39     WIDGET_MIN_VERSION,  //sp-3240
40     WIDGET_UNRECOGNIZED
41 };
42
43 enum InfoPopupButton
44 {
45     WRT_POPUP_BUTTON = 0,
46     WRT_POPUP_BUTTON_OK,
47     WRT_POPUP_BUTTON_CANCEL
48 };
49
50 class WidgetInstallPopup
51 {
52   public:
53     explicit WidgetInstallPopup(InstallerContext &installContext);
54     virtual ~WidgetInstallPopup();
55
56     bool createPopup();
57     void destroyPopup();
58     void loadPopup(PopupType type, const std::string &label);
59     void showPopup();
60     bool addWin(const char *name);
61     bool addPopup();
62     void addTitle(PopupType type);
63     void addScrollLabel(const std::string &str);
64     void addContent(PopupType type, const std::string &str);
65     void addButton(PopupType type);
66
67     static void userPermitCallback(void *data,
68                                    Evas_Object *obj,
69                                    void *event_info);
70     static void userCancelCallback(void *data,
71                                    Evas_Object *obj,
72                                    void *event_info);
73
74   protected:
75     Evas_Object *m_win;
76     Evas_Object *m_popup;
77     InstallerContext &m_installContext;
78     int m_installCancel;
79 };
80 }
81 }
82 #endif
83