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

_CONFIGINCLUDE(gtkmmconfig.h)

#include <glibmm/object.h>
#include <gtkmm/enums.h>
#include <gdkmm/rgba.h>
#include <pangomm/attributes.h>
#include <pangomm/fontdescription.h>
#include <pangomm/tabarray.h>

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

namespace Gtk
{

/** Typedefed as Gtk::TextBuffer::Tag.
 *
 * Text in a buffer can be marked with tags. A tag is an attribute that can be applied to some range of text. For example, a tag
 * might be called "bold" and might make the text inside the tag bold. However, the tag concept is more general than that; tags don't
 * have to affect appearance. They can instead affect the behavior of mouse and key presses, "lock" a range of text so the user
 * can't edit it, or countless other things.
 * One tag can be applied to any number of text ranges in any number of @link Gtk::TextBuffer Gtk::TextBuffers@endlink.
 *
 * Each tag is stored in a @link Gtk::TextTagTable Gtk::TextBuffer::TagTable@endlink, and Tags should be in the
 * @link Gtk::TextTagTable Gtk::TextBuffer::TagTable@endlink for a given Gtk::TextBuffer before using
 * them with that buffer.
 *
 * Tags can have names, which is convenient sometimes (for example, you can name your tag that makes things bold "bold"), but
 * they can also be anonymous (which is convenient if you're creating tags on-the-fly).
 *
 * Gtk::TextBuffer::create_tag() is the best way to create tags. See the demo for numerous examples.
 *
 * @ingroup TextView
 */
class GTKMM_API TextTag : public Glib::Object
{
   _CLASS_GOBJECT(TextTag, GtkTextTag, GTK_TEXT_TAG, Glib::Object, GObject, , , GTKMM_API)
protected:
  _CTOR_DEFAULT()
  _WRAP_CTOR(TextTag(const Glib::ustring& name), gtk_text_tag_new)

public:
  _WRAP_CREATE()
  _WRAP_CREATE(const Glib::ustring& name)

  _WRAP_METHOD(int get_priority() const, gtk_text_tag_get_priority)
  _WRAP_METHOD(void set_priority(int priority), gtk_text_tag_set_priority)
  _WRAP_METHOD(void tag_changed(bool size_changed), gtk_text_tag_changed)

