1 //========================================================= 2 // MusE 3 // Linux Music Editor 4 // $Id: tools.h,v 1.1.1.1 2003/10/27 18:54:49 wschweer Exp $ 5 // (C) Copyright 1999 Werner Schweer (ws@seh.de) 6 // 7 // This program is free software; you can redistribute it and/or 8 // modify it under the terms of the GNU General Public License 9 // as published by the Free Software Foundation; version 2 of 10 // the License, or (at your option) any later version. 11 // 12 // This program is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 // GNU General Public License for more details. 16 // 17 // You should have received a copy of the GNU General Public License 18 // along with this program; if not, write to the Free Software 19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 // 21 //========================================================= 22 23 #ifndef __TOOLS_H__ 24 #define __TOOLS_H__ 25 26 #include <QToolBar> 27 #include <QMap> 28 29 class QAction; 30 class QPixmap; 31 class QWidget; 32 class QIcon; 33 34 namespace MusEGui { 35 36 enum Tool { 37 PointerTool=1, 38 PencilTool=2, 39 RubberTool=4, 40 CutTool=8, 41 GlueTool=16, 42 RangeTool=32, 43 PanTool=64, 44 ZoomTool=128, 45 DrawTool=256, 46 MuteTool=512, 47 AutomationTool=1024, 48 CursorTool=2048, 49 StretchTool=4096, 50 SamplerateTool=8192 51 }; 52 53 struct ToolB { 54 QIcon** icon; 55 const char* tip; 56 const char* ltip; 57 }; 58 59 //extern const QVector<ToolB> toolList; 60 61 //--------------------------------------------------------- 62 // EditToolBar 63 //--------------------------------------------------------- 64 65 class EditToolBar : public QToolBar { 66 Q_OBJECT 67 68 QActionGroup* actionGroup; 69 70 private slots: 71 void toolChanged(QAction* action); 72 73 signals: 74 void toolChanged(int); 75 76 public slots: 77 void set(int id); 78 void configChanged(); 79 80 public: 81 EditToolBar(QWidget* /*parent*/, int /*tools*/, const char* name = 0); // Needs a parent ! 82 ~EditToolBar(); 83 int curTool(); 84 85 static const QMap<int,int> toolShortcuts; 86 static const QVector<ToolB> toolList; 87 }; 88 89 } // namespace MusEGui 90 91 #endif 92 93