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>
36 //Widget Installer typedefs
37 typedef void (*InstallerFinishedCallback)(
40 Jobs::WidgetInstall::Exceptions::Type);
42 typedef void (*InstallerProgressCallback)(void *userParam,
43 ProgressPercent percent,
44 const ProgressDescription &);
46 namespace WidgetUpdateMode {
52 NotInstalled = 1 << 0,
53 IncomingVersionNotStd = 1 << 1,
54 ExistingVersionNotStd = 1 << 2,
55 BothVersionsNotStd = 1 << 3,
56 ExistingVersionOlder = 1 << 4,
57 ExistingVersionEqual = 1 << 5,
58 ExistingVersionNewer = 1 << 6,
61 PolicyNeverUpdate = NotInstalled,
63 PolicyWac = NotInstalled |
66 PolicyAlwaysInstall = NotInstalled |
67 IncomingVersionNotStd |
68 ExistingVersionNotStd |
70 ExistingVersionOlder |
71 ExistingVersionEqual |
74 PolicyForceInstall = PolicyAlwaysInstall
77 inline Type operator | (const Type &a,
80 return static_cast<Type>(static_cast<unsigned long>(a) |
81 static_cast<unsigned long>(b));
84 inline Type operator & (const Type &a,
87 return static_cast<Type>(static_cast<unsigned long>(a) &
88 static_cast<unsigned long>(b));
94 typedef Jobs::JobCallbacksBase<InstallerFinishedCallback,
95 InstallerProgressCallback>
96 WidgetInstallCallbackBase;
98 //Widget Installation Struct
99 struct WidgetInstallationStruct : public WidgetInstallCallbackBase
101 WidgetUpdateMode::Type updateMode;
104 // It must be empty-constructible as a parameter of generic event
105 WidgetInstallationStruct() : updateMode(WidgetUpdateMode::Zero),
110 WidgetInstallationStruct(InstallerFinishedCallback finished,
111 InstallerProgressCallback progress,
113 WidgetUpdateMode::Type mode,
115 WidgetInstallCallbackBase(finished, progress, param),
122 #endif // WRT_SRC_INSTALLER_CORE_INSTALLER_TASKS_WIDGET_INSTALLER_STRUCT_H_