00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_ZYPP_H 00013 #define ZYPP_ZYPP_H 00014 00015 #include <iosfwd> 00016 00017 #include "zypp/base/ReferenceCounted.h" 00018 #include "zypp/base/NonCopyable.h" 00019 #include "zypp/base/PtrTypes.h" 00020 00021 #include "zypp/base/Deprecated.h" 00022 #include "zypp/ZYppCommit.h" 00023 00024 #include "zypp/Target.h" 00025 #include "zypp/Resolver.h" 00026 #include "zypp/KeyRing.h" 00027 #include "zypp/DiskUsageCounter.h" 00028 00030 namespace zypp 00031 { 00032 00033 namespace zypp_detail 00034 { 00035 class ZYppImpl; 00036 } 00037 00038 class ZYppFactory; 00039 class ResPool; 00040 class ResPoolProxy; 00041 class SourceFeed_Ref; 00042 class ResStore; 00043 class Locale; 00044 class KeyRing; 00045 00047 // 00048 // CLASS NAME : ZYpp 00049 // 00053 class ZYpp : public base::ReferenceCounted, private base::NonCopyable 00054 { 00055 public: 00056 00057 typedef intrusive_ptr<ZYpp> Ptr; 00058 typedef intrusive_ptr<const ZYpp> constPtr; 00059 00060 public: 00061 00063 ResPool pool() const; 00064 00069 ResPoolProxy poolProxy() const; 00070 00072 //SourceFeed_Ref sourceFeed() const; 00073 00074 void addResolvables (const ResStore& store, bool installed = false); 00075 00076 void removeResolvables (const ResStore& store); 00077 00078 DiskUsageCounter::MountPointSet diskUsage(); 00079 00080 void setPartitions(const DiskUsageCounter::MountPointSet &mp); 00081 00082 public: 00086 Target_Ptr target() const; 00087 00092 void initTarget(const Pathname & root, bool commit_only = false); 00093 00097 void finishTarget(); 00098 00099 00100 public: 00101 typedef ZYppCommitResult CommitResult; 00102 00108 ZYppCommitResult commit( const ZYppCommitPolicy & policy_r ); 00109 00110 public: 00112 Resolver_Ptr resolver() const; 00113 KeyRing_Ptr keyRing() const; 00114 public: 00118 void setTextLocale( const Locale & textLocale_r ); 00120 Locale getTextLocale() const; 00121 00122 public: 00123 typedef std::set<Locale> LocaleSet; 00130 void setRequestedLocales( const LocaleSet & locales_r ); 00132 LocaleSet getRequestedLocales() const; 00133 00139 LocaleSet getAvailableLocales() const; 00140 00144 void availableLocale( const Locale & locale_r ); 00145 00146 public: 00148 Pathname homePath() const; 00149 00151 Pathname tmpPath() const; 00152 00154 void setHomePath( const Pathname & path ); 00155 00157 Arch architecture() const; 00161 void setArchitecture( const Arch & arch ); 00162 00163 protected: 00165 virtual ~ZYpp(); 00167 virtual std::ostream & dumpOn( std::ostream & str ) const; 00168 private: 00170 friend class ZYppFactory; 00171 00173 typedef zypp_detail::ZYppImpl Impl; 00174 typedef shared_ptr<Impl> Impl_Ptr; 00176 explicit 00177 ZYpp( const Impl_Ptr & impl_r ); 00178 private: 00180 RW_pointer<Impl> _pimpl; 00181 }; 00183 00185 } // namespace zypp 00187 #endif // ZYPP_ZYPP_H