Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Types | Public Member Functions
Xfc::Gtk::FileFilter Class Reference

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

#include <xfc/gtk/filefilter.hh>

Inheritance diagram for Xfc::Gtk::FileFilter:
Xfc::Gtk::Object Xfc::G::Object Xfc::G::TypeInstance Xfc::Trackable

List of all members.

Public Types

Public 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&> Xfc::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

Xfc::Gtk::FileFilter::FileFilter ( GtkFileFilter *  filter,
bool  owns_reference = false 
) [explicit, protected]

Construct a new FileFilter from an existing GtkFileFilter.

Parameters:
filterA pointer to a GtkFileFilter.
owns_referenceSet 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).

Xfc::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

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

Parameters:
neededThe bitfield of Gtk::FileFilterFlags indicating the information that the custom filter slot needs.
slotThe 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 Xfc::Gtk::FileFilter::add_mime_type ( const String mime_type)

Adds a rule allowing a given mime type to filter.

Parameters:
mime_typeThe name of a MIME type (such as "image/png").
void Xfc::Gtk::FileFilter::add_pattern ( const String pattern)

Adds a rule allowing a shell style glob to filter.

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

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

Returns:
The human-readable name of the filter, or a null String.
void Xfc::Gtk::FileFilter::set_name ( const String name)

Sets the human-readable name of the filter.

Parameters:
nameThe 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:
nameThe human-readable-name for the filter, or null to remove any existing name.

The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC