aboutsummaryrefslogtreecommitdiffstats
path: root/shell/Evolution-ShellComponentDnd.idl
blob: 01862156270204d8628fdde9b4a7c424e7f673ba (plain) (blame)
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
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Interface for the Evolution components.
 *
 * Authors:
 *   Ettore Perazzoli <ettore@helixcode.com>
 *
 * Copyright (C) 2001 Ximian, Inc.
 */

#include <Bonobo.h>

module GNOME {
module Evolution {
module ShellComponentDnd {
    typedef short Action;
    const Action ACTION_DEFAULT = 0;
    const Action ACTION_COPY = 1 << 1;
    const Action ACTION_MOVE = 1 << 2;
    const Action ACTION_LINK = 1 << 3;
    const Action ACTION_ASK = 1 << 4;
    const Action ACTION_ANY = ACTION_COPY | ACTION_MOVE | ACTION_LINK | ACTION_ASK;

    typedef Action ActionSet; // For readability.

    struct Data {
        short format;
        short target;
        sequence <octet> bytes;
    };

    exception NoData {};

    interface SourceFolder : Bonobo::Unknown {
        struct Context {
            string physicalUri;
            string folderType;
            ActionSet possibleActions;
            Action suggestedAction;
        };

        /* The user started a drag from this object.  If the component
           receives this while still in the middle of an existing drag
           operation, it should stop the existing drag operation and
           start a new one.  */
        void beginDrag (in string physical_uri,
                in string folder_type,
                out ActionSet possible_actions,
                out Action suggested_action);

        /* User released the mouse button and dropped the object
           somewhere, so we now want to get the data for the current
           context.  */
        void getData (in Context source_context,
                  in Action action,
                  in string dnd_type,
                  out Data data)
            raises (NoData);

        /* The target has finished processing the data, so we can
           delete it.  */
        void deleteData (in Context source_context);

        /* The drag is over.  This should also clean up the data if
           there was a `getData()' but no `deleteData()' after it.  */
        void endDrag (in Context source_context);
    };

    interface DestinationFolder : Bonobo::Unknown {
        struct Context {
            string dndType;
            ActionSet possibleActions;
            Action suggestedAction;
        };

        /* The user is moving a dragged object over our folder.  This
           will return %FALSE if the specified object cannot be
           dropped; otherwise, it will return %TRUE and then set the
           @default_action and @non_default_action we want to be
           performed when the drop happens.  */
        boolean handleMotion (in Context destination_context,
                      out Action suggested_action);

        /* Data is dropped.  We are given the data for the dropped
           object, and we are supposed to perform the operation
           requested.  */
        boolean handleDrop (in Context destination_context,
                    in Action action,
                    in Data data);
    };
};
};
};