- Add method Product::replacedProducts to identify installed
[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     /***/
48     typedef std::vector<constPtr> ReplacedProducts;
49
50     /** Array of \b installed Products that would be replaced by
51      *  installing this one.
52      */
53     ReplacedProducts replacedProducts() const;
54
55   public:
56     /** Untranslated short name like <tt>SLES 10</tt>*/
57     std::string shortName() const;
58
59     /** The product flavor (LiveCD Demo, FTP edition,...). */
60     std::string flavor() const;
61
62     /** Get the product type (base, add-on)
63      * Well, in an ideal world there is only one base product.
64      * It's the installed product denoted by a symlink in
65      * \c /etc/products.d.
66     */
67     std::string type() const;
68
69     /** The URL to download the release notes for this product */
70     Url releaseNotesUrl() const;
71
72     /**
73      * Online updates for the product.
74      * They are complementary, not alternatives. #163192
75      */
76     std::list<Url> updateUrls() const;
77
78     /**
79      * Additional software for the product
80      * They are complementary, not alternatives.
81      */
82     std::list<Url> extraUrls() const;
83
84     /**
85      * Optional software for the product
86      * (for example. Non OSS repositories)
87      * They are complementary, not alternatives.
88      */
89     std::list<Url> optionalUrls() const;
90
91     /** The product flags */
92     std::list<std::string> flags() const;
93
94     /** Translated long name like <tt>SUSE Linux Enterprise Server 10</tt>
95      * \deprecated use summary.
96      */
97     std::string longName( const Locale & lang_r = Locale() ) const ZYPP_DEPRECATED
98     { return summary( lang_r ); }
99
100     /** Vendor specific distribution id.
101      * \deprecated replaced by ResObject::distribution
102      */
103     std::string distributionName() const ZYPP_DEPRECATED;
104
105     /** Vendor specific distribution version.
106      * \deprecated replaced by ResObject::distribution
107      */
108     Edition distributionEdition() const ZYPP_DEPRECATED;
109
110   protected:
111     friend Ptr make<Self>( const sat::Solvable & solvable_r );
112     /** Ctor */
113     Product( const sat::Solvable & solvable_r );
114     /** Dtor */
115     virtual ~Product();
116   };
117
118   /////////////////////////////////////////////////////////////////
119 } // namespace zypp
120 ///////////////////////////////////////////////////////////////////
121 #endif // ZYPP_PRODUCT_H