| gtkmm
    3.93.0
    | 
A filter for selecting a file subset. More...
#include <gtkmm/filefilter.h>

| Classes | |
| class | Info | 
| Public Types | |
| enum | Flags { Flags::FILENAME = 1 << 0, Flags::URI = 1 << 1, Flags::DISPLAY_NAME = 1 << 2, Flags::MIME_TYPE = 1 << 3 } | 
| These flags indicate what parts of a Gtk::FileFilterInfo struct are filled or need to be filled.  More... | |
| typedef sigc::slot< bool(const Info&)> | SlotCustom | 
| For instance, bool on_custom(const Gtk::FileFilter::Info& filter_info);.  More... | |
|  Public Types inherited from Glib::Object | |
| typedef void(*)(gpointer data | DestroyNotify) | 
|  Public Types inherited from sigc::trackable | |
| typedef internal::func_destroy_notify | func_destroy_notify | 
| Public Member Functions | |
| FileFilter (FileFilter&& src) noexcept | |
| FileFilter& | operator= (FileFilter&& src) noexcept | 
| ~FileFilter () noexcept override | |
| GtkFileFilter* | gobj () | 
| Provides access to the underlying C GObject.  More... | |
| const GtkFileFilter* | gobj () const | 
| Provides access to the underlying C GObject.  More... | |
| GtkFileFilter* | gobj_copy () | 
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.  More... | |
| void | set_name (const Glib::ustring& name) | 
| Sets the human-readable name of the filter; this is the string that will be displayed in the file selector user interface if there is a selectable list of filters.  More... | |
| Glib::ustring | get_name () const | 
| Gets the human-readable name for the filter.  More... | |
| void | add_mime_type (const Glib::ustring& mime_type) | 
| Adds a rule allowing a given mime type to filter.  More... | |
| void | add_pattern (const Glib::ustring& pattern) | 
| Adds a rule allowing a shell style glob to a filter.  More... | |
| void | add_pixbuf_formats () | 
| Adds a rule allowing image files in the formats supported by GdkPixbuf.  More... | |
| void | add_custom (Flags needed, const SlotCustom& slot) | 
| Flags | get_needed () const | 
| Gets the fields that need to be filled in for the Gtk::FileFilterInfo passed to filter()  More... | |
|  Public Member Functions inherited from Glib::Object | |
| Object (const Object &)=delete | |
| Object & | operator= (const Object &)=delete | 
| Object (Object &&src) noexcept | |
| Object & | operator= (Object &&src) noexcept | 
| void * | get_data (const QueryQuark &key) | 
| void | set_data (const Quark &key, void *data) | 
| void | set_data (const Quark &key, void *data, DestroyNotify notify) | 
| void | remove_data (const QueryQuark &quark) | 
| void * | steal_data (const QueryQuark &quark) | 
| Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) | 
|  Public Member Functions inherited from Glib::ObjectBase | |
| ObjectBase (const ObjectBase &)=delete | |
| ObjectBase & | operator= (const ObjectBase &)=delete | 
| void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) | 
| void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const | 
| void | set_property (const Glib::ustring &property_name, const PropertyType &value) | 
| void | get_property (const Glib::ustring &property_name, PropertyType &value) const | 
| PropertyType | get_property (const Glib::ustring &property_name) const | 
| sigc::connection | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot) | 
| sigc::connection | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot) | 
| void | freeze_notify () | 
| void | thaw_notify () | 
| virtual void | reference () const | 
| virtual void | unreference () const | 
| GObject * | gobj () | 
| const GObject * | gobj () const | 
| GObject * | gobj_copy () const | 
|  Public Member Functions inherited from sigc::trackable | |
| trackable () noexcept | |
| trackable (const trackable &src) noexcept | |
| trackable (trackable &&src) | |
| ~trackable () | |
| void | add_destroy_notify_callback (void *data, func_destroy_notify func) const | 
| void | notify_callbacks () | 
| trackable & | operator= (const trackable &src) | 
| trackable & | operator= (trackable &&src) | 
| void | remove_destroy_notify_callback (void *data) const | 
|  Public Member Functions inherited from Gtk::Buildable | |
| Buildable (Buildable&& src) noexcept | |
| Buildable& | operator= (Buildable&& src) noexcept | 
| ~Buildable () noexcept override | |
| GtkBuildable* | gobj () | 
| Provides access to the underlying C GObject.  More... | |
| const GtkBuildable* | gobj () const | 
| Provides access to the underlying C GObject.  More... | |
| void | set_name (const Glib::ustring& name) | 
| Sets the name of the buildable object.  More... | |
| Glib::ustring | get_name () const | 
| Gets the name of the buildable object.  More... | |
|  Public Member Functions inherited from Glib::Interface | |
| Interface () | |
| Interface (Interface &&src) noexcept | |
| Interface & | operator= (Interface &&src) noexcept | 
| Interface (const Glib::Interface_Class &interface_class) | |
| Interface (GObject *castitem) | |
| ~Interface () noexcept override | |
| Interface (const Interface &)=delete | |
| Interface & | operator= (const Interface &)=delete | 
| GObject * | gobj () | 
| const GObject * | gobj () const | 
| Static Public Member Functions | |
| static GType | get_type () | 
| Get the GType for this class, for use with the underlying GObject type system.  More... | |
| static Glib::RefPtr< FileFilter > | create () | 
|  Static Public Member Functions inherited from Gtk::Buildable | |
| static void | add_interface (GType gtype_implementer) | 
| static GType | get_type () | 
| Get the GType for this class, for use with the underlying GObject type system.  More... | |
| Protected Member Functions | |
| FileFilter () | |
|  Protected Member Functions inherited from Glib::Object | |
| Object () | |
| Object (const Glib::ConstructParams &construct_params) | |
| Object (GObject *castitem) | |
| ~Object () noexcept override | |
|  Protected Member Functions inherited from Glib::ObjectBase | |
| ObjectBase () | |
| ObjectBase (const char *custom_type_name) | |
| ObjectBase (const std::type_info &custom_type_info) | |
| ObjectBase (ObjectBase &&src) noexcept | |
| ObjectBase & | operator= (ObjectBase &&src) noexcept | 
| virtual | ~ObjectBase () noexcept=0 | 
| void | initialize (GObject *castitem) | 
| void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) | 
|  Protected Member Functions inherited from Gtk::Buildable | |
| Buildable () | |
| You should derive from this class to use it.  More... | |
| Related Functions | |
| (Note that these are not member functions.) | |
| Glib::RefPtr< Gtk::FileFilter > | wrap (GtkFileFilter* object, bool take_copy=false) | 
| A Glib::wrap() method for this object.  More... | |
|  Related Functions inherited from Gtk::Buildable | |
| Glib::RefPtr< Gtk::Buildable > | wrap (GtkBuildable* object, bool take_copy=false) | 
| A Glib::wrap() method for this object.  More... | |
A filter for selecting a file subset.
A Gtk::FileFilter can be used to restrict the files being shown in a Gtk::FileChooser. Files can be filtered based on their name (with add_pattern()), on their mime type (with add_mime_type()), or by a custom filter function (with add_custom()).
Filtering by mime types handles aliasing and subclassing of mime types; e.g. a filter for text/plain also matches a file with mime type application/rtf, since application/rtf is a subclass of text/plain. Note that Gtk::FileFilter allows wildcards for the subtype of a mime type, so you can e.g. filter for image/*.
Normally, filters are used by adding them to a Gtk::FileChooser. See Gtk::FileChooser::add_filter(). But it is also possible to manually use a filter on a file with filter().
| typedef sigc::slot<bool(const Info&)> Gtk::FileFilter::SlotCustom | 
For instance, bool on_custom(const Gtk::FileFilter::Info& filter_info);.
| 
 | noexcept | 
| 
 | overridenoexcept | 
| 
 | protected | 
| void Gtk::FileFilter::add_custom | ( | Flags | needed, | 
| const SlotCustom& | slot | ||
| ) | 
| void Gtk::FileFilter::add_mime_type | ( | const Glib::ustring & | mime_type | ) | 
Adds a rule allowing a given mime type to filter.
| mime_type | Name of a MIME type. | 
| void Gtk::FileFilter::add_pattern | ( | const Glib::ustring & | pattern | ) | 
Adds a rule allowing a shell style glob to a filter.
| pattern | A shell style glob. | 
| void Gtk::FileFilter::add_pixbuf_formats | ( | ) | 
Adds a rule allowing image files in the formats supported by GdkPixbuf.
| 
 | static | 
| Glib::ustring Gtk::FileFilter::get_name | ( | ) | const | 
Gets the human-readable name for the filter.
See set_name().
nullptr. This value is owned by GTK+ and must not be modified or freed. | Flags Gtk::FileFilter::get_needed | ( | ) | const | 
Gets the fields that need to be filled in for the Gtk::FileFilterInfo passed to filter()
This function will not typically be used by applications; it is intended principally for use in the implementation of Gtk::FileChooser.
| 
 | static | 
Get the GType for this class, for use with the underlying GObject type system.
| 
 | inline | 
Provides access to the underlying C GObject.
| 
 | inline | 
Provides access to the underlying C GObject.
| GtkFileFilter* Gtk::FileFilter::gobj_copy | ( | ) | 
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
| 
 | noexcept | 
| void Gtk::FileFilter::set_name | ( | const Glib::ustring & | name | ) | 
Sets the human-readable name of the filter; this is the string that will be displayed in the file selector user interface if there is a selectable list of filters.
| name | The human-readable-name for the filter, or nullptrto remove any existing name. | 
| 
 | related | 
A Glib::wrap() method for this object.
| object | The C instance. | 
| take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. | 
 1.8.13
 1.8.13