2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file InstallerManager.h
19 * @brief This is the header file for the %InstallerManager class.
21 * This header file contains the declarations of the %InstallerManager class.
23 #ifndef _INSTALLER_MANAGER_H_
24 #define _INSTALLER_MANAGER_H_
26 #include "InstallationContext.h"
27 #include "Installer.h"
30 * @class InstallerManager
31 * @brief This class represents the class of InstallerManager.
34 * This class represents the class of InstallerManager.
37 class InstallerManager
40 InstallerManager(void);
41 InstallerError Construct(const Tizen::Base::String& path, InstallerOperation op, InstallerOption option);
42 virtual ~InstallerManager(void);
44 static InstallerManager* GetInstance(void);
47 bool RemoveGarbage(const Tizen::Base::String& filePath);
49 void PrintResult(void);
50 void PrintError(int errorType);
52 const Tizen::App::PackageId& GetId(void) const;
53 void SetId(const Tizen::App::PackageId& appId);
55 int GetErrorType(void) const;
56 void SetErrorType(int errorType);
58 void SetInstallerOperation(InstallerOperation op);
59 InstallerOperation GetInstallerOperation(void) const;
61 Tizen::Base::String GetLogFilePath() const;
62 bool IsFileLogOn() const;
64 static int Request(const Tizen::Base::String& path, InstallerOperation operation, InstallerOption option, Tizen::Base::String& packageId);
65 static int RequestRecursiveDirectory(const Tizen::Base::String& path, int& errorType);
66 static int RequestByCommand(int argc, char **argv);
67 static int ReqeustByTest(void);
68 static int RequestMove(const Tizen::App::PackageId& packageId, int moveType);
71 InstallerManager(const InstallerManager& value);
72 InstallerManager& operator =(const InstallerManager& source);
74 InstallationStep GetNext(void);
76 InstallerError Init(void);
77 InstallerError Register(void);
78 InstallerError End(void);
80 InstallerError Error(void);
81 InstallerError Rollback(void);
82 InstallerError UserCancel(void);
84 InstallerError Activate(void);
85 InstallerError Progress(void);
87 Installer* CreateInstaller(InstallerType installerType);
88 InstallationContext* GetContext(void);
90 static int ParseCommandArg(int argc, char **argv, int *mode, char *buf, bool *output);
93 static InstallerManager* __pInstallerManager;
94 InstallationContext* __pContext;
95 Installer* __pInstaller;
97 Tizen::App::PackageId __packageId;
99 InstallerOperation __operation;
101 long long __startTick;
103 Tizen::Base::String __logFilePath;
106 }; // InstallerManager
108 #endif //_INSTALLER_MANAGER_H_