~ubuntu-branches/debian/sid/qpdfview/sid

« back to all changes in this revision

Viewing changes to sources/shortcuthandler.h

  • Committer: Package Import Robot
  • Author(s): Benjamin Eltzner
  • Date: 2013-05-26 13:52:50 UTC
  • mfrom: (1.2.8)
  • Revision ID: package-import@ubuntu.com-20130526135250-s1rhw935iqd8fcfs
Tags: 0.4.3-1
* New upstream release.
* Added menu file and fetch xpm icon file in debian folder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#define SHORTCUTHANDLER_H
24
24
 
25
25
#include <QAbstractTableModel>
 
26
#include <QAction>
26
27
#include <QKeySequence>
27
28
 
28
 
class QAction;
29
29
class QSettings;
30
30
 
31
31
class ShortcutHandler : public QAbstractTableModel
33
33
    Q_OBJECT
34
34
 
35
35
public:
36
 
    ShortcutHandler(QObject* parent = 0);
 
36
    static ShortcutHandler* instance();
 
37
    ~ShortcutHandler();
37
38
 
38
39
    void registerAction(QAction* action);
39
40
 
47
48
    QVariant data(const QModelIndex& index, int role) const;
48
49
    bool setData(const QModelIndex& index, const QVariant& value, int role);
49
50
 
 
51
    bool matchesSkipBackward(const QKeySequence& keySequence) const;
 
52
    bool matchesSkipForward(const QKeySequence& keySequence) const;
 
53
 
 
54
    bool matchesMoveUp(const QKeySequence& keySequence) const;
 
55
    bool matchesMoveDown(const QKeySequence& keySequence) const;
 
56
    bool matchesMoveLeft(const QKeySequence& keySequence) const;
 
57
    bool matchesMoveRight(const QKeySequence& keySequence) const;
 
58
 
50
59
public slots:
51
60
    bool submit();
52
61
    void revert();
54
63
    void reset();
55
64
 
56
65
private:
 
66
    static ShortcutHandler* s_instance;
 
67
    ShortcutHandler(QObject* parent = 0);
 
68
 
57
69
    QSettings* m_settings;
58
70
 
59
71
    QList< QAction* > m_actions;
60
72
 
61
 
    QMap< QAction*, QKeySequence > m_shortcuts;
62
 
    QMap< QAction*, QKeySequence > m_defaultShortcuts;
 
73
    QMap< QAction*, QList< QKeySequence > > m_shortcuts;
 
74
    QMap< QAction*, QList< QKeySequence > > m_defaultShortcuts;
63
75
 
64
76
    QAction* m_skipBackwardAction;
65
77
    QAction* m_skipForwardAction;