731818d99af9f293b95358f0b8e13e84b64665b8
[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 <set>
16
17 #include "zypp/detail/ResObjectImplIf.h"
18 #include "zypp/Edition.h"
19 #include "zypp/Arch.h"
20 #include "zypp/Changelog.h"
21 #include "zypp/PatchRpm.h"
22 #include "zypp/DeltaRpm.h"
23
24 ///////////////////////////////////////////////////////////////////
25 namespace zypp
26 { /////////////////////////////////////////////////////////////////
27
28   class Package;
29
30   ///////////////////////////////////////////////////////////////////
31   namespace detail
32   { /////////////////////////////////////////////////////////////////
33
34     ///////////////////////////////////////////////////////////////////
35     //
36     //  CLASS NAME : PackageImplIf
37     //
38     /** Abstact Package implementation interface.
39     */
40     class PackageImplIf : public ResObjectImplIf
41     {
42     public:
43       typedef Package ResType;
44
45 #if 0
46     
47       /**
48        * @short Holds Data about file and file type
49        *  (directory, plain)
50        **/
51       class FileData {
52       public:
53         std::string name;
54         std::string type;
55         FileData();
56         FileData(const std::string &name,
57                  const std::string &type)
58         : name(name), type(type)
59         {}
60       };
61 #endif
62
63     public:
64       /** \name Rpm Package Attributes. */
65       //@{
66       /** */
67       virtual Date buildtime() const PURE_VIRTUAL;
68       /** */
69       virtual std::string buildhost() const PURE_VIRTUAL;
70       /** */
71       virtual Date installtime() const PURE_VIRTUAL;
72       /** */
73       virtual std::string distribution() const PURE_VIRTUAL;
74       /** */
75       virtual Vendor vendor() const PURE_VIRTUAL;
76       /** */
77       virtual Label license() const PURE_VIRTUAL;
78       /** */
79       virtual std::string packager() const PURE_VIRTUAL;
80       /** */
81       virtual PackageGroup group() const PURE_VIRTUAL;
82       /** */
83       virtual Changelog changelog() const PURE_VIRTUAL;
84       /** */
85       virtual Pathname location() const PURE_VIRTUAL;
86       /** Don't ship it as class Url, because it might be
87        * in fact anything but a legal Url. */
88       virtual std::string url() const PURE_VIRTUAL;
89       /** */
90       virtual std::string os() const PURE_VIRTUAL;
91       /** */
92       virtual Text prein() const PURE_VIRTUAL;
93       /** */
94       virtual Text postin() const PURE_VIRTUAL;
95       /** */
96       virtual Text preun() const PURE_VIRTUAL;
97       /** */
98       virtual Text postun() const PURE_VIRTUAL;
99       /** */
100       virtual ByteCount sourcesize() const PURE_VIRTUAL;
101       /** */
102       virtual ByteCount archivesize() const PURE_VIRTUAL;
103       /** */
104       virtual std::list<std::string> authors() const PURE_VIRTUAL;
105       /** */
106       virtual std::list<std::string> filenames() const PURE_VIRTUAL;
107       /** */
108       virtual std::list<DeltaRpm> deltaRpms() const PURE_VIRTUAL;
109       /** */
110       virtual std::list<PatchRpm> patchRpms() const PURE_VIRTUAL;
111       /** */
112       virtual bool installOnly() const PURE_VIRTUAL;
113
114       //@}
115
116       /** \name Additional Package Attributes.
117        * \todo review what's actually needed here. Maybe worth grouping
118        * all the package rertieval related stuff in a class. Easier to ship
119        * and handle it.
120       */
121       //@{
122       /** */
123       virtual License licenseToConfirm() const PURE_VIRTUAL;
124 #if 0
125       /** */
126       virtual std::string sourceloc() const PURE_VIRTUAL;
127       /** */
128       virtual void du( PkgDu & dudata_r ) const PURE_VIRTUAL;
129       /** */
130       virtual std::string location() const PURE_VIRTUAL;
131       /** */
132       virtual unsigned int medianr() const PURE_VIRTUAL;
133       /** */
134       virtual PackageKeywords keywords() const PURE_VIRTUAL;
135       /** */
136       virtual std::string md5sum() const PURE_VIRTUAL;
137       /** */
138       virtual std::string externalUrl() const PURE_VIRTUAL;
139       /** */
140       virtual std::list<Edition> patchRpmBaseVersions() const PURE_VIRTUAL;
141       /** */
142       virtual ByteCount patchRpmSize() const PURE_VIRTUAL;
143       /** */
144       virtual bool forceInstall() const PURE_VIRTUAL;
145       /** */
146       virtual std::string patchRpmMD5() const PURE_VIRTUAL;
147       /** */
148       virtual bool isRemote() const PURE_VIRTUAL;
149       /** */
150       virtual PMError providePkgToInstall( Pathname& path_r ) const PURE_VIRTUAL;
151       /** */
152       virtual PMError provideSrcPkgToInstall( Pathname& path_r ) const PURE_VIRTUAL;
153       /** */
154       virtual constInstSrcPtr source() const PURE_VIRTUAL;
155       /** */
156       virtual std::list<PMPackageDelta> deltas() const PURE_VIRTUAL;
157 #endif
158       //@}
159     };
160     ///////////////////////////////////////////////////////////////////
161
162     /////////////////////////////////////////////////////////////////
163   } // namespace detail
164   ///////////////////////////////////////////////////////////////////
165   /////////////////////////////////////////////////////////////////
166 } // namespace zypp
167 ///////////////////////////////////////////////////////////////////
168 #endif // ZYPP_DETAIL_PACKAGEIMPLIF_H