FileFilter

Description A GtkFileFilter can be used to restrict the files being shown in a GtkFileChooser. Files can be filtered based on their name (with gtk_file_filter_add_pattern()), on their mime type (with gtk_file_filter_add_mime_type()), or by a custom filter function (with gtk_file_filter_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 GtkFileFilter 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 GtkFileChooser, see gtk_file_chooser_add_filter(), but it is also possible to manually use a filter on a file with gtk_file_filter_filter().

Constructors

this
this(GtkFileFilter* gtkFileFilter)

Sets our main struct and passes it to the parent class

this
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 Since 2.4

Members

Functions

addCustom
void 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. Since 2.4

addMimeType
void addMimeType(string mimeType)

Adds a rule allowing a given mime type to filter. Since 2.4

addPattern
void addPattern(string pattern)

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

addPixbufFormats
void addPixbufFormats()

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

filter
int 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. Since 2.4

getFileFilterStruct
GtkFileFilter* getFileFilterStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getName
string getName()

Gets the human-readable name for the filter. See gtk_file_filter_set_name(). Since 2.4

getNeeded
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. Since 2.4

getStruct
void* getStruct()

the main Gtk struct as a void*

setName
void setName(string 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. Since 2.4

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

gtkFileFilter
GtkFileFilter* gtkFileFilter;

the main Gtk struct

Inherited Members

From ObjectGtk

gtkObject
GtkObject* gtkObject;

the main Gtk struct

getObjectGtkStruct
GtkObject* getObjectGtkStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
getId
string getId(StockID id)
connectedSignals
int[string] connectedSignals;
onDestroyListeners
void delegate(ObjectGtk)[] onDestroyListeners;
Undocumented in source.
addOnDestroy
void addOnDestroy(void delegate(ObjectGtk) dlg, ConnectFlags connectFlags)

Signals that all holders of a reference to the GtkObject should release the reference that they hold. May result in finalization of the object if all references are released. See Also GObject

callBackDestroy
void callBackDestroy(GtkObject* objectStruct, ObjectGtk _objectGtk)
Undocumented in source. Be warned that the author may not have intended to support it.
sink
void sink()

Warning gtk_object_sink has been deprecated since version 2.10 and should not be used in newly-written code. Use g_object_ref_sink() instead Removes the floating reference from a GtkObject, if it exists; otherwise does nothing. See the GtkObject overview documentation at the top of the page.

weakref
void weakref(GDestroyNotify notify, void* data)

Warning gtk_object_weakref is deprecated and should not be used in newly-written code. Use g_object_weak_ref() instead. Adds a weak reference callback to an object. Weak references are used for notification when an object is finalized. They are called "weak references" because they allow you to safely hold a pointer to an object without calling g_object_ref() (g_object_ref() adds a strong reference, that is, forces the object to stay alive).

weakunref
void weakunref(GDestroyNotify notify, void* data)

Warning gtk_object_weakunref is deprecated and should not be used in newly-written code. Use g_object_weak_unref() instead. Removes a weak reference callback to an object.

destroy
void destroy()

Warning gtk_object_destroy has been deprecated since version 2.24 and should not be used in newly-written code. Use gtk_widget_destroy() instead (if object is a widget) Emits the "destroy" signal notifying all reference holders that they should release the GtkObject. See the overview documentation at the top of the page for more details. The memory for the object itself won't be deleted until its reference count actually drops to 0; gtk_object_destroy() merely asks reference holders to release their references, it does not free the object.

removeNoNotify
void removeNoNotify(string key)

Warning gtk_object_remove_no_notify is deprecated and should not be used in newly-written code. Use g_object_steal_data() instead. Remove a specified datum from the object's data associations (the object_data), without invoking the association's destroy handler. Just like gtk_object_remove_data() except that any destroy handler will be ignored. Therefore this only affects data set using gtk_object_set_data_full().

setUserData
void setUserData(void* data)

Warning gtk_object_set_user_data is deprecated and should not be used in newly-written code. Use g_object_set_data() instead. For convenience, every object offers a generic user data pointer. This function sets it.

getUserData
void* getUserData()

Warning gtk_object_get_user_data is deprecated and should not be used in newly-written code. Use g_object_get_data() instead. Get the object's user data pointer. This is intended to be a pointer for your convenience in writing applications.

addArgType
void addArgType(string argName, GType argType, uint argFlags, uint argId)

Warning gtk_object_add_arg_type is deprecated and should not be used in newly-written code. Deprecated in favor of the GObject property system including GParamSpec. Add a new type of argument to an object class. Usually this is called when registering a new type of object.

setDataById
void setDataById(GQuark dataId, void* data)

Warning gtk_object_set_data_by_id is deprecated and should not be used in newly-written code. Use g_object_set_qdata() instead. Just like gtk_object_set_data() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

setDataByIdFull
void setDataByIdFull(GQuark dataId, void* data, GDestroyNotify destroy)

Warning gtk_object_set_data_by_id_full is deprecated and should not be used in newly-written code. Use g_object_set_qdata_full() instead. Just like gtk_object_set_data_full() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

getDataById
void* getDataById(GQuark dataId)

Warning gtk_object_get_data_by_id is deprecated and should not be used in newly-written code. Use g_object_get_qdata() instead. Just like gtk_object_get_data() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

removeDataById
void removeDataById(GQuark dataId)

Warning gtk_object_remove_data_by_id is deprecated and should not be used in newly-written code. Use g_object_set_qdata() with data of NULL instead. Just like gtk_object_remove_data() except that it takes a GQuark instead of a string, so it is slightly faster. Remove a specified datum from the object's data associations. Subsequent calls to gtk_object_get_data() will return NULL. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

removeNoNotifyById
void removeNoNotifyById(GQuark keyId)

Warning gtk_object_remove_no_notify_by_id is deprecated and should not be used in newly-written code. Use g_object_steal_qdata() instead. Just like gtk_object_remove_no_notify() except that it takes a GQuark instead of a string, so it is slightly faster. Use gtk_object_data_try_key() and gtk_object_data_force_id() to get an id from a string.

Meta