#ifndef _COM_SUN_STAR_DEPLOYMENT_THEPACKAGEMANAGERFACTORY_HPP_
#define _COM_SUN_STAR_DEPLOYMENT_THEPACKAGEMANAGERFACTORY_HPP_

#ifndef _SAL_CONFIG_H_
#include "sal/config.h"
#endif

#ifndef _COM_SUN_STAR_DEPLOYMENT_XPACKAGEMANAGERFACTORY_HPP_
#include "com/sun/star/deployment/XPackageManagerFactory.hpp"
#endif
#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
#include "com/sun/star/uno/XComponentContext.hpp"
#endif
#ifndef _COM_SUN_STAR_UNO_DEPLOYMENTEXCEPTION_HPP_
#include "com/sun/star/uno/DeploymentException.hpp"
#endif
#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
#include "com/sun/star/uno/Any.hxx"
#endif
#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
#include "com/sun/star/uno/Reference.hxx"
#endif
#ifndef INCLUDED_CPPU_UNOTYPE_HXX
#include "cppu/unotype.hxx"
#endif
#ifndef _RTL_USTRING_H_
#include "rtl/ustring.h"
#endif
#ifndef _RTL_USTRING_HXX_
#include "rtl/ustring.hxx"
#endif

namespace com { namespace sun { namespace star { namespace deployment {

class thePackageManagerFactory {
public:
    static ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManagerFactory > get(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context) {
        ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManagerFactory > instance;
        if (!(context->getValueByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.deployment.thePackageManagerFactory"))) >>= instance) || !instance.is()) {
            throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply singleton com.sun.star.deployment.thePackageManagerFactory of type com.sun.star.deployment.XPackageManagerFactory")), context);
        }
        return instance;
    }

private:
    thePackageManagerFactory(); // not implemented
    thePackageManagerFactory(thePackageManagerFactory &); // not implemented
    ~thePackageManagerFactory(); // not implemented
    void operator =(thePackageManagerFactory); // not implemented
};

} } } }

#endif // _COM_SUN_STAR_DEPLOYMENT_THEPACKAGEMANAGERFACTORY_HPP_
