ASPiK SDK
cdropsource.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __cdropsource__
6 #define __cdropsource__
7 
8 #include "vstguibase.h"
9 #include "idatapackage.h"
10 #include "malloc.h"
11 #include <vector>
12 
13 namespace VSTGUI {
14 
15 //-----------------------------------------------------------------------------
16 // CDropSource Declaration
20 //-----------------------------------------------------------------------------
21 class CDropSource : public IDataPackage
22 {
23 public:
24  static SharedPointer<IDataPackage> create (const void* buffer, uint32_t bufferSize, Type type);
25 
26  CDropSource ();
27  CDropSource (const void* buffer, uint32_t bufferSize, Type type);
28 
29  bool add (const void* buffer, uint32_t bufferSize, Type type);
30 
31  // IDataPackage
32  uint32_t getCount () const final;
33  uint32_t getDataSize (uint32_t index) const final;
34  Type getDataType (uint32_t index) const final;
35  uint32_t getData (uint32_t index, const void*& buffer, Type& type) const final;
36 protected:
38  struct CDropEntry {
39  Malloc<int8_t> buffer;
40  Type type;
41 
42  CDropEntry (const void* buffer, uint32_t bufferSize, Type type);
43  CDropEntry (const CDropEntry& entry);
44  CDropEntry (CDropEntry&& entry) noexcept;
45  };
47  using DropEntryVector = std::vector<CDropEntry>;
48  DropEntryVector entries;
49 };
50 
51 } // namespace
52 
53 #endif // __cdropsource__
Type
Definition: idatapackage.h:18
Definition: malloc.h:21
Definition: vstguibase.h:299
drop source
Definition: cdropsource.h:21
Definition: customcontrols.cpp:8
interface for drag&drop and clipboard data
Definition: idatapackage.h:15