/*
 * Copyright (C) 2004 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

_CONFIGINCLUDE(gtkmmconfig.h)

#include <gtkmm/widget.h>
#include <gtkmm/celllayout.h>
#include <gtkmm/treemodel.h>
#include <gtkmm/treepath.h>
#include <gtkmm/cellrenderer.h>
#include <gtkmm/cellarea.h>
#include <gtkmm/cellareacontext.h>
#include <gtkmm/orientable.h>
#include <gdkmm/pixbuf.h>
#include <gdkmm/rgba.h>

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

namespace Gtk
{

/** A widget displaying a single row of a TreeModel.
 * A CellView displays a single row of a TreeModel, using cell renderers just like TreeView. CellView doesn't support some of the more
 * complex features of GtkTreeView, like cell editing and drag and drop.
 *
 * @ingroup Widgets
 */
class CellView :
  public Widget,
  public CellLayout,
  public Orientable
{
  _CLASS_GTKOBJECT(CellView, GtkCellView, GTK_CELL_VIEW, Gtk::Widget, GtkWidget)
  _IMPLEMENTS_INTERFACE(CellLayout)
  _IMPLEMENTS_INTERFACE(Orientable)

public:
  _CTOR_DEFAULT()

  /** Creates a new CellView widget, adds a CellRendererText to it, and makes it show the text.
   * Optionally, the text can be marked up with the Pango text markup language.
   *
   * @param text The text to display in the cell view
   * @param markup Whether the @a text uses Pango text markup language.
   */
  explicit CellView(const Glib::ustring& text, bool use_markup = false);
  _IGNORE(gtk_cell_view_new_with_text, gtk_cell_view_new_with_markup)

  /** Creates a new CellView widget, adds a CellRendererPixbuf to it, and makes it show the pixbuf.
   *
   * @param pixbuf The image to display in the cell view
   * @param markup Whether the @a text uses Pango text markup language.
   */
  explicit CellView(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
  _IGNORE(gtk_cell_view_new_with_pixbuf)

  //_WRAP_METHOD(void set_value(CellRenderer& renderer, const Glib::ustring& property, const Glib::ValueBase& value), gtk_cell_view_set_value)
  _IGNORE(gtk_cell_view_set_values)

  _WRAP_METHOD(void set_model(const Glib::RefPtr<TreeModel>& model), gtk_cell_view_set_model)

  /** Remove the model from the CellView.
   *
   * @see set_model().
   *
   * @newin{2,16}
   */
  void unset_model();

  _WRAP_METHOD(Glib::RefPtr<TreeModel> get_model(), gtk_cell_view_get_model, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const TreeModel> get_model() const, gtk_cell_view_get_model, refreturn, constversion)

  _WRAP_METHOD(void set_displayed_row(const TreeModel::Path& path), gtk_cell_view_set_displayed_row)
  _WRAP_METHOD(TreeModel::Path get_displayed_row() const, gtk_cell_view_get_displayed_row)
  _IGNORE(gtk_cell_view_get_size_of_row) //deprecated

  _WRAP_METHOD(void set_background_color(const Gdk::Color& color), gtk_cell_view_set_background_color)
  _WRAP_METHOD(void set_background_rgba(const Gdk::RGBA& rgba), gtk_cell_view_set_background_rgba)
  
  _WRAP_METHOD(bool get_draw_sensitive() const, gtk_cell_view_get_draw_sensitive)
  _WRAP_METHOD(void set_draw_sensitive(bool draw_sensitive = true), gtk_cell_view_set_draw_sensitive)
  _WRAP_METHOD(bool get_fit_model() const, gtk_cell_view_get_fit_model)
  _WRAP_METHOD(void set_fit_model(bool fit_model = true), gtk_cell_view_set_fit_model)

  _IGNORE(gtk_cell_view_get_cell_renderers) //deprecated

  _WRAP_PROPERTY("background", Glib::ustring)
  _WRAP_PROPERTY("background-gdk", Gdk::Color)
  _WRAP_PROPERTY("background-rgba", Gdk::RGBA)
  _WRAP_PROPERTY("background-set", bool)
  _WRAP_PROPERTY("model", Glib::RefPtr<TreeModel>)
  _WRAP_PROPERTY("cell-area", Glib::RefPtr<CellArea>)
  _WRAP_PROPERTY("cell-area-context", Glib::RefPtr<CellAreaContext>)
  _WRAP_PROPERTY("draw-sensitive", bool)
  _WRAP_PROPERTY("fit-model", bool) 
};

} // namespace Gtk
