File indexing completed on 2024-04-14 03:59:57

0001 /***************************************************************************
0002                           cshortcutlist.h  -  macro key list
0003                              -------------------
0004     begin                : St máj 28 2003
0005     copyright            : (C) 2003-2008 by Tomas Mecir
0006     email                : kmuddy@kmuddy.com
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #ifndef CSHORTCUTLIST_H
0019 #define CSHORTCUTLIST_H
0020 
0021 #include "clist.h"
0022 
0023 /**
0024 List of macro keys/shortcuts
0025 
0026   *@author Tomas Mecir
0027   */
0028 
0029 class cShortcutList : public cList {
0030 public: 
0031   cShortcutList ();
0032   ~cShortcutList () override;
0033   
0034   static cList *newList () { return new cShortcutList; };
0035   cListObject *newObject () override;
0036   QString objName () override { return "Macro key"; }
0037   cListEditor *editor (QWidget *parent) override;
0038 
0039   /** this key was pressed - send a command if needed, returns true if
0040   some shortcut matched the key */
0041   bool handleKey (int key, Qt::KeyboardModifiers state);
0042 protected:
0043   friend class cShortcut;
0044   bool matched;
0045   unsigned int currentKey;
0046   Qt::KeyboardModifiers currentModifiers;
0047 };
0048 
0049 #endif