summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-file.h
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-03-30 15:39:13 +0200
committerCarlos Soriano <csoriano@gnome.org>2016-04-06 10:55:12 +0200
commit3e76538e5433da64830e72ce1320184ca080f527 (patch)
tree40fcef392e50eb5c1b19279c17a92415f05ac233 /libnautilus-private/nautilus-file.h
parent40e6775fdcf1130157df651d00d95c607e6994fe (diff)
downloadnautilus-3e76538e5433da64830e72ce1320184ca080f527.tar.gz
file-dnd: move dnd handling to file
We are requiring file handling like special casing subclasses in the dnd handling. We are currently doing it outside of nautilus class... which makes overriding on subclasses impossible. This design goes against inheritance design, so there is no point on making it that way if it defeats this purpose. So merge the handling of file dnd inside the file class itself, and in upcoming patches we will override that handling in order to use inheritance instead of special casing in the parent.
Diffstat (limited to 'libnautilus-private/nautilus-file.h')
-rw-r--r--libnautilus-private/nautilus-file.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/libnautilus-private/nautilus-file.h b/libnautilus-private/nautilus-file.h
index 40d060baa..447eb727b 100644
--- a/libnautilus-private/nautilus-file.h
+++ b/libnautilus-private/nautilus-file.h
@@ -82,7 +82,27 @@ typedef enum {
NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM = (1<<7)
} NautilusFileIconFlags;
-/* Emblems sometimes displayed for NautilusFiles. Do not localize. */
+/* Standard Drag & Drop types. */
+typedef enum {
+ NAUTILUS_ICON_DND_GNOME_ICON_LIST,
+ NAUTILUS_ICON_DND_URI_LIST,
+ NAUTILUS_ICON_DND_NETSCAPE_URL,
+ NAUTILUS_ICON_DND_TEXT,
+ NAUTILUS_ICON_DND_XDNDDIRECTSAVE,
+ NAUTILUS_ICON_DND_RAW,
+ NAUTILUS_ICON_DND_ROOTWINDOW_DROP
+} NautilusIconDndTargetType;
+
+/* Item of the drag selection list */
+typedef struct {
+ NautilusFile *file;
+ char *uri;
+ gboolean got_icon_position;
+ int icon_x, icon_y;
+ int icon_width, icon_height;
+} NautilusDragSelectionItem;
+
+/* Emblems sometimes displayed for NautilusFiles. Do not localize. */
#define NAUTILUS_FILE_EMBLEM_NAME_SYMBOLIC_LINK "symbolic-link"
#define NAUTILUS_FILE_EMBLEM_NAME_CANT_READ "unreadable"
#define NAUTILUS_FILE_EMBLEM_NAME_CANT_WRITE "readonly"
@@ -458,6 +478,16 @@ GList * nautilus_file_list_filter (GList
GList **failed,
NautilusFileFilterFunc filter_function,
gpointer user_data);
+/* DND */
+gboolean nautilus_drag_can_accept_item (NautilusFile *drop_target_item,
+ const char *item_uri);
+
+gboolean nautilus_drag_can_accept_items (NautilusFile *drop_target_item,
+ const GList *items);
+
+gboolean nautilus_drag_can_accept_info (NautilusFile *drop_target_item,
+ NautilusIconDndTargetType drag_type,
+ const GList *items);
/* Debugging */
void nautilus_file_dump (NautilusFile *file);