/* Copyright (C) 2020 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 */

#include <gtkmm/filter.h>
#include <gtkmm/expression.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/filter_p.h)

namespace Gtk
{

/** Filtering by boolean expressions.
 *
 * %Gtk::BoolFilter is a simple filter that takes a boolean Gtk::Expression
 * to determine whether to include items.
 *
 * @ingroup ListView
 * @newin{3,98}
 */
class GTKMM_API BoolFilter : public Filter
{
  _CLASS_GOBJECT(BoolFilter, GtkBoolFilter, GTK_BOOL_FILTER, Gtk::Filter, GtkFilter, , , GTKMM_API)
  _DO_NOT_DERIVE_GTYPE dnl// GtkBoolFilter is a final type
  _ABI_AS_WITH_DERIVED_GTYPE dnl// Remove when we can break ABI
  _STRUCT_NOT_HIDDEN

protected:
  _WRAP_CTOR(BoolFilter(const Glib::RefPtr<Expression<bool>>& expression), gtk_bool_filter_new)

public:
  _WRAP_CREATE(const Glib::RefPtr<Expression<bool>>& expression)

  _WRAP_METHOD(Glib::RefPtr<Expression<bool>> get_expression(), gtk_bool_filter_get_expression, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Expression<bool>> get_expression() const, gtk_bool_filter_get_expression, refreturn)
  _WRAP_METHOD(void set_expression(const Glib::RefPtr<Expression<bool>>& expression), gtk_bool_filter_set_expression)
  _WRAP_METHOD(bool get_invert() const, gtk_bool_filter_get_invert)
  _WRAP_METHOD(void set_invert(bool invert = true), gtk_bool_filter_set_invert)

  _WRAP_PROPERTY("expression", Glib::RefPtr<Expression<bool>>)
  _WRAP_PROPERTY("invert", bool)
};

} // namespace Gtk
