MATE Library Reference Manual | ||||
---|---|---|---|---|
Top | Description |
#include <libmate/libmate.h> enum MateHelpError; #define MATE_HELP_ERROR gboolean mate_help_display (const char *file_name
,const char *link_id
,GError **error
); gboolean mate_help_display_with_doc_id (MateProgram *program
,const char *doc_id
,const char *file_name
,const char *link_id
,GError **error
); gboolean mate_help_display_with_doc_id_and_env (MateProgram *program
,const char *doc_id
,const char *file_name
,const char *link_id
,char **envp
,GError **error
); gboolean mate_help_display_desktop (MateProgram *program
,const char *doc_id
,const char *file_name
,const char *link_id
,GError **error
); gboolean mate_help_display_desktop_with_env (MateProgram *program
,const char *doc_id
,const char *file_name
,const char *link_id
,char **envp
,GError **error
); gboolean mate_help_display_uri (const char *help_uri
,GError **error
); gboolean mate_help_display_uri_with_env (const char *help_uri
,char **envp
,GError **error
);
These functions provide a way to display help files that are either installed as part of the main MATE installation or that are specific to the current application.
typedef enum { MATE_HELP_ERROR_INTERNAL, MATE_HELP_ERROR_NOT_FOUND } MateHelpError;
The different error codes which can be thrown in the MATE_HELP_ERROR domain.
#define MATE_HELP_ERROR (mate_help_error_quark ())
The class (or domain) of errors raised directly by the mate-help module. This is used as a value in the domain field of the GError structure.
gboolean mate_help_display (const char *file_name
,const char *link_id
,GError **error
);
Displays the help file specified by file_name
at location link_id
in the
preferred help browser of the user.
|
The name of the help document to display. |
|
Can be NULL . If set, refers to an anchor or section id within the
requested document.
|
|
A GError instance that will hold the specifics of any error which
occurs during processing, or NULL
|
Returns : |
TRUE on success, FALSE otherwise (in which case error will
contain the actual error).
|
gboolean mate_help_display_with_doc_id (MateProgram *program
,const char *doc_id
,const char *file_name
,const char *link_id
,GError **error
);
Displays the help file specified by file_name
at location link_id
within
the doc_id
domain in the preferred help browser of the user. Most of the
time, you want to call mate_help_display()
instead.
This function will display the help through creating a "ghelp" URI, by
looking for file_name
in the applications installed help location (found by
MATE_FILE_DOMAIN_APP_HELP) and its app_id. The resulting URI is roughly
in the form "ghelp:appid/file_name?link_id". If a matching file cannot be
found, FALSE
is returned and error
is set.
Please note that this only displays application help. To display help files
from the global MATE domain, you will want to use
mate_help_display_desktop()
.
|
The current application object, or NULL for the default one.
|
|
The document identifier, or NULL to default to the application ID
(app_id) of the specified program .
|
|
The name of the help document to display. |
|
Can be NULL . If set, refers to an anchor or section id within the
requested document.
|
|
A GError instance that will hold the specifics of any error which
occurs during processing, or NULL
|
Returns : |
TRUE on success, FALSE otherwise (in which case error will
contain the actual error).
|
gboolean mate_help_display_with_doc_id_and_env (MateProgram *program
,const char *doc_id
,const char *file_name
,const char *link_id
,char **envp
,GError **error
);
Like mate_display_with_doc_id()
, but the the contents of envp
will become the url viewer's environment rather than inheriting
from the parents environment.
|
The current application object, or NULL for the default one.
|
|
The document identifier, or NULL to default to empty string.
(app_id) of the specified program .
|
|
The name of the help document to display. |
|
Can be NULL . If set, refers to an anchor or section id within the
requested document.
|
|
child's environment, or NULL to inherit parent's.
|
|
A GError instance that will hold the specifics of any error which
occurs during processing, or NULL
|
Returns : |
TRUE on success, FALSE otherwise (in which case error will
contain the actual error).
|
Since 2.2
gboolean mate_help_display_desktop (MateProgram *program
,const char *doc_id
,const char *file_name
,const char *link_id
,GError **error
);
Displays the MATE system help file specified by file_name
at location
link_id
in the preferred help browser of the user. This is done by creating
a "ghelp" URI, by looking for file_name
in the system help domain
(MATE_FILE_DOMAIN_HELP) and it's app_id. This domain is determined when
the library is compiled. If a matching file cannot be found, FALSE
is
returned and error
is set.
Please note that this only displays system help. To display help files
for an application, you will want to use mate_help_display()
.
|
The current application object, or NULL for the default one.
|
|
The name of the help file relative to the system's help domain (MATE_FILE_DOMAIN_HELP). |
|
The name of the help document to display. |
|
Can be NULL . If set, refers to an anchor or section id within the
requested document.
|
|
A GError instance that will hold the specifics of any error which
occurs during processing, or NULL
|
Returns : |
TRUE on success, FALSE otherwise (in which case error will
contain the actual error).
|
gboolean mate_help_display_desktop_with_env (MateProgram *program
,const char *doc_id
,const char *file_name
,const char *link_id
,char **envp
,GError **error
);
Like mate_help_display_desktop()
, but the the contents of envp
will become the url viewer's environment rather than inheriting
from the parents environment.
|
The current application object, or NULL for the default one.
|
|
The name of the help file relative to the system's help domain (MATE_FILE_DOMAIN_HELP). |
|
The name of the help document to display. |
|
Can be NULL . If set, refers to an anchor or section id within the
requested document.
|
|
child's environment, or NULL to inherit parent's.
|
|
A GError instance that will hold the specifics of any error which
occurs during processing, or NULL
|
Returns : |
TRUE on success, FALSE otherwise (in which case error will
contain the actual error).
|
Since 2.2
gboolean mate_help_display_uri (const char *help_uri
,GError **error
);
Displays help_uri
in the user's preferred viewer. You should never need to
call this function directly in code, since it is just a wrapper for
mate_url_show()
and consequently the viewer used to display the results
depends upon the scheme of the URI (so it is not strictly a help-only
function).
|
The URI to display. |
|
A GError instance that will hold the specifics of any error which
occurs during processing, or NULL
|
Returns : |
TRUE on success, FALSE otherwise (in which case error will
contain the actual error).
|
gboolean mate_help_display_uri_with_env (const char *help_uri
,char **envp
,GError **error
);
Like mate_help_display_uri()
, but the the contents of envp
will become the help viewer's environment rather than inheriting
from the parents environment.
|
The URI to display. |
|
child's environment, or NULL to inherit parent's.
|
|
A GError instance that will hold the specifics of any error which
occurs during processing, or NULL
|
Returns : |
TRUE on success, FALSE otherwise (in which case error will
contain the actual error).
|
Since 2.2