1 2 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 3 4 /* 5 Rosegarden 6 A MIDI and audio sequencer and musical notation editor. 7 Copyright 2000-2021 the Rosegarden development team. 8 9 Other copyrights also apply to some parts of this work. Please 10 see the AUTHORS file and individual file headers for details. 11 12 This program is free software; you can redistribute it and/or 13 modify it under the terms of the GNU General Public License as 14 published by the Free Software Foundation; either version 2 of the 15 License, or (at your option) any later version. See the file 16 COPYING included with this distribution for more information. 17 */ 18 19 #ifndef RG_COPYCOMMAND_H 20 #define RG_COPYCOMMAND_H 21 22 #include "document/Command.h" 23 #include <QString> 24 #include "base/Event.h" 25 #include "base/Selection.h" 26 #include <QCoreApplication> 27 28 29 30 31 namespace Rosegarden 32 { 33 34 35 class EventSelection; 36 class Composition; 37 class Clipboard; 38 39 40 /// Copy a selection 41 42 class CopyCommand : public NamedCommand 43 { 44 Q_DECLARE_TR_FUNCTIONS(Rosegarden::CopyCommand) 45 46 public: 47 /// Make a CopyCommand that copies events from within a Segment 48 CopyCommand(EventSelection &selection, 49 Clipboard *clipboard); 50 51 /// Make a CopyCommand that copies whole Segments 52 CopyCommand(SegmentSelection &selection, 53 Clipboard *clipboard); 54 55 /// Make a CopyCommand that copies a range of a Composition 56 CopyCommand(Composition *composition, 57 timeT beginTime, 58 timeT endTime, 59 Clipboard *clipboard); 60 61 ~CopyCommand() override; 62 getGlobalName()63 static QString getGlobalName() { return tr("&Copy"); } 64 65 void execute() override; 66 void unexecute() override; 67 68 protected: 69 Clipboard *m_sourceClipboard; 70 Clipboard *m_targetClipboard; 71 Clipboard *m_savedClipboard; 72 }; 73 74 75 76 } 77 78 #endif 79