4e3692e02a8477829b17de933d440231d7e3e34f
[platform/core/appfw/app-installers.git] / src / common / step / filesystem / step_recover_icons.h
1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMMON_STEP_FILESYSTEM_STEP_RECOVER_ICONS_H_
6 #define COMMON_STEP_FILESYSTEM_STEP_RECOVER_ICONS_H_
7
8 #include <boost/filesystem/path.hpp>
9
10 #include <manifest_parser/utils/logging.h>
11
12 #include <set>
13 #include <string>
14 #include <utility>
15
16 #include "common/installer_context.h"
17 #include "common/step/recovery/step_recovery.h"
18
19 namespace common_installer {
20 namespace filesystem {
21
22 /**
23  * @brief The StepRecoverIcons class
24  *        Fixes state of platform icon files in recovery mode.
25  *
26  * For recovery of new installation, all icons files are removed.
27  * For recovery of update installation, all icons of applications of package are
28  * restored to its previous locations.
29  */
30 class StepRecoverIcons : public recovery::StepRecovery {
31  public:
32   using StepRecovery::StepRecovery;
33
34   Status RecoveryNew() override;
35   Status RecoveryUpdate() override;
36
37  private:
38   bool TryGatherIcons();
39
40   std::set<std::pair<boost::filesystem::path, boost::filesystem::path>>
41       icons_;
42
43   STEP_NAME(RecoverIcons)
44 };
45
46 }  // namespace filesystem
47 }  // namespace common_installer
48
49 #endif  // COMMON_STEP_FILESYSTEM_STEP_RECOVER_ICONS_H_