89cc887dca6391004fea639fd3055f305a87e52e
[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
17 ///////////////////////////////////////////////////////////////////
18 namespace zypp
19 { /////////////////////////////////////////////////////////////////
20
21   DEFINE_PTR_TYPE(Patch);
22
23   ///////////////////////////////////////////////////////////////////
24   //
25   //    CLASS NAME : Patch
26   //
27   /** Class representing a patch.
28    * \todo Patch::atoms can't be const, if Impl does not
29    * provide a const method. Check it.
30   */
31   class Patch : public ResObject
32   {
33   public:
34     typedef Patch                    Self;
35     typedef ResTraits<Self>          TraitsType;
36     typedef TraitsType::PtrType      Ptr;
37     typedef TraitsType::constPtrType constPtr;
38
39   public:
40     typedef std::list<ResObject::Ptr> AtomList;
41
42   public:
43     /** Patch ID */
44     std::string id() const;
45     /** Patch time stamp */
46     Date timestamp() const;
47     /** Patch category (recommended, security,...) */
48     std::string category() const;
49     /** Does the system need to reboot to finish the update process? */
50     bool reboot_needed() const;
51     /** Does the patch affect the package manager itself? */
52     bool affects_pkg_manager() const;
53     /** The list of all atoms building the patch */
54     AtomList atoms() const;
55     /** Is the patch installation interactive? (does it need user input?) */
56     bool interactive() const;
57
58   protected:
59     friend Ptr make<Self>( const sat::Solvable & solvable_r );
60     /** Ctor */
61     Patch( const sat::Solvable & solvable_r );
62     /** Dtor */
63     virtual ~Patch();
64   };
65
66   /////////////////////////////////////////////////////////////////
67 } // namespace zypp
68 ///////////////////////////////////////////////////////////////////
69 #endif // ZYPP_PATCH_H