95d9e5368240412fd509cfb84eef29d01d2a7cc5
[platform/framework/native/installer.git] / src / Manager / ConfigurationManager.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file        ConfigurationManager.h
19  * @brief       This is the header file for the %ConfigurationManager class.
20  *
21  * This header file contains the declarations of the %ConfigurationManager class.
22  */
23 #ifndef _CONFIGURATION_MANAGER_H_
24 #define _CONFIGURATION_MANAGER_H_
25
26 #include "InstallationContext.h"
27
28 /**
29  * @class               ConfigurationManager
30  * @brief               This class represents the class of ConfigurationManager.
31  * @since               1.0
32  *
33  * This class represents the class of ConfigurationManager.
34  *
35  */
36 class ConfigurationManager
37 {
38 public:
39         ConfigurationManager(void);
40         virtual ~ConfigurationManager(void);
41
42         bool CreateFile(InstallationContext* pContext);
43         bool RemoveFile(InstallationContext* pContext);
44
45         bool PostInstall(InstallationContext* pContext, bool error) const;
46         bool PostUninstall(InstallationContext* pContext) const;
47
48 private:
49         bool CreateCoreXmlFile(InstallationContext* pContext) const;
50         bool RegisterCoreXmlFile(InstallationContext* pContext) const;
51         // bool CreateHybridServiceDesktopFile(InstallationContext* pContext);
52         bool MergeToSystemXmlFile(const Tizen::Base::String& systemXmlPath, const Tizen::Base::String& webXmlPath,const Tizen::Base::String& serviceXmlPath);
53         bool MergePrivileges(char* pMergedBuf, char* pServiceBuf, int& fileSize);
54
55         bool MergeAppWidgets(char* pMergedBuf, char* pServiceBuf, int& fileSize);
56         bool MergeAccounts(char* pMergedBuf, char* pServiceBuf, int& fileSize);
57         bool MergeNotifications(char* pMergedBuf, char* pServiceBuf, int& fileSize);
58         bool MergeIme(char* pMergedBuf, char* pServiceBuf, int& fileSize);
59         bool MergeTags(char* pMergedBuf, char* pServiceBuf, int& fileSize, const char* pStartTag, const char* pEndTag);
60
61         bool GetPart(const char* pStartPoint, const char* pStartTag, const char* pEndTag, char** ppBuf, int* pLength, char** ppNext);
62         bool MergeTo(const char* pMergedBuf, int& fileSize, const char* pTag, const char* pBuf, int length);
63
64         bool CreateImeSymlink(const Tizen::Base::String& binaryPath, const Tizen::Base::String& packageName);
65         bool FindPrivilege(InstallationContext* pContext, const Tizen::Base::String& privilege) const;
66
67         bool CreateAppInfoFile(AppData* pAppData, const Tizen::Base::String& rootPath) const;
68
69 }; // ConfigurationManager
70
71 #endif // _CONFIGURATION_MANAGER_H_