1
/*********************************************************
2
* Copyright (C) 2010 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation version 2.1 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
11
* License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*********************************************************/
20
* @guestCopyPasteDest.cc --
22
* Implementation of common layer GuestCopyPasteDest object for guest.
25
#include "guestCopyPaste.hh"
28
#include "dndClipboard.h"
36
* @param[in] mgr guest CP manager
39
GuestCopyPasteDest::GuestCopyPasteDest(GuestCopyPasteMgr *mgr)
47
* Got valid clipboard data from UI. Send sendClip cmd to controller.
49
* @param[in] clip cross-platform clipboard data.
53
GuestCopyPasteDest::UISendClip(const CPClipboard *clip)
57
Debug("%s: state is %d\n", __FUNCTION__, mMgr->GetState());
58
if (mMgr->GetState() != GUEST_CP_READY) {
59
/* Reset DnD for any wrong state. */
60
Debug("%s: Bad state: %d\n", __FUNCTION__, mMgr->GetState());
64
if (!mMgr->GetRpc()->DestSendClip(mMgr->GetSessionId(), mIsActive, clip)) {
65
Debug("%s: DestSendClip failed\n", __FUNCTION__);
72
mMgr->ResetCopyPaste();
77
* Host is asking for clipboard data. Emit destRequestClipChanged signal.
79
* @param[in] isActive active or passive CopyPaste.
83
GuestCopyPasteDest::OnRpcRequestClip(bool isActive)
86
Debug("%s: state is %d\n", __FUNCTION__, mMgr->GetState());
87
mMgr->destRequestClipChanged.emit();