Debian Codegraph @

src/utils/dragndrop/DndView.vala

raw
1 /*
2 * Copyright (c) 2017-2019 José Amuedo (https://github.com/spheras)
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 namespace DesktopFolder.DragnDrop {
19
20 public interface DndView : Object {
21 /**
22 * @name get_widget
23 * @description return the widget associated with this view
24 * @return Widget the widget
25 */
26 public abstract Gtk.Widget get_widget ();
27
28 /**
29 * @name get_application_window
30 * @description return the application window of this view, needed for drag operations
31 * @return ApplicationWindow
32 */
33 public abstract Gtk.ApplicationWindow get_application_window ();
34
35 /**
36 * @name get_file
37 * @description return the file asociated with this view
38 * @return File the file
39 */
40 public abstract GLib.File get_file ();
41
42 /**
43 * @name get_image
44 * @description return the image to be shown when dragging
45 * @return {Gtk.Image} the image to be rendered
46 */
47 public abstract Gtk.Image get_image ();
48
49 /**
50 * @name get_file_at
51 * @name get the file at the position x, y
52 * @return File
53 */
54 public abstract GLib.File get_file_at (int x, int y);
55
56 /**
57 * @name is_folder
58 * @description check whether the view represents a folder or a file
59 * @return bool true->this view represents a folder
60 */
61 public abstract bool is_folder ();
62
63 /**
64 * @name is_writable
65 * @description indicates if the file linked by this view is writable or not
66 * @return bool
67 */
68 public abstract bool is_writable ();
69
70 /**
71 * @name get_target_location
72 * @description return the target File that represents this view
73 * @return File the file target of this view
74 */
75 public abstract GLib.File get_target_location ();
76
77 /**
78 * @name is_recent_uri_scheme
79 * @description check whether the File is a recent uri scheme?
80 * @return bool
81 */
82 public abstract bool is_recent_uri_scheme ();
83
84 /**
85 * @name get_display_target_uri
86 * @description return the target uri of this view
87 * @return string the target uri
88 */
89 public abstract string get_display_target_uri ();
90
91 /**
92 * @name on_drag_end
93 * @description drag finished event
94 */
95 public abstract void on_drag_end ();
96
97 /**
98 * @name on_drag_motion
99 * @description the mouse is over the dnd view
100 */
101 public abstract void on_drag_motion ();
102
103 /**
104 * @name on_drag_leave
105 * @description the mouse leave the view
106 */
107 public abstract void on_drag_leave ();
108
109 /**
110 * @name get_all_selected_views
111 * @description return all the selected views at this moment
112 * @return DndView[] the list of DndViews selected
113 */
114 public abstract DndView[] get_all_selected_views ();
115
116 }
117 }