Scribus
Open source desktop publishing at your fingertips
prefs_keyboardshortcuts.h
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 
11 #include <QMap>
12 #include <QPair>
13 #include <QString>
14 #include <QStringList>
15 #include <QKeyEvent>
16 #include <QEvent>
17 
18 #include "ui_prefs_keyboardshortcutsbase.h"
19 #include "prefs_pane.h"
20 #include "scribusapi.h"
21 #include "scribusstructs.h"
22 
23 
24 class SCRIBUS_API Prefs_KeyboardShortcuts : public Prefs_Pane, Ui::Prefs_KeyboardShortcuts
25 {
26  Q_OBJECT
27 
28  public:
29  Prefs_KeyboardShortcuts(QWidget* parent, ScribusDoc* doc=NULL);
30  ~Prefs_KeyboardShortcuts();
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 
38  static QString getKeyText(QKeySequence KeyC);
39  static QString getTrKeyText(QKeySequence KeyC);
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();
64  bool checkKey(int code);
65  QString getAction(int code);
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 );
77 };
78 
79 #endif // PREFS_KEYBOARDSHORTCUTS_H
Definition: prefsstructs.h:453
the Document Class
Definition: scribusdoc.h:90
Definition: prefs_pane.h:14