kiten/lib
DictionaryManager.h
Go to the documentation of this file.00001 /* This file is part of Kiten, a KDE Japanese Reference Tool... 00002 Copyright (C) 2006 Joseph Kerian <jkerian@gmail.com> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 #ifndef KITEN_DICTIONARYMANAGER_H_ 00020 #define KITEN_DICTIONARYMANAGER_H_ 00021 00022 #include "libkitenexport.h" 00023 00024 #include <QtCore/QMap> 00025 #include <QtCore/QPair> 00026 00027 class QWidget; 00028 class QString; 00029 class QStringList; 00030 00031 class Entry; 00032 class EntryList; 00033 class KConfigSkeleton; 00034 class KConfig; 00035 00036 class dictFile; 00037 class DictQuery; 00038 class DictionaryPreferenceDialog; 00039 00057 class KITEN_EXPORT DictionaryManager { 00058 public: 00060 DictionaryManager(); 00062 virtual ~DictionaryManager(); 00063 00070 bool addDictionary(const QString &file,const QString &name,const QString &type); 00073 bool removeDictionary(const QString &name); 00075 QStringList listDictionaries() const; 00078 QPair<QString, QString> listDictionaryInfo(const QString &name) const; 00081 QStringList listDictionariesOfType(const QString &type) const; 00084 EntryList *doSearch(const DictQuery &query) const; 00090 EntryList *doSearchInList(const DictQuery &query, const EntryList *list) const; 00092 static QStringList listDictFileTypes(); 00098 static QMap<QString,DictionaryPreferenceDialog*> 00099 generatePreferenceDialogs(KConfigSkeleton *config, QWidget *parent=NULL); 00103 static QMap<QString,QString> generateExtendedFieldsList(); 00107 void loadDictSettings(const QString &dict, KConfigSkeleton* config); 00109 void loadSettings(const KConfig&); 00110 00111 private: 00114 static dictFile *makeDictFile(const QString&); 00115 class Private; 00116 Private * const d; 00117 }; 00118 00119 #endif
KDE 4.2 API Reference