merge REFACTORING-10_3 back to 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/detail/PackageImplIf.h"
17
18 ///////////////////////////////////////////////////////////////////
19 namespace zypp
20 { /////////////////////////////////////////////////////////////////
21
22   DEFINE_PTR_TYPE(Package);
23
24   ///////////////////////////////////////////////////////////////////
25   //
26   //    CLASS NAME : Package
27   //
28   /** Package interface.
29   */
30   class Package : public ResObject
31   {
32   public:
33     typedef detail::PackageImplIf    Impl;
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     /** Disk usage per directory */
79     DiskUsage diskusage() const;
80     
81     /**
82      * Checksum the source says this package should have
83      * \deprecated Use location().checksum()
84      */
85     ZYPP_DEPRECATED CheckSum checksum() const
86     { return location().checksum(); }
87     
88     /**
89      * \short Location of the resolvable in the repository
90      */
91     OnMediaLocation location() const;
92     
93   protected:
94     Package( const NVRAD & nvrad_r );
95     /** Dtor */
96     virtual ~Package();
97
98   private:
99     /** Access implementation */
100     virtual Impl & pimpl() = 0;
101     /** Access implementation */
102     virtual const Impl & pimpl() const = 0;
103   };
104   ///////////////////////////////////////////////////////////////////
105
106   /////////////////////////////////////////////////////////////////
107 } // namespace zypp
108 ///////////////////////////////////////////////////////////////////
109 #endif // ZYPP_PACKAGE_H