  _WRAP_PROPERTY("name", Glib::ustring) //construct-only.
  _WRAP_PROPERTY("background", Glib::ustring)
  _WRAP_PROPERTY("foreground", Glib::ustring)
  _WRAP_PROPERTY("background-rgba", Gdk::RGBA)
  _WRAP_PROPERTY("foreground-rgba", Gdk::RGBA)
  _WRAP_PROPERTY("font", Glib::ustring)
  _WRAP_PROPERTY("font-desc", Pango::FontDescription)
  _WRAP_PROPERTY("family", Glib::ustring)
  _WRAP_PROPERTY("style", Pango::Style)
  _WRAP_PROPERTY("variant", Pango::Variant)
  _WRAP_PROPERTY("weight", int)
  _WRAP_PROPERTY("stretch", Pango::Stretch)
  _WRAP_PROPERTY("size", int)
  _WRAP_PROPERTY("size-points", double)
  _WRAP_PROPERTY("scale", double)
  _WRAP_PROPERTY("pixels-above-lines", int)
  _WRAP_PROPERTY("pixels-below-lines", int)
  _WRAP_PROPERTY("pixels-inside-wrap", int)
  _WRAP_PROPERTY("editable", bool)
  _WRAP_PROPERTY("wrap-mode", WrapMode)
  _WRAP_PROPERTY("justification", Justification)
  _WRAP_PROPERTY("direction", TextDirection)
  _WRAP_PROPERTY("left-margin", int)
  _WRAP_PROPERTY("indent", int)
  _WRAP_PROPERTY("line-height", float)
  _WRAP_PROPERTY("strikethrough", bool)
  _WRAP_PROPERTY("strikethrough-rgba", Gdk::RGBA, newin "3,20")
  _WRAP_PROPERTY("right-margin", int)
  _WRAP_PROPERTY("underline", Pango::Underline)
  _WRAP_PROPERTY("underline-rgba", Gdk::RGBA, newin "3,20")
  _WRAP_PROPERTY("overline", Pango::Overline)
  _WRAP_PROPERTY("overline-rgba", Gdk::RGBA)
  _WRAP_PROPERTY("rise", int)
  _WRAP_PROPERTY("background-full-height", bool)
  _WRAP_PROPERTY("language", Glib::ustring)
  _WRAP_PROPERTY("tabs",  Pango::TabArray)
  _WRAP_PROPERTY("invisible", bool)
  _WRAP_PROPERTY("paragraph-background", Glib::ustring)
  _WRAP_PROPERTY("paragraph-background-rgba", Gdk::RGBA)
  _WRAP_PROPERTY("font-features", Glib::ustring, newin "3,20")
  _WRAP_PROPERTY("allow-breaks", bool)
  _WRAP_PROPERTY("show-spaces", Pango::ShowFlags)
  _WRAP_PROPERTY("insert-hyphens", bool)
  _WRAP_PROPERTY("text-transform", Pango::TextTransform)
  _WRAP_PROPERTY("word", bool)
  _WRAP_PROPERTY("sentence", bool)
  _WRAP_PROPERTY("accumulative-margin", bool)
  _WRAP_PROPERTY("background-set", bool)
  _WRAP_PROPERTY("foreground-set", bool)
  _WRAP_PROPERTY("family-set", bool)
  _WRAP_PROPERTY("style-set", bool)
  _WRAP_PROPERTY("variant-set", bool)
  _WRAP_PROPERTY("weight-set", bool)
  _WRAP_PROPERTY("stretch-set", bool)
  _WRAP_PROPERTY("size-set", bool)
  _WRAP_PROPERTY("scale-set", bool)
  _WRAP_PROPERTY("pixels-above-lines-set", bool)
  _WRAP_PROPERTY("pixels-below-lines-set", bool)
  _WRAP_PROPERTY("pixels-inside-wrap-set", bool)
  _WRAP_PROPERTY("editable-set", bool)
  _WRAP_PROPERTY("wrap-mode-set", bool)
  _WRAP_PROPERTY("justification-set", bool)
  _WRAP_PROPERTY("left-margin-set", bool)
  _WRAP_PROPERTY("indent-set", bool)
  _WRAP_PROPERTY("line-height-set", bool)
  _WRAP_PROPERTY("strikethrough-set", bool)
  _WRAP_PROPERTY("strikethrough-rgba-set", bool, newin "3,20")
  _WRAP_PROPERTY("right-margin-set", bool)
  _WRAP_PROPERTY("underline-set", bool)
  _WRAP_PROPERTY("underline-rgba-set", bool, newin "3,20")
  _WRAP_PROPERTY("overline-set", bool)
  _WRAP_PROPERTY("overline-rgba-set", bool)
  _WRAP_PROPERTY("rise-set", bool)
  _WRAP_PROPERTY("background-full-height-set", bool)
  _WRAP_PROPERTY("language-set", bool)
  _WRAP_PROPERTY("tabs-set", bool)
  _WRAP_PROPERTY("invisible-set", bool)
  _WRAP_PROPERTY("paragraph-background-set", bool)
  _WRAP_PROPERTY("fallback", bool)
  _WRAP_PROPERTY("fallback-set", bool)
  _WRAP_PROPERTY("letter-spacing", int)
  _WRAP_PROPERTY("letter-spacing-set", bool)
  _WRAP_PROPERTY("font-features-set", bool, newin "3,20")
  _WRAP_PROPERTY("allow-breaks-set", bool)
  _WRAP_PROPERTY("show-spaces-set", bool)
  _WRAP_PROPERTY("insert-hyphens-set", bool)
  _WRAP_PROPERTY("text-transform-set", bool)
  _WRAP_PROPERTY("word-set", bool)
  _WRAP_PROPERTY("sentence-set", bool)
};

} //namespace Gtk
