2008-02-29 Cosimo Cecchi <cosimoc@gnome.org>
[nautilus.git] / libnautilus-private / nautilus-file-utilities.h
blobc540a4ef821ccc8854de9575cd33a7deda9c4eac
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
3 /* nautilus-file-utilities.h - interface for file manipulation routines.
5 Copyright (C) 1999, 2000, 2001 Eazel, Inc.
7 The Gnome 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.
12 The Gnome 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.
17 You should have received a copy of the GNU Library General Public
18 License along with the Gnome Library; see the file COPYING.LIB. If not,
19 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
22 Authors: John Sullivan <sullivan@eazel.com>
25 #ifndef NAUTILUS_FILE_UTILITIES_H
26 #define NAUTILUS_FILE_UTILITIES_H
28 #include <gio/gio.h>
30 #define NAUTILUS_SAVED_SEARCH_EXTENSION ".savedSearch"
31 #define NAUTILUS_SAVED_SEARCH_MIMETYPE "application/x-gnome-saved-search"
33 /* Recognizing special file names. */
34 gboolean nautilus_file_name_matches_hidden_pattern (const char *name_or_relative_uri);
35 gboolean nautilus_file_name_matches_backup_pattern (const char *name_or_relative_uri);
37 /* These functions all return something something that needs to be
38 * freed with g_free, is not NULL, and is guaranteed to exist.
40 char * nautilus_get_xdg_dir (const char *type);
41 char * nautilus_get_user_directory (void);
42 char * nautilus_get_desktop_directory (void);
43 GFile * nautilus_get_desktop_location (void);
44 char * nautilus_get_desktop_directory_uri (void);
45 char * nautilus_get_home_directory_uri (void);
46 gboolean nautilus_is_desktop_directory_file (GFile *dir,
47 const char *filename);
48 gboolean nautilus_is_root_directory (GFile *dir);
49 gboolean nautilus_is_desktop_directory (GFile *dir);
50 gboolean nautilus_is_home_directory (GFile *dir);
51 gboolean nautilus_is_home_directory_file (GFile *dir,
52 const char *filename);
53 char * nautilus_get_gmc_desktop_directory (void);
54 char * nautilus_get_pixmap_directory (void);
56 gboolean nautilus_should_use_templates_directory (void);
57 char * nautilus_get_templates_directory (void);
58 char * nautilus_get_templates_directory_uri (void);
59 void nautilus_create_templates_directory (void);
61 char * nautilus_get_searches_directory (void);
63 char * nautilus_compute_title_for_location (GFile *file);
65 /* This function returns something that needs to be freed with g_free,
66 * is not NULL, but is not garaunteed to exist */
67 char * nautilus_get_desktop_directory_uri_no_create (void);
69 /* A version of gnome's gnome_pixmap_file that works for the nautilus prefix.
70 * Otherwise similar to gnome_pixmap_file in that it checks to see if the file
71 * exists and returns NULL if it doesn't.
73 /* FIXME bugzilla.gnome.org 42425:
74 * We might not need this once we get on gnome-libs 2.0 which handles
75 * gnome_pixmap_file better, using GNOME_PATH.
77 char * nautilus_pixmap_file (const char *partial_path);
79 /* Locate a file in either the uers directory or the datadir. */
80 char * nautilus_get_data_file_path (const char *partial_path);
82 /* Return an allocated file name that is guranteed to be unique, but
83 * tries to make the name readable to users.
84 * This isn't race-free, so don't use for security-related things
86 char * nautilus_ensure_unique_file_name (const char *directory_uri,
87 const char *base_name,
88 const char *extension);
89 char * nautilus_unique_temporary_file_name (void);
91 GFile * nautilus_find_existing_uri_in_hierarchy (GFile *location);
93 GFile *
94 nautilus_find_file_insensitive (GFile *parent, const gchar *name);
96 #endif /* NAUTILUS_FILE_UTILITIES_H */