1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Pattern.h
12 #ifndef ZYPP_PATTERN_H
13 #define ZYPP_PATTERN_H
15 #include "zypp/ResObject.h"
16 #include "zypp/Pathname.h"
18 ///////////////////////////////////////////////////////////////////
20 { /////////////////////////////////////////////////////////////////
22 DEFINE_PTR_TYPE(Pattern);
24 ///////////////////////////////////////////////////////////////////
26 // CLASS NAME : Pattern
28 /** Pattern interface.
30 class Pattern : public ResObject
34 typedef ResTraits<Self> TraitsType;
35 typedef TraitsType::PtrType Ptr;
36 typedef TraitsType::constPtrType constPtr;
39 typedef sat::ArrayAttr<IdString,IdString> NameList;
40 typedef sat::SolvableSet Contents;
44 bool isDefault() const;
46 bool userVisible() const;
48 std::string category( const Locale & lang_r = Locale() ) const;
50 Pathname icon() const;
52 Pathname script() const;
54 std::string order() const;
57 /** \name Auto pattens (libyzpp-14)
58 * Patterns are no longer defined by separate metadate files, but via
59 * special dependencies provided by a corresponding patterns- package.
60 * The pattern itself requires only it's patterns- package, the package
61 * contains all further dependencies.
62 * This way pattens are no longer pseudo installed objects with a computed
63 * status, but installed, iff the corresponding patterns- package is
67 /** This patterns is auto-defined by a patterns- package. */
68 bool isAutoPattern() const;
69 /** The corresponding patterns- package if \ref isAutoPattern. */
70 sat::Solvable autoPackage() const;
73 /** Ui hint: included patterns. */
74 NameList includes() const;
76 /** Ui hint: patterns this one extends. */
77 NameList extends() const;
79 /** Ui hint: Required Packages. */
80 Contents core() const;
82 /** Ui hint: Dependent packages.
83 * This also includes recommended and suggested (optionally exclude) packages.
85 Contents depends( bool includeSuggests_r = true ) const;
86 /** \overload Without SUGGESTS. */
87 Contents dependsNoSuggests() const
88 { return depends( false ); }
90 /** The collection of packages associated with this pattern.
91 * This also evaluates the patterns includes/extends relation.
92 * Optionally exclude \c SUGGESTED packages.
94 Contents contents( bool includeSuggests_r = true ) const;
95 /** \overload Without SUGGESTS. */
96 Contents contentsNoSuggests() const
97 { return contents( false ); }
100 friend Ptr make<Self>( const sat::Solvable & solvable_r );
102 Pattern( const sat::Solvable & solvable_r );
106 ///////////////////////////////////////////////////////////////////
108 /////////////////////////////////////////////////////////////////
110 ///////////////////////////////////////////////////////////////////
111 #endif // ZYPP_PATTERN_H