/* completionwords.h
 *
 * Copyright (C) 2010, 2011 Krzesimir Nowak
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <glibmm/object.h>
#include <gtksourceviewmm/completionprovider.h>

_DEFS(gtksourceviewmm,gtksourceview)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gsv
{
// TODO: docs needed. krnowak
/** Words completion provider.
 *
 * @newin{2,10}
 */
class CompletionWords
:
  public Glib::Object,
  public CompletionProvider
{
  _CLASS_GOBJECT(CompletionWords, GtkSourceCompletionWords, GTK_SOURCE_COMPLETION_WORDS, Glib::Object, GObject)
  _IMPLEMENTS_INTERFACE(CompletionProvider)
protected:
  _WRAP_CTOR(CompletionWords(const Glib::ustring& name, const Glib::RefPtr<Gdk::Pixbuf>& icon), gtk_source_completion_words_new)
public:
  /** Creates words provider with given name and icon.
   *
   * @param name Provider's name
   * @param icon Provider's icon
   *
   * @return A new CompletionWords.
   *
   * @newin{2,10}
   */
  _WRAP_CREATE(const Glib::ustring& name, const Glib::RefPtr<Gdk::Pixbuf>& icon)

// TODO: think about a good method name - register is a C/C++ keyword. krnowak
#m4 _CONVERSION(`const Glib::RefPtr<Gtk::TextBuffer>&',`GtkTextBuffer*',`Glib::unwrap($3)')
  /** Registers this provider in given buffer.
   *
   * @param buffer A buffer which will use this provider.
   *
   * @newin{2,10}
   */
  _WRAP_METHOD(void register_provider(const Glib::RefPtr<Gtk::TextBuffer>& buffer), gtk_source_completion_words_register)

  /** Unregisters this provider from given buffer.
   *
   * @param buffer A buffer which will not use this provider anymore.
   *
   * @newin{2,10}
   */
  _WRAP_METHOD(void unregister_provider(const Glib::RefPtr<Gtk::TextBuffer>& buffer), gtk_source_completion_words_unregister)

  _WRAP_PROPERTY("name", Glib::ustring)

  _WRAP_PROPERTY("icon", Glib::RefPtr<Gdk::Pixbuf>)

  _WRAP_PROPERTY("proposals-batch-size", guint)

  _WRAP_PROPERTY("scan-batch-size", guint)

  _WRAP_PROPERTY("minimum-word-size", guint)

  _WRAP_PROPERTY("interactive-delay", int)

  _WRAP_PROPERTY("priority", int)

  _WRAP_PROPERTY("activation", CompletionActivation)
};

} /* namespace Gsv */

