/* Copyright (C) 1998-2002 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 <https://www.gnu.org/licenses/>.
 */

#include <vector>

#include <gtkmm/widget.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gtk
{

/** A %TextChildAnchor is a spot in the buffer where child widgets can be "anchored"
 * (inserted inline, as if they were characters). The anchor can have multiple widgets anchored,
 * to allow for multiple views.
 *
 * Typedefed as Gtk::TextBuffer::ChildAnchor.
 * @ingroup TextView
 */
class GTKMM_API TextChildAnchor : public Glib::Object
{
   _CLASS_GOBJECT(TextChildAnchor, GtkTextChildAnchor, GTK_TEXT_CHILD_ANCHOR, Glib::Object, GObject, , , GTKMM_API)
protected:
  _CTOR_DEFAULT()

public:
  _WRAP_CREATE()

  // gtk_text_child_anchor_new_with_replacement() does more than call g_object_new().
  /** Creates a new `Gtk::TextChildAnchor` with the given replacement character.
   *
   * Usually you would then insert it into a `Gtk::TextBuffer` with
   * Gtk::TextBuffer::insert_child_anchor().
   *
   * @param replacement_character Must be exactly one UTF-8 character.
   *                              Can be more than one byte.
   *
   * @newin{4,6}
   *
   * @return A new `Gtk::TextChildAnchor`.
   */
  _WRAP_METHOD(static Glib::RefPtr<TextChildAnchor> create(const Glib::ustring& replacement_character),
    gtk_text_child_anchor_new_with_replacement)

  /** Gets a list of all widgets anchored at this child anchor.
   *
   * @return A vector of widgets anchored at this %TextChildAnchor.
   */
  std::vector<Widget*> get_widgets();

  /** Gets a list of all widgets anchored at this child anchor.
   *
   * @return A vector of widgets anchored at this %TextChildAnchor.
   */
  std::vector<const Widget*> get_widgets() const;
  _IGNORE(gtk_text_child_anchor_get_widgets)

  _WRAP_METHOD(bool get_deleted() const, gtk_text_child_anchor_get_deleted)
};

} //namespace Gtk
