Skip to content

Commit affa5dd

Browse files
committed
Copy-by-dragging: prototype
1 parent f2e8da3 commit affa5dd

File tree

5 files changed

+479
-184
lines changed

5 files changed

+479
-184
lines changed

Diff for: src/notation/inotationinteraction.h

+13-10
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
#ifndef MU_NOTATION_INOTATIONINTERACTION_H
23-
#define MU_NOTATION_INOTATIONINTERACTION_H
22+
#pragma once
2423

2524
#include <functional>
2625

@@ -95,17 +94,23 @@ class INotationInteraction
9594
virtual void endDrag() = 0;
9695
virtual muse::async::Notification dragChanged() const = 0;
9796

98-
virtual bool isDragCopyStarted() const = 0;
9997
virtual bool dragCopyAllowed(const EngravingItem* element) const = 0;
100-
virtual void startDragCopy(const EngravingItem* element, QObject* dragSource) = 0;
98+
virtual void prepareDragCopyElement(const EngravingItem* element, QObject* dragSource) = 0;
99+
virtual void prepareDragCopyRange(QObject* dragSource) = 0;
100+
virtual bool hasDragCopy() const = 0;
101+
virtual bool hasStartedDragCopy() const = 0;
102+
virtual void startDragCopy() = 0;
101103
virtual void endDragCopy() = 0;
102104

103105
// Drop
104106
//! TODO Change KeyboardModifiers to modes
105-
virtual void startDrop(const QByteArray& edata) = 0;
106-
virtual bool startDrop(const QUrl& url) = 0;
107-
virtual bool isDropAccepted(const muse::PointF& pos, Qt::KeyboardModifiers modifiers) = 0; //! NOTE Also may set drop target
108-
virtual bool drop(const muse::PointF& pos, Qt::KeyboardModifiers modifiers) = 0;
107+
virtual bool startDropSingle(const QByteArray& edata) = 0;
108+
virtual bool startDropRange(const QByteArray& data) = 0;
109+
virtual bool startDropImage(const QUrl& url) = 0;
110+
virtual bool isDropSingleAccepted(const muse::PointF& pos, Qt::KeyboardModifiers modifiers) = 0; //! NOTE Also may set drop target
111+
virtual bool isDropRangeAccepted(const muse::PointF& pos) = 0;
112+
virtual bool dropSingle(const muse::PointF& pos, Qt::KeyboardModifiers modifiers) = 0;
113+
virtual bool dropRange(const QByteArray& data, const muse::PointF& pos) = 0;
109114
virtual void setDropTarget(EngravingItem* item, bool notify = true) = 0;
110115
virtual void setDropRect(const muse::RectF& rect) = 0;
111116
virtual void endDrop() = 0;
@@ -317,5 +322,3 @@ using INotationInteractionPtr = std::shared_ptr<INotationInteraction>;
317322

318323
EngravingItem* contextItem(INotationInteractionPtr);
319324
}
320-
321-
#endif // MU_NOTATION_INOTATIONINTERACTION_H

0 commit comments

Comments
 (0)