Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gtkrecentmanager.h
Go to the documentation of this file.
1/* GTK - The GIMP Toolkit
2 * gtkrecentmanager.h: a manager for the recently used resources
3 *
4 * Copyright (C) 2006 Emmanuele Bassi
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
23#error "Only <gtk/gtk.h> can be included directly."
24#endif
25
27#include <gdk/gdk.h>
28#include <time.h>
29
31
32#define GTK_TYPE_RECENT_INFO (gtk_recent_info_get_type ())
33
34#define GTK_TYPE_RECENT_MANAGER (gtk_recent_manager_get_type ())
35#define GTK_RECENT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RECENT_MANAGER, GtkRecentManager))
36#define GTK_IS_RECENT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RECENT_MANAGER))
37#define GTK_RECENT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RECENT_MANAGER, GtkRecentManagerClass))
38#define GTK_IS_RECENT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RECENT_MANAGER))
39#define GTK_RECENT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RECENT_MANAGER, GtkRecentManagerClass))
40
41typedef struct _GtkRecentInfo GtkRecentInfo;
45typedef struct _GtkRecentManagerPrivate GtkRecentManagerPrivate;
46
47/**
48 * GtkRecentData:
49 * @display_name: a UTF-8 encoded string, containing the name of the recently
50 * used resource to be displayed, or %NULL;
51 * @description: a UTF-8 encoded string, containing a short description of
52 * the resource, or %NULL;
53 * @mime_type: the MIME type of the resource;
54 * @app_name: the name of the application that is registering this recently
55 * used resource;
56 * @app_exec: command line used to launch this resource; may contain the
57 * ā€œ\%fā€ and ā€œ\%uā€ escape characters which will be expanded
58 * to the resource file path and URI respectively when the command line
59 * is retrieved;
60 * @groups: (array zero-terminated=1): a vector of strings containing
61 * groups names;
62 * @is_private: whether this resource should be displayed only by the
63 * applications that have registered it or not.
64 *
65 * Meta-data to be passed to gtk_recent_manager_add_full() when
66 * registering a recently used resource.
67 **/
69{
72
73 char *mime_type;
74
75 char *app_name;
76 char *app_exec;
77
78 char **groups;
79
81};
82
90
91/**
92 * GtkRecentManagerClass:
93 *
94 * `GtkRecentManagerClass` contains only private data.
95 */
97{
98 /*< private >*/
100
101 void (*changed) (GtkRecentManager *manager);
102
103 /* padding for future expansion */
104 void (*_gtk_recent1) (void);
105 void (*_gtk_recent2) (void);
106 void (*_gtk_recent3) (void);
107 void (*_gtk_recent4) (void);
108};
109
110/**
111 * GtkRecentManagerError:
112 * @GTK_RECENT_MANAGER_ERROR_NOT_FOUND: the URI specified does not exists in
113 * the recently used resources list.
114 * @GTK_RECENT_MANAGER_ERROR_INVALID_URI: the URI specified is not valid.
115 * @GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: the supplied string is not
116 * UTF-8 encoded.
117 * @GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: no application has registered
118 * the specified item.
119 * @GTK_RECENT_MANAGER_ERROR_READ: failure while reading the recently used
120 * resources file.
121 * @GTK_RECENT_MANAGER_ERROR_WRITE: failure while writing the recently used
122 * resources file.
123 * @GTK_RECENT_MANAGER_ERROR_UNKNOWN: unspecified error.
124 *
125 * Error codes for `GtkRecentManager` operations
126 */
137
138/**
139 * GTK_RECENT_MANAGER_ERROR:
140 *
141 * The `GError` domain for `GtkRecentManager` errors.
142 */
143#define GTK_RECENT_MANAGER_ERROR (gtk_recent_manager_error_quark ())
146
147
150
155
158 const char *uri);
161 const char *uri,
162 const GtkRecentData *recent_data);
165 const char *uri,
166 GError **error);
169 const char *uri,
170 GError **error);
173 const char *uri);
176 const char *uri,
177 const char *new_uri,
178 GError **error);
183 GError **error);
184
185
188
193
212 const char *app_name,
213 const char **app_exec,
214 guint *count,
215 GDateTime **stamp);
218 const char *app_name,
219 GError **error);
222 gsize *length) G_GNUC_MALLOC;
227 const char *app_name);
230 gsize *length) G_GNUC_MALLOC;
233 const char *group_name);
248 GtkRecentInfo *info_b);
249
250/* private */
252
255
257
struct _GDateTime GDateTime
Definition gdatetime.h:122
#define GDK_AVAILABLE_IN_ALL
struct _GIcon GIcon
Definition giotypes.h:92
struct _GAppInfo GAppInfo
Definition giotypes.h:35
unsigned long gsize
Definition glibconfig.h:83
typedefG_BEGIN_DECLS struct _GList GList
Definition glist.h:39
#define G_GNUC_MALLOC
Definition gmacros.h:293
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
#define G_DEFINE_AUTOPTR_CLEANUP_FUNC(TypeName, func)
Definition gmacros.h:1400
GOBJECT_AVAILABLE_IN_ALL void g_object_unref(gpointer object)
G_BEGIN_DECLS typedef guint32 GQuark
Definition gquark.h:38
GDK_AVAILABLE_IN_ALL char ** gtk_recent_info_get_groups(GtkRecentInfo *info, gsize *length) G_GNUC_MALLOC
GDK_AVAILABLE_IN_ALL GAppInfo * gtk_recent_info_create_app_info(GtkRecentInfo *info, const char *app_name, GError **error)
GDK_AVAILABLE_IN_ALL GType gtk_recent_info_get_type(void) G_GNUC_CONST
struct _GtkRecentInfo GtkRecentInfo
GDK_AVAILABLE_IN_ALL const char * gtk_recent_info_get_display_name(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL const char * gtk_recent_info_get_mime_type(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL GDateTime * gtk_recent_info_get_modified(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL const char * gtk_recent_info_get_uri(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL GType gtk_recent_manager_get_type(void) G_GNUC_CONST
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_info_has_group(GtkRecentInfo *info, const char *group_name)
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_manager_remove_item(GtkRecentManager *manager, const char *uri, GError **error)
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_info_exists(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_info_get_application_info(GtkRecentInfo *info, const char *app_name, const char **app_exec, guint *count, GDateTime **stamp)
GDK_AVAILABLE_IN_ALL char * gtk_recent_info_get_uri_display(GtkRecentInfo *info) G_GNUC_MALLOC
GDK_AVAILABLE_IN_ALL char ** gtk_recent_info_get_applications(GtkRecentInfo *info, gsize *length) G_GNUC_MALLOC
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_info_get_private_hint(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL GDateTime * gtk_recent_info_get_visited(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL GQuark gtk_recent_manager_error_quark(void)
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_manager_move_item(GtkRecentManager *manager, const char *uri, const char *new_uri, GError **error)
GDK_AVAILABLE_IN_ALL GtkRecentManager * gtk_recent_manager_get_default(void)
GDK_AVAILABLE_IN_ALL int gtk_recent_info_get_age(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_info_match(GtkRecentInfo *info_a, GtkRecentInfo *info_b)
struct _GtkRecentManagerPrivate GtkRecentManagerPrivate
GDK_AVAILABLE_IN_ALL GtkRecentInfo * gtk_recent_info_ref(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL const char * gtk_recent_info_get_description(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL char * gtk_recent_info_get_short_name(GtkRecentInfo *info) G_GNUC_MALLOC
GDK_AVAILABLE_IN_ALL GList * gtk_recent_manager_get_items(GtkRecentManager *manager)
GDK_AVAILABLE_IN_ALL void gtk_recent_info_unref(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_manager_add_full(GtkRecentManager *manager, const char *uri, const GtkRecentData *recent_data)
GDK_AVAILABLE_IN_ALL char * gtk_recent_info_last_application(GtkRecentInfo *info) G_GNUC_MALLOC
GDK_AVAILABLE_IN_ALL int gtk_recent_manager_purge_items(GtkRecentManager *manager, GError **error)
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_info_is_local(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL GIcon * gtk_recent_info_get_gicon(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL GDateTime * gtk_recent_info_get_added(GtkRecentInfo *info)
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_manager_add_item(GtkRecentManager *manager, const char *uri)
GtkRecentManagerError
@ GTK_RECENT_MANAGER_ERROR_UNKNOWN
@ GTK_RECENT_MANAGER_ERROR_READ
@ GTK_RECENT_MANAGER_ERROR_WRITE
@ GTK_RECENT_MANAGER_ERROR_NOT_FOUND
@ GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED
@ GTK_RECENT_MANAGER_ERROR_INVALID_URI
@ GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING
GDK_AVAILABLE_IN_ALL GtkRecentInfo * gtk_recent_manager_lookup_item(GtkRecentManager *manager, const char *uri, GError **error)
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_manager_has_item(GtkRecentManager *manager, const char *uri)
void _gtk_recent_manager_sync(void)
GDK_AVAILABLE_IN_ALL gboolean gtk_recent_info_has_application(GtkRecentInfo *info, const char *app_name)
GDK_AVAILABLE_IN_ALL GtkRecentManager * gtk_recent_manager_new(void)
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
unsigned int guint
Definition gtypes.h:61
static void error(LoadState *S, const char *why)
void(* changed)(GtkRecentManager *manager)
GtkRecentManagerPrivate * priv