1 
2 /*
3  * Nautilus
4  *
5  * Copyright (C) 2002 Sun Microsystems, Inc.
6  *
7  * Nautilus is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU 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  * Nautilus is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public
18  * License along with this program; if not, see <http://www.gnu.org/licenses/>.
19  *
20  * Author: Dave Camp <dave@ximian.com>
21  */
22 
23 /* nautilus-tree-view-drag-dest.h: Handles drag and drop for treeviews which
24  *                                 contain a hierarchy of files
25  */
26 
27 #pragma once
28 
29 #include <gtk/gtk.h>
30 
31 #include "nautilus-file.h"
32 
33 G_BEGIN_DECLS
34 
35 #define NAUTILUS_TYPE_TREE_VIEW_DRAG_DEST	(nautilus_tree_view_drag_dest_get_type ())
36 #define NAUTILUS_TREE_VIEW_DRAG_DEST(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_TREE_VIEW_DRAG_DEST, NautilusTreeViewDragDest))
37 #define NAUTILUS_TREE_VIEW_DRAG_DEST_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_TREE_VIEW_DRAG_DEST, NautilusTreeViewDragDestClass))
38 #define NAUTILUS_IS_TREE_VIEW_DRAG_DEST(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_TREE_VIEW_DRAG_DEST))
39 #define NAUTILUS_IS_TREE_VIEW_DRAG_DEST_CLASS(klass)	(G_TYPE_CLASS_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_TREE_VIEW_DRAG_DEST))
40 
41 typedef struct _NautilusTreeViewDragDest        NautilusTreeViewDragDest;
42 typedef struct _NautilusTreeViewDragDestClass   NautilusTreeViewDragDestClass;
43 typedef struct _NautilusTreeViewDragDestDetails NautilusTreeViewDragDestDetails;
44 
45 struct _NautilusTreeViewDragDest {
46 	GObject parent;
47 
48 	NautilusTreeViewDragDestDetails *details;
49 };
50 
51 struct _NautilusTreeViewDragDestClass {
52 	GObjectClass parent;
53 
54 	char *(*get_root_uri) (NautilusTreeViewDragDest *dest);
55 	NautilusFile *(*get_file_for_path) (NautilusTreeViewDragDest *dest,
56 					    GtkTreePath *path);
57 	void (*move_copy_items) (NautilusTreeViewDragDest *dest,
58 				 const GList *item_uris,
59 				 const char *target_uri,
60 				 GdkDragAction action,
61 				 int x,
62 				 int y);
63 	void (* handle_netscape_url) (NautilusTreeViewDragDest *dest,
64 				 const char *url,
65 				 const char *target_uri,
66 				 GdkDragAction action,
67 				 int x,
68 				 int y);
69 	void (* handle_uri_list) (NautilusTreeViewDragDest *dest,
70 				  const char *uri_list,
71 				  const char *target_uri,
72 				  GdkDragAction action,
73 				  int x,
74 				  int y);
75 	void (* handle_text)    (NautilusTreeViewDragDest *dest,
76 				  const char *text,
77 				  const char *target_uri,
78 				  GdkDragAction action,
79 				  int x,
80 				  int y);
81 	void (* handle_raw)    (NautilusTreeViewDragDest *dest,
82 				  char *raw_data,
83 				  int length,
84 				  const char *target_uri,
85 				  const char *direct_save_uri,
86 				  GdkDragAction action,
87 				  int x,
88 				  int y);
89 	void (* handle_hover)   (NautilusTreeViewDragDest *dest,
90 				 const char *target_uri);
91 };
92 
93 GType                     nautilus_tree_view_drag_dest_get_type (void);
94 NautilusTreeViewDragDest *nautilus_tree_view_drag_dest_new      (GtkTreeView *tree_view);
95 
96 G_END_DECLS