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 *******************************************************************************/
21 //! \file WordListwidget.h
22 //! \brief Implements word list widget
23 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
25 #ifndef WORDLISTWIDGET_H
26 #define WORDLISTWIDGET_H
30 #include <QStringListModel>
31 #include "../backbone/backbone.h"
32 #include "SearchBarWidget.h"
34 //! Displays list of words found in dictionaries
36 It allow user to select word to see it's translation or to mark it as "star"
38 class WordListWidget : public QListWidget {
41 explicit WordListWidget(QWidget *parent = 0);
44 //! Request to show translation which is described by passed translations
46 void showTranslation(QList<Translation*>);
48 void addBookmark(QList<Translation*>);
50 void removeBookmark(QList<Translation*>);
54 //! Shows search results
56 \param hash of found words and it's translations objects
58 void showSearchResults(QHash<QString, QList<Translation*> >);
60 //! Lock words list, while backbone is doing somethig in background
63 //! Unlocks words list
67 void wordClicked(QListWidgetItem* item);
68 void wordPressed(QListWidgetItem* item);
71 void addWord(QString word);
73 Qt::CheckState itemState;
74 QHash<QString, QList<Translation*> > searchResult;
77 #endif // WORDLISTWIDGET_H