summaryrefslogtreecommitdiff
path: root/open-vm-tools/services/plugins/dndcp/dnd/dndRpc.hh
blob: 57484a363eb9b0e69910af839220209d5fd4aad0 (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
107
108
109
110
111
/*********************************************************
 * Copyright (C) 2007-2015 VMware, Inc. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation version 2.1 and no later version.
 *
 * This program 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 Lesser GNU General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser 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.
 *
 *********************************************************/

/**
 * @dndRpc.hh --
 *
 * Rpc layer object for DnD.
 */

#ifndef DND_RPC_HH
#define DND_RPC_HH

#include <sigc++/connection.h>
#include "dndCPLibExport.hh"
#include "rpcBase.h"

extern "C" {
   #include "dnd.h"
}

class LIB_EXPORT DnDRpc
   : public RpcBase
{
public:
   virtual ~DnDRpc(void) {};

   /* sigc signals for DnD source callback. */
   sigc::signal<void, uint32, const CPClipboard *> srcDragBeginChanged;
   sigc::signal<void, uint32> srcCancelChanged;
   sigc::signal<void, uint32, uint32, uint32> srcDropChanged;

   /* sigc signals for DnD destination callback. */
   sigc::signal<void, uint32, int32> destDragEnterReplyChanged;
   sigc::signal<void, uint32> destPrivDragEnterChanged;
   sigc::signal<void, uint32, int32, int32> destPrivDragLeaveChanged;
   sigc::signal<void, uint32, int32, int32> destPrivDropChanged;
   sigc::signal<void, uint32, int32, int32> destDropChanged;
   sigc::signal<void, uint32> destCancelChanged;

   sigc::signal<void, uint32, int32, int32> moveMouseChanged;
   sigc::signal<void, uint32, uint32> updateFeedbackChanged;
   sigc::signal<void, uint32, int32, int32> queryExitingChanged;
   sigc::signal<void, uint32> dragNotPendingChanged;
   sigc::signal<void, uint32, bool, uint32> updateUnityDetWndChanged;
   sigc::signal<void, uint32, const uint8 *, uint32> requestFileChanged;
   sigc::signal<void, uint32, bool, const uint8 *, uint32> getFilesDoneChanged;

   /* sigc signal for responding to ping reply */
   sigc::signal<void, uint32> pingReplyChanged;

   /* sigc signal for rpc cmd reply received. */
   sigc::signal<void, uint32, uint32> cmdReplyChanged;

   /* DnD source. */
   virtual bool SrcDragBeginDone(uint32 sessionId) = 0;
   virtual bool SrcDrop(uint32 sessionId, int32 x, int32 y) = 0;
   virtual bool SrcDropDone(uint32 sessionId,
                            const uint8 *stagingDirCP,
                            uint32 sz) = 0;

   virtual bool SrcPrivDragEnter(uint32 sessionId) = 0;
   virtual bool SrcPrivDragLeave(uint32 sessionId, int32 x, int32 y) = 0;
   virtual bool SrcPrivDrop(uint32 sessionId, int32 x, int32 y) = 0;
   virtual bool SrcCancel(uint32 sessionId) = 0;

   /* DnD destination. */
   virtual bool DestDragEnter(uint32 sessionId,
                              const CPClipboard *clip) = 0;
   virtual bool DestSendClip(uint32 sessionId,
                             const CPClipboard *clip) = 0;
   virtual bool DestDragLeave(uint32 sessionId, int32 x, int32 y) = 0;
   virtual bool DestDrop(uint32 sessionId, int32 x, int32 y) = 0;
   virtual bool DestCancel(uint32 sessionId) = 0;

   /* Common. */
   virtual void Init(void) = 0;
   virtual void SendPing(uint32 caps) = 0;
   virtual bool UpdateFeedback(uint32 sessionId, DND_DROPEFFECT feedback) = 0;
   virtual bool MoveMouse(uint32 sessionId,
                          int32 x,
                          int32 y) = 0;
   virtual bool QueryExiting(uint32 sessionId, int32 x, int32 y) = 0;
   virtual bool DragNotPending(uint32 sessionId) = 0;
   virtual bool UpdateUnityDetWnd(uint32 sessionId,
                                  bool show,
                                  uint32 unityWndId) = 0;
   virtual bool RequestFiles(uint32 sessionId) = 0;
   virtual bool SendFilesDone(uint32 sessionId,
                              bool success,
                              const uint8 *stagingDirCP,
                              uint32 sz) = 0;
   virtual bool GetFilesDone(uint32 sessionId,
                             bool success) = 0;
};

#endif // DND_RPC_HH