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