/* Copyright (C) 2011 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
 */

#include <gtkmm/appchooser.h>
#include <gtkmm/combobox.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/combobox_p.h)


namespace Gtk
{

//TODO: The AppChooser content-type is not documented properly: https://bugzilla.gnome.org/show_bug.cgi?id=650012

/** A button to launch an application chooser dialog.
 *
 * This widget lets the user select an application. See the GtkAppChooser base class API.
 *
 * The AppChooserButton widget looks like this:
 * @image html appchooserbutton1.png
 *
 * @ingroup Widgets
 *
 * @newin{3,0}
 */
class AppChooserButton
  : public ComboBox,
    public AppChooser
{
  _CLASS_GTKOBJECT(AppChooserButton, GtkAppChooserButton, GTK_APP_CHOOSER_BUTTON, ComboBox, GtkComboBox)
  _IMPLEMENTS_INTERFACE(AppChooser)
public:

  /** Creates a new app-chooser button for applications that can handle content of the given type.
   *
   * @param content_type The content type to show applications for
   */
  _WRAP_CTOR(AppChooserButton(const Glib::ustring& content_type), gtk_app_chooser_button_new)

  _WRAP_METHOD(void append_separator(), gtk_app_chooser_button_append_separator)
  _WRAP_METHOD(void append_custom_item(const Glib::ustring& name, const Glib::ustring& label, const Glib::RefPtr<Gio::Icon>& icon), gtk_app_chooser_button_append_custom_item)
  _WRAP_METHOD(void set_active_custom_item(const Glib::ustring& name), gtk_app_chooser_button_set_active_custom_item)
  _WRAP_METHOD(void set_show_dialog_item(bool setting = true), gtk_app_chooser_button_set_show_dialog_item)
  _WRAP_METHOD(bool get_show_dialog_item() const, gtk_app_chooser_button_get_show_dialog_item)
  _WRAP_METHOD(void set_heading(const Glib::ustring& heading), gtk_app_chooser_button_set_heading)
  _WRAP_METHOD(Glib::ustring get_heading() const, gtk_app_chooser_button_get_heading)

  _WRAP_SIGNAL(void custom_item_activated(const Glib::ustring& item_name), "custom-item-activated")

  _WRAP_PROPERTY("show-dialog-item", bool)
  _WRAP_PROPERTY("heading", Glib::ustring)
};


} // namespace Gtk
