1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
17 #include "zypp/base/ReferenceCounted.h"
18 #include "zypp/base/NonCopyable.h"
19 #include "zypp/base/PtrTypes.h"
21 #include "zypp/base/Deprecated.h"
22 #include "zypp/ZYppCommit.h"
24 #include "zypp/Target.h"
25 #include "zypp/Resolver.h"
26 #include "zypp/KeyRing.h"
27 #include "zypp/DiskUsageCounter.h"
29 ///////////////////////////////////////////////////////////////////
31 { /////////////////////////////////////////////////////////////////
46 ///////////////////////////////////////////////////////////////////
51 * \todo define Exceptions
53 class ZYpp : public base::ReferenceCounted, private base::NonCopyable
57 typedef intrusive_ptr<ZYpp> Ptr;
58 typedef intrusive_ptr<const ZYpp> constPtr;
62 /** Pool of ResStatus for individual ResObjetcs. */
65 /** Pool of ui::Selectable.
66 * Based on the ResPool, ui::Selectable groups ResObjetcs of
69 ResPoolProxy poolProxy() const;
72 //SourceFeed_Ref sourceFeed() const;
74 void addResolvables (const ResStore& store, bool installed = false);
76 void removeResolvables (const ResStore& store);
78 DiskUsageCounter::MountPointSet diskUsage();
80 void setPartitions(const DiskUsageCounter::MountPointSet &mp);
82 DiskUsageCounter::MountPointSet getPartitions() const;
88 Target_Ptr target() const;
92 * just init the target, dont populate store or pool
94 void initializeTarget(const Pathname & root);
98 * if commit_only == true, just init the target, dont populate store or pool
100 ZYPP_DEPRECATED void initTarget(const Pathname & root, bool commit_only = false);
109 typedef ZYppCommitResult CommitResult;
111 /** Commit changes and transactions.
112 * \param \ref CommitPolicy
113 * \return \ref CommitResult
116 ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
120 Resolver_Ptr resolver() const;
121 KeyRing_Ptr keyRing() const;
123 /** Set the preferd locale for translated labels, descriptions,
124 * etc. passed to the UI.
126 void setTextLocale( const Locale & textLocale_r );
128 Locale getTextLocale() const;
131 typedef std::set<Locale> LocaleSet;
132 /** Set the requested locales.
133 * Languages to be supported by the system, e.g. language specific
134 * packages to be installed. This function operates on the pool,
135 * so only the locales that are available as resolvables
136 * are marked as requested. The rest is ignored.
138 void setRequestedLocales( const LocaleSet & locales_r );
140 LocaleSet getRequestedLocales() const;
143 * Get the set of available locales.
144 * This is computed from the package data so it actually
145 * represents all locales packages claim to support.
147 LocaleSet getAvailableLocales() const;
152 void availableLocale( const Locale & locale_r );
155 /** Get the path where zypp related plugins store persistent data and caches */
156 Pathname homePath() const;
158 /** Get the path where zypp related plugins store temp data */
159 Pathname tmpPath() const;
161 /** set the home, if you need to change it */
162 void setHomePath( const Pathname & path );
164 /** Get the system architecture. */
165 Arch architecture() const;
166 /** Set the system architecture.
167 This should be used for testing/debugging only since the Target backend
168 won't be able to install incompatible packages ;-) */
169 void setArchitecture( const Arch & arch );
175 virtual std::ostream & dumpOn( std::ostream & str ) const;
178 friend class ZYppFactory;
181 typedef zypp_detail::ZYppImpl Impl;
182 typedef shared_ptr<Impl> Impl_Ptr;
185 ZYpp( const Impl_Ptr & impl_r );
187 /** Pointer to implementation */
188 RW_pointer<Impl> _pimpl;
190 ///////////////////////////////////////////////////////////////////
192 /////////////////////////////////////////////////////////////////
194 ///////////////////////////////////////////////////////////////////
195 #endif // ZYPP_ZYPP_H