Export package attributes through public interface
[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   ///////////////////////////////////////////////////////////////////
23   //
24   //    CLASS NAME : Package
25   //
26   /** Package interface.
27   */
28   class Package : public ResObject
29   {
30   public:
31     typedef detail::PackageImplIf    Impl;
32     typedef Package                  Self;
33     typedef ResTraits<Self>          TraitsType;
34     typedef TraitsType::PtrType      Ptr;
35     typedef TraitsType::constPtrType constPtr;
36
37   public:
38     /** Time of package installation */
39     Date installtime() const;
40     /** Get the package change log */
41     Changelog changelog() const;
42     /** */
43     Date buildtime() const;
44     /** */
45     std::string buildhost() const;
46     /** */
47     std::string distribution() const;
48     /** */
49     Vendor vendor() const;
50     /** */
51     Label license() const;
52     /** */
53     std::string packager() const;
54     /** */
55     PackageGroup group() const;
56     /** Don't ship it as class Url, because it might be
57      * in fact anything but a legal Url. */
58     std::string url() const;
59     /** */
60     std::string os() const;
61     /** */
62     Text prein() const;
63     /** */
64     Text postin() const;
65     /** */
66     Text preun() const;
67     /** */
68     Text postun() const;
69     /** */
70     ByteCount sourcesize() const;
71     /** */
72     ByteCount archivesize() const;
73     /** */
74     Text authors() const;
75     /** */
76     Text filenames() const;
77     /** */
78     License licenseToConfirm() const;
79     // data here:
80
81   protected:
82     Package( const NVRAD & nvrad_r );
83     /** Dtor */
84     virtual ~Package();
85
86   private:
87     /** Access implementation */
88     virtual Impl & pimpl() = 0;
89     /** Access implementation */
90     virtual const Impl & pimpl() const = 0;
91   };
92   ///////////////////////////////////////////////////////////////////
93
94   /////////////////////////////////////////////////////////////////
95 } // namespace zypp
96 ///////////////////////////////////////////////////////////////////
97 #endif // ZYPP_PACKAGE_H