1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 
3 /*
4  * Caja
5  *
6  * Copyright (C) 2008 Red Hat, Inc.
7  *
8  * Caja is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  *
22  * Author: David Zeuthen <davidz@redhat.com>
23  */
24 
25 /* TODO:
26  *
27  * - automount all user-visible media on startup
28  *  - but avoid doing autorun for these
29  * - unmount all the media we've automounted on shutdown
30  * - finish x-content / * types
31  *  - finalize the semi-spec
32  *  - add probing/sniffing code
33  * - clean up code
34  * - implement missing features
35  *  - "Open Folder when mounted"
36  *  - Autorun spec (e.g. $ROOT/.autostart)
37  *
38  */
39 
40 #ifndef CAJA_AUTORUN_H
41 #define CAJA_AUTORUN_H
42 
43 #include <gtk/gtk.h>
44 
45 #include <eel/eel-background.h>
46 
47 #include "caja-file.h"
48 
49 typedef void (*CajaAutorunComboBoxChanged) (gboolean selected_ask,
50         gboolean selected_ignore,
51         gboolean selected_open_folder,
52         GAppInfo *selected_app,
53         gpointer user_data);
54 
55 typedef void (*CajaAutorunOpenWindow) (GMount *mount, gpointer user_data);
56 typedef void (*CajaAutorunGetContent) (char **content, gpointer user_data);
57 
58 void caja_autorun_prepare_combo_box (GtkWidget *combo_box,
59                                      const char *x_content_type,
60                                      gboolean include_ask,
61                                      gboolean include_open_with_other_app,
62                                      gboolean update_settings,
63                                      CajaAutorunComboBoxChanged changed_cb,
64                                      gpointer user_data);
65 
66 void caja_autorun_set_preferences (const char *x_content_type, gboolean pref_ask, gboolean pref_ignore, gboolean pref_open_folder);
67 void caja_autorun_get_preferences (const char *x_content_type, gboolean *pref_ask, gboolean *pref_ignore, gboolean *pref_open_folder);
68 
69 void caja_autorun (GMount *mount, CajaAutorunOpenWindow open_window_func, gpointer user_data);
70 
71 char **caja_autorun_get_cached_x_content_types_for_mount (GMount       *mount);
72 
73 void caja_autorun_get_x_content_types_for_mount_async (GMount *mount,
74         CajaAutorunGetContent callback,
75         GCancellable *cancellable,
76         gpointer user_data);
77 
78 void caja_autorun_launch_for_mount (GMount *mount, GAppInfo *app_info);
79 
80 void caja_allow_autorun_for_volume (GVolume *volume);
81 void caja_allow_autorun_for_volume_finish (GVolume *volume);
82 
83 #endif /* CAJA_AUTORUN_H */
84