// Generated by gmmproc 2.77.0 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gtkmm/columnviewsorter.h>
#include <gtkmm/private/columnviewsorter_p.h>


/* Copyright (C) 2022 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 <gtk/gtk.h>

namespace Gtk
{

std::pair<Glib::RefPtr<ColumnViewColumn>, SortType>
ColumnViewSorter::get_nth_sort_column(unsigned int position)
{
  GtkSortType sort_order;
  auto retvalue = Glib::wrap(gtk_column_view_sorter_get_nth_sort_column(gobj(), position, (GtkSortType*)&sort_order));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return {retvalue, (SortType)sort_order};
}

std::pair<Glib::RefPtr<const ColumnViewColumn>, SortType>
ColumnViewSorter::get_nth_sort_column(unsigned int position) const
{
  return const_cast<ColumnViewSorter*>(this)->get_nth_sort_column(position);
}

} // namespace Gtk

namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gtk::ColumnViewSorter> wrap(GtkColumnViewSorter* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gtk::ColumnViewSorter>( dynamic_cast<Gtk::ColumnViewSorter*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gtk
{


/* The *_Class implementation: */

const Glib::Class& ColumnViewSorter_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Do not derive a GType, or use a derived class:
    gtype_ = gtk_column_view_sorter_get_type();

  }

  return *this;
}


Glib::ObjectBase* ColumnViewSorter_Class::wrap_new(GObject* object)
{
  return new ColumnViewSorter((GtkColumnViewSorter*)object);
}


/* The implementation: */

GtkColumnViewSorter* ColumnViewSorter::gobj_copy()
{
  reference();
  return gobj();
}

ColumnViewSorter::ColumnViewSorter(const Glib::ConstructParams& construct_params)
:
  Gtk::Sorter(construct_params)
{

}

ColumnViewSorter::ColumnViewSorter(GtkColumnViewSorter* castitem)
:
  Gtk::Sorter((GtkSorter*)(castitem))
{}


ColumnViewSorter::ColumnViewSorter(ColumnViewSorter&& src) noexcept
: Gtk::Sorter(std::move(src))
{}

ColumnViewSorter& ColumnViewSorter::operator=(ColumnViewSorter&& src) noexcept
{
  Gtk::Sorter::operator=(std::move(src));
  return *this;
}


ColumnViewSorter::~ColumnViewSorter() noexcept
{}


ColumnViewSorter::CppClassType ColumnViewSorter::columnviewsorter_class_; // initialize static member

GType ColumnViewSorter::get_type()
{
  return columnviewsorter_class_.init().get_type();
}


GType ColumnViewSorter::get_base_type()
{
  return gtk_column_view_sorter_get_type();
}


ColumnViewSorter::ColumnViewSorter()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Gtk::Sorter(Glib::ConstructParams(columnviewsorter_class_.init()))
{
  

}

Glib::RefPtr<ColumnViewColumn> ColumnViewSorter::get_primary_sort_column()
{
  auto retvalue = Glib::wrap(gtk_column_view_sorter_get_primary_sort_column(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const ColumnViewColumn> ColumnViewSorter::get_primary_sort_column() const
{
  return const_cast<ColumnViewSorter*>(this)->get_primary_sort_column();
}

SortType ColumnViewSorter::get_primary_sort_order() const
{
  return static_cast<SortType>(gtk_column_view_sorter_get_primary_sort_order(const_cast<GtkColumnViewSorter*>(gobj())));
}

unsigned int ColumnViewSorter::get_n_sort_columns() const
{
  return gtk_column_view_sorter_get_n_sort_columns(const_cast<GtkColumnViewSorter*>(gobj()));
}


static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<Glib::RefPtr<ColumnViewColumn>>::value,
  "Type Glib::RefPtr<ColumnViewColumn> cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ColumnViewColumn> > ColumnViewSorter::property_primary_sort_column() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ColumnViewColumn> >(this, "primary-sort-column");
}

static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<SortType>::value,
  "Type SortType cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy_ReadOnly< SortType > ColumnViewSorter::property_primary_sort_order() const
{
  return Glib::PropertyProxy_ReadOnly< SortType >(this, "primary-sort-order");
}


} // namespace Gtk


