]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkrecentmanager.h
Revert "combobox: Don't special-case RTL child positions anymore"
[~andy/gtk] / gtk / gtkrecentmanager.h
index f41e2dab2b0015a13f4005374a899c0beed02400..a1d7500ead8b3f8c9d298dcd1e07788d1bff5aa5 100644 (file)
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef __GTK_RECENT_MANAGER_H__
 #define __GTK_RECENT_MANAGER_H__
 
-#include <glib-object.h>
-#include <gdk/gdkscreen.h>
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
 #include <time.h>
 
 G_BEGIN_DECLS
@@ -45,7 +47,6 @@ typedef struct _GtkRecentManagerPrivate GtkRecentManagerPrivate;
 
 /**
  * GtkRecentData:
- *
  * @display_name: a UTF-8 encoded string, containing the name of the recently
  *   used resource to be displayed, or %NULL;
  * @description: a UTF-8 encoded string, containing a short description of
@@ -54,8 +55,9 @@ typedef struct _GtkRecentManagerPrivate GtkRecentManagerPrivate;
  * @app_name: the name of the application that is registering this recently
  *   used resource;
  * @app_exec: command line used to launch this resource; may contain the
- *   "%f" and "%u" escape characters which will be expanded to the resource
- *   file path and URI respectively when the command line is retrieved;
+ *   "&percnt;f" and "&percnt;u" escape characters which will be expanded
+ *   to the resource file path and URI respectively when the command line
+ *   is retrieved;
  * @groups: a vector of strings containing groups names;
  * @is_private: whether this resource should be displayed only by the
  *   applications that have registered it or not.
@@ -67,32 +69,47 @@ struct _GtkRecentData
 {
   gchar *display_name;
   gchar *description;
-  
+
   gchar *mime_type;
-  
+
   gchar *app_name;
   gchar *app_exec;
-  
+
   gchar **groups;
-  
+
   gboolean is_private;
 };
 
+/**
+ * GtkRecentManager:
+ *
+ * #GtkRecentManager contains only private data
+ * and should be accessed using the provided API.
+ *
+ * Since: 2.10
+ */
 struct _GtkRecentManager
 {
   /*< private >*/
   GObject parent_instance;
-  
+
   GtkRecentManagerPrivate *priv;
 };
 
+/**
+ * GtkRecentManagerClass:
+ *
+ * #GtkRecentManagerClass contains only private data.
+ *
+ * Since: 2.10
+ */
 struct _GtkRecentManagerClass
 {
   /*< private >*/
   GObjectClass parent_class;
-  
+
   void (*changed) (GtkRecentManager *manager);
-  
+
   /* padding for future expansion */
   void (*_gtk_recent1) (void);
   void (*_gtk_recent2) (void);
@@ -105,8 +122,6 @@ struct _GtkRecentManagerClass
  * @GTK_RECENT_MANAGER_ERROR_NOT_FOUND: the URI specified does not exists in
  *   the recently used resources list.
  * @GTK_RECENT_MANAGER_ERROR_INVALID_URI: the URI specified is not valid.
- * @GTK_RECENT_MANAGER_ERROR_INVALID_MIME: the MIME type specified is not
- *   valid.
  * @GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: the supplied string is not
  *   UTF-8 encoded.
  * @GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: no application has registered
@@ -117,21 +132,28 @@ struct _GtkRecentManagerClass
  *   resources file.
  * @GTK_RECENT_MANAGER_ERROR_UNKNOWN: unspecified error.
  *
- * Error codes for GtkRecentManager operations
- **/
+ * Error codes for #GtkRecentManager operations
+ *
+ * Since: 2.10
+ */
 typedef enum
 {
   GTK_RECENT_MANAGER_ERROR_NOT_FOUND,
   GTK_RECENT_MANAGER_ERROR_INVALID_URI,
-  GTK_RECENT_MANAGER_ERROR_INVALID_MIME,
   GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
   GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
-  GTK_RECENT_MANAGER_ERROR_BAD_EXEC_STRING,
   GTK_RECENT_MANAGER_ERROR_READ,
   GTK_RECENT_MANAGER_ERROR_WRITE,
   GTK_RECENT_MANAGER_ERROR_UNKNOWN
 } GtkRecentManagerError;
 
+/**
+ * GTK_RECENT_MANAGER_ERROR:
+ *
+ * The #GError domain for #GtkRecentManager errors.
+ *
+ * Since: 2.10
+ */
 #define GTK_RECENT_MANAGER_ERROR       (gtk_recent_manager_error_quark ())
 GQuark         gtk_recent_manager_error_quark (void);
 
@@ -140,18 +162,12 @@ GType               gtk_recent_manager_get_type       (void) G_GNUC_CONST;
 
 GtkRecentManager *gtk_recent_manager_new            (void);
 GtkRecentManager *gtk_recent_manager_get_default    (void);
-GtkRecentManager *gtk_recent_manager_get_for_screen (GdkScreen            *screen);
-
-void              gtk_recent_manager_set_screen     (GtkRecentManager     *manager,
-                                                    GdkScreen            *screen);
 
 gboolean          gtk_recent_manager_add_item       (GtkRecentManager     *manager,
-                                                    const gchar          *uri,
-                                                    GError              **error);
+                                                    const gchar          *uri);
 gboolean          gtk_recent_manager_add_full       (GtkRecentManager     *manager,
                                                     const gchar          *uri,
-                                                    const GtkRecentData  *recent_data,
-                                                    GError              **error);
+                                                    const GtkRecentData  *recent_data);
 gboolean          gtk_recent_manager_remove_item    (GtkRecentManager     *manager,
                                                     const gchar          *uri,
                                                     GError              **error);
@@ -164,9 +180,6 @@ gboolean          gtk_recent_manager_move_item      (GtkRecentManager     *manag
                                                     const gchar          *uri,
                                                     const gchar          *new_uri,
                                                     GError              **error);
-void              gtk_recent_manager_set_limit      (GtkRecentManager     *manager,
-                                                    gint                  limit);
-gint              gtk_recent_manager_get_limit      (GtkRecentManager     *manager);
 GList *           gtk_recent_manager_get_items      (GtkRecentManager     *manager);
 gint              gtk_recent_manager_purge_items    (GtkRecentManager     *manager,
                                                     GError              **error);
@@ -177,19 +190,22 @@ GType                   gtk_recent_info_get_type             (void) G_GNUC_CONST;
 GtkRecentInfo *       gtk_recent_info_ref                  (GtkRecentInfo  *info);
 void                  gtk_recent_info_unref                (GtkRecentInfo  *info);
 
-G_CONST_RETURN gchar *gtk_recent_info_get_uri              (GtkRecentInfo  *info);
-G_CONST_RETURN gchar *gtk_recent_info_get_display_name     (GtkRecentInfo  *info);
-G_CONST_RETURN gchar *gtk_recent_info_get_description      (GtkRecentInfo  *info);
-G_CONST_RETURN gchar *gtk_recent_info_get_mime_type        (GtkRecentInfo  *info);
+const gchar *         gtk_recent_info_get_uri              (GtkRecentInfo  *info);
+const gchar *         gtk_recent_info_get_display_name     (GtkRecentInfo  *info);
+const gchar *         gtk_recent_info_get_description      (GtkRecentInfo  *info);
+const gchar *         gtk_recent_info_get_mime_type        (GtkRecentInfo  *info);
 time_t                gtk_recent_info_get_added            (GtkRecentInfo  *info);
 time_t                gtk_recent_info_get_modified         (GtkRecentInfo  *info);
 time_t                gtk_recent_info_get_visited          (GtkRecentInfo  *info);
 gboolean              gtk_recent_info_get_private_hint     (GtkRecentInfo  *info);
 gboolean              gtk_recent_info_get_application_info (GtkRecentInfo  *info,
                                                            const gchar    *app_name,
-                                                           gchar         **app_exec,
+                                                           const gchar   **app_exec,
                                                            guint          *count,
-                                                           time_t         *time);
+                                                           time_t         *time_);
+GAppInfo *            gtk_recent_info_create_app_info      (GtkRecentInfo  *info,
+                                                            const gchar    *app_name,
+                                                            GError        **error);
 gchar **              gtk_recent_info_get_applications     (GtkRecentInfo  *info,
                                                            gsize          *length) G_GNUC_MALLOC;
 gchar *               gtk_recent_info_last_application     (GtkRecentInfo  *info) G_GNUC_MALLOC;
@@ -201,6 +217,7 @@ gboolean              gtk_recent_info_has_group            (GtkRecentInfo  *info
                                                            const gchar    *group_name);
 GdkPixbuf *           gtk_recent_info_get_icon             (GtkRecentInfo  *info,
                                                            gint            size);
+GIcon *               gtk_recent_info_get_gicon            (GtkRecentInfo  *info);
 gchar *               gtk_recent_info_get_short_name       (GtkRecentInfo  *info) G_GNUC_MALLOC;
 gchar *               gtk_recent_info_get_uri_display      (GtkRecentInfo  *info) G_GNUC_MALLOC;
 gint                  gtk_recent_info_get_age              (GtkRecentInfo  *info);
@@ -209,6 +226,9 @@ gboolean              gtk_recent_info_exists               (GtkRecentInfo  *info
 gboolean              gtk_recent_info_match                (GtkRecentInfo  *info_a,
                                                            GtkRecentInfo  *info_b);
 
+/* private */
+void _gtk_recent_manager_sync (void);
+
 G_END_DECLS
 
 #endif /* __GTK_RECENT_MANAGER_H__ */