[Release] wrt-installer_0.1.53
[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 <wrt_install_mode.h>
31 #include <pkgmgr_signal_interface.h>
32 #include <memory>
33
34 typedef void (*WrtInstallerInitCallback)(WrtErrStatus status,
35                                          void *data);
36 typedef void (*WrtPluginInstallerStatusCallback)(WrtErrStatus status,
37                                                  void *data);
38 typedef void (*WrtInstallerStatusCallback)(std::string tizenId,
39                                            WrtErrStatus status,
40                                            void *data);
41 typedef void (*WrtProgressCallback)(float percent,
42                                     const char *description,
43                                     void *data);
44
45 void wrt_installer_init(
46     void *userdata,
47     WrtInstallerInitCallback callback);
48 void wrt_installer_shutdown(void);
49 void wrt_install_widget(
50     const char *path,
51     void *user_parameter,
52     WrtInstallerStatusCallback status_callback,
53     WrtProgressCallback progress_callback,
54     InstallMode install_mode,
55     std::shared_ptr<PackageManager::IPkgmgrSignal>
56     pkgmgrInterface
57     );
58 void wrt_uninstall_widget (
59     const char * const tzAppid,
60     void* userdata,
61     WrtInstallerStatusCallback status_cb,
62     WrtProgressCallback progress_cb,
63     std::shared_ptr<PackageManager::IPkgmgrSignal>
64     pkgmgrSignalInterface);
65 void wrt_install_plugin(const char *pluginDirectory,
66                         void *userData,
67                         WrtPluginInstallerStatusCallback statusCallback,
68                         WrtProgressCallback progressCallback);
69
70 #endif /* WRT_INSTALLER_API_H_ */