- Make basic attributes available through ResObject.
[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
33   public:
34     typedef detail::PackageImplIf    Impl;
35     typedef Package                  Self;
36     typedef ResTraits<Self>          TraitsType;
37     typedef TraitsType::PtrType      Ptr;
38     typedef TraitsType::constPtrType constPtr;
39
40   public:
41     /**
42      * Checksum the source says this package should have
43      */
44     CheckSum checksum() const;
45     /** Get the package change log */
46     Changelog changelog() const;
47     /** */
48     std::string buildhost() const;
49     /** */
50     std::string distribution() const;
51     /** */
52     Label license() const;
53     /** */
54     std::string packager() const;
55     /** */
56     PackageGroup group() const;
57     /** Don't ship it as class Url, because it might be
58      * in fact anything but a legal Url. */
59     std::string url() const;
60     /** */
61     std::string os() const;
62     /** */
63     Text prein() const;
64     /** */
65     Text postin() const;
66     /** */
67     Text preun() const;
68     /** */
69     Text postun() const;
70     /** */
71     ByteCount sourcesize() const;
72     /** */
73     std::list<std::string> authors() const;
74     /** */
75     std::list<std::string> filenames() const;
76
77     /** Disk usage per directory */
78     DiskUsage diskusage() const;
79
80     /** location in source */
81     Pathname location() const;
82
83   protected:
84     Package( const NVRAD & nvrad_r );
85     /** Dtor */
86     virtual ~Package();
87
88   private:
89     /** Access implementation */
90     virtual Impl & pimpl() = 0;
91     /** Access implementation */
92     virtual const Impl & pimpl() const = 0;
93   };
94   ///////////////////////////////////////////////////////////////////
95
96   /////////////////////////////////////////////////////////////////
97 } // namespace zypp
98 ///////////////////////////////////////////////////////////////////
99 #endif // ZYPP_PACKAGE_H