GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Gtk::FileFilter Class Reference

A GtkFileFilter C++ wrapper class. More...

#include <gfc/gtk/filefilter.hh>

Inheritance diagram for GFC::Gtk::FileFilter:

GFC::Gtk::Object GFC::G::Object GFC::G::TypeInstance GFC::Trackable List of all members.

Public Types

Public Member Functions

Constructors
Accessors
Methods

Protected Member Functions

Constructors

Detailed Description

A GtkFileFilter C++ wrapper class.

FileFilter is a filter for selecting a file subset.


Member Typedef Documentation

typedef sigc::slot<bool, const FileFilterInfo&> GFC::Gtk::FileFilter::CustomSlot
 

Signature of the custom filter callback slot to be called to filter files.

Example: Method signature for CustomSlot.

             bool method(const FileFilterInfo& filter_info);
             // filter_info: The file information as requested when the slot was added.


Constructor & Destructor Documentation

GFC::Gtk::FileFilter::FileFilter GtkFileFilter *  filter,
bool  owns_reference = false
[explicit, protected]
 

Construct a new FileFilter from an existing GtkFileFilter.

Parameters:
filter A pointer to a GtkFileFilter.
owns_reference Set false if the initial reference count is floating, set true if it's not.

The filter can be a newly created GtkFileFilter or an existing GtkFileFilter (see G::Object::Object).

GFC::Gtk::FileFilter::FileFilter  ) 
 

Constructs a new file filter with no rules added to it.

Such a filter doesn't accept any files, so is not particularly useful until you add rules with add_mime_type(), add_pattern(), or add_custom().


Example: To create a filter that accepts any file, use:

             Gtk::FileFilter *filter = new Gtk::FileFilter;
             filter->add_pattern("*");


Member Function Documentation

void GFC::Gtk::FileFilter::add_custom FileFilterFlagsField  needed,
const CustomSlot slot
 

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

Parameters:
needed The bitfield of Gtk::FileFilterFlags indicating the information that the custom filter slot needs.
slot The callback slot; if the slot returns true, then the file will be displayed.

The bitfield needed which is passed in provides information about what sorts of information the filter function needs; this allows GTK+ to avoid retrieving expensive information when it isn't needed by the filter.

void GFC::Gtk::FileFilter::add_mime_type const String mime_type  ) 
 

Adds a rule allowing a given mime type to filter.

Parameters:
mime_type The name of a MIME type (such as "image/png").

void GFC::Gtk::FileFilter::add_pattern const String pattern  ) 
 

Adds a rule allowing a shell style glob to filter.

Parameters:
pattern A shell style glob (such as "*" for all files).

String GFC::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 a null String.

void GFC::Gtk::FileFilter::set_name const String name  ) 
 

Sets the human-readable name of the filter.

Parameters:
name The human-readable-name for the filter, or null to remove any existing name.

This is the string that will be displayed in the file selector user interface if there is a selectable list of filters.
Parameters:
name The human-readable-name for the filter, or null to remove any existing name.


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:34:39 2004 for GFC-UI by doxygen 1.3.8