[Release] wrt-installer_0.1.23
[framework/web/wrt-installer.git] / src / wrt-installer / wrt_installer_api.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        wrt_installer_api.h
18  * @author      Chung Jihoon (jihoon.chung@samsung.com)
19  * @version     1.0
20  * @brief       This file contains declarations of wrt_installer_api
21  */
22
23 #ifndef WRT_INSTALLER_API_H_
24 #define WRT_INSTALLER_API_H_
25
26 #include <string>
27 #include <stdbool.h>
28 #include <stddef.h>
29 #include <wrt_type.h>
30 #include <pkgmgr_signal_interface.h>
31 #include <memory>
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 typedef void (*WrtInstallerInitCallback)(WrtErrStatus status,
38                                          void *data);
39 typedef void (*WrtPluginInstallerStatusCallback)(WrtErrStatus status,
40                                                  void *data);
41 typedef void (*WrtInstallerStatusCallback)(std::string tizenId,
42                                            WrtErrStatus status,
43                                            void *data);
44 typedef void (*WrtProgressCallback)(float percent,
45                                     const char *description,
46                                     void *data);
47 typedef void (*WrtAllPluginInstalledCallback)(void *userdata);
48
49 typedef struct
50 {
51     WrtAllPluginInstalledCallback plugin_installed_cb;
52     char *plugin_path;
53     void *user_data;
54 } wrt_plugin_data;
55
56 enum WrtInstallMode
57 {
58     WRT_INSTALL_MODE_UNKNOWN = 0,
59     WRT_INSTALL_MODE_INSTALL_WGT,
60     WRT_INSTALL_MODE_INSTALL_DIRECTORY,
61     WRT_INSTALL_MODE_INSTALL_PRELOAD
62 };
63
64 void wrt_installer_init(
65     void *userdata,
66     WrtInstallerInitCallback callback);
67 void wrt_installer_shutdown(void);
68 void wrt_install_widget(
69     const char *path,
70     void *user_parameter,
71     WrtInstallerStatusCallback status_callback,
72     WrtProgressCallback progress_callback,
73     WrtInstallMode install_mode,
74     bool quiet,
75     std::shared_ptr<PackageManager::IPkgmgrSignal>
76     pkgmgrInterface
77     );
78 void wrt_uninstall_widget (
79     const char * const tzAppid,
80     void* userdata,
81     WrtInstallerStatusCallback status_cb,
82     WrtProgressCallback progress_cb,
83     std::shared_ptr<PackageManager::IPkgmgrSignal>
84     pkgmgrSignalInterface);
85 void wrt_install_plugin(const char *pluginDirectory,
86                         void *userData,
87                         WrtPluginInstallerStatusCallback statusCallback,
88                         WrtProgressCallback progressCallback);
89 void wrt_install_all_plugins(WrtAllPluginInstalledCallback installed_cb,
90                              void *user_param);
91
92 #ifdef __cplusplus
93 }
94 #endif
95
96 #endif /* WRT_INSTALLER_API_H_ */