47 lines
974 B
C
47 lines
974 B
C
|
|
#ifndef NTX_CLIPBOARD_H
|
||
|
|
#define NTX_CLIPBOARD_H
|
||
|
|
|
||
|
|
#include <ntxicommand.h>
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
namespace ntx
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @brief Einfaches Clipboard für Copy/Cut/Paste-Operationen.
|
||
|
|
*
|
||
|
|
* Speichert elternlose Deep-Clones mit Original-Position für Undo.
|
||
|
|
* Kein Singleton - wird als Member von NtxHeadNode verwendet.
|
||
|
|
*/
|
||
|
|
class NtxClipboard
|
||
|
|
{
|
||
|
|
|
||
|
|
public:
|
||
|
|
|
||
|
|
NtxClipboard() = default;
|
||
|
|
~NtxClipboard() = default;
|
||
|
|
|
||
|
|
// Copy/Cut Operations
|
||
|
|
void copyNodes(const NtxNodeList& nodes);
|
||
|
|
void cutNodes(const NtxNodeList& nodes);
|
||
|
|
|
||
|
|
// Paste Operations
|
||
|
|
NtxNodeList pasteNodes() const;
|
||
|
|
|
||
|
|
// State
|
||
|
|
bool isEmpty() const;
|
||
|
|
size_t getCount() const;
|
||
|
|
void clear();
|
||
|
|
|
||
|
|
// Access
|
||
|
|
const NtxNodeEntryList& getEntries() const;
|
||
|
|
|
||
|
|
private:
|
||
|
|
|
||
|
|
NtxNodeEntryList m_nodeEntryList;
|
||
|
|
|
||
|
|
NtxNodePtr createOrphanClone(NtxNodePtr node) const;
|
||
|
|
};
|
||
|
|
|
||
|
|
} // namespace ntx
|
||
|
|
|
||
|
|
#endif // NTX_CLIPBOARD_H
|