2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file task_widget_config.cpp
18 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
20 * @brief Implementation file for installer task widget config
22 #ifndef INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_WIDGET_CONFIG_H
23 #define INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_WIDGET_CONFIG_H
25 #include <WidgetConfigurationManager.h>
27 #include <dpl/task_list.h>
28 #include <dpl/string.h>
29 #include <dpl/event/nested_loop.h>
30 #include <wrt_error.h>
31 #include <dpl/wrt-dao-ro/global_config.h>
33 #include <dpl/popup/popup_controller.h>
34 #include <dpl/popup/popup_manager.h>
35 #include <dpl/popup/popup_renderer.h>
36 #include <wrt_common_types.h>
38 class InstallerContext;
41 namespace WidgetInstall {
42 namespace InstallerTaskWidgetPopupData {
45 DPL::String widgetInfo;
46 void addWidgetInfo(const DPL::String &head,
47 const DPL::String &info);
49 } // InstalllerTaskWidgetPopupData
51 class TaskWidgetConfig :
52 public DPL::TaskDecl<TaskWidgetConfig>,
53 public DPL::Popup::PopupControllerUser
58 WRT_POPUP_BUTTON_OK, WRT_POPUP_BUTTON_CANCEL
61 InstallerContext& m_installContext;
62 WrtDB::LocaleSet m_localeFolders;
63 std::set<DPL::String> m_processedIconSet;
65 InstallerTaskWidgetPopupData::PopupData m_popupData;
67 void StepProcessConfigurationFile();
68 void ReadLocaleFolders();
69 void ProcessLocalizedStartFiles();
70 void ProcessStartFile(const DPL::OptionalString& path,
71 const DPL::OptionalString& type,
72 const DPL::OptionalString& encoding = DPL::OptionalString::Null,
73 bool typeForcedInConfig = false);
74 void ProcessLocalizedIcons();
75 void ProcessIcon(const WrtDB::ConfigParserData::Icon& icon);
76 void StepProcessPowderFile();
77 void StepVerifyFeatures();
78 void StepShowWidgetInfo();
79 void StepPowderCancel();
80 void StepFeatureCancel();
81 void StepCancelWidgetInstallation();
82 void StepShowPowderPassword();
83 void StepShowPowderPasswordCancel();
85 DPL::String createPowderInfo() const;
86 void AnswerCallback(const DPL::Popup::AnswerCallbackData& answer);
87 DPL::String createAuthorWidgetInfo() const;
88 void setApplicationType();
89 bool isFeatureAllowed(
90 WrtDB::AppType appType, DPL::String featureName);
93 TaskWidgetConfig(InstallerContext& installTaskContext);
95 } //namespace WidgetInstall
98 #endif // INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_WIDGET_CONFIG_H