1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 
3 /* caja-bookmark.h - interface for individual bookmarks.
4 
5    Copyright (C) 1999, 2000 Eazel, Inc.
6 
7    The Mate Library is free software; you can redistribute it and/or
8    modify it under the terms of the GNU Library General Public License as
9    published by the Free Software Foundation; either version 2 of the
10    License, or (at your option) any later version.
11 
12    The Mate Library is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    Library General Public License for more details.
16 
17    You should have received a copy of the GNU Library General Public
18    License along with the Mate Library; see the file COPYING.LIB.  If not,
19    write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20    Boston, MA 02110-1301, USA.
21 
22    Authors: John Sullivan <sullivan@eazel.com>
23 */
24 
25 #ifndef CAJA_BOOKMARK_H
26 #define CAJA_BOOKMARK_H
27 
28 #include <gtk/gtk.h>
29 #include <gio/gio.h>
30 typedef struct CajaBookmark CajaBookmark;
31 
32 #define CAJA_TYPE_BOOKMARK caja_bookmark_get_type()
33 #define CAJA_BOOKMARK(obj) \
34   (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAJA_TYPE_BOOKMARK, CajaBookmark))
35 #define CAJA_BOOKMARK_CLASS(klass) \
36   (G_TYPE_CHECK_CLASS_CAST ((klass), CAJA_TYPE_BOOKMARK, CajaBookmarkClass))
37 #define CAJA_IS_BOOKMARK(obj) \
38   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAJA_TYPE_BOOKMARK))
39 #define CAJA_IS_BOOKMARK_CLASS(klass) \
40   (G_TYPE_CHECK_CLASS_TYPE ((klass), CAJA_TYPE_BOOKMARK))
41 #define CAJA_BOOKMARK_GET_CLASS(obj) \
42   (G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_BOOKMARK, CajaBookmarkClass))
43 
44 typedef struct CajaBookmarkDetails CajaBookmarkDetails;
45 
46 struct CajaBookmark
47 {
48     GObject object;
49     CajaBookmarkDetails *details;
50 };
51 
52 struct CajaBookmarkClass
53 {
54     GObjectClass parent_class;
55 
56     /* Signals that clients can connect to. */
57 
58     /* The appearance_changed signal is emitted when the bookmark's
59      * name or icon has changed.
60      */
61     void	(* appearance_changed) (CajaBookmark *bookmark);
62 
63     /* The contents_changed signal is emitted when the bookmark's
64      * URI has changed.
65      */
66     void	(* contents_changed) (CajaBookmark *bookmark);
67 };
68 
69 typedef struct CajaBookmarkClass CajaBookmarkClass;
70 
71 GType                 caja_bookmark_get_type               (void);
72 CajaBookmark *    caja_bookmark_new                    (GFile *location,
73         const char *name,
74         gboolean has_custom_name,
75         GIcon *icon);
76 CajaBookmark *    caja_bookmark_copy                   (CajaBookmark      *bookmark);
77 char *                caja_bookmark_get_name               (CajaBookmark      *bookmark);
78 GFile *               caja_bookmark_get_location           (CajaBookmark      *bookmark);
79 char *                caja_bookmark_get_uri                (CajaBookmark      *bookmark);
80 GIcon *               caja_bookmark_get_icon               (CajaBookmark      *bookmark);
81 gboolean	      caja_bookmark_get_has_custom_name    (CajaBookmark      *bookmark);
82 gboolean              caja_bookmark_set_name               (CajaBookmark      *bookmark,
83         const char            *new_name);
84 gboolean              caja_bookmark_uri_known_not_to_exist (CajaBookmark      *bookmark);
85 int                   caja_bookmark_compare_with           (gconstpointer          a,
86         gconstpointer          b);
87 int                   caja_bookmark_compare_uris           (gconstpointer          a,
88         gconstpointer          b);
89 
90 void                  caja_bookmark_set_scroll_pos         (CajaBookmark      *bookmark,
91         const char            *uri);
92 char *                caja_bookmark_get_scroll_pos         (CajaBookmark      *bookmark);
93 
94 
95 /* Helper functions for displaying bookmarks */
96 cairo_surface_t *     caja_bookmark_get_surface            (CajaBookmark      *bookmark,
97         GtkIconSize            icon_size);
98 GtkWidget *           caja_bookmark_menu_item_new          (CajaBookmark      *bookmark);
99 
100 #endif /* CAJA_BOOKMARK_H */
101