Subversion Repositories Scribus

Rev

Rev 17663 | Rev 18194 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
13761 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
7
 
8
#ifndef PREFS_KEYBOARDSHORTCUTS_H
9
#define PREFS_KEYBOARDSHORTCUTS_H
10
 
14610 cbradney 11
#include <QMap>
12
#include <QPair>
13
#include <QString>
14
#include <QStringList>
15
#include <QKeyEvent>
16
#include <QEvent>
17
 
13761 cbradney 18
#include "ui_prefs_keyboardshortcutsbase.h"
14610 cbradney 19
#include "prefs_pane.h"
13761 cbradney 20
#include "scribusapi.h"
14610 cbradney 21
#include "scribusstructs.h"
13761 cbradney 22
 
14610 cbradney 23
 
24
class SCRIBUS_API Prefs_KeyboardShortcuts : public Prefs_Pane, Ui::Prefs_KeyboardShortcuts
13761 cbradney 25
{
26
        Q_OBJECT
27
 
28
        public:
15021 cbradney 29
                Prefs_KeyboardShortcuts(QWidget* parent, ScribusDoc* doc=NULL);
13761 cbradney 30
                ~Prefs_KeyboardShortcuts();
14610 cbradney 31
                virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
32
                virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
33
 
34
                bool event( QEvent* ev );
35
                void keyPressEvent(QKeyEvent *k);
36
                void keyReleaseEvent(QKeyEvent *k);
17864 jghali 37
 
14610 cbradney 38
                static QString getKeyText(int KeyC);
17864 jghali 39
                static QString getTrKeyText(int KeyC);
14610 cbradney 40
 
41
        public slots:
42
                void languageChange();
43
 
44
protected:
45
        QMap<QString,Keys> keyMap;
46
        QMap<QString,Keys>::Iterator currentKeyMapRow;
47
        QMap<QString, QString> keySetList;
48
        QMap<QTreeWidgetItem*, QString> lviToActionMap;
49
        QList<QTreeWidgetItem*> lviToMenuMap;
50
        QVector< QPair<QString, QStringList> >* defMenus;
51
        QVector< QPair<QString, QStringList> >* defNonMenuActions;
52
        QTreeWidgetItem * selectedLVI;
53
        int keyCode;
54
        QString Part0;
55
        QString Part1;
56
        QString Part2;
57
        QString Part3;
58
        QString Part4;
59
 
60
        void insertActions();
61
        void importKeySet(QString);
62
        bool exportKeySet(QString);
63
        QStringList scanForSets();
17663 craig 64
        bool checkKey(int code);
65
        QString getAction(int code);
14610 cbradney 66
 
67
protected slots:
68
        void setKeyText();
69
        void dispKey(QTreeWidgetItem* current, QTreeWidgetItem* previous=0);
70
        void setNoKey();
71
        void loadKeySetFile();
72
        void importKeySetFile();
73
        void exportKeySetFile();
74
        void resetKeySet();
75
        void clearSearchString();
76
        void applySearch( const QString & newss );
13761 cbradney 77
};
78
 
79
#endif // PREFS_KEYBOARDSHORTCUTS_H