Subversion Repositories Scribus

Rev

Rev 14610 | Rev 17663 | 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);
37
                static QString getKeyText(int KeyC);
38
 
39
        public slots:
40
                void languageChange();
41
 
42
protected:
43
        QMap<QString,Keys> keyMap;
44
        QMap<QString,Keys>::Iterator currentKeyMapRow;
45
        QMap<QString, QString> keySetList;
46
        QMap<QTreeWidgetItem*, QString> lviToActionMap;
47
        QList<QTreeWidgetItem*> lviToMenuMap;
48
        QVector< QPair<QString, QStringList> >* defMenus;
49
        QVector< QPair<QString, QStringList> >* defNonMenuActions;
50
        QTreeWidgetItem * selectedLVI;
51
        int keyCode;
52
        QString Part0;
53
        QString Part1;
54
        QString Part2;
55
        QString Part3;
56
        QString Part4;
57
 
58
        void insertActions();
59
        void importKeySet(QString);
60
        bool exportKeySet(QString);
61
        QStringList scanForSets();
62
        bool checkKey(int Code);
63
 
64
protected slots:
65
        void setKeyText();
66
        void dispKey(QTreeWidgetItem* current, QTreeWidgetItem* previous=0);
67
        void setNoKey();
68
        void loadKeySetFile();
69
        void importKeySetFile();
70
        void exportKeySetFile();
71
        void resetKeySet();
72
        void clearSearchString();
73
        void applySearch( const QString & newss );
13761 cbradney 74
};
75
 
76
#endif // PREFS_KEYBOARDSHORTCUTS_H