gtk.FileFilter.FileFilter Class Reference

Inheritance diagram for gtk.FileFilter.FileFilter:

gtk.ObjectGtk.ObjectGtk gobject.ObjectG.ObjectG List of all members.

Public Member Functions

GtkFileFiltergetFileFilterStruct ()
 this (GtkFileFilter *gtkFileFilter)
 Sets our main struct and passes it to the parent class.
 this ()
 Creates a new GtkFileFilter with no rules added to it.
void setName (char[] 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.
char[] getName ()
 Gets the human-readable name for the filter.
void addMimeType (char[] mimeType)
 Adds a rule allowing a given mime type to filter.
void addPattern (char[] pattern)
 Adds a rule allowing a shell style glob to a filter.
void addPixbufFormats ()
 Adds a rule allowing image files in the formats supported by GdkPixbuf.
void addCustom (GtkFileFilterFlags needed, GtkFileFilterFunc func, void *data, GDestroyNotify notify)
 Adds rule to a filter that allows files based on a custom callback function.
GtkFileFilterFlags getNeeded ()
 Gets the fields that need to be filled in for the structure passed to gtk_file_filter_filter() This function will not typically be used by applications; it is intended principally for use in the implementation of GtkFileChooser.
int filter (GtkFileFilterInfo *filterInfo)
 Tests whether a file should be displayed according to filter.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GtkFileFiltergtkFileFilter
 the main Gtk struct

Constructor & Destructor Documentation

gtk.FileFilter.FileFilter.this ( GtkFileFilter gtkFileFilter  ) 

Sets our main struct and passes it to the parent class.

gtk.FileFilter.FileFilter.this (  ) 

Creates a new GtkFileFilter with no rules added to it.

Such a filter doesn't accept any files, so is not particularly useful until you add rules with gtk_file_filter_add_mime_type(), gtk_file_filter_add_pattern(), or gtk_file_filter_add_custom(). To create a filter that accepts any file, use: GtkFileFilter *filter = gtk_file_filter_new (); gtk_file_filter_add_pattern (filter, "*"); Returns: a new GtkFileFilter Since 2.4


Member Function Documentation

void gtk.FileFilter.FileFilter.addCustom ( GtkFileFilterFlags  needed,
GtkFileFilterFunc  func,
void *  data,
GDestroyNotify  notify 
)

Adds rule to a filter that allows files based on a custom callback function.

The bitfield needed which is passed in provides information about what sorts of information that the filter function needs; this allows GTK+ to avoid retrieving expensive information when it isn't needed by the filter. filter: a GtkFileFilter needed: bitfield of flags indicating the information that the custom filter function needs. func: callback function; if the function returns TRUE, then the file will be displayed. data: data to pass to func notify: function to call to free data when it is no longer needed. Since 2.4

void gtk.FileFilter.FileFilter.addMimeType ( char[]  mimeType  ) 

Adds a rule allowing a given mime type to filter.

filter: A GtkFileFilter mime_type: name of a MIME type Since 2.4

void gtk.FileFilter.FileFilter.addPattern ( char[]  pattern  ) 

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

filter: a GtkFileFilter pattern: a shell style glob Since 2.4

void gtk.FileFilter.FileFilter.addPixbufFormats (  ) 

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

filter: a GtkFileFilter Since 2.6

int gtk.FileFilter.FileFilter.filter ( GtkFileFilterInfo filterInfo  ) 

Tests whether a file should be displayed according to filter.

The GtkFileFilterInfo structure filter_info should include the fields returned from gtk_file_filter_get_needed(). This function will not typically be used by applications; it is intended principally for use in the implementation of GtkFileChooser. filter: a GtkFileFilter filter_info: a GtkFileFilterInfo structure containing information about a file. Returns: TRUE if the file should be displayed Since 2.4 See Also GtkFileChooser

GtkFileFilter* gtk.FileFilter.FileFilter.getFileFilterStruct (  ) 

char [] gtk.FileFilter.FileFilter.getName (  ) 

Gets the human-readable name for the filter.

See gtk_file_filter_set_name(). filter: a GtkFileFilter Returns: The human-readable name of the filter, or NULL. This value is owned by GTK+ and must not be modified or freed. Since 2.4

GtkFileFilterFlags gtk.FileFilter.FileFilter.getNeeded (  ) 

Gets the fields that need to be filled in for the structure passed to gtk_file_filter_filter() This function will not typically be used by applications; it is intended principally for use in the implementation of GtkFileChooser.

filter: a GtkFileFilter Returns: bitfield of flags indicating needed fields when calling gtk_file_filter_filter() Since 2.4

void* gtk.FileFilter.FileFilter.getStruct (  )  [protected]

the main Gtk struct as a void*

Reimplemented from gtk.ObjectGtk.ObjectGtk.

void gtk.FileFilter.FileFilter.setName ( char[]  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.

filter: a GtkFileFilter name: the human-readable-name for the filter, or NULL to remove any existing name. Since 2.4


Member Data Documentation

GtkFileFilter* gtk.FileFilter.FileFilter.gtkFileFilter [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo