Ardour  9.0-pre0-582-g084a23a80d
Gtk::FileFilter Class Reference

#include <filefilter.h>

Inheritance diagram for Gtk::FileFilter:
[legend]

Classes

class  Info
 

Public Types

typedef sigc::slot< bool, const Info & > SlotCustom
 For instance, bool on_custom(const Gtk::FileFilter::Info& filter_info);. More...
 

Public Member Functions

virtual ~FileFilter ()
 
GtkFileFiltergobj ()
 Provides access to the underlying C GtkObject. More...
 
const GtkFileFiltergobj () const
 Provides access to the underlying C GtkObject. More...
 
 FileFilter ()
 
void set_name (const Glib::ustring &name)
 
Glib::ustring get_name () const
 
void add_mime_type (const Glib::ustring &mime_type)
 
void add_pattern (const Glib::ustring &pattern)
 
void add_pixbuf_formats ()
 
void add_custom (FileFilterFlags needed, const SlotCustom &slot)
 
FileFilterFlags get_needed () const
 
- Public Member Functions inherited from Gtk::Object
virtual ~Object ()
 
GtkObjectgobj ()
 Provides access to the underlying C GtkObject. More...
 
const GtkObjectgobj () const
 Provides access to the underlying C GtkObject. More...
 
Glib::PropertyProxy< void * > property_user_data ()
 
Glib::PropertyProxy_ReadOnly< void * > property_user_data () const
 

Related Functions

(Note that these are not member functions.)

Gtk::FileFilterwrap (GtkFileFilter *object, bool take_copy=false)
 

Detailed Description

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().

Definition at line 137 of file filefilter.h.

Member Typedef Documentation

◆ SlotCustom

typedef sigc::slot<bool, const Info&> Gtk::FileFilter::SlotCustom

For instance, bool on_custom(const Gtk::FileFilter::Info& filter_info);.

Definition at line 241 of file filefilter.h.

Constructor & Destructor Documentation

◆ ~FileFilter()

virtual Gtk::FileFilter::~FileFilter ( )
virtual

◆ FileFilter()

Gtk::FileFilter::FileFilter ( )

Member Function Documentation

◆ add_custom()

void Gtk::FileFilter::add_custom ( FileFilterFlags  needed,
const SlotCustom slot 
)

◆ add_mime_type()

void Gtk::FileFilter::add_mime_type ( const Glib::ustring &  mime_type)

Adds a rule allowing a given mime type to filter.

Parameters
mime_typeName of a MIME type.

◆ add_pattern()

void Gtk::FileFilter::add_pattern ( const Glib::ustring &  pattern)

Adds a rule allowing a shell style glob to a filter.

Parameters
patternA shell style glob.

◆ add_pixbuf_formats()

void Gtk::FileFilter::add_pixbuf_formats ( )

Adds a rule allowing image files in the formats supported by GdkPixbuf.

◆ get_name()

Glib::ustring Gtk::FileFilter::get_name ( ) const

Gets the human-readable name for the filter. See set_name().

Returns
The human-readable name of the filter, or 0. This value is owned by GTK+ and must not be modified or freed.

◆ get_needed()

FileFilterFlags Gtk::FileFilter::get_needed ( ) const

Gets the fields that need to be filled in for the structure passed to filter()

This function will not typically be used by applications; it is intended principally for use in the implementation of Gtk::FileChooser.

Returns
Bitfield of flags indicating needed fields when calling filter().

◆ gobj() [1/2]

GtkFileFilter* Gtk::FileFilter::gobj ( )
inline

Provides access to the underlying C GtkObject.

Definition at line 174 of file filefilter.h.

◆ gobj() [2/2]

const GtkFileFilter* Gtk::FileFilter::gobj ( ) const
inline

Provides access to the underlying C GtkObject.

Definition at line 177 of file filefilter.h.

◆ set_name()

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.

Parameters
nameThe human-readable-name for the filter, or 0 to remove any existing name.

Friends And Related Function Documentation

◆ wrap()

Gtk::FileFilter * wrap ( GtkFileFilter object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file: