/* vim: set sw=4 sts=4 et foldmethod=syntax : */

/*
 * Copyright (c) 2007 Piotr Jaroszyński <peper@gentoo.org>
 *
 * This file is part of the Paludis package manager. Paludis is free software;
 * you can redistribute it and/or modify it under the terms of the GNU General
 * Public License version 2, as published by the Free Software Foundation.
 *
 * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include <paludis_python.hh>

#include <paludis/query.hh>
#include <paludis/dep_spec.hh>
#include <paludis/util/fs_entry.hh>

namespace p = paludis;
namespace pp = paludis::python;
namespace bp = boost::python;

void expose_query()
{
    bp::class_<p::Query>
        q("Query", bp::no_init);
    q.def("__and__", p::operator&);

    bp::scope query = q;

    bp::class_<p::query::Matches, bp::bases<p::Query> >
        qm("Matches",
                bp::init<const p::PackageDepSpec &>("__init__(PackageDepSpec)")
          );

    bp::class_<p::query::Package, bp::bases<p::Query> >
        qp("Package",
                bp::init<const p::QualifiedPackageName &>("__init__(QualifiedPackageName)")
          );

    bp::class_<p::query::NotMasked, bp::bases<p::Query> >
        qnm("NotMasked",
                bp::init<>("__init__()")
          );

    bp::class_<p::query::RepositoryHasInstalledInterface, bp::bases<p::Query> >
        qrhii1("RepositoryHasInstalledInterface",
                "Matches...",
                bp::init<>("__init__()")
          );

    bp::class_<p::query::RepositoryHasInstallableInterface, bp::bases<p::Query> >
        qrhii2("RepositoryHasInstallableInterface",
                bp::init<>("__init__()")
          );

    bp::class_<p::query::RepositoryHasUninstallableInterface, bp::bases<p::Query> >
        qrhui("RepositoryHasUninstallableInterface",
                bp::init<>("__init__()")
          );

    bp::class_<p::query::InstalledAtRoot, bp::bases<p::Query> >
        qiar("InstalledAtRoot",
                bp::init<const p::FSEntry &>("__init__(path)")
          );
}
