add vendor support enums
[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 #include "zypp/VendorSupportOptions.h"
19
20 ///////////////////////////////////////////////////////////////////
21 namespace zypp
22 { /////////////////////////////////////////////////////////////////
23
24   DEFINE_PTR_TYPE(Package);
25
26   ///////////////////////////////////////////////////////////////////
27   //
28   //    CLASS NAME : Package
29   //
30   /** Package interface.
31   */
32   class Package : public ResObject
33   {
34   public:
35     typedef Package                  Self;
36     typedef ResTraits<Self>          TraitsType;
37     typedef TraitsType::PtrType      Ptr;
38     typedef TraitsType::constPtrType constPtr;
39
40   public:
41     typedef sat::ArrayAttr<PackageKeyword,IdString> Keywords;
42
43   public:
44
45     /**
46      * Returns the level of supportability the vendor
47      * gives to this package.
48      * 
49      * This is one value from \ref VendorSupportOption
50      */
51     VendorSupportOption vendorSupport() const;
52
53     /** Get the package change log */
54     Changelog changelog() const;
55     /** */
56     std::string buildhost() const;
57     /** */
58     std::string distribution() const;
59     /** */
60     std::string license() const;
61     /** */
62     std::string packager() const;
63     /** */
64     std::string group() const;
65     /** */
66     Keywords keywords() const;
67     /** Don't ship it as class Url, because it might be
68      * in fact anything but a legal Url. */
69     std::string url() const;
70     /** Size of corresponding the source package. */
71     ByteCount sourcesize() const;
72     /** */
73     std::list<std::string> authors() const;
74     /** */
75     std::list<std::string> filenames() const;
76
77     /** Name of the source rpm this package was built from.
78      */
79     std::string sourcePkgName() const;
80
81     /** Edition of the source rpm this package was built from.
82      */
83     Edition sourcePkgEdition() const;
84
85     /**
86      * Checksum the source says this package should have.
87      * \see \ref location
88      */
89     CheckSum checksum() const;
90
91     /** Location of the resolvable in the repository.
92      * \ref OnMediaLocation conatins all information required to
93      * retrieve the packge (url, checksum, etc.).
94      */
95     OnMediaLocation location() const;
96
97   protected:
98     friend Ptr make<Self>( const sat::Solvable & solvable_r );
99     /** Ctor */
100     Package( const sat::Solvable & solvable_r );
101     /** Dtor */
102     virtual ~Package();
103   };
104
105   ///////////////////////////////////////////////////////////////////
106
107   /////////////////////////////////////////////////////////////////
108 } // namespace zypp
109 ///////////////////////////////////////////////////////////////////
110 #endif // ZYPP_PACKAGE_H