/*---------------------------------------------------------------------\
|                          ____ _   __ __ ___                          |
|                         |__  / \ / / . \ . \                         |
|                           / / \ V /|  _/  _/                         |
|                          / /__ | | | | | |                           |
|                         /_____||_| |_| |_|                           |
|                                                                      |
\---------------------------------------------------------------------*/
#include "private/context_p.h"
#include <zypp-core/ng/base/private/threaddata_p.h>
#include <zypp-core/ng/base/EventLoop>
#include <zypp-media/ng/Provide>

namespace zyppng {

  ZYPP_IMPL_PRIVATE( Context )

  ZYPP_IMPL_PRIVATE_CONSTR( Context )
    : UserInterface( *new ContextPrivate( *this ) )
  {
    Z_D();
    d->_eventDispatcher = ThreadData::current().ensureDispatcher();

    d->_provider = Provide::create( d->_providerDir );

    // @TODO should start be implicit as soon as something is enqueued?
    d->_provider->start();
  }

  ProvideRef Context::provider() const
  {
    Z_D();
    return d->_provider;
  }


#if 0
  KeyRingRef Context::keyRing() const
  {
    return d_func()->_zyppPtr->keyRing();
  }
  zypp::ZConfig &Context::config()
  {
    return zypp::ZConfig::instance();
  }

  zypp::ResPool Context::pool()
  {
    return zypp::ResPool::instance();
  }

  zypp::ResPoolProxy Context::poolProxy()
  {
    return zypp::ResPool::instance().proxy();
  }

  zypp::sat::Pool Context::satPool()
  {
    return zypp::sat::Pool::instance();
  }
#endif
}
