c32d253fed322857c5c723a4bd1da6a9b4438448
[framework/web/wrt-installer.git] / src / wrt-installer / installer_callbacks_translate.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    api_callbacks_translate.h
18  * @author  Pawel Sikorski (p.sikorski@samsung.com)
19  * @version 1.0
20  * @brief   Header file for api callbacks translate functions
21  */
22 #ifndef WRT_SRC_API_API_CALLBACKS_TRANSLATE_H_
23 #define WRT_SRC_API_API_CALLBACKS_TRANSLATE_H_
24
25 #include <wrt_installer_api.h>
26 #include <wrt_common_types.h>
27 #include <widget_install/widget_install_errors.h>
28 #include <widget_uninstall/widget_uninstall_errors.h>
29 #include <plugin_install/plugin_installer_errors.h>
30 #include <job_base.h>
31 #include <string>
32
33 namespace InstallerCallbacksTranslate {
34 struct StatusCallbackStruct
35 {
36     void* userdata;
37     WrtInstallerStatusCallback status_callback;
38     WrtProgressCallback progress_callback;
39
40     StatusCallbackStruct(void* u,
41             WrtInstallerStatusCallback s,
42             WrtProgressCallback p) :
43         userdata(u),
44         status_callback(s),
45         progress_callback(p)
46     {
47     }
48 };
49
50 struct PluginStatusCallbackStruct
51 {
52     void* userdata;
53     WrtPluginInstallerStatusCallback statusCallback;
54     WrtProgressCallback progressCallback;
55
56     PluginStatusCallbackStruct(void* u,
57             WrtPluginInstallerStatusCallback s,
58             WrtProgressCallback p) :
59         userdata(u),
60         statusCallback(s),
61         progressCallback(p)
62     {
63     }
64 };
65
66 void StatusCallback(std::string tizenId,
67         CommonError::Type result,
68         void *data);
69
70 void installFinishedCallback(void *userParam,
71         std::string tizenId,
72         Jobs::WidgetInstall::Exceptions::Type status);
73
74 void uninstallFinishedCallback(void *userParam,
75         std::string tizenId,
76         Jobs::WidgetUninstall::Exceptions::Type status);
77
78 void pluginInstallFinishedCallback(void *userParam,
79         Jobs::PluginInstall::Exceptions::Type status);
80
81 // callback for progress of install OR uninstall
82 void installProgressCallback(void *userParam,
83         ProgressPercent percent,
84         const ProgressDescription &description);
85
86 } //namespace
87
88 #endif /* WRT_SRC_API_API_CALLBACKS_TRANSLATE_H_ */