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 widget_installer_struct.h
18 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
19 * @author Grzegorz Krawczyk (g.krawczyk@samsung.com)
21 * @brief Implementation file for widget installer struct
23 #ifndef WRT_SRC_INSTALLER_CORE_INSTALLER_TASKS_WIDGET_INSTALLER_STRUCT_H_
24 #define WRT_SRC_INSTALLER_CORE_INSTALLER_TASKS_WIDGET_INSTALLER_STRUCT_H_
27 #include <dpl/assert.h>
32 #include <widget_install/widget_install_errors.h>
33 #include <wrt_common_types.h>
35 //Widget Installer typedefs
36 typedef void (*InstallerFinishedCallback)(
39 Jobs::WidgetInstall::Exceptions::Type);
41 typedef void (*InstallerProgressCallback)(void *userParam,
42 ProgressPercent percent,
43 const ProgressDescription &);
45 namespace WidgetUpdateMode {
51 NotInstalled = 1 << 0,
52 IncomingVersionNotStd = 1 << 1,
53 ExistingVersionNotStd = 1 << 2,
54 BothVersionsNotStd = 1 << 3,
55 ExistingVersionOlder = 1 << 4,
56 ExistingVersionEqual = 1 << 5,
57 ExistingVersionNewer = 1 << 6,
60 PolicyNeverUpdate = NotInstalled,
62 PolicyWac = NotInstalled |
65 PolicyAlwaysInstall = NotInstalled |
66 IncomingVersionNotStd |
67 ExistingVersionNotStd |
69 ExistingVersionOlder |
70 ExistingVersionEqual |
73 PolicyForceInstall = PolicyAlwaysInstall
76 inline Type operator | (const Type &a,
79 return static_cast<Type>(static_cast<unsigned long>(a) |
80 static_cast<unsigned long>(b));
83 inline Type operator & (const Type &a,
86 return static_cast<Type>(static_cast<unsigned long>(a) &
87 static_cast<unsigned long>(b));
93 typedef Jobs::JobCallbacksBase<InstallerFinishedCallback,
94 InstallerProgressCallback>
95 WidgetInstallCallbackBase;
97 //Widget Installation Struct
98 struct WidgetInstallationStruct : public WidgetInstallCallbackBase
100 WidgetUpdateMode::Type updateMode;
102 // It must be empty-constructible as a parameter of generic event
103 WidgetInstallationStruct() : updateMode(WidgetUpdateMode::Zero)
107 WidgetInstallationStruct(InstallerFinishedCallback finished,
108 InstallerProgressCallback progress,
110 WidgetUpdateMode::Type mode) :
111 WidgetInstallCallbackBase(finished, progress, param),
117 #endif // WRT_SRC_INSTALLER_CORE_INSTALLER_TASKS_WIDGET_INSTALLER_STRUCT_H_