uninstall_task.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PALUDIS_GUARD_PALUDIS_UNINSTALL_TASK_HH
00021 #define PALUDIS_GUARD_PALUDIS_UNINSTALL_TASK_HH 1
00022
00023 #include <paludis/dep_spec-fwd.hh>
00024 #include <paludis/dep_tree.hh>
00025 #include <paludis/package_id.hh>
00026 #include <paludis/util/instantiation_policy.hh>
00027 #include <paludis/util/private_implementation_pattern.hh>
00028 #include <paludis/util/exception.hh>
00029 #include <paludis/util/wrapped_forward_iterator-fwd.hh>
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 namespace paludis
00042 {
00043 class Environment;
00044 class UninstallListEntry;
00045
00046
00047
00048
00049
00050
00051
00052 class PALUDIS_VISIBLE AmbiguousUnmergeTargetError :
00053 public Exception
00054 {
00055 private:
00056 const std::string _t;
00057 const std::tr1::shared_ptr<const PackageIDSequence> _p;
00058
00059 public:
00060
00061
00062
00063 AmbiguousUnmergeTargetError(const std::string & our_target,
00064 const std::tr1::shared_ptr<const PackageIDSequence> matches) throw ();
00065
00066 ~AmbiguousUnmergeTargetError() throw ();
00067
00068
00069
00070
00071
00072
00073 struct ConstIteratorTag;
00074 typedef WrappedForwardIterator<ConstIteratorTag, const std::tr1::shared_ptr<const PackageID> > ConstIterator;
00075 ConstIterator begin() const;
00076 ConstIterator end() const;
00077
00078
00079
00080
00081
00082
00083 std::string target() const;
00084 };
00085
00086
00087
00088
00089
00090
00091
00092 class PALUDIS_VISIBLE UninstallTask :
00093 PrivateImplementationPattern<UninstallTask>,
00094 InstantiationPolicy<UninstallTask, instantiation_method::NonCopyableTag>
00095 {
00096 protected:
00097
00098
00099
00100 UninstallTask(Environment * const env);
00101
00102
00103
00104 public:
00105
00106
00107
00108 virtual ~UninstallTask();
00109
00110
00111
00112
00113
00114
00115 void set_pretend(const bool value);
00116 void set_preserve_world(const bool value);
00117 void set_all_versions(const bool value);
00118 void set_with_unused_dependencies(const bool value);
00119 void set_with_dependencies(const bool value);
00120 void set_check_safety(const bool value);
00121
00122
00123
00124
00125
00126
00127 void add_target(const std::string &);
00128 void add_unused();
00129
00130
00131
00132
00133
00134
00135 virtual void on_build_unmergelist_pre() = 0;
00136 virtual void on_build_unmergelist_post() = 0;
00137
00138 virtual void on_display_unmerge_list_pre() = 0;
00139 virtual void on_display_unmerge_list_post() = 0;
00140 virtual void on_display_unmerge_list_entry(const UninstallListEntry &) = 0;
00141
00142 virtual void on_uninstall_all_pre() = 0;
00143 virtual void on_uninstall_pre(const UninstallListEntry &) = 0;
00144 virtual void on_uninstall_post(const UninstallListEntry &) = 0;
00145 virtual void on_uninstall_all_post() = 0;
00146
00147 virtual void on_not_continuing_due_to_errors() = 0;
00148
00149 virtual void on_update_world_pre() = 0;
00150 virtual void on_update_world(const PackageDepSpec &) = 0;
00151 virtual void on_update_world(const SetName &) = 0;
00152 virtual void on_update_world_post() = 0;
00153 virtual void on_preserve_world() = 0;
00154
00155
00156
00157
00158
00159
00160 virtual void world_remove_set(const SetName &);
00161 virtual void world_remove_packages(const std::tr1::shared_ptr<const SetSpecTree::ConstItem> &);
00162
00163
00164
00165
00166
00167
00168 void execute();
00169 };
00170 }
00171
00172 #endif