- Create the cache directly from the schema (installed) file.
[platform/upstream/libzypp.git] / zypp / Patch.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Patch.h
10  *
11 */
12 #ifndef ZYPP_PATCH_H
13 #define ZYPP_PATCH_H
14
15 #include "zypp/ResObject.h"
16 #include "zypp/detail/PatchImplIf.h"
17
18 ///////////////////////////////////////////////////////////////////
19 namespace zypp
20 { /////////////////////////////////////////////////////////////////
21
22   DEFINE_PTR_TYPE(Patch);
23
24   ///////////////////////////////////////////////////////////////////
25   //
26   //    CLASS NAME : Patch
27   //
28   /** Class representing a patch.
29    * \todo Patch::atoms can't be const, if Impl does not
30    * provide a const method. Check it.
31   */
32   class Patch : public ResObject
33   {
34   public:
35     typedef detail::PatchImplIf      Impl;
36     typedef Patch                    Self;
37     typedef ResTraits<Self>          TraitsType;
38     typedef TraitsType::PtrType      Ptr;
39     typedef TraitsType::constPtrType constPtr;
40
41   public:
42     typedef Impl::AtomList AtomList;
43
44   public:
45     /** Patch ID */
46     std::string id() const;
47     /** Patch time stamp */
48     Date timestamp() const;
49     /** Patch category (recommended, security,...) */
50     std::string category() const;
51     /** Does the system need to reboot to finish the update process? */
52     bool reboot_needed() const;
53     /** Does the patch affect the package manager itself? */
54     bool affects_pkg_manager() const;
55     /** The list of all atoms building the patch */
56     AtomList atoms() const;
57     /** Is the patch installation interactive? (does it need user input?) */
58     bool interactive() const;
59
60
61     void mark_atoms_to_freshen(bool freshen) ZYPP_DEPRECATED;
62     bool any_atom_selected() ZYPP_DEPRECATED;
63     void select() ZYPP_DEPRECATED;
64
65   protected:
66     /** Ctor */
67     Patch( const NVRAD & nvrad_r );
68     /** Dtor */
69     virtual ~Patch();
70
71   private:
72     /** Access implementation */
73     virtual Impl & pimpl() = 0;
74     /** Access implementation */
75     virtual const Impl & pimpl() const = 0;
76   };
77
78   /////////////////////////////////////////////////////////////////
79 } // namespace zypp
80 ///////////////////////////////////////////////////////////////////
81 #endif // ZYPP_PATCH_H