1 | /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* |
---|
3 | * Interface for the Evolution components that want to support Drag and Drop |
---|
4 | * operations on their folders. |
---|
5 | * |
---|
6 | * Authors: |
---|
7 | * Ettore Perazzoli <ettore@ximian.com> |
---|
8 | * |
---|
9 | * Copyright (C) 2001 Ximian, Inc. |
---|
10 | */ |
---|
11 | |
---|
12 | #include <Bonobo.h> |
---|
13 | |
---|
14 | module GNOME { |
---|
15 | module Evolution { |
---|
16 | module ShellComponentDnd { |
---|
17 | typedef short Action; |
---|
18 | const Action ACTION_DEFAULT = 0; |
---|
19 | const Action ACTION_COPY = 1 << 1; |
---|
20 | const Action ACTION_MOVE = 1 << 2; |
---|
21 | const Action ACTION_LINK = 1 << 3; |
---|
22 | const Action ACTION_ASK = 1 << 4; |
---|
23 | const Action ACTION_ANY = ACTION_COPY | ACTION_MOVE | ACTION_LINK | ACTION_ASK; |
---|
24 | |
---|
25 | typedef Action ActionSet; // For readability. |
---|
26 | |
---|
27 | struct Data { |
---|
28 | short format; |
---|
29 | short target; |
---|
30 | sequence <octet> bytes; |
---|
31 | }; |
---|
32 | |
---|
33 | exception NoData {}; |
---|
34 | |
---|
35 | interface SourceFolder : Bonobo::Unknown { |
---|
36 | struct Context { |
---|
37 | string physicalUri; |
---|
38 | string folderType; |
---|
39 | ActionSet possibleActions; |
---|
40 | Action suggestedAction; |
---|
41 | }; |
---|
42 | |
---|
43 | /* The user started a drag from this object. If the component |
---|
44 | receives this while still in the middle of an existing drag |
---|
45 | operation, it should stop the existing drag operation and |
---|
46 | start a new one. */ |
---|
47 | void beginDrag (in string physical_uri, |
---|
48 | in string folder_type, |
---|
49 | out ActionSet possible_actions, |
---|
50 | out Action suggested_action); |
---|
51 | |
---|
52 | /* User released the mouse button and dropped the object |
---|
53 | somewhere, so we now want to get the data for the current |
---|
54 | context. */ |
---|
55 | void getData (in Context source_context, |
---|
56 | in Action action, |
---|
57 | in string dnd_type, |
---|
58 | out Data data) |
---|
59 | raises (NoData); |
---|
60 | |
---|
61 | /* The target has finished processing the data, so we can |
---|
62 | delete it. */ |
---|
63 | void deleteData (in Context source_context); |
---|
64 | |
---|
65 | /* The drag is over. This should also clean up the data if |
---|
66 | there was a `getData()' but no `deleteData()' after it. */ |
---|
67 | void endDrag (in Context source_context); |
---|
68 | }; |
---|
69 | |
---|
70 | interface DestinationFolder : Bonobo::Unknown { |
---|
71 | struct Context { |
---|
72 | string dndType; |
---|
73 | ActionSet possibleActions; |
---|
74 | Action suggestedAction; |
---|
75 | }; |
---|
76 | |
---|
77 | /* The user is moving a dragged object over our folder. This |
---|
78 | will return %FALSE if the specified object cannot be |
---|
79 | dropped; otherwise, it will return %TRUE and then set the |
---|
80 | @default_action and @non_default_action we want to be |
---|
81 | performed when the drop happens. */ |
---|
82 | boolean handleMotion (in string physical_uri, |
---|
83 | in string folder_type, |
---|
84 | in Context destination_context, |
---|
85 | out Action suggested_action); |
---|
86 | |
---|
87 | /* Data is dropped. We are given the data for the dropped |
---|
88 | object, and we are supposed to perform the operation |
---|
89 | requested. */ |
---|
90 | boolean handleDrop (in string physical_uri, |
---|
91 | in string folder_type, |
---|
92 | in Context destination_context, |
---|
93 | in Action action, |
---|
94 | in Data data); |
---|
95 | }; |
---|
96 | }; |
---|
97 | }; |
---|
98 | }; |
---|