Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / ZYpp.h
index 58cee3d..f193f97 100644 (file)
 #include "zypp/base/ReferenceCounted.h"
 #include "zypp/base/NonCopyable.h"
 #include "zypp/base/PtrTypes.h"
+#include "zypp/APIConfig.h"
+
+#include "zypp/ZConfig.h"
+#include "zypp/ManagedFile.h"
+
+#include "zypp/ZYppCommit.h"
+#include "zypp/ResTraits.h"
+
 #include "zypp/Target.h"
 #include "zypp/Resolver.h"
+#include "zypp/KeyRing.h"
+#include "zypp/DiskUsageCounter.h"
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
@@ -32,9 +42,7 @@ namespace zypp
   class ZYppFactory;
   class ResPool;
   class ResPoolProxy;
-  class SourceFeed_Ref;
-  class ResStore;
-  class Locale;
+  class KeyRing;
 
   ///////////////////////////////////////////////////////////////////
   //
@@ -42,7 +50,8 @@ namespace zypp
   //
   /**
    * \todo define Exceptions
-  */
+   * ZYpp API main interface
+   */
   class ZYpp : public base::ReferenceCounted, private base::NonCopyable
   {
   public:
@@ -52,7 +61,10 @@ namespace zypp
 
   public:
 
-    /** Pool of ResStatus for individual ResObjetcs. */
+    /**
+     * Access to the global resolvable pool.
+     * Same as \ref zypp::ResPool::instance
+     */
     ResPool pool() const;
 
     /** Pool of ui::Selectable.
@@ -61,12 +73,11 @@ namespace zypp
     */
     ResPoolProxy poolProxy() const;
 
-    /**  */
-    //SourceFeed_Ref sourceFeed() const;
+    DiskUsageCounter::MountPointSet diskUsage();
 
-    void addResolvables (const ResStore& store, bool installed = false);
+    void setPartitions(const DiskUsageCounter::MountPointSet &mp);
 
-    void removeResolvables (const ResStore& store);
+    DiskUsageCounter::MountPointSet getPartitions() const;
 
   public:
     /**
@@ -74,11 +85,18 @@ namespace zypp
      */
     Target_Ptr target() const;
 
+    /** Same as \ref target but returns NULL if target is not
+     *  initialized, instead of throwing.
+     */
+    Target_Ptr getTarget() const;
+
     /**
      * \throws Exception
-     * if commit_only == true, just init, don't populate store or pool
+     * Just init the target, dont populate store or pool.
+     * If \c doRebuild_r is \c true, an already existing
+     * database is rebuilt (rpm --rebuilddb ).
      */
-    void initTarget(const Pathname & root, bool commit_only = false);
+    void initializeTarget(const Pathname & root, bool doRebuild_r = false);
 
     /**
      * \throws Exception
@@ -87,38 +105,39 @@ namespace zypp
 
 
   public:
-    /** Result returned from ZYpp::commit. */
-    struct CommitResult;
+    typedef ZYppCommitResult CommitResult;
 
     /** Commit changes and transactions.
-     * \param medianr 0 = all/any media
-     *                 > 0 means only the given media number
+     * \param \ref CommitPolicy
      * \return \ref CommitResult
      * \throws Exception
     */
-    CommitResult commit( int medianr_r );
+    ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
+
+    /** Install a source package on the Target.
+     * \throws Exception
+     */
+    void installSrcPackage( const SrcPackage_constPtr & srcPackage_r );
+
+    /** Provides a source package on the Target.
+     * \throws Exception
+     */
+    ManagedFile provideSrcPackage( const SrcPackage_constPtr & srcPackage_r );
 
   public:
     /** */
     Resolver_Ptr resolver() const;
+    KeyRing_Ptr keyRing() const;
 
   public:
-    /** Set the preferd locale for translated labels, descriptions,
-     *  etc. passed to the UI.
-     */
-    void setTextLocale( const Locale & textLocale_r );
-    /** */
-    Locale getTextLocale() const;
+    /** Get the path where zypp related plugins store persistent data and caches   */
+    Pathname homePath() const;
 
-  public:
-    typedef std::set<Locale> LocaleSet;
-    /** Set the requested locales.
-     * Languages to be supported by the system, e.g. language specific
-     * packages to be installed.
-    */
-    void setRequestedLocales( const LocaleSet & locales_r );
-    /** */
-    LocaleSet getRequestedLocales() const;
+    /** Get the path where zypp related plugins store temp data   */
+    Pathname tmpPath() const;
+
+    /** set the home, if you need to change it */
+    void setHomePath( const Pathname & path );
 
   protected:
     /** Dtor */
@@ -128,6 +147,7 @@ namespace zypp
   private:
     /** Factory */
     friend class ZYppFactory;
+
     /** */
     typedef zypp_detail::ZYppImpl Impl;
     typedef shared_ptr<Impl>      Impl_Ptr;