Fix the crash while installing of ServiceApp
[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 RegisterCertInfo(InstallationContext* pContext) const;
46         bool UnregisterCertInfo(InstallationContext* pContext) const;
47
48         bool PostInstall(InstallationContext* pContext, bool error) const;
49         bool PostUninstall(InstallationContext* pContext) const;
50
51 private:
52         bool CreateCoreXmlFile(InstallationContext* pContext);
53         // bool CreateHybridServiceDesktopFile(InstallationContext* pContext);
54         bool MergeToSystemXmlFile(const Tizen::Base::String& systemXmlPath, const Tizen::Base::String& webXmlPath,const Tizen::Base::String& serviceXmlPath);
55
56         bool CreateInfoFile(const Tizen::Base::String& filePath, const Tizen::Base::String* pContext);
57         bool CreateImeSymlink(const Tizen::Base::String& binaryPath, const Tizen::Base::String& packageName);
58         bool FindPrivilege(InstallationContext* pContext, const Tizen::Base::String& privilege) const;
59         bool SetCertHashValue(void* pHandle, Tizen::Security::Cert::X509CertificatePath* pCertPath, int certType) const;
60         char* GetCertValueN(Tizen::Security::Cert::ICertificate* pCert) const;
61
62 }; // ConfigurationManager
63
64 #endif // _CONFIGURATION_MANAGER_H_