11#include <QRegularExpression> 
   16#include <dtkwidget_global.h> 
   18DWIDGET_BEGIN_NAMESPACE
 
   20class DShortcutEditLabel;
 
   22#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0) 
   24class D_DECL_DEPRECATED_X(
"Use DKeySequenceEdit instead.") LIBDTKWIDGETSHARED_EXPORT DShortcutEdit : 
public QFrame
 
   29    DShortcutEdit(QWidget *parent = Q_NULLPTR);
 
   31    QSize sizeHint() 
const;
 
   32    bool eventFilter(QObject *o, QEvent *e);
 
   33    bool isValidShortcutKey(
const QString & key);
 
   34    const QMap<QString, QString> &getKeyMapping() 
const;
 
   35    const QList<QRegularExpression> &getBlockShortcutKeysList() 
const;
 
   38    void shortcutKeysChanged(
const QString & shortcutKeys);
 
   39    void shortcutKeysFinished(
const QString & shortcutKeys);
 
   40    void invalidShortcutKey(
const QString & shortcutKeys);
 
   43    void clearShortcutKey();
 
   44    void setShortcutKey(
const QString & key);
 
   45    void setKeyMapping(
const QMap<QString, QString> & mapping);
 
   46    void setBlockShortcutKeysList(
const QList<QRegularExpression> & kList);
 
   47    void setInValidState() 
const;
 
   48    void setNormalState() 
const;
 
   52    void toInputMode() 
const;
 
   53    void shortcutKeyPress(QKeyEvent *e);
 
   56    QString convertShortcutKeys(
const QString & keys);
 
   59    DShortcutEditLabel *m_keysLabel;
 
   62    QString m_shortcutKeys;
 
   63    QList<QRegularExpression> m_blockedShortcutKeys;
 
   64    QMap<QString, QString> m_keyMapping;
 
   66    static const QString DefaultTips;
 
   74    Q_PROPERTY(QColor echoNormal MEMBER m_colorNormal NOTIFY colorSettingChange DESIGNABLE 
true SCRIPTABLE 
true)
 
   75    Q_PROPERTY(QColor echoHover MEMBER m_colorHover NOTIFY colorSettingChange DESIGNABLE 
true SCRIPTABLE 
true)
 
   76    Q_PROPERTY(QColor echoInvalid MEMBER m_colorInvalid NOTIFY colorSettingChange DESIGNABLE 
true SCRIPTABLE 
true)
 
   79    enum EchoState {Normal = 1, Hover, Invalid};
 
   84    void setEchoState(
const EchoState state);
 
   87    void colorSettingChange();
 
   90    void enterEvent(QEvent *);
 
   91    void leaveEvent(QEvent *);
 
   96    QColor m_colorInvalid;
 
   98    EchoState m_state = Normal;