move into trunk
[platform/upstream/libzypp.git] / zypp / Package.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/Package.h
10  *
11 */
12 #ifndef ZYPP_PACKAGE_H
13 #define ZYPP_PACKAGE_H
14
15 #include "zypp/ResObject.h"
16 #include "zypp/PackageKeyword.h"
17 #include "zypp/Changelog.h"
18
19 ///////////////////////////////////////////////////////////////////
20 namespace zypp
21 { /////////////////////////////////////////////////////////////////
22
23   DEFINE_PTR_TYPE(Package);
24
25   ///////////////////////////////////////////////////////////////////
26   //
27   //    CLASS NAME : Package
28   //
29   /** Package interface.
30   */
31   class Package : public ResObject
32   {
33   public:
34     typedef Package                  Self;
35     typedef ResTraits<Self>          TraitsType;
36     typedef TraitsType::PtrType      Ptr;
37     typedef TraitsType::constPtrType constPtr;
38
39   public:
40     typedef std::set<PackageKeyword> Keywords;
41
42   public:
43
44     /** Get the package change log */
45     Changelog changelog() const;
46     /** */
47     std::string buildhost() const;
48     /** */
49     std::string distribution() const;
50     /** */
51     Label license() const;
52     /** */
53     std::string packager() const;
54     /** */
55     PackageGroup group() const;
56     /** */
57     Keywords keywords() const;
58     /** Don't ship it as class Url, because it might be
59      * in fact anything but a legal Url. */
60     std::string url() const;
61     /** */
62     std::string os() const;
63     /** */
64     Text prein() const;
65     /** */
66     Text postin() const;
67     /** */
68     Text preun() const;
69     /** */
70     Text postun() const;
71     /** */
72     ByteCount sourcesize() const;
73     /** */
74     std::list<std::string> authors() const;
75     /** */
76     std::list<std::string> filenames() const;
77
78     /** Name of the source rpm this package was built from.
79      * Empty if unknown.
80      */
81     std::string sourcePkgName() const;
82
83     /** Edition of the source rpm this package was built from.
84      * Empty if unknown.
85      */
86     Edition sourcePkgEdition() const;
87
88     /**
89      * Checksum the source says this package should have
90      * \deprecated Use location().checksum()
91      */
92     ZYPP_DEPRECATED CheckSum checksum() const
93     { return location().checksum(); }
94
95     /**
96      * \short Location of the resolvable in the repository
97      */
98     OnMediaLocation location() const;
99
100   protected:
101     friend Ptr make<Self>( const sat::Solvable & solvable_r );
102     /** Ctor */
103     Package( const sat::Solvable & solvable_r );
104     /** Dtor */
105     virtual ~Package();
106   };
107   ///////////////////////////////////////////////////////////////////
108
109   /////////////////////////////////////////////////////////////////
110 } // namespace zypp
111 ///////////////////////////////////////////////////////////////////
112 #endif // ZYPP_PACKAGE_H