summaryrefslogtreecommitdiff
path: root/open-vm-tools/services/plugins/dndcp/copyPasteDnDWrapper.h
blob: 1fddc9baba6bffa5efabc07e3f45ef3226ab454b (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
/*********************************************************
 * Copyright (C) 2010-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.
 *
 *********************************************************/

/**
 * @file copyPasteDnDWrapper.h
 *
 * This singleton class implements an abstraction around the concrete classes
 * that implement DnD, and copy and paste.
 */

#ifndef __COPYPASTEDNDWRAPPER_H__
#define __COPYPASTEDNDWRAPPER_H__

#include "vmware/tools/plugin.h"
#include "copyPasteDnDImpl.h"
#include "dndPluginInt.h"

class CopyPasteDnDWrapper
{
public:
   ~CopyPasteDnDWrapper();
   static CopyPasteDnDWrapper *GetInstance();
   static void Destroy();
   gboolean RegisterCP();
   void UnregisterCP();
   gboolean RegisterDnD();
   void UnregisterDnD();
   void SetDnDVersion(int version) {m_dndVersion = version;};
   int GetDnDVersion();
   void SetCPVersion(int version) {m_cpVersion = version;};
   int GetCPVersion();
   void SetCPIsRegistered(gboolean isRegistered);
   gboolean IsCPRegistered();
   void SetDnDIsRegistered(gboolean isRegistered);
   gboolean IsDnDRegistered();
   void SetDnDIsEnabled(gboolean isEnabled);
   gboolean IsDnDEnabled();
   void SetCPIsEnabled(gboolean isEnabled);
   gboolean IsCPEnabled();
   void OnReset();
   void OnResetInternal();
   void OnCapReg(gboolean set);
   gboolean OnSetOption(const char *option, const char *value);
   void Init(ToolsAppCtx *ctx);
   void PointerInit(void);
   ToolsAppCtx *GetToolsAppCtx() {return m_ctx;};
   uint32 GetCaps();
private:
   /*
    * We're a singleton, so it is a compile time error to call these.
    */
   CopyPasteDnDWrapper();
   CopyPasteDnDWrapper(const CopyPasteDnDWrapper &wrapper);
   CopyPasteDnDWrapper& operator=(const CopyPasteDnDWrapper &wrapper);
private:
   gboolean m_isCPEnabled;
   gboolean m_isDnDEnabled;
   gboolean m_isCPRegistered;
   gboolean m_isDnDRegistered;
   int m_cpVersion;
   int m_dndVersion;
   static CopyPasteDnDWrapper *m_instance;
   ToolsAppCtx *m_ctx;
   CopyPasteDnDImpl *m_pimpl;
};

#endif // __COPYPASTEDNDWRAPPER_H__