1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
17 #include "zypp/base/ReferenceCounted.h"
18 #include "zypp/base/NonCopyable.h"
19 #include "zypp/base/PtrTypes.h"
20 #include "zypp/Target.h"
21 #include "zypp/Resolver.h"
23 ///////////////////////////////////////////////////////////////////
25 { /////////////////////////////////////////////////////////////////
39 ///////////////////////////////////////////////////////////////////
44 * \todo define Exceptions
46 class ZYpp : public base::ReferenceCounted, private base::NonCopyable
50 typedef intrusive_ptr<ZYpp> Ptr;
51 typedef intrusive_ptr<const ZYpp> constPtr;
55 /** Pool of ResStatus for individual ResObjetcs. */
58 /** Pool of ui::Selectable.
59 * Based on the ResPool, ui::Selectable groups ResObjetcs of
62 ResPoolProxy poolProxy() const;
65 //SourceFeed_Ref sourceFeed() const;
67 void addResolvables (const ResStore& store, bool installed = false);
69 void removeResolvables (const ResStore& store);
75 Target_Ptr target() const;
79 * if commit_only == true, just init, don't populate store or pool
81 void initTarget(const Pathname & root, bool commit_only = false);
90 /** Result returned from ZYpp::commit. */
93 /** Commit changes and transactions.
94 * \param medianr 0 = all/any media
95 * > 0 means only the given media number
96 * \return \ref CommitResult
99 CommitResult commit( int medianr_r );
103 Resolver_Ptr resolver() const;
106 /** Set the preferd locale for translated labels, descriptions,
107 * etc. passed to the UI.
109 void setTextLocale( const Locale & textLocale_r );
111 Locale getTextLocale() const;
114 typedef std::set<Locale> LocaleSet;
115 /** Set the requested locales.
116 * Languages to be supported by the system, e.g. language specific
117 * packages to be installed.
119 void setRequestedLocales( const LocaleSet & locales_r );
121 LocaleSet getRequestedLocales() const;
124 /** Get the system architecture. */
125 Arch architecture() const;
126 /** Set the system architecture.
127 This should be used for testing/debugging only since the Target backend
128 won't be able to install incompatible packages ;-) */
129 void setArchitecture( const Arch & arch );
135 virtual std::ostream & dumpOn( std::ostream & str ) const;
138 friend class ZYppFactory;
140 typedef zypp_detail::ZYppImpl Impl;
141 typedef shared_ptr<Impl> Impl_Ptr;
144 ZYpp( const Impl_Ptr & impl_r );
146 /** Pointer to implementation */
147 RW_pointer<Impl> _pimpl;
149 ///////////////////////////////////////////////////////////////////
151 /////////////////////////////////////////////////////////////////
153 ///////////////////////////////////////////////////////////////////
154 #endif // ZYPP_ZYPP_H