tizen beta release
[framework/web/wrt-installer.git] / src / jobs / widget_install / task_certify.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    task_certify.h
18  * @author  Pawel Sikorski (p.sikorski@samgsung.com)
19  * @version
20  * @brief
21  */
22 #ifndef INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_CERTIFY_H
23 #define INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_CERTIFY_H
24
25 //SYSTEM INCLUDES
26 #include <string>
27 #include <libxml/c14n.h>
28
29 //WRT INCLUDES
30 #include <dpl/task.h>
31 #include <dpl/popup/popup_controller.h>
32
33 class InstallerContext;
34
35 namespace ValidationCore {
36 class SignatureData;
37 }
38
39 namespace Jobs {
40 namespace WidgetInstall {
41 class TaskCertify :
42     public DPL::TaskDecl<TaskCertify>,
43     public DPL::Popup::PopupControllerUser
44 {
45   public:
46     TaskCertify(InstallerContext &inCont);
47     virtual ~TaskCertify();
48
49   private:
50     //data
51     InstallerContext& m_contextData;
52     bool m_cancelInstallation;
53     bool m_userAgreedToInstallUntrustedWidget;
54
55     //steps
56     void stepSignature();
57     void stepWarningPopup();
58     void stepWarningPopupAnswer();
59     void stepAuthorInfoPopup();
60     void stepAuthorInfoPopupAnswer();
61     void stepFinalize();
62
63     void processDistributorSignature(const ValidationCore::SignatureData &data,
64             bool first);
65     void processAuthorSignature(const ValidationCore::SignatureData &data);
66
67     std::string createAuthorWidgetInfo() const;
68
69     void onWarningPopupAnswer(const DPL::Popup::AnswerCallbackData &answer);
70     void onAuthorInfoPopupAnswer(const DPL::Popup::AnswerCallbackData &answer);
71 };
72 } //namespace WidgetInstall
73 } //namespace Jobs
74
75 #endif // INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_CERTIFY_H