/* 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/sorter.h>
#include <gtkmm/buildable.h>
#include <giomm/listmodel.h>

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

namespace Gtk
{

/** Combining multiple sorters.
 *
 * %Gtk::MultiSorter combines multiple sorters by trying them
 * in turn. If the first sorter compares two items as equal,
 * the second is tried next, and so on.
 *
 * @newin{3,98}
 */
class GTKMM_API MultiSorter : public Sorter, public Gio::ListModel, public Buildable
{
  _CLASS_GOBJECT(MultiSorter, GtkMultiSorter, GTK_MULTI_SORTER, Gtk::Sorter, GtkSorter, , , GTKMM_API)
  _IMPLEMENTS_INTERFACE(Gio::ListModel)
  _IMPLEMENTS_INTERFACE(Buildable)
  _STRUCT_NOT_HIDDEN

protected:
  _CTOR_DEFAULT

public:
  _WRAP_CREATE()

#m4 _CONVERSION(`const Glib::RefPtr<Sorter>&', `GtkSorter*', `Glib::unwrap_copy($3)')
  _WRAP_METHOD(void append(const Glib::RefPtr<Sorter>& sorter), gtk_multi_sorter_append)
  _WRAP_METHOD(void remove(guint position), gtk_multi_sorter_remove)
};

} // namespace Gtk
