1 /*************************************************************************** 2 tagtemplatedit.h - Edit tag templates 3 ------------------- 4 begin : Sep 2008 5 copyright : (C) 2008 by Klaas Freitag 6 email : freitag@kde.org 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * 11 * 12 * This program is free software; you can redistribute it and/or modify * 13 * it under the terms of the GNU General Public License as published by * 14 * the Free Software Foundation; either version 2 of the License, or * 15 * (at your option) any later version. * 16 * * 17 ***************************************************************************/ 18 19 20 #ifndef TAGTEMPLATESDIALOG_H 21 #define TAGTEMPLATESDIALOG_H 22 23 #include <qmap.h> 24 25 #include <QDialog> 26 27 #include "tagman.h" 28 29 class QWidget; 30 class QTreeWidget; 31 class QTreeWidgetItem; 32 class QStringList; 33 class QPushButton; 34 class QLineEdit; 35 class QTextEdit; 36 37 class TagTemplateEditor: public QDialog 38 { 39 Q_OBJECT 40 41 public: 42 TagTemplateEditor( QWidget* ); 43 ~TagTemplateEditor(); 44 45 void setTemplate( const TagTemplate& ); 46 TagTemplate currentTemplate(); 47 48 private slots: 49 void slotColorSelect(bool); 50 void setColorButton(); 51 52 private: 53 TagTemplate mOrigTemplate; 54 QLineEdit *mNameEdit; 55 QTextEdit *mDescriptionEdit; 56 QPushButton *mColorButton; 57 QPushButton *mOkButton; 58 QColor mColor; 59 60 }; 61 62 class TagTemplatesDialog: public QDialog 63 { 64 Q_OBJECT 65 66 public: 67 TagTemplatesDialog( QWidget* ); 68 ~TagTemplatesDialog( ); 69 70 TagTemplate currentTemplate(); 71 72 protected slots: 73 void slotSelectionChanged(); 74 void slotAddTemplate(); 75 void slotEditTemplate(); 76 void slotDeleteTemplate(); 77 78 protected: 79 void setTags( ); 80 81 private: 82 QTreeWidget *mListView; 83 QMap<QTreeWidgetItem*, QString> mItemMap; 84 85 QPushButton *mAddButton; 86 QPushButton *mEditButton; 87 QPushButton *mDeleteButton; 88 }; 89 90 #endif 91