backup of YUM*Impl skeletons
[platform/upstream/libzypp.git] / zypp / detail / PackageImplIf.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/detail/PackageImplIf.h
10  *
11 */
12 #ifndef ZYPP_DETAIL_PACKAGEIMPLIF_H
13 #define ZYPP_DETAIL_PACKAGEIMPLIF_H
14
15 #include "zypp/detail/ResObjectImplIf.h"
16
17 ///////////////////////////////////////////////////////////////////
18 namespace zypp
19 { /////////////////////////////////////////////////////////////////
20
21   class Package;
22
23   ///////////////////////////////////////////////////////////////////
24   namespace detail
25   { /////////////////////////////////////////////////////////////////
26
27     ///////////////////////////////////////////////////////////////////
28     //
29     //  CLASS NAME : PackageImplIf
30     //
31     /** Abstact Package implementation interface.
32     */
33     class PackageImplIf : public ResObjectImplIf
34     {
35     public:
36       typedef Package ResType;
37 #if 0
38       class CheckSum
39       {
40       public:
41         CheckSum(std::string type, bool pkgid, std::string checksum) {
42           _type = type; _pkgid = pkgid; _checksum = checksum;
43         }
44         std::string type() { return _type; }
45         bool pkgid() { return _pkgid; }
46         std::string checksum() { return _checksum; }
47       private:
48         std::string _type;
49         bool _pkgid;
50         std::string _checksum;
51       };
52       /**
53       * @short Holds data about how much space will be needed per directory
54       **/
55       class DirSize {
56       public:
57         DirSize();
58         DirSize(const std::string& path,
59                 const std::string& size,
60                 const std::string& fileCount)
61         : path(path), sizeKByte(size), fileCount(fileCount)
62         {}
63         const std::string path;
64         const std::string sizeKByte;
65         const std::string fileCount;
66       };
67     
68       /**
69        * @short Holds Data about file and file type
70        *  (directory, plain)
71        **/
72       class FileData {
73       public:
74         std::string name;
75         std::string type;
76         FileData();
77         FileData(const std::string &name,
78                  const std::string &type)
79         : name(name), type(type)
80         {}
81       };
82 #endif
83
84     public:
85       /** \name Rpm Package Attributes. */
86       //@{
87       /** */
88       virtual Date buildtime() const PURE_VIRTUAL;
89       /** */
90       virtual std::string buildhost() const PURE_VIRTUAL;
91       /** */
92       virtual Date installtime() const PURE_VIRTUAL;
93       /** */
94       virtual std::string distribution() const PURE_VIRTUAL;
95       /** */
96       virtual Vendor vendor() const PURE_VIRTUAL;
97       /** */
98       virtual Label license() const PURE_VIRTUAL;
99       /** */
100       virtual std::string packager() const PURE_VIRTUAL;
101       /** */
102       virtual PackageGroup group() const PURE_VIRTUAL;
103       /** */
104       virtual Text changelog() const PURE_VIRTUAL;
105       /** Don't ship it as class Url, because it might be
106        * in fact anything but a legal Url. */
107       virtual std::string url() const PURE_VIRTUAL;
108       /** */
109       virtual std::string os() const PURE_VIRTUAL;
110       /** */
111       virtual Text prein() const PURE_VIRTUAL;
112       /** */
113       virtual Text postin() const PURE_VIRTUAL;
114       /** */
115       virtual Text preun() const PURE_VIRTUAL;
116       /** */
117       virtual Text postun() const PURE_VIRTUAL;
118       /** */
119       virtual FSize sourcesize() const PURE_VIRTUAL;
120       /** */
121       virtual FSize archivesize() const PURE_VIRTUAL;
122       /** */
123       virtual Text authors() const PURE_VIRTUAL;
124       /** */
125       virtual Text filenames() const PURE_VIRTUAL;
126       //@}
127
128       /** \name Additional Package Attributes.
129        * \todo review what's actually needed here. Maybe worth grouping
130        * all the package rertieval related stuff in a class. Easier to ship
131        * and handle it.
132       */
133       //@{
134       /** */
135       virtual License licenseToConfirm() const PURE_VIRTUAL;
136 #if 0
137       /** */
138       virtual std::string sourceloc() const PURE_VIRTUAL;
139       /** */
140       virtual void du( PkgDu & dudata_r ) const PURE_VIRTUAL;
141       /** */
142       virtual std::string location() const PURE_VIRTUAL;
143       /** */
144       virtual unsigned int medianr() const PURE_VIRTUAL;
145       /** */
146       virtual PackageKeywords keywords() const PURE_VIRTUAL;
147       /** */
148       virtual std::string md5sum() const PURE_VIRTUAL;
149       /** */
150       virtual std::string externalUrl() const PURE_VIRTUAL;
151       /** */
152       virtual std::list<Edition> patchRpmBaseVersions() const PURE_VIRTUAL;
153       /** */
154       virtual FSize patchRpmSize() const PURE_VIRTUAL;
155       /** */
156       virtual bool forceInstall() const PURE_VIRTUAL;
157       /** */
158       virtual std::string patchRpmMD5() const PURE_VIRTUAL;
159       /** */
160       virtual bool isRemote() const PURE_VIRTUAL;
161       /** */
162       virtual PMError providePkgToInstall( Pathname& path_r ) const PURE_VIRTUAL;
163       /** */
164       virtual PMError provideSrcPkgToInstall( Pathname& path_r ) const PURE_VIRTUAL;
165       /** */
166       virtual constInstSrcPtr source() const PURE_VIRTUAL;
167       /** */
168       virtual std::list<PMPackageDelta> deltas() const PURE_VIRTUAL;
169 #endif
170       //@}
171     };
172     ///////////////////////////////////////////////////////////////////
173
174     /////////////////////////////////////////////////////////////////
175   } // namespace detail
176   ///////////////////////////////////////////////////////////////////
177   /////////////////////////////////////////////////////////////////
178 } // namespace zypp
179 ///////////////////////////////////////////////////////////////////
180 #endif // ZYPP_DETAIL_PACKAGEIMPLIF_H