+ Package::maybeUnsupported
[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     /**
54      * True if the vendor support for this package
55      * is unknown or explictly unsupported.
56      */
57     bool maybeUnsupported() const;
58
59     /** Get the package change log */
60     Changelog changelog() const;
61     /** */
62     std::string buildhost() const;
63     /** */
64     std::string distribution() const;
65     /** */
66     std::string license() const;
67     /** */
68     std::string packager() const;
69     /** */
70     std::string group() const;
71     /** */
72     Keywords keywords() const;
73     /** Don't ship it as class Url, because it might be
74      * in fact anything but a legal Url. */
75     std::string url() const;
76     /** Size of corresponding the source package. */
77     ByteCount sourcesize() const;
78     /** */
79     std::list<std::string> authors() const;
80     /** */
81     std::list<std::string> filenames() const;
82
83     /** Name of the source rpm this package was built from.
84      */
85     std::string sourcePkgName() const;
86
87     /** Edition of the source rpm this package was built from.
88      */
89     Edition sourcePkgEdition() const;
90
91     /**
92      * Checksum the source says this package should have.
93      * \see \ref location
94      */
95     CheckSum checksum() const;
96
97     /** Location of the resolvable in the repository.
98      * \ref OnMediaLocation conatins all information required to
99      * retrieve the packge (url, checksum, etc.).
100      */
101     OnMediaLocation location() const;
102
103   protected:
104     friend Ptr make<Self>( const sat::Solvable & solvable_r );
105     /** Ctor */
106     Package( const sat::Solvable & solvable_r );
107     /** Dtor */
108     virtual ~Package();
109   };
110
111   ///////////////////////////////////////////////////////////////////
112
113   /////////////////////////////////////////////////////////////////
114 } // namespace zypp
115 ///////////////////////////////////////////////////////////////////
116 #endif // ZYPP_PACKAGE_H