summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-tree-view-drag-dest.h
blob: 520c882215df477a1a8b55acfc266251ff88bdfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */

/*
 * Caja
 *
 * Copyright (C) 2002 Sun Microsystems, Inc.
 *
 * Caja is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * Caja is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 * Author: Dave Camp <dave@ximian.com>
 */

/* caja-tree-view-drag-dest.h: Handles drag and drop for treeviews which
 *                                 contain a hierarchy of files
 */

#ifndef CAJA_TREE_VIEW_DRAG_DEST_H
#define CAJA_TREE_VIEW_DRAG_DEST_H

#include <gtk/gtk.h>

#include "caja-file.h"

#ifdef __cplusplus
extern "C" {
#endif

#define CAJA_TYPE_TREE_VIEW_DRAG_DEST	(caja_tree_view_drag_dest_get_type ())
#define CAJA_TREE_VIEW_DRAG_DEST(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), CAJA_TYPE_TREE_VIEW_DRAG_DEST, CajaTreeViewDragDest))
#define CAJA_TREE_VIEW_DRAG_DEST_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), CAJA_TYPE_TREE_VIEW_DRAG_DEST, CajaTreeViewDragDestClass))
#define CAJA_IS_TREE_VIEW_DRAG_DEST(obj)		(G_TYPE_INSTANCE_CHECK_TYPE ((obj), CAJA_TYPE_TREE_VIEW_DRAG_DEST))
#define CAJA_IS_TREE_VIEW_DRAG_DEST_CLASS(klass)	(G_TYPE_CLASS_CHECK_CLASS_TYPE ((klass), CAJA_TYPE_TREE_VIEW_DRAG_DEST))

    typedef struct _CajaTreeViewDragDest        CajaTreeViewDragDest;
    typedef struct _CajaTreeViewDragDestClass   CajaTreeViewDragDestClass;
    typedef struct _CajaTreeViewDragDestDetails CajaTreeViewDragDestDetails;

    struct _CajaTreeViewDragDest
    {
        GObject parent;

        CajaTreeViewDragDestDetails *details;
    };

    struct _CajaTreeViewDragDestClass
    {
        GObjectClass parent;

        char *(*get_root_uri) (CajaTreeViewDragDest *dest);
        CajaFile *(*get_file_for_path) (CajaTreeViewDragDest *dest,
                                        GtkTreePath *path);
        void (*move_copy_items) (CajaTreeViewDragDest *dest,
                                 const GList *item_uris,
                                 const char *target_uri,
                                 GdkDragAction action,
                                 int x,
                                 int y);
        void (* handle_netscape_url) (CajaTreeViewDragDest *dest,
                                      const char *url,
                                      const char *target_uri,
                                      GdkDragAction action,
                                      int x,
                                      int y);
        void (* handle_uri_list) (CajaTreeViewDragDest *dest,
                                  const char *uri_list,
                                  const char *target_uri,
                                  GdkDragAction action,
                                  int x,
                                  int y);
        void (* handle_text)    (CajaTreeViewDragDest *dest,
                                 const char *text,
                                 const char *target_uri,
                                 GdkDragAction action,
                                 int x,
                                 int y);
        void (* handle_raw)    (CajaTreeViewDragDest *dest,
                                char *raw_data,
                                int length,
                                const char *target_uri,
                                const char *direct_save_uri,
                                GdkDragAction action,
                                int x,
                                int y);
    };

    GType                     caja_tree_view_drag_dest_get_type (void);
    CajaTreeViewDragDest *caja_tree_view_drag_dest_new      (GtkTreeView *tree_view);

#ifdef __cplusplus
}
#endif

#endif