Back to index

scribus-ng  1.3.4.dfsg+svn20071115
tabkeyboardshortcutswidget.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008 *   Copyright (C) 2006 by Craig Bradney                                   *
00009 *   cbradney@zip.com.au                                                   *
00010 *                                                                         *
00011 *   This program is free software; you can redistribute it and/or modify  *
00012 *   it under the terms of the GNU General Public License as published by  *
00013 *   the Free Software Foundation; either version 2 of the License, or     *
00014 *   (at your option) any later version.                                   *
00015 *                                                                         *
00016 *   This program is distributed in the hope that it will be useful,       *
00017 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00019 *   GNU General Public License for more details.                          *
00020 *                                                                         *
00021 *   You should have received a copy of the GNU General Public License     *
00022 *   along with this program; if not, write to the                         *
00023 *   Free Software Foundation, Inc.,                                       *
00024 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00025 ***************************************************************************/
00026 #ifndef TABKEYBOARDSHORTCUTSWIDGET_H
00027 #define TABKEYBOARDSHORTCUTSWIDGET_H
00028 
00029 #include "tabkeyboardshortcutswidgetbase.h"
00030 #include "scribusapi.h"
00031 #include "scribusstructs.h"
00032 
00033 #include <qmap.h>
00034 #include <qpair.h>
00035 #include <qptrlist.h>
00036 #include <qstring.h>
00037 #include <qstringlist.h>
00038 #include <qvaluevector.h>
00039 #include <qlistview.h>
00040 
00041 class TabKeyboardShortcutsWidget: public TabKeyboardShortcutsWidgetBase 
00042 {
00043        Q_OBJECT
00044        public:
00045               TabKeyboardShortcutsWidget(QMap<QString, Keys> oldKeyMap, QWidget *parent = 0, const char *name = 0);
00046               const QMap<QString, Keys> getNewKeyMap();
00047               static QString getKeyText(int KeyC);
00048               bool event( QEvent* ev );
00049               void keyPressEvent(QKeyEvent *k);
00050               void keyReleaseEvent(QKeyEvent *k);
00051               void restoreDefaults();
00052               
00053        protected:
00054               QMap<QString,Keys> keyMap;
00055               QMap<QString,Keys>::Iterator currentKeyMapRow;
00056               QMap<QString, QString> keySetList;
00057               QMap<QListViewItem*, QString> lviToActionMap;
00058               QPtrList<QListViewItem> lviToMenuMap;
00059               QValueVector< QPair<QString, QStringList> >* defMenus;
00060               QValueVector< QPair<QString, QStringList> >* defNonMenuActions;
00061               QListViewItem* selectedLVI;
00062               int keyCode;
00063               QString Part0;
00064               QString Part1;
00065               QString Part2;
00066               QString Part3;
00067               QString Part4;
00068        
00069               void insertActions();
00070               void importKeySet(QString);
00071               bool exportKeySet(QString);
00072               QStringList scanForSets();
00073               bool checkKey(int Code);
00074        
00075        protected slots:
00076               void setKeyText();
00077               void dispKey(QListViewItem*);
00078               void setNoKey();
00079               void loadKeySetFile();
00080               void importKeySetFile();
00081               void exportKeySetFile();
00082               void resetKeySet();
00083               void clearSearchString();
00084               void applySearch( const QString & newss );
00085 };
00086 
00087 #endif