namespace Gio
{
+/** @defgroup giommContentType Platform-specific content typing
+ * A content type is a platform specific string that defines the type of a file.
+ * On UNIX it is a <a href="http://www.wikipedia.org/wiki/Internet_media_type">mime type</a>
+ * like "text/plain" or "image/png".
+ * On Win32 it is an extension string like ".doc", ".txt" or a perceived
+ * string like "audio". Such strings can be looked up in the registry at
+ * HKEY_CLASSES_ROOT.
+ * @{
+ */
/**
* Compares two content types for equality.
* Determines if @a type is a subset of @a supertype.
*
* @param type A content type string.
- * @param supertype A string.
+ * @param supertype A content type string.
*
* @return true if @a type is a kind of @a supertype, false otherwise.
*/
Glib::ustring content_type_get_description(const Glib::ustring& type);
/**
- * Gets the mime-type for the content type. If one is registered
+ * Gets the mime-type for the content type, if one is registered.
*
* @param type A content type string.
*
- * @return the registered mime-type for the given @a type, or NULL if unknown.
+ * @return the registered mime-type for the given @a type, or an empty string if unknown.
*/
Glib::ustring content_type_get_mime_type(const Glib::ustring& type);
/**
- * @param type A content type string.
- *
* Gets the icon for a content type.
*
+ * @param type A content type string.
+ *
* @return Icon corresponding to the content type.
*/
Glib::RefPtr<Icon> content_type_get_icon(const Glib::ustring& type);
* Gets the symbolic icon for a content type.
*
* @param type A content type string.
- * @return Icon corresponding to the content type.
+ * @return symbolic Icon corresponding to the content type.
*
* @newin{2,34}
*/
/**
* Guesses the content type based on example data. If the function is uncertain,
- * @a result_uncertain will be set to true
+ * @a result_uncertain will be set to true. Either @a filename may be an empty
+ * string or @a data may be <tt>0</tt>, in which case the guess will be based
+ * solely on the other argument.
*
* @param filename a string.
* @param data A stream of data.
* @param data_size The size of @a data.
- * @param result_uncertain A flag indicating the certainty of the result.
+ * @param[out] result_uncertain A flag indicating the certainty of the result.
* @return A string indicating a guessed content type for the
* given data.
*/
/**
* Guesses the content type based on example data. If the function is uncertain,
- * @a result_uncertain will be set to true
+ * @a result_uncertain will be set to true. @a filename may be an empty string,
+ * in which case the guess will be based solely on @a data.
*
* @param filename a string.
* @param data A stream of data.
- * @param result_uncertain A flag indicating the certainty of the result.
+ * @param[out] result_uncertain A flag indicating the certainty of the result.
* @return A string indicating a guessed content type for the
* given data.
*/
*
* The types returned all have the form x-content/foo, e.g.
* x-content/audio-cdda (for audio CDs) or x-content/image-dcf
- * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
+ * (for a camera memory card). See the <a href="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</a>
* specification for more on x-content types.
*
* @param root The root of the tree to guess a type for.
*/
Glib::ListHandle<Glib::ustring> content_types_get_registered();
+/** @} group giommContentType */
+
} // namespace Gio
#endif // _GIOMM_CONTENTTYPE_H
+// This test case fails unless an implementation of TLS backend is installed.
+// (Exception caught: TLS support is not available.)
+// Module glib-networking implements TLS backend.
+//
+// Even if glib-networking is installed, it's possible that glib does not find it.
+// That's very probable if glib and glib-networking are installed with different
+// directory prefixes, e.g. glib in /opt/gnome and glib-networking in /usr.
+// You can fix that by setting the GIO_EXTRA_MODULES environment variable to
+// the directory to search for implementations of gio extension points.
+// Example:
+// export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules
+// If you don't know where the implementations of gio extension points are stored,
+// search for a file named giomodule.cache.
+//
+// https://developer.gnome.org/gio/stable/extending-gio.html (G_TLS_BACKEND_EXTENSION_POINT_NAME)
+// https://developer.gnome.org/gio/stable/gio-Extension-Points.html
+// https://developer.gnome.org/gio/stable/gio-querymodules.html
+
#include <giomm.h>
#include <iostream>
#include <cstdlib>