File indexing completed on 2024-04-14 03:40:25

0001 /***************************************************************************
0002  *   Copyright (C) 2005 by Joshua Keel <joshuakeel@gmail.com>              *
0003  *             (C) 2007 by Jeremy Whiting <jpwhiting@kde.org>              *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; if not, write to the                         *
0017  *   Free Software Foundation, Inc.,                                       *
0018  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.           *
0019  ***************************************************************************/
0020 
0021 #ifndef VOCABSETTINGS_H
0022 #define VOCABSETTINGS_H
0023 
0024 #include "ui_vocabsettingswidget.h"
0025 
0026 
0027 /** @brief Vocabulary Settings class
0028  *  @author Joshua Keel <joshuakeel@gmail.com>
0029  *
0030  *  Settings page to choose vocabularies, and buttons to invoke the vocabulary editor
0031  */
0032 class VocabSettings : public QWidget, public Ui::VocabSettingsWidget
0033 {
0034 Q_OBJECT
0035     public:
0036         /** default constructor */
0037         explicit VocabSettings(QWidget *parent);
0038 
0039         /** default destructor */
0040         virtual ~VocabSettings();
0041 
0042     Q_SIGNALS:
0043 
0044         /** signifies the widget has been changed */
0045         void widgetModified();
0046 
0047     private Q_SLOTS:
0048 
0049         /** create a new vocabulary
0050          *  called when the btnCreateNew is clicked
0051          */
0052         void on_btnCreateNew_clicked();
0053         void on_btnEdit_clicked();
0054         void slotSelectionChanged(QTreeWidgetItem *item);
0055 
0056         /** reload the list of vocabularies from what's on disk
0057          * and emit widgetModified
0058          */
0059         void refreshView();
0060 
0061     private:
0062 
0063         /** load the list of vocabularies from what's on disk */
0064         void loadView();
0065 
0066         /** list of vocabulary files */
0067         QStringList m_fileList;
0068 
0069         /** list of document titles */
0070         QStringList m_titleList;
0071 
0072         /** list of document comments */
0073         QStringList m_commentList;
0074 
0075         QMap<const QTreeWidgetItem*, int> m_itemMap;
0076 };
0077 
0078 #endif
0079