summaryrefslogtreecommitdiffstats
path: root/src/widget/trackdroptarget.h
blob: 6933a4d70f1a3800e29b457093a11e75796967c8 (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
#pragma once

#include <QString>

/// Mixin to mark a widget as a drop target for tracks.
///
/// This class is *not* derived from QObject (inheriting from 2 QObject classes
/// is not possible). Therefore, the signals are marked as pure-virtual and
/// you need to use the `emitFoo` methods to emit a signal.
class TrackDropTarget {
  public:
    virtual ~TrackDropTarget() {
    }

    void emitCloneDeck(const QString& sourceGroup, const QString& targetGroup) {
        emit cloneDeck(sourceGroup, targetGroup); // clazy:exclude=incorrect-emit
    }

    void emitTrackDropped(const QString& filename, const QString& group) {
        emit trackDropped(filename, group); // clazy:exclude=incorrect-emit
    }

  signals:
    virtual void trackDropped(const QString& filename, const QString& group) = 0;
    virtual void cloneDeck(const QString& sourceGroup, const QString& targetGroup) = 0;
};