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);
86 Target_Ptr target() const;
90 * if commit_only == true, just init, don't populate store or pool
92 void initTarget(const Pathname & root, bool commit_only = false);
101 typedef ZYppCommitResult CommitResult;
103 /** Commit changes and transactions.
104 * \param \ref CommitPolicy
105 * \return \ref CommitResult
108 ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
112 Resolver_Ptr resolver() const;
113 KeyRing_Ptr keyRing() const;
115 /** Set the preferd locale for translated labels, descriptions,
116 * etc. passed to the UI.
118 void setTextLocale( const Locale & textLocale_r );
120 Locale getTextLocale() const;
123 typedef std::set<Locale> LocaleSet;
124 /** Set the requested locales.
125 * Languages to be supported by the system, e.g. language specific
126 * packages to be installed.
128 void setRequestedLocales( const LocaleSet & locales_r );
130 LocaleSet getRequestedLocales() const;
133 * Get the set of available locales.
134 * This is computed from the package data so it actually
135 * represents all locales packages claim to support.
137 LocaleSet getAvailableLocales() const;
142 void availableLocale( const Locale & locale_r );
145 /** Get the path where zypp related plugins store persistent data and caches */
146 Pathname homePath() const;
147 /** set the home, if you need to change it */
148 void setHomePath( const Pathname & path );
150 /** Get the system architecture. */
151 Arch architecture() const;
152 /** Set the system architecture.
153 This should be used for testing/debugging only since the Target backend
154 won't be able to install incompatible packages ;-) */
155 void setArchitecture( const Arch & arch );
161 virtual std::ostream & dumpOn( std::ostream & str ) const;
164 friend class ZYppFactory;
167 typedef zypp_detail::ZYppImpl Impl;
168 typedef shared_ptr<Impl> Impl_Ptr;
171 ZYpp( const Impl_Ptr & impl_r );
173 /** Pointer to implementation */
174 RW_pointer<Impl> _pimpl;
176 ///////////////////////////////////////////////////////////////////
178 /////////////////////////////////////////////////////////////////
180 ///////////////////////////////////////////////////////////////////
181 #endif // ZYPP_ZYPP_H