/* 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, see <https://www.gnu.org/licenses/>.
 */

_CONFIGINCLUDE(gtkmmconfig.h)

#include <glibmm/interface.h>
#include <giomm/appinfo.h>

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

#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
#undef GTK_DISABLE_DEPRECATED
#define GDK_DISABLE_DEPRECATION_WARNINGS 1
#m4 _POP()

_IS_DEPRECATED // The entire file is deprecated.

#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C"
{
typedef struct _GtkAppChooserIface GtkAppChooserIface;
}
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

namespace Gtk
{

/** Interface implemented by widgets for choosing an application.
 *
 * This interface can be implemented by widgets which allow the user to choose
 * an application (typically for the purpose of opening a file). The main
 * objects that implement this interface are AppChooserWidget, AppChooserDialog
 * and AppChooserButton.
 *
 * Applications are represented by Gio::AppInfo objects here.
 * GIO has a concept of recommended and fallback applications for a
 * given content type. Recommended applications are those that claim
 * to handle the content type itself, while fallback also includes
 * applications that handle a more generic content type. GIO also
 * knows the default and last-used application for a given content
 * type. The AppChooserWidget provides detailed control over
 * whether the shown list of applications should include default,
 * recommended or fallback applications.
 *
 * To obtain the application that has been selected in an AppChooser,
 * use get_app_info().
 *
 * See @ref giommContentType in glibmm for more information about content types.
 *
 * @newin{3,0}
 * @deprecated 4.10: The application selection widgets should be
 *   implemented according to the design of each platform and/or
 *   application requiring them.
 *   This interface will be removed in GTK 5.
 */
class GTKMM_API AppChooser : public Glib::Interface
{
  _CLASS_INTERFACE(AppChooser, GtkAppChooser, GTK_APP_CHOOSER, GtkAppChooserIface, , , GTKMM_API)

public:
  _WRAP_METHOD(Glib::RefPtr<Gio::AppInfo> get_app_info(), gtk_app_chooser_get_app_info, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Gio::AppInfo> get_app_info() const, gtk_app_chooser_get_app_info, refreturn, constversion)

  _WRAP_METHOD(Glib::ustring get_content_type() const, gtk_app_chooser_get_content_type)
  _WRAP_METHOD(void refresh(), gtk_app_chooser_refresh)

  _WRAP_PROPERTY("content_type", Glib::ustring)
};

} // namespace Gtk
