768770458ce5dde2fc3d236804dde43df3a5e0dd
[platform/core/dotnet/launcher.git] / NativeLauncher / inc / tac_installer.h
1 /*
2  * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved\r
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 #ifndef __TAC_INSTALLER_H__\r
18 #define __TAC_INSTALLER_H__\r
19 \r
20 #include <functional>\r
21 \r
22 typedef enum {
23         TAC_STATE_NONE = 0,
24         TAC_STATE_INSTALL = 1,
25         TAC_STATE_UPGRADE = 2,
26         TAC_STATE_UNINSTALL = 3,
27         TAC_STATE_REMOVED = 4,
28         TAC_STATE_RESTORE = 5
29 } tac_state;
30
31 /**
32  * @brief Tac install
33  * @param[in] pkgId package ID
34  * @param[in] state state of tac
35  * @param[in] tacForce force TAC to package
36  * @return 0 if success, otherwise -1
37  */
38 int tacInstall(const std::string& pkgId, tac_state state, bool tacForce = false);
39
40 /**
41  * @brief Tac upgrade
42  * @param[in] pkgId package ID
43  * @param[in] state state of tac
44  * @param[in] tacForce force TAC to package
45  * @return 0 if success, otherwise -1
46  */
47 int tacUpgrade(const std::string& pkgId, tac_state state, bool tacForce = false);
48
49 /**
50  * @brief Tac uninstall
51  * @param[in] pkgId package ID
52  * @param[in] state state of tac
53  * @return 0 if success, otherwise -1
54  */
55 int tacUninstall(const std::string& pkgId, tac_state state);
56
57 /**
58  * @brief Tac clean
59  * @param[in] pkgId package ID
60  * @return 0 if success, otherwise -1
61  */
62 int tacClean(const std::string& pkgId);\r
63
64 /**
65  * @brief Tac remove
66  * @param[in] pkgId package ID
67  * @return 0 if success, otherwise -1
68  */
69 int tacRemoved(const std::string& pkgId);\r
70
71 /**
72  * @brief Tac undo
73  * @param[in] pkgId package ID
74  * @return 0 if success, otherwise -1
75  */
76 int tacUndo(const std::string& pkgId);\r
77
78 #endif /* __TAC_INSTALLER_H__ */\r