1 /*******************************************************************************
3 This file is part of mDictionary.
5 mDictionary is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 mDictionary is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
18 Copyright 2010 Comarch S.A.
20 *******************************************************************************/
22 // Created by Bartosz Szatkowski
30 #include "../../includes/CommonDictInterface.h"
31 #include "../../includes/settings.h"
32 #include "../../includes/translation.h"
35 //! Inner part of dictionary - glues together GUI and plugins
36 class Backbone : public QObject
41 Backbone(QObject *parent = 0);
43 Backbone(const Backbone& b);
45 //! \return all loadded dictionaries with activity state flag
46 QHash<CommonDictInterface*, bool > getDictionaries();
48 //! \return all loadded plugins
49 QList<CommonDictInterface* > getPlugins();
51 //! \return history of performed searches
52 QList<QString> getHistory(); //TODO implementation needed (in future)
54 //! \return return search fesult
55 QHash<QString, Translation*> result();
58 //! stops all current searches
61 //! search for a word translation
62 void search(QString word);
64 //! sets active dictionaries
65 void selectedDictionaries(QList<CommonDictInterface* >);
67 //! adds new dictionary
68 void addDictionary(CommonDictInterface* dict);
71 //! stops all current activity and kill plugins - be ready to exit
74 //! \return maximum number of word that plugin could find
77 // TODO void removeDictionary(CommonDictInterface* dict);
78 // TODO addToBookmark(Translation*);
79 // TODO removeFromBookmark(Translation*);
82 //! emmited when backbone is ready to close - after getting stop signal it
83 //! should kill all threads and so on
86 //! emitted when there are search result ready to fetch
90 QHash<CommonDictInterface*, bool> dicts;
91 QList<CommonDictInterface*> plugins;
92 QHash<QString, Translation*> resultv;