support buddies in solver testcases
[platform/upstream/libzypp.git] / zypp / Product.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Product.h
10  *
11 */
12 #ifndef ZYPP_PRODUCT_H
13 #define ZYPP_PRODUCT_H
14
15 #include <list>
16 #include <string>
17
18 #include "zypp/ResObject.h"
19
20 ///////////////////////////////////////////////////////////////////
21 namespace zypp
22 { /////////////////////////////////////////////////////////////////
23
24   DEFINE_PTR_TYPE(Product);
25
26   ///////////////////////////////////////////////////////////////////
27   //
28   //    CLASS NAME : Product
29   //
30   /** Product interface.
31   */
32   class Product : public ResObject
33   {
34   public:
35     typedef Product                  Self;
36     typedef ResTraits<Self>          TraitsType;
37     typedef TraitsType::PtrType      Ptr;
38     typedef TraitsType::constPtrType constPtr;
39
40   public:
41     /** The reference package providing the product metadata,
42      *  if such a package exists.
43      */
44     sat::Solvable referencePackage() const;
45
46   public:
47     /** Untranslated short name like <tt>SLES 10</tt>*/
48     std::string shortName() const;
49
50     /** The product flavor (LiveCD Demo, FTP edition,...). */
51     std::string flavor() const;
52
53     /** Get the product type (base, add-on)
54      * Well, in an ideal world there is only one base product.
55      * It's the installed product denoted by a symlink in
56      * \c /etc/products.d.
57     */
58     std::string type() const;
59
60     /** The URL to download the release notes for this product */
61     Url releaseNotesUrl() const;
62
63     /**
64      * Online updates for the product.
65      * They are complementary, not alternatives. #163192
66      */
67     std::list<Url> updateUrls() const;
68
69     /**
70      * Additional software for the product
71      * They are complementary, not alternatives.
72      */
73     std::list<Url> extraUrls() const;
74
75     /**
76      * Optional software for the product
77      * (for example. Non OSS repositories)
78      * They are complementary, not alternatives.
79      */
80     std::list<Url> optionalUrls() const;
81
82     /** The product flags */
83     std::list<std::string> flags() const;
84
85     /** Translated long name like <tt>SUSE Linux Enterprise Server 10</tt>
86      * \deprecated use summary.
87      */
88     std::string longName( const Locale & lang_r = Locale() ) const ZYPP_DEPRECATED
89     { return summary( lang_r ); }
90
91     /** Vendor specific distribution id.
92      * \deprecated replaced by ResObject::distribution
93      */
94     std::string distributionName() const ZYPP_DEPRECATED;
95
96     /** Vendor specific distribution version.
97      * \deprecated replaced by ResObject::distribution
98      */
99     Edition distributionEdition() const ZYPP_DEPRECATED;
100
101   protected:
102     friend Ptr make<Self>( const sat::Solvable & solvable_r );
103     /** Ctor */
104     Product( const sat::Solvable & solvable_r );
105     /** Dtor */
106     virtual ~Product();
107   };
108
109   /////////////////////////////////////////////////////////////////
110 } // namespace zypp
111 ///////////////////////////////////////////////////////////////////
112 #endif // ZYPP_PRODUCT_H