/* completioninfo.h
 *
 * Copyright (C) 2009, 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 <gtkmm/widget.h>
#include <gtkmm/textview.h>
#include <gtkmm/window.h>

_DEFS(gtksourceviewmm,gtksourceview)
_PINCLUDE(gtkmm/private/window_p.h)


namespace Gsv
{

/** Calltips object
 *
 * This object can be used to show a calltip or help for the current completion
 * proposal.
 *
 * @newin{2,10}
 */
class CompletionInfo : public Gtk::Window
{
  _CLASS_GTKOBJECT(CompletionInfo, GtkSourceCompletionInfo, GTK_SOURCE_COMPLETION_INFO, Gtk::Window, GtkWindow)

public:
  /** Creates new CompletionInfo popup window.
   *
   * @return The new CompletionInfo.
   *
   * @newin{2,10}
   */
  CompletionInfo();

#m4 _CONVERSION(`const Gtk::TextView&',`GtkTextView*',`const_cast<GtkTextView*>(($3).gobj())')
#m4 _CONVERSION(`const Gtk::TextIter&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
  /** Moves the CompletionInfo to @a iter. Moving will respect the
   * Gdk::Gravity setting of the info window and will ensure the line at @a iter
   * is not occluded by the window.
   *
   * @param view A Gtk::TextView on which the info window should be positioned.
   * @param iter A Gtk::TextIter.
   *
   * @newin{2,10}
   */
  _WRAP_METHOD(void move_to_iter(const Gtk::TextView& view, const Gtk::TextIter& iter), gtk_source_completion_info_move_to_iter)

  /** Moves the Gtk::CompletionInfo to the cursor position. Moving will
   * respect the Gdk::Gravity setting of the info window and will ensure the
   * line at cursor position is not occluded by the window.
   *
   * @param view A Gtk::TextView on which the info window should be positioned.
   *
   * @newin{2,10}
   */
  void move_to_iter(const Gtk::TextView& view);

  _WRAP_METHOD(void set_widget(Gtk::Widget& widget), gtk_source_completion_info_set_widget, deprecated "Use Gtk::Container:add() instead. If there is already a child widget, remove it with Gtk::Container::remove().")

  _WRAP_METHOD(Gtk::Widget* get_widget(), gtk_source_completion_info_get_widget, deprecated "Use Gtk::Bin::get_child() instead.")
  _WRAP_METHOD(const Gtk::Widget* get_widget() const, gtk_source_completion_info_get_widget, constversion, deprecated "Use Gtk::Bin::get_child() instead.")

  /** Emited before any "show" management.
   *
   * You can connect to this signal if you want to change some properties or
   * position before the real "show".
   *
   * @newin{2,10}
   */
  _WRAP_SIGNAL(void before_show(), "before-show", deprecated "This should not be used in newly-written code.")
};

} /* namespace Gsv */

