Changed include folder name
authorMateusz Półrola <mateusz.polrola@comarch.pl>
Fri, 3 Sep 2010 06:23:17 +0000 (08:23 +0200)
committerMateusz Półrola <mateusz.polrola@comarch.pl>
Fri, 3 Sep 2010 06:23:17 +0000 (08:23 +0200)
53 files changed:
mdictionary.pro
src/common/AccentsNormalizer.h [deleted file]
src/common/CommonDictInterface.h [deleted file]
src/common/DictDialog.h [deleted file]
src/common/GUIInterface.h [deleted file]
src/common/History.h [deleted file]
src/common/Notify.h [deleted file]
src/common/settings.h [deleted file]
src/common/translation.h [deleted file]
src/include/AccentsNormalizer.h [new file with mode: 0644]
src/include/CommonDictInterface.h [new file with mode: 0644]
src/include/DictDialog.h [new file with mode: 0644]
src/include/GUIInterface.h [new file with mode: 0644]
src/include/History.h [new file with mode: 0644]
src/include/Notify.h [new file with mode: 0644]
src/include/settings.h [new file with mode: 0644]
src/include/translation.h [new file with mode: 0644]
src/mdictionary/backbone/BookmarkTranslations.h
src/mdictionary/backbone/Bookmarks.h
src/mdictionary/backbone/History.cpp
src/mdictionary/backbone/backbone.h
src/mdictionary/gui/AboutWidget.h
src/mdictionary/gui/BookmarksWidget.h
src/mdictionary/gui/DictManagerWidget.cpp
src/mdictionary/gui/DictManagerWidget.h
src/mdictionary/gui/DictTypeSelectDialog.h
src/mdictionary/gui/HistoryListDialog.h
src/mdictionary/gui/MainWindow.h
src/mdictionary/gui/NotifyManager.h
src/mdictionary/gui/SearchBarWidget.cpp
src/mdictionary/gui/SearchBarWidget.h
src/mdictionary/gui/SettingsWidget.h
src/mdictionary/gui/TranslationWidget.h
src/mdictionary/gui/WordListWidget.cpp
src/mdictionary/gui/main.cpp
src/mdictionary/mdictionary.pro
src/plugins/google/GoogleDictDialog.h
src/plugins/google/GooglePlugin.h
src/plugins/google/GoogleSettingsDialog.h
src/plugins/google/TranslationGoogle.h
src/plugins/google/google.pro
src/plugins/xdxf/TranslationXdxf.h
src/plugins/xdxf/XdxfDictDialog.h
src/plugins/xdxf/XdxfLoadDialog.h
src/plugins/xdxf/XdxfSettingsDialog.h
src/plugins/xdxf/xdxf.pro
src/plugins/xdxf/xdxfplugin.cpp
src/plugins/xdxf/xdxfplugin.h
src/src.pro
tests/mDictionaryTests/CommonDictInterfaceMock.h
tests/mDictionaryTests/TranslationMock.h
tests/mDictionaryTests/mDictionaryTests.pro
tests/tests.pro

index ee0ade9..f501bf2 100644 (file)
@@ -1,6 +1,13 @@
 TEMPLATE = subdirs
+SUBDIRS = src tests
+CONFIG += ordered
 include (mdictionary.pri)
-SUBDIRS = src
+
+
+check.CONFIG += recursive
+check.recurse = src tests
+check.depends = install
+QMAKE_EXTRA_TARGETS += check
 
 message("Enabled sources: "$$ENABLED_SRC)
 message("Enabled plugins: "$$ENABLED_PLUGINS)
@@ -10,3 +17,15 @@ message("Binary directory: "$$BIN_DIR)
 message("Data directory: "$$DATA_DIR)
 message("Plugins directory: "$$PLUGINS_DIR)
 message("Documentation directory: "$$DOCS_DIR)
+
+
+if(coverage) {
+        coverage-report.CONFIG = recursive
+        coverage-report.recurse = src
+        QMAKE_EXTRA_TARGETS += coverage-report
+        message('******************************************************************' )
+        message('* Remember to disable CCACHE in scratchbox to make Code Coverage' )
+        message('* report!' )
+        message('* use command: export SBOX_USE_CCACHE="no"' )
+        message('******************************************************************' )
+}
diff --git a/src/common/AccentsNormalizer.h b/src/common/AccentsNormalizer.h
deleted file mode 100644 (file)
index 0343e88..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
-
-    This file is part of mDictionary.
-
-    mDictionary is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    mDictionary is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
-
-    Copyright 2010 Comarch S.A.
-
-*******************************************************************************/
-
-/*! /file AccentsNormalizer.h
-\brief Common functionality for all classes that need to remove accents from strings
-
-\author Bartosz Szatkowski <bulislaw@linux.com>
-*/
-
-#ifndef ACCENTSNORMALIZER_H
-#define ACCENTSNORMALIZER_H
-
-#include <QMap>
-#include <QString>
-#include <QRegExp>
-
-
-class AccentsNormalizer {
-  protected:
-    QMap<QChar, QRegExp> letters;
-    QRegExp noLetter;
-
-    QString removeAccents(QString string) {
-       string = string.toLower();
-       QString normalized = string.normalized(QString::NormalizationForm_KD);
-       foreach(QChar let, letters.keys()) {
-           normalized.replace(letters[let], QString(let));
-       }
-       normalized.replace(noLetter, "");
-       return normalized;
-    }
-
-    void initAccents() {
-        letters['a'] = QRegExp(QString::fromUtf8("[ÀàÁáÂÂâÃãÄäÅåæÆĀāĂ㥹ǠȀǡȁǢȂǣȃȦȧǺȺǻǼǍǽǎǞǟⱥ]"), Qt::CaseInsensitive);
-        letters['b'] = QRegExp(QString::fromUtf8("[ƀƁƂƃɃƄƅ]"), Qt::CaseInsensitive);
-        letters['c'] = QRegExp(QString::fromUtf8("[ÇçÈçŒĆćĈĉĊċČčƇƈȻȼ]"), Qt::CaseInsensitive);
-        letters['d'] = QRegExp(QString::fromUtf8("[ÐĐđĎďȡƉ]"), Qt::CaseInsensitive);
-        letters['e'] = QRegExp(QString::fromUtf8("[ÈéèÉÊêËëĒēĔĕĖėĘęĚěēȄȅȆɆȇɇȨȩ]"), Qt::CaseInsensitive);
-        letters['f'] = QRegExp(QString::fromUtf8("[ſƑƒꜰ]"), Qt::CaseInsensitive);
-        letters['g'] = QRegExp(QString::fromUtf8("[ĠġĢģĜĝĞğƓǤǴǥǵǦǧ]"), Qt::CaseInsensitive);
-        letters['h'] = QRegExp(QString::fromUtf8("[ħĤĥĦȞȟⱧⱨ]"), Qt::CaseInsensitive);
-        letters['i'] = QRegExp(QString::fromUtf8("[ÌìÍíÎîÏïİijĨĩĪīĬĭĮįǐƗȈȉȊȋǏꟾ]"), Qt::CaseInsensitive);
-        letters['j'] = QRegExp(QString::fromUtf8("[ĴĵǰȷɈɉⱼ]"), Qt::CaseInsensitive);
-        letters['k'] = QRegExp(QString::fromUtf8("[ĶķĸƘǨƙǩⱩⱪ]"), Qt::CaseInsensitive);
-        letters['l'] = QRegExp(QString::fromUtf8("[ŀŁłĹĺĻļĽľĿȴȽⱠⱡⱢꝈ]"), Qt::CaseInsensitive);
-        letters['m'] = QRegExp(QString::fromUtf8("[Ɱ]"), Qt::CaseInsensitive);
-        letters['n'] = QRegExp(QString::fromUtf8("[ÑñŃńŅņŇňʼnŊŋȵǸǹƝ]"), Qt::CaseInsensitive);
-        letters['o'] = QRegExp(QString::fromUtf8("[ÒòÓóÔÕõÖöØøŐőœŌōŎŏƠȰơǑȱǒǪȪǫȫǬȌȬǭȍȭǾȎȮǿȏȯⱺ]"), Qt::CaseInsensitive);
-        letters['p'] = QRegExp(QString::fromUtf8("[ƤƥⱣ]"), Qt::CaseInsensitive);
-        letters['q'] = QRegExp(QString::fromUtf8("[Ɋɋ]"), Qt::CaseInsensitive);
-        letters['r'] = QRegExp(QString::fromUtf8("[ŕŖŖŗŘřȐȑȒȓɌɍⱤ]"), Qt::CaseInsensitive);
-        letters['s'] = QRegExp(QString::fromUtf8("[ߊšŚśŜŝŞşȘșȿꜱ]"), Qt::CaseInsensitive);
-        letters['t'] = QRegExp(QString::fromUtf8("[ŢţŤťŦŧȶȚƫțƬƮȾⱦ]"), Qt::CaseInsensitive);
-        letters['u'] = QRegExp(QString::fromUtf8("[ÙùÚúÛûÜüŰűŲųŨũŪūŬŮůưǓǔȔɄǕȕǖȖǗȗǘǙǚǛǜƯ]"), Qt::CaseInsensitive);
-        letters['v'] = QRegExp(QString::fromUtf8("[Ʋⱱⱴⱽ]"), Qt::CaseInsensitive);
-        letters['w'] = QRegExp(QString::fromUtf8("[ŴŵⱲⱳ]"), Qt::CaseInsensitive);
-        letters['y'] = QRegExp(QString::fromUtf8("[ÿÝýŶŷŸȲƳȳƴɎɏ]"), Qt::CaseInsensitive);
-        letters['z'] = QRegExp(QString::fromUtf8("[ŹźŻżŽžɀȤƵȥƶⱫⱬ]"), Qt::CaseInsensitive);
-        noLetter = QRegExp("[^-a-z '\"]", Qt::CaseInsensitive);
-    }
-};
-
-#endif // ACCENTSNORMALIZER_H
diff --git a/src/common/CommonDictInterface.h b/src/common/CommonDictInterface.h
deleted file mode 100644 (file)
index 899843a..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
-
-    This file is part of mDictionary.
-
-    mDictionary is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    mDictionary is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
-
-    Copyright 2010 Comarch S.A.
-
-*******************************************************************************/
-
-/*! \file CommonDictInterface.h
-\brief Common interface for all dicts and plugins \see CommonDictInterface
-
-\author Bartosz Szatkowski <bulislaw@linux.com>
-*/
-
-#ifndef COMMONDICTINTERFACE_H
-#define COMMONDICTINTERFACE_H
-
-#include <QString>
-#include <QDialog>
-#include <QObject>
-#include <QList>
-#include "translation.h"
-#include "Notify.h"
-#include "settings.h"
-#include "AccentsNormalizer.h"
-
-class DictDialog;
-
-
-//! Interface for dict engines plugins
-class CommonDictInterface : public QObject, public AccentsNormalizer {
-  Q_OBJECT
-  public:
-    CommonDictInterface(QObject *parent = 0):QObject(parent) {}
-
-    virtual ~CommonDictInterface() {}
-
-    //! returns source language code iso 639-2
-    virtual QString langFrom() const = 0;
-
-    //! returns destination language code iso 639-2
-    virtual QString langTo() const = 0;
-
-    //! returns dictionary name (like "old English" or so)
-    virtual QString name() const = 0;
-
-    //! returns dictionary type (xdxf, google translate, etc)
-    virtual QString type() const = 0;
-
-    //! returns information about dictionary in html (name, authors, etc)
-    virtual QString infoNote() const = 0;
-
-    /*! returns DictDialog object that creates dialogs
-        for adding new dictionary and changing plugin settings*/
-    virtual DictDialog* dictDialog() = 0;
-
-
-    //! returns new, clean copy of plugin with settings set as in Settings*
-    virtual CommonDictInterface* getNew(const Settings*) const = 0;
-
-    //! returns whether plugin can start searching
-    virtual bool isAvailable() const = 0;
-
-    //! returns the actual translation of a word given in key
-    virtual QString search(QString key) = 0;
-
-    //! \returns unique value (unique for every dictionary, not plugin)
-    virtual uint hash() const = 0;
-
-    //! sets unique value (unique for every dictionary, not plugin)
-    virtual void setHash(uint) = 0;
-
-    //! returns current plugin settings
-    virtual Settings* settings() = 0;
-
-    //! returns plugin icon
-    virtual QIcon* icon() = 0;
-
-    //! returns empty translation object (to be fetched later) for given key
-    virtual Translation* getTranslationFor(QString ) {return 0;}
-
-    /*! plugin should delete any files (eg. cache) that have been created and are ready
-        to be deleted
-        */
-    virtual void clean() {}
-
-
- public Q_SLOTS:
-    /*! performs search in dictionary
-        \param  word word to search in dictionary
-        \param  limit limit on number of results,
-                if limit=0 all matching words are returned
-
-        After finishing search it has to emit
-        \see CommonDictInterface:finalTranslation  finalTranslation
-    */
-    virtual QList<Translation*> searchWordList(QString word, int limit=0) = 0;
-
-    //! stops current operation
-    virtual void stop() = 0;
-
-  Q_SIGNALS:
-
-    //! emitted when dictionary is ready to use afer being loaded
-    void loaded(CommonDictInterface*);
-
-    //! emitted after change in dictionary settings
-    void settingsChanged();
-
-    /*! emitted to backbone when it's needed to inform user about something
-        \param Backbone::NotifyType GUI may decide to show different types in
-            different ways
-        \param QString text of the notification
-    */
-    void notify(Notify::NotifyType, QString);
-    
-
-protected:
-    QString removeAccents(QString string) {
-        if(settings()->value("strip_accents") == "true")
-            return AccentsNormalizer::removeAccents(string);
-        return string;
-    }
-};
-
-Q_DECLARE_INTERFACE(CommonDictInterface, "CommonDictInterface/0.1");
-
-#endif
diff --git a/src/common/DictDialog.h b/src/common/DictDialog.h
deleted file mode 100644 (file)
index fc83744..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
-
-    This file is part of mDictionary.
-
-    mDictionary is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    mDictionary is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
-
-    Copyright 2010 Comarch S.A.
-
-*******************************************************************************/
-
-//Created by Mateusz Półrola
-
-#ifndef DICTDIALOG_H
-#define DICTDIALOG_H
-
-#include <QObject>
-
-class Settings;
-
-//! Interface for plugin dialog provider
-class DictDialog : public QObject {
-    Q_OBJECT
-
-public:
-    DictDialog(QObject *parent = 0) : QObject(parent) {}
-
-    /*!
-      Shows "add new dictionary" dialog and returns settings of new dict
-      \param parent parent widget on which dialog will be displayed
-      */
-    virtual Settings* addNewDictionary(QWidget*parent=0)=0;
-
-    /*!
-      Shows "settings" dialog and saves new settings in plugin
-      \param parent parent widget on which dialog will be displayed
-      */
-    virtual void changeSettings(QWidget *parent = 0) = 0;
-};
-
-#endif // DICTDIALOG_H
diff --git a/src/common/GUIInterface.h b/src/common/GUIInterface.h
deleted file mode 100644 (file)
index 2f10cc1..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
-
-    This file is part of mDictionary.
-
-    mDictionary is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    mDictionary is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
-
-    Copyright 2010 Comarch S.A.
-
-*******************************************************************************/
-//! \file GUIInterface.h
-//! \brief Defines interface for GUI
-//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
-
-
-
-#ifndef GUIINTERFACE_H
-#define GUIINTERFACE_H
-#include <QMainWindow>
-#include <QMultiHash>
-
-#include "translation.h"
-#include "CommonDictInterface.h"
-
-class Settings;
-
-//! Interface for different GUIs
-/*!
-  Default base class for all GUIs is QMainWindow
-  */
-class GUIInterface : public QMainWindow {
-    Q_OBJECT
-
-public:
-    GUIInterface(QWidget *parent = 0) :QMainWindow(parent) {}
-
-    virtual ~GUIInterface() {}
-
-    //! Returns all loaded dictionaries with information about that they are
-    //! active/inactive
-    /*!
-        \return Hash of pointers to dictionary and boolean flag indicating if
-        dictionary is active
-     */
-    virtual QHash<CommonDictInterface*, bool> getDictionaries() = 0;
-
-
-    //! Returns all loaded plugins
-    /*!
-        \return List of pointers to plugins
-     */
-    virtual QList<CommonDictInterface*> getPlugins() = 0;
-
-    //! Indicates if GUI is in exact search mode.
-    /*! When GUI is in exact search mode it searches for word, and
-        if it finds exactly matching translation it directly displays it, without
-        displaying matching word list. This mode should be
-        used for browsing search history and searching words from application
-        arguments.
-        \returns flag indicating if GUI is in exact search mode
-    */
-    bool exactSearch();
-
-    //! Sets GUI exact search mode.
-    /*! \sa exactSearch() */
-    void setExactSearch(bool exactSearch);
-
-    virtual Settings* settings() = 0;
-
-    virtual void setSettings(Settings*) = 0;
-
-
-public Q_SLOTS:
-    //! Searches in exact mode for given word
-    /*!
-      GUI will be automatically set into exact search mode, and after search or
-      break it will be unset from exact search mode.
-      \param word which will be searched in dictionaries
-      */
-    virtual void searchExact(QString word) = 0;
-
-    //! Adds key words from given translations to history
-    /*!
-      By default this slot is connected to searchTranslations signal, and
-      passed translations list contains only translations with the same key, so
-      only one word is added to history.
-      \param list of translations with key words
-      \sa searchTranslations();
-      */
-    virtual void addToHistory(QList<Translation*>) = 0;
-
-    //! Shows history dialog
-    virtual void showHistory(QPoint) = 0;
-
-    //! Shows translation of next word in history
-    /*!
-      It will work only if there is next word available in history.
-      Translation of word is searched with searchExact() function
-      \sa searchExact()
-      */
-    virtual void historyNext() = 0;
-
-    //! Shows translation of previous word in history
-    /*!
-      It will work only if there is previous word available in history.
-      Translation of word is searched with searchExact() function
-      \sa searchExact()
-      */
-    virtual void historyPrev() = 0;
-
-    //! Gets words list from backbone and prepares received list to display
-    /*!
-      Checks if received list is empty, in that case it displays suitable
-      information. If GUI is in exact search mode it will search for exact
-      word in received list, and if word is found it will emit signal to
-      display its translation. Otherwise it will display list of matching
-      words and show suitable information.
-      \sa exactSearch()
-      \sa showTranslation()
-     */
-    virtual void wordListReady() = 0;
-
-    //! Gets translation strings from backbone and emits signal to display them
-    virtual void translationsReady() = 0;
-
-Q_SIGNALS:
-    //! Should be emitted when user wants to close application to stop
-    //! all ongoing searches
-    void quit();
-
-    //! Emitted when user wants to search for list of words matching given word
-    /*! \param word word which will be matched, it can contain wildcards
-    */
-    void searchWordList(QString word);
-
-    //! Emitted when user wants to see translation of words.
-    /*! \param list of translations for given word which will be received
-        in wordListReady() slot
-        \sa wordListReady()
-    */
-    void searchTranslations(QList<Translation*>);
-
-    //! Emitted when starting search, will disable GUI components
-    //! and show progress bars
-    void setBusy();
-
-    //! Emitted when searching ends, will enable GUI components
-    void setIdle();
-
-    //! Emitted when user wants to break search
-    void stopSearching();
-
-    //! Emitted after receiving word list in wordListReady() slot, will display
-    //! list of matched words
-    /*! \param hash of word and list of translations of this word found
-         in dictionaries
-     */
-    void showWordList(QHash<QString, QList<Translation*> >);
-
-    //! Emitted after receiving translation strings in translationsReady() slot,
-    //! will display translation of given word
-    /*! \param list of translations from different dictionaries
-         in dictionaries
-     */
-    void showTranslation(QStringList);
-
-    //! Emitted when user wants to add new dictionary
-    /*! \param new dictionary returned by specific plugin dialog
-      */
-    void addNewDictionary(CommonDictInterface*);
-
-    //! Emitted when user wants to remove dictionary
-    /*! \param dictionary which will be removed
-      */
-    void removeDictionary(CommonDictInterface*);
-
-    //! Emitted when user changes dictionaries active/inactive states
-    /*! \param list of only active dictionaries
-      */
-    void selectedDictionaries(QList<CommonDictInterface* >);
-
-    void addToBookmarks(QList<Translation*>);
-};
-
-#endif // GUIINTERFACE_H
diff --git a/src/common/History.h b/src/common/History.h
deleted file mode 100644 (file)
index 133b3ad..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
-
-    This file is part of mDictionary.
-
-    mDictionary is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    mDictionary is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
-
-    Copyright 2010 Comarch S.A.
-
-*******************************************************************************/
-
-//Created by Mateusz Półrola
-
-#ifndef HISTORY_H
-#define HISTORY_H
-
-#include <QObject>
-#include <QVector>
-#include <QStringList>
-
-class History : public QObject
-{
-    Q_OBJECT
-public:
-    explicit History(int maxSize = 5, QObject *parent = 0);
-
-Q_SIGNALS:
-    void historyChanged(bool prevAvailable,
-                        bool nextAvailable,
-                        bool listAvailable);
-
-public Q_SLOTS:
-    void refreshStatus();
-
-public:
-    void add(QString);
-    QString previous();
-    QString next();
-    QStringList list();
-
-    bool prevAvailable();
-    bool nextAvailable();
-    bool listAvailable();
-
-    void setCurrentElement(int element);
-
-    int maxSize();
-
-    void setMaxSize(int size);
-
-private:
-    QVector<QString> _history;
-    int _maxSize;
-    int currentElement;
-    bool _prevAvailable;
-    bool _nextAvailable;
-    bool _listAvailable;
-};
-
-#endif // HISTORY_H
diff --git a/src/common/Notify.h b/src/common/Notify.h
deleted file mode 100644 (file)
index a5266e9..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
-
-    This file is part of mDictionary.
-
-    mDictionary is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    mDictionary is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
-
-    Copyright 2010 Comarch S.A.
-
-*******************************************************************************/
-
-/*! /file Notify.h
-\brief Declaration of common notify subsystem (NotifyType for now)
-
-\author Bartosz Szatkowski <bulislaw@linux.com>
-*/
-
-#ifndef NOTIFY_H
-#define NOTIFY_H
-
-#include <QObject>
-#include <QMetaClassInfo>
-
-/*! Notify wraps NotifyType which is interpreted by GUI and may change way in
-    which GUI handles given notification
-    */
-class Notify : QObject {
-    Q_OBJECT
-public:
-    Notify() : QObject(0) {}
-    Notify(const Notify&) : QObject(0) {}
-    enum notifytype {Error, Warning, Info};
-    Q_DECLARE_FLAGS(NotifyType, notifytype);
-};
-#endif // NOTIFY_H
diff --git a/src/common/settings.h b/src/common/settings.h
deleted file mode 100644 (file)
index 6843a79..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
-
-    This file is part of mDictionary.
-
-    mDictionary is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    mDictionary is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
-
-    Copyright 2010 Comarch S.A.
-
-*******************************************************************************/
-
-/*! \file settings.h
-\brief Settings object for plugins \see Settings
-
-\author Bartosz Szatkowski <bulislaw@linux.com>
-*/
-
-#ifndef SETTINGS_H
-#define SETTINGS_H
-
-#include <QString>
-#include <QHash>
-#include <QDebug>
-
-/*! Plugins or dictionaries may need to keep some of configuration between
-  sessions, moreover Backbone or GUI may want to store some additional info in
-  plugin Settings.
-
-  It's important for plugin to store all information given to it in Settings.*/
-class Settings {
-  public:
-    Settings(){}
-    Settings(const Settings* set) {
-        _settings = QHash<QString, QString>(set->_settings);
-    }
-    ~Settings(){}
-
-    /*! \returns value fo given key
-         \param key
-    */
-    QString value(const QString key) const {
-        if(!_settings.contains(key)) {
-            return QString();
-        }
-        return _settings[key];
-    }
-
-    //! sets key to value
-    void setValue(const QString key, const QString value) {
-        _settings.insert(key, value);
-    }
-
-    QList<QString> keys() const {
-        return _settings.keys();
-    }
-
-private:
-    QHash<QString, QString> _settings;
-};
-
-#endif // SETTINGS_H
diff --git a/src/common/translation.h b/src/common/translation.h
deleted file mode 100644 (file)
index a6a20a9..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
-
-    This file is part of mDictionary.
-
-    mDictionary is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    mDictionary is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
-
-    Copyright 2010 Comarch S.A.
-
-*******************************************************************************/
-
-/*! \file translation.h
-\brief Interface for translation instances \see Translation
-
-\author Bartosz Szatkowski <bulislaw@linux.com>
-*/
-
-#ifndef TRANSLATION_H
-#define TRANSLATION_H
-
-#include <QString>
-#include <QMetaType>
-#include <QDebug>
-
-class CommonDictInterface;
-
-
-/*! Translation is kind of GoF proxy, it stores key:translation pair and
-  provides it in lazy way -> key is available always, but translation is fetched
-  as late as possible*/
-class Translation {
-  public:
-    Translation  () { _bookmark = 0;}
-    virtual ~Translation () {}
-    //! \return word to be translated
-    virtual QString key() const = 0;
-    bool operator==(Translation* translation) {
-        return this->key()==translation->key();
-    }
-
-    /*! \returns dictionary information (plugin name, languages, <logo> etc)\
-         to be displayed in translation table header */
-    virtual QString dictionaryInfo() const = 0;
-
-    //! \return parsed raw format into html
-    virtual QString toHtml() const = 0;
-
-    //! \return whether given translation is taken from bookmarks
-    virtual bool isBookmark() const {
-        return _bookmark;
-   }
-
-   //! \param b if true then translation is from bookmarks
-   void setBookmark(bool b) {
-       _bookmark = b;
-   }
-
-    //! returns coresponding dict object
-   virtual uint dict() const {return 0;}
-
-   protected:
-       bool _bookmark;
-
-};
-
-Q_DECLARE_METATYPE(Translation*);
-Q_DECLARE_METATYPE(QList<Translation*>);
-
-#endif
diff --git a/src/include/AccentsNormalizer.h b/src/include/AccentsNormalizer.h
new file mode 100644 (file)
index 0000000..0343e88
--- /dev/null
@@ -0,0 +1,81 @@
+/*******************************************************************************
+
+    This file is part of mDictionary.
+
+    mDictionary is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    mDictionary is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
+
+    Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+/*! /file AccentsNormalizer.h
+\brief Common functionality for all classes that need to remove accents from strings
+
+\author Bartosz Szatkowski <bulislaw@linux.com>
+*/
+
+#ifndef ACCENTSNORMALIZER_H
+#define ACCENTSNORMALIZER_H
+
+#include <QMap>
+#include <QString>
+#include <QRegExp>
+
+
+class AccentsNormalizer {
+  protected:
+    QMap<QChar, QRegExp> letters;
+    QRegExp noLetter;
+
+    QString removeAccents(QString string) {
+       string = string.toLower();
+       QString normalized = string.normalized(QString::NormalizationForm_KD);
+       foreach(QChar let, letters.keys()) {
+           normalized.replace(letters[let], QString(let));
+       }
+       normalized.replace(noLetter, "");
+       return normalized;
+    }
+
+    void initAccents() {
+        letters['a'] = QRegExp(QString::fromUtf8("[ÀàÁáÂÂâÃãÄäÅåæÆĀāĂ㥹ǠȀǡȁǢȂǣȃȦȧǺȺǻǼǍǽǎǞǟⱥ]"), Qt::CaseInsensitive);
+        letters['b'] = QRegExp(QString::fromUtf8("[ƀƁƂƃɃƄƅ]"), Qt::CaseInsensitive);
+        letters['c'] = QRegExp(QString::fromUtf8("[ÇçÈçŒĆćĈĉĊċČčƇƈȻȼ]"), Qt::CaseInsensitive);
+        letters['d'] = QRegExp(QString::fromUtf8("[ÐĐđĎďȡƉ]"), Qt::CaseInsensitive);
+        letters['e'] = QRegExp(QString::fromUtf8("[ÈéèÉÊêËëĒēĔĕĖėĘęĚěēȄȅȆɆȇɇȨȩ]"), Qt::CaseInsensitive);
+        letters['f'] = QRegExp(QString::fromUtf8("[ſƑƒꜰ]"), Qt::CaseInsensitive);
+        letters['g'] = QRegExp(QString::fromUtf8("[ĠġĢģĜĝĞğƓǤǴǥǵǦǧ]"), Qt::CaseInsensitive);
+        letters['h'] = QRegExp(QString::fromUtf8("[ħĤĥĦȞȟⱧⱨ]"), Qt::CaseInsensitive);
+        letters['i'] = QRegExp(QString::fromUtf8("[ÌìÍíÎîÏïİijĨĩĪīĬĭĮįǐƗȈȉȊȋǏꟾ]"), Qt::CaseInsensitive);
+        letters['j'] = QRegExp(QString::fromUtf8("[ĴĵǰȷɈɉⱼ]"), Qt::CaseInsensitive);
+        letters['k'] = QRegExp(QString::fromUtf8("[ĶķĸƘǨƙǩⱩⱪ]"), Qt::CaseInsensitive);
+        letters['l'] = QRegExp(QString::fromUtf8("[ŀŁłĹĺĻļĽľĿȴȽⱠⱡⱢꝈ]"), Qt::CaseInsensitive);
+        letters['m'] = QRegExp(QString::fromUtf8("[Ɱ]"), Qt::CaseInsensitive);
+        letters['n'] = QRegExp(QString::fromUtf8("[ÑñŃńŅņŇňʼnŊŋȵǸǹƝ]"), Qt::CaseInsensitive);
+        letters['o'] = QRegExp(QString::fromUtf8("[ÒòÓóÔÕõÖöØøŐőœŌōŎŏƠȰơǑȱǒǪȪǫȫǬȌȬǭȍȭǾȎȮǿȏȯⱺ]"), Qt::CaseInsensitive);
+        letters['p'] = QRegExp(QString::fromUtf8("[ƤƥⱣ]"), Qt::CaseInsensitive);
+        letters['q'] = QRegExp(QString::fromUtf8("[Ɋɋ]"), Qt::CaseInsensitive);
+        letters['r'] = QRegExp(QString::fromUtf8("[ŕŖŖŗŘřȐȑȒȓɌɍⱤ]"), Qt::CaseInsensitive);
+        letters['s'] = QRegExp(QString::fromUtf8("[ߊšŚśŜŝŞşȘșȿꜱ]"), Qt::CaseInsensitive);
+        letters['t'] = QRegExp(QString::fromUtf8("[ŢţŤťŦŧȶȚƫțƬƮȾⱦ]"), Qt::CaseInsensitive);
+        letters['u'] = QRegExp(QString::fromUtf8("[ÙùÚúÛûÜüŰűŲųŨũŪūŬŮůưǓǔȔɄǕȕǖȖǗȗǘǙǚǛǜƯ]"), Qt::CaseInsensitive);
+        letters['v'] = QRegExp(QString::fromUtf8("[Ʋⱱⱴⱽ]"), Qt::CaseInsensitive);
+        letters['w'] = QRegExp(QString::fromUtf8("[ŴŵⱲⱳ]"), Qt::CaseInsensitive);
+        letters['y'] = QRegExp(QString::fromUtf8("[ÿÝýŶŷŸȲƳȳƴɎɏ]"), Qt::CaseInsensitive);
+        letters['z'] = QRegExp(QString::fromUtf8("[ŹźŻżŽžɀȤƵȥƶⱫⱬ]"), Qt::CaseInsensitive);
+        noLetter = QRegExp("[^-a-z '\"]", Qt::CaseInsensitive);
+    }
+};
+
+#endif // ACCENTSNORMALIZER_H
diff --git a/src/include/CommonDictInterface.h b/src/include/CommonDictInterface.h
new file mode 100644 (file)
index 0000000..899843a
--- /dev/null
@@ -0,0 +1,141 @@
+/*******************************************************************************
+
+    This file is part of mDictionary.
+
+    mDictionary is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    mDictionary is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
+
+    Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+/*! \file CommonDictInterface.h
+\brief Common interface for all dicts and plugins \see CommonDictInterface
+
+\author Bartosz Szatkowski <bulislaw@linux.com>
+*/
+
+#ifndef COMMONDICTINTERFACE_H
+#define COMMONDICTINTERFACE_H
+
+#include <QString>
+#include <QDialog>
+#include <QObject>
+#include <QList>
+#include "translation.h"
+#include "Notify.h"
+#include "settings.h"
+#include "AccentsNormalizer.h"
+
+class DictDialog;
+
+
+//! Interface for dict engines plugins
+class CommonDictInterface : public QObject, public AccentsNormalizer {
+  Q_OBJECT
+  public:
+    CommonDictInterface(QObject *parent = 0):QObject(parent) {}
+
+    virtual ~CommonDictInterface() {}
+
+    //! returns source language code iso 639-2
+    virtual QString langFrom() const = 0;
+
+    //! returns destination language code iso 639-2
+    virtual QString langTo() const = 0;
+
+    //! returns dictionary name (like "old English" or so)
+    virtual QString name() const = 0;
+
+    //! returns dictionary type (xdxf, google translate, etc)
+    virtual QString type() const = 0;
+
+    //! returns information about dictionary in html (name, authors, etc)
+    virtual QString infoNote() const = 0;
+
+    /*! returns DictDialog object that creates dialogs
+        for adding new dictionary and changing plugin settings*/
+    virtual DictDialog* dictDialog() = 0;
+
+
+    //! returns new, clean copy of plugin with settings set as in Settings*
+    virtual CommonDictInterface* getNew(const Settings*) const = 0;
+
+    //! returns whether plugin can start searching
+    virtual bool isAvailable() const = 0;
+
+    //! returns the actual translation of a word given in key
+    virtual QString search(QString key) = 0;
+
+    //! \returns unique value (unique for every dictionary, not plugin)
+    virtual uint hash() const = 0;
+
+    //! sets unique value (unique for every dictionary, not plugin)
+    virtual void setHash(uint) = 0;
+
+    //! returns current plugin settings
+    virtual Settings* settings() = 0;
+
+    //! returns plugin icon
+    virtual QIcon* icon() = 0;
+
+    //! returns empty translation object (to be fetched later) for given key
+    virtual Translation* getTranslationFor(QString ) {return 0;}
+
+    /*! plugin should delete any files (eg. cache) that have been created and are ready
+        to be deleted
+        */
+    virtual void clean() {}
+
+
+ public Q_SLOTS:
+    /*! performs search in dictionary
+        \param  word word to search in dictionary
+        \param  limit limit on number of results,
+                if limit=0 all matching words are returned
+
+        After finishing search it has to emit
+        \see CommonDictInterface:finalTranslation  finalTranslation
+    */
+    virtual QList<Translation*> searchWordList(QString word, int limit=0) = 0;
+
+    //! stops current operation
+    virtual void stop() = 0;
+
+  Q_SIGNALS:
+
+    //! emitted when dictionary is ready to use afer being loaded
+    void loaded(CommonDictInterface*);
+
+    //! emitted after change in dictionary settings
+    void settingsChanged();
+
+    /*! emitted to backbone when it's needed to inform user about something
+        \param Backbone::NotifyType GUI may decide to show different types in
+            different ways
+        \param QString text of the notification
+    */
+    void notify(Notify::NotifyType, QString);
+    
+
+protected:
+    QString removeAccents(QString string) {
+        if(settings()->value("strip_accents") == "true")
+            return AccentsNormalizer::removeAccents(string);
+        return string;
+    }
+};
+
+Q_DECLARE_INTERFACE(CommonDictInterface, "CommonDictInterface/0.1");
+
+#endif
diff --git a/src/include/DictDialog.h b/src/include/DictDialog.h
new file mode 100644 (file)
index 0000000..fc83744
--- /dev/null
@@ -0,0 +1,51 @@
+/*******************************************************************************
+
+    This file is part of mDictionary.
+
+    mDictionary is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    mDictionary is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
+
+    Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
+#ifndef DICTDIALOG_H
+#define DICTDIALOG_H
+
+#include <QObject>
+
+class Settings;
+
+//! Interface for plugin dialog provider
+class DictDialog : public QObject {
+    Q_OBJECT
+
+public:
+    DictDialog(QObject *parent = 0) : QObject(parent) {}
+
+    /*!
+      Shows "add new dictionary" dialog and returns settings of new dict
+      \param parent parent widget on which dialog will be displayed
+      */
+    virtual Settings* addNewDictionary(QWidget*parent=0)=0;
+
+    /*!
+      Shows "settings" dialog and saves new settings in plugin
+      \param parent parent widget on which dialog will be displayed
+      */
+    virtual void changeSettings(QWidget *parent = 0) = 0;
+};
+
+#endif // DICTDIALOG_H
diff --git a/src/include/GUIInterface.h b/src/include/GUIInterface.h
new file mode 100644 (file)
index 0000000..2f10cc1
--- /dev/null
@@ -0,0 +1,195 @@
+/*******************************************************************************
+
+    This file is part of mDictionary.
+
+    mDictionary is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    mDictionary is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
+
+    Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+//! \file GUIInterface.h
+//! \brief Defines interface for GUI
+//! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
+
+
+
+#ifndef GUIINTERFACE_H
+#define GUIINTERFACE_H
+#include <QMainWindow>
+#include <QMultiHash>
+
+#include "translation.h"
+#include "CommonDictInterface.h"
+
+class Settings;
+
+//! Interface for different GUIs
+/*!
+  Default base class for all GUIs is QMainWindow
+  */
+class GUIInterface : public QMainWindow {
+    Q_OBJECT
+
+public:
+    GUIInterface(QWidget *parent = 0) :QMainWindow(parent) {}
+
+    virtual ~GUIInterface() {}
+
+    //! Returns all loaded dictionaries with information about that they are
+    //! active/inactive
+    /*!
+        \return Hash of pointers to dictionary and boolean flag indicating if
+        dictionary is active
+     */
+    virtual QHash<CommonDictInterface*, bool> getDictionaries() = 0;
+
+
+    //! Returns all loaded plugins
+    /*!
+        \return List of pointers to plugins
+     */
+    virtual QList<CommonDictInterface*> getPlugins() = 0;
+
+    //! Indicates if GUI is in exact search mode.
+    /*! When GUI is in exact search mode it searches for word, and
+        if it finds exactly matching translation it directly displays it, without
+        displaying matching word list. This mode should be
+        used for browsing search history and searching words from application
+        arguments.
+        \returns flag indicating if GUI is in exact search mode
+    */
+    bool exactSearch();
+
+    //! Sets GUI exact search mode.
+    /*! \sa exactSearch() */
+    void setExactSearch(bool exactSearch);
+
+    virtual Settings* settings() = 0;
+
+    virtual void setSettings(Settings*) = 0;
+
+
+public Q_SLOTS:
+    //! Searches in exact mode for given word
+    /*!
+      GUI will be automatically set into exact search mode, and after search or
+      break it will be unset from exact search mode.
+      \param word which will be searched in dictionaries
+      */
+    virtual void searchExact(QString word) = 0;
+
+    //! Adds key words from given translations to history
+    /*!
+      By default this slot is connected to searchTranslations signal, and
+      passed translations list contains only translations with the same key, so
+      only one word is added to history.
+      \param list of translations with key words
+      \sa searchTranslations();
+      */
+    virtual void addToHistory(QList<Translation*>) = 0;
+
+    //! Shows history dialog
+    virtual void showHistory(QPoint) = 0;
+
+    //! Shows translation of next word in history
+    /*!
+      It will work only if there is next word available in history.
+      Translation of word is searched with searchExact() function
+      \sa searchExact()
+      */
+    virtual void historyNext() = 0;
+
+    //! Shows translation of previous word in history
+    /*!
+      It will work only if there is previous word available in history.
+      Translation of word is searched with searchExact() function
+      \sa searchExact()
+      */
+    virtual void historyPrev() = 0;
+
+    //! Gets words list from backbone and prepares received list to display
+    /*!
+      Checks if received list is empty, in that case it displays suitable
+      information. If GUI is in exact search mode it will search for exact
+      word in received list, and if word is found it will emit signal to
+      display its translation. Otherwise it will display list of matching
+      words and show suitable information.
+      \sa exactSearch()
+      \sa showTranslation()
+     */
+    virtual void wordListReady() = 0;
+
+    //! Gets translation strings from backbone and emits signal to display them
+    virtual void translationsReady() = 0;
+
+Q_SIGNALS:
+    //! Should be emitted when user wants to close application to stop
+    //! all ongoing searches
+    void quit();
+
+    //! Emitted when user wants to search for list of words matching given word
+    /*! \param word word which will be matched, it can contain wildcards
+    */
+    void searchWordList(QString word);
+
+    //! Emitted when user wants to see translation of words.
+    /*! \param list of translations for given word which will be received
+        in wordListReady() slot
+        \sa wordListReady()
+    */
+    void searchTranslations(QList<Translation*>);
+
+    //! Emitted when starting search, will disable GUI components
+    //! and show progress bars
+    void setBusy();
+
+    //! Emitted when searching ends, will enable GUI components
+    void setIdle();
+
+    //! Emitted when user wants to break search
+    void stopSearching();
+
+    //! Emitted after receiving word list in wordListReady() slot, will display
+    //! list of matched words
+    /*! \param hash of word and list of translations of this word found
+         in dictionaries
+     */
+    void showWordList(QHash<QString, QList<Translation*> >);
+
+    //! Emitted after receiving translation strings in translationsReady() slot,
+    //! will display translation of given word
+    /*! \param list of translations from different dictionaries
+         in dictionaries
+     */
+    void showTranslation(QStringList);
+
+    //! Emitted when user wants to add new dictionary
+    /*! \param new dictionary returned by specific plugin dialog
+      */
+    void addNewDictionary(CommonDictInterface*);
+
+    //! Emitted when user wants to remove dictionary
+    /*! \param dictionary which will be removed
+      */
+    void removeDictionary(CommonDictInterface*);
+
+    //! Emitted when user changes dictionaries active/inactive states
+    /*! \param list of only active dictionaries
+      */
+    void selectedDictionaries(QList<CommonDictInterface* >);
+
+    void addToBookmarks(QList<Translation*>);
+};
+
+#endif // GUIINTERFACE_H
diff --git a/src/include/History.h b/src/include/History.h
new file mode 100644 (file)
index 0000000..133b3ad
--- /dev/null
@@ -0,0 +1,70 @@
+/*******************************************************************************
+
+    This file is part of mDictionary.
+
+    mDictionary is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    mDictionary is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
+
+    Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+//Created by Mateusz Półrola
+
+#ifndef HISTORY_H
+#define HISTORY_H
+
+#include <QObject>
+#include <QVector>
+#include <QStringList>
+
+class History : public QObject
+{
+    Q_OBJECT
+public:
+    explicit History(int maxSize = 5, QObject *parent = 0);
+
+Q_SIGNALS:
+    void historyChanged(bool prevAvailable,
+                        bool nextAvailable,
+                        bool listAvailable);
+
+public Q_SLOTS:
+    void refreshStatus();
+
+public:
+    void add(QString);
+    QString previous();
+    QString next();
+    QStringList list();
+
+    bool prevAvailable();
+    bool nextAvailable();
+    bool listAvailable();
+
+    void setCurrentElement(int element);
+
+    int maxSize();
+
+    void setMaxSize(int size);
+
+private:
+    QVector<QString> _history;
+    int _maxSize;
+    int currentElement;
+    bool _prevAvailable;
+    bool _nextAvailable;
+    bool _listAvailable;
+};
+
+#endif // HISTORY_H
diff --git a/src/include/Notify.h b/src/include/Notify.h
new file mode 100644 (file)
index 0000000..a5266e9
--- /dev/null
@@ -0,0 +1,45 @@
+/*******************************************************************************
+
+    This file is part of mDictionary.
+
+    mDictionary is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    mDictionary is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
+
+    Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+/*! /file Notify.h
+\brief Declaration of common notify subsystem (NotifyType for now)
+
+\author Bartosz Szatkowski <bulislaw@linux.com>
+*/
+
+#ifndef NOTIFY_H
+#define NOTIFY_H
+
+#include <QObject>
+#include <QMetaClassInfo>
+
+/*! Notify wraps NotifyType which is interpreted by GUI and may change way in
+    which GUI handles given notification
+    */
+class Notify : QObject {
+    Q_OBJECT
+public:
+    Notify() : QObject(0) {}
+    Notify(const Notify&) : QObject(0) {}
+    enum notifytype {Error, Warning, Info};
+    Q_DECLARE_FLAGS(NotifyType, notifytype);
+};
+#endif // NOTIFY_H
diff --git a/src/include/settings.h b/src/include/settings.h
new file mode 100644 (file)
index 0000000..6843a79
--- /dev/null
@@ -0,0 +1,71 @@
+/*******************************************************************************
+
+    This file is part of mDictionary.
+
+    mDictionary is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    mDictionary is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
+
+    Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+/*! \file settings.h
+\brief Settings object for plugins \see Settings
+
+\author Bartosz Szatkowski <bulislaw@linux.com>
+*/
+
+#ifndef SETTINGS_H
+#define SETTINGS_H
+
+#include <QString>
+#include <QHash>
+#include <QDebug>
+
+/*! Plugins or dictionaries may need to keep some of configuration between
+  sessions, moreover Backbone or GUI may want to store some additional info in
+  plugin Settings.
+
+  It's important for plugin to store all information given to it in Settings.*/
+class Settings {
+  public:
+    Settings(){}
+    Settings(const Settings* set) {
+        _settings = QHash<QString, QString>(set->_settings);
+    }
+    ~Settings(){}
+
+    /*! \returns value fo given key
+         \param key
+    */
+    QString value(const QString key) const {
+        if(!_settings.contains(key)) {
+            return QString();
+        }
+        return _settings[key];
+    }
+
+    //! sets key to value
+    void setValue(const QString key, const QString value) {
+        _settings.insert(key, value);
+    }
+
+    QList<QString> keys() const {
+        return _settings.keys();
+    }
+
+private:
+    QHash<QString, QString> _settings;
+};
+
+#endif // SETTINGS_H
diff --git a/src/include/translation.h b/src/include/translation.h
new file mode 100644 (file)
index 0000000..a6a20a9
--- /dev/null
@@ -0,0 +1,80 @@
+/*******************************************************************************
+
+    This file is part of mDictionary.
+
+    mDictionary is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    mDictionary is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
+
+    Copyright 2010 Comarch S.A.
+
+*******************************************************************************/
+
+/*! \file translation.h
+\brief Interface for translation instances \see Translation
+
+\author Bartosz Szatkowski <bulislaw@linux.com>
+*/
+
+#ifndef TRANSLATION_H
+#define TRANSLATION_H
+
+#include <QString>
+#include <QMetaType>
+#include <QDebug>
+
+class CommonDictInterface;
+
+
+/*! Translation is kind of GoF proxy, it stores key:translation pair and
+  provides it in lazy way -> key is available always, but translation is fetched
+  as late as possible*/
+class Translation {
+  public:
+    Translation  () { _bookmark = 0;}
+    virtual ~Translation () {}
+    //! \return word to be translated
+    virtual QString key() const = 0;
+    bool operator==(Translation* translation) {
+        return this->key()==translation->key();
+    }
+
+    /*! \returns dictionary information (plugin name, languages, <logo> etc)\
+         to be displayed in translation table header */
+    virtual QString dictionaryInfo() const = 0;
+
+    //! \return parsed raw format into html
+    virtual QString toHtml() const = 0;
+
+    //! \return whether given translation is taken from bookmarks
+    virtual bool isBookmark() const {
+        return _bookmark;
+   }
+
+   //! \param b if true then translation is from bookmarks
+   void setBookmark(bool b) {
+       _bookmark = b;
+   }
+
+    //! returns coresponding dict object
+   virtual uint dict() const {return 0;}
+
+   protected:
+       bool _bookmark;
+
+};
+
+Q_DECLARE_METATYPE(Translation*);
+Q_DECLARE_METATYPE(QList<Translation*>);
+
+#endif
index 34a3dfc..6dbd1b9 100644 (file)
@@ -28,8 +28,8 @@
 #ifndef BOOKMARKTRANSLATIONS_H
 #define BOOKMARKTRANSLATIONS_H
 
-#include "../../common/settings.h"
-#include "../../common/translation.h"
+#include "../../include/settings.h"
+#include "../../include/translation.h"
 #include "Bookmarks.h"
 #include "QObject"
 
index 5696296..472ac2b 100644 (file)
@@ -40,9 +40,9 @@
 #include <QSqlError>
 #include <QDir>
 #include <QDebug>
-#include "../../common/settings.h"
-#include "../../common/translation.h"
-#include "../../common/AccentsNormalizer.h"
+#include "../../include/settings.h"
+#include "../../include/translation.h"
+#include "../../include/AccentsNormalizer.h"
 class BookmarkTranslation;
 
 
index 6187976..0fe31e8 100644 (file)
@@ -21,7 +21,7 @@
 
 //Created by Mateusz Półrola
 
-#include "../../common/History.h"
+#include "../../include/History.h"
 #include <QDebug>
 
 History::History(int maxSize, QObject *parent) :
index 3e8396c..89a9da7 100644 (file)
 #include <QThread>
 #include <QSettings>
 #include <QFutureWatcher>
-#include "../../common/CommonDictInterface.h"
-#include "../../common/settings.h"
-#include "../../common/translation.h"
-#include "../../common/History.h"
-#include "../../common/Notify.h"
+#include "../../include/CommonDictInterface.h"
+#include "../../include/settings.h"
+#include "../../include/translation.h"
+#include "../../include/History.h"
+#include "../../include/Notify.h"
 #include "ConfigGenerator.h"
 #include "Bookmarks.h"
 
index 413469d..972b3f7 100644 (file)
@@ -30,7 +30,7 @@
 #include <QDialog>
 #include <QWidget>
 #include <QtGui>
-#include "../../common/GUIInterface.h"
+#include "../../include/GUIInterface.h"
 
 class AboutWidget : public QDialog
 {
index 55b7b28..c5188fa 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <QDialog>
 #include <QtGui>
-#include "../../common/GUIInterface.h"
+#include "../../include/GUIInterface.h"
 
 //! Implements bookmarks management widget
 /*!
index 292e47c..249230b 100644 (file)
@@ -26,7 +26,7 @@
 #include "DictManagerWidget.h"
 #include "DictTypeSelectDialog.h"
 #include <QDebug>
-#include "../../common/DictDialog.h"
+#include "../../include/DictDialog.h"
 
 DictManagerWidget::DictManagerWidget(GUIInterface *parent) :
     QDialog(parent) {
index 324be83..ada3af8 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <QWidget>
 #include <QtGui>
-#include "../../common/GUIInterface.h"
+#include "../../include/GUIInterface.h"
 
 
 //! Implements dictionaries management widget
index d63d082..11b1e0a 100644 (file)
@@ -26,8 +26,8 @@
 
 #include <QDialog>
 #include <QtGui>
-#include "../../common/settings.h"
-#include "../../common/CommonDictInterface.h"
+#include "../../include/settings.h"
+#include "../../include/CommonDictInterface.h"
 
 #define PLUGIN_ROW_ROLE 99      //TODO remove this
 
index 591794f..767a968 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <QDialog>
 #include "SearchBarWidget.h"
-#include "../../common/History.h"
+#include "../../include/History.h"
 #include <QtGui>
 
 
index 9e9a988..b4738b3 100644 (file)
@@ -25,8 +25,8 @@
 #define MAINWINDOW_H
 
 #include <QMainWindow>
-#include "../../common/GUIInterface.h"
-#include "../../common/settings.h"
+#include "../../include/GUIInterface.h"
+#include "../../include/settings.h"
 #include "../backbone/backbone.h"
 #include "TranslationWidget.h"
 #include "WordListWidget.h"
index 2286abb..57bd309 100644 (file)
@@ -29,7 +29,7 @@
 #include <QHash>
 #include <QString>
 #include <QDialog>
-#include "../../common/Notify.h"
+#include "../../include/Notify.h"
 
 //! Manages notifications in applications
 /*!
index ea7d30d..7bd9b26 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "SearchBarWidget.h"
 #include <QDebug>
-#include "../../common/DictDialog.h"
+#include "../../include/DictDialog.h"
 #include "HistoryListDialog.h"
 
 
index 71d33cb..4c04bf6 100644 (file)
@@ -28,7 +28,7 @@
 #include <QWidget>
 #include <QtGui>
 #include "../backbone/backbone.h"
-#include "../../common/History.h"
+#include "../../include/History.h"
 
 //! Displays search bar
 /*!
index b281f22..7cc5ce4 100644 (file)
@@ -28,8 +28,8 @@
 #include <QWidget>
 #include <QtGui>
 #include <QPushButton>
-#include "../../common/GUIInterface.h"
-#include "../../common/settings.h"
+#include "../../include/GUIInterface.h"
+#include "../../include/settings.h"
 
 //! Implements applications settings widget
 /*!
index da13431..4e3352b 100644 (file)
@@ -32,7 +32,7 @@
 #include <QXmlQuery>
 #include "TranslationTextEdit.h"
 #include <QPropertyAnimation>
-#include "../../common/GUIInterface.h"
+#include "../../include/GUIInterface.h"
 
 //! Displays translation of word found in dictionaries
 /*!
index 7d6eaab..379e691 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "WordListWidget.h"
 #include "WordListProxyStyle.h"
-#include "../../common/translation.h"
+#include "../../include/translation.h"
 
 
 WordListWidget::WordListWidget(QWidget *parent):
index c19b931..3f166be 100644 (file)
@@ -25,8 +25,8 @@
 #include <QtGui/QApplication>
 #include "MainWindow.h"
 #include "../backbone/backbone.h"
-#include "../../common/translation.h"
-#include "../../common/Notify.h"
+#include "../../include/translation.h"
+#include "../../include/Notify.h"
 #include "DBusAdapter.h"
 #include <QDebug>
 #include <QDBusConnection>
index 00aafe9..00118ca 100644 (file)
@@ -34,26 +34,26 @@ HEADERS += gui/MainWindow.h \
     gui/WordListWidget.h \
     gui/TranslationWidget.h \
     backbone/backbone.h \
-    ../common/translation.h \
-    ../common/settings.h \
-    ../common/CommonDictInterface.h \
+    ../include/translation.h \
+    ../include/settings.h \
+    ../include/CommonDictInterface.h \
     gui/MenuWidget.h \
     gui/MenuTabWidget.h \
     gui/DictManagerWidget.h \
     gui/DictTypeSelectDialog.h \
-    ../common/History.h \
+    ../include/History.h \
     gui/HistoryListDialog.h \
-    ../common/GUIInterface.h \
+    ../include/GUIInterface.h \
     gui/WordListProxyStyle.h \
     backbone/Bookmarks.h \
     backbone/BookmarkTranslations.h \
     gui/SettingsWidget.h \
     gui/BookmarksWidget.h \
     gui/WelcomeScreenWidget.h \
-    ../common/Notify.h \
+    ../include/Notify.h \
     gui/TranslationTextEdit.h \
-    ../common/AccentsNormalizer.h \
-    ../common/DictDialog.h \
+    ../include/AccentsNormalizer.h \
+    ../include/DictDialog.h \
     gui/DBusAdapter.h \
     gui/NotifyManager.h
 
@@ -83,3 +83,21 @@ unix {
        
        INSTALLS += desktop icon64 bookmarks service
 }
+
+
+
+coverage {
+        # add flags to compiler
+        LIBS += -lgcov
+        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs -fno-elide-constructors
+
+        # and add a target for generating report
+        QMAKE_EXTRA_TARGETS += coverage-report
+        coverage-report.commands  = lcov -d .obj --capture --output-file all.cov -b . &&
+        coverage-report.commands += lcov -r all.cov '*thumbtest*' -r all.cov '*/src/dbus/*' -r all.cov '*/src/.moc/*' -o to_test.cov &&
+        coverage-report.commands += lcov -e to_test.cov '*/*/src/*.cpp*' -e to_test.cov '*/*/src/*.h*' -e to_test.cov '*/*/src/common/*.h*' -o final.cov &&
+        coverage-report.commands += genhtml -o coverage final.cov
+}
+
+check.commands = echo 'No check here'
+QMAKE_EXTRA_TARGETS += check
index 3929032..7823dab 100644 (file)
@@ -28,8 +28,8 @@
 #ifndef GOOGLEDICTDIALOG_H
 #define GOOGLEDICTDIALOG_H
 
-#include "../../common/DictDialog.h"
-#include "../../common/settings.h"
+#include "../../include/DictDialog.h"
+#include "../../include/settings.h"
 #include "GooglePlugin.h"
 #include "GoogleSettingsDialog.h"
 
index 87c709a..5942596 100644 (file)
@@ -34,9 +34,9 @@
 #include <QIcon>
 #include <QtNetwork>
 
-#include "../../common/CommonDictInterface.h"
-#include "../../common/settings.h"
-#include "../../common/DictDialog.h"
+#include "../../include/CommonDictInterface.h"
+#include "../../include/settings.h"
+#include "../../include/DictDialog.h"
 #include "TranslationGoogle.h"
 #include "GoogleDictDialog.h"
 
index ff4503f..24d1857 100644 (file)
@@ -28,7 +28,7 @@
 #define GOOGLESETTINGSDIALOG_H
 
 #include <QDialog>
-#include "../../common/settings.h"
+#include "../../include/settings.h"
 #include <QtGui>
 #include "GooglePlugin.h"
 
index 963ac90..4068136 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef TRANSLATIONGOOGLE_H
 #define TRANSLATIONGOOGLE_H
 
-#include "../../common/translation.h"
+#include "../../include/translation.h"
 #include "GooglePlugin.h"
 
 class GooglePlugin;
index 61bbe42..3b39bc5 100644 (file)
@@ -10,10 +10,10 @@ SOURCES +=  \
 
 HEADERS += \
     GooglePlugin.h \
-    ../../common/DictDialog.h \
-    ../../common/translation.h \
-    ../../common/settings.h \
-    ../../common/CommonDictInterface.h \
+    ../../include/DictDialog.h \
+    ../../include/translation.h \
+    ../../include/settings.h \
+    ../../include/CommonDictInterface.h \
     TranslationGoogle.h \
     GoogleDictDialog.h \
     GoogleSettingsDialog.h
index 7809758..c28af27 100644 (file)
@@ -24,7 +24,7 @@
 #define TRANSLATIONXDXF_H
 
 #include <QString>
-#include "../../common/translation.h"
+#include "../../include/translation.h"
 #include "xdxfplugin.h"
 
 class TranslationXdxf : public Translation
index 34649c6..f7b06f2 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef XDXFDICTDIALOG_H
 #define XDXFDICTDIALOG_H
 
-#include "../../common/DictDialog.h"
+#include "../../include/DictDialog.h"
 #include "XdxfLoadDialog.h"
 
 class XdxfPlugin;
index d9480d1..97e79e5 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <QDialog>
 #include <QtGui>
-#include "../../common/settings.h"
+#include "../../include/settings.h"
 
 //! Displays dialog which allows user to add new xdxf dictionary
 class XdxfLoadDialog : public QDialog {
index 4baf322..b7543f8 100644 (file)
@@ -26,7 +26,7 @@
 #define XDXFSETTINGSDIALOG_H
 
 #include <QDialog>
-#include "../../common/settings.h"
+#include "../../include/settings.h"
 #include <QtGui>
 #include "xdxfplugin.h"
 
index 4bc26f3..91955f4 100644 (file)
@@ -15,11 +15,11 @@ HEADERS += \
     xdxfplugin.h \
     TranslationXdxf.h \
     XdxfLoadDialog.h \
-    ../../common/DictDialog.h \
+    ../../include/DictDialog.h \
     XdxfDictDialog.h \
-    ../../common/translation.h \
-    ../../common/settings.h \
-    ../../common/CommonDictInterface.h \
+    ../../include/translation.h \
+    ../../include/settings.h \
+    ../../include/CommonDictInterface.h \
     XdxfSettingsDialog.h \
     XdxfCachingDialog.h
 
index 9335759..fe3dde3 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "xdxfplugin.h"
 #include <QDebug>
-#include "../../common/Notify.h"
+#include "../../include/Notify.h"
 
 XdxfPlugin::XdxfPlugin(QObject *parent) : CommonDictInterface(parent),
                     _langFrom(""), _langTo(""),_name(""), _infoNote("") {
index 287426d..2bc7930 100644 (file)
@@ -37,8 +37,8 @@
 #include <QXmlStreamReader>
 #include <QtPlugin>
 
-#include "../../common/CommonDictInterface.h"
-#include "../../common/settings.h"
+#include "../../include/CommonDictInterface.h"
+#include "../../include/settings.h"
 #include "XdxfDictDialog.h"
 #include "XdxfCachingDialog.h"
 #include "TranslationXdxf.h"
index d6fdbde..6c65bf4 100644 (file)
@@ -2,3 +2,13 @@ include(src.pri)
 
 TEMPLATE = subdirs
 SUBDIRS = $$ENABLED_SRC
+
+check.CONFIG = recursive
+check.recurse = $$ENABLED_SRC
+QMAKE_EXTRA_TARGETS += check
+
+coverage {
+        # add flags to compiler
+        LIBS += -lgcov
+        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs -fno-elide-constructors
+}
index 326bf54..7d67498 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef COMMONDICTINTERFACEMOCK_H
 #define COMMONDICTINTERFACEMOCK_H
 
-#include "../../src/common/CommonDictInterface.h"
+#include "../../src/include/CommonDictInterface.h"
 #include "TranslationMock.h"
 
 /*! CommonDictInterfaceMock simulates dict/plugin behaviour without any
index 1b4ed4a..fcc8771 100644 (file)
@@ -29,7 +29,7 @@
 #ifndef TRANSLATIONMOCK_H
 #define TRANSLATIONMOCK_H
 
-#include "../../src/common/translation.h"
+#include "../../src/include/translation.h"
 
 /*! Translation mock is intended to simulate behaviour of real plugins
   translation, but without dependency and any kind of complicated operations*/
index eaca07e..1287425 100644 (file)
@@ -21,14 +21,26 @@ SOURCES += tst_Backbone.cpp \
 DEFINES += SRCDIR=\\\"$$PWD/\\\"
 HEADERS += CommonDictInterfaceMock.h \
     ../../src/mdictionary/backbone/backbone.h \
-    ../../src/common/translation.h \
-    ../../src/common/settings.h \
-    ../../src/common/CommonDictInterface.h \
-    ../../src/common/History.h \
+    ../../src/include/translation.h \
+    ../../src/include/settings.h \
+    ../../src/include/CommonDictInterface.h \
+    ../../src/include/History.h \
     TranslationMock.h \
     ../../src/mdictionary/backbone/BookmarkTranslations.h \
     ../../src/mdictionary/backbone/Bookmarks.h \
     ../../src/mdictionary/backbone/ConfigGenerator.h
+
+
 target.path = .
 target.commands += ./mDictionaryTests
 INSTALLS += target
+
+
+coverage {
+        LIBS += -lgcov
+        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs -fno-elide-constructors
+}
+
+check.depends = $$TARGET
+check.commands = ./mDictionaryTests
+QMAKE_EXTRA_TARGETS += check
index ea018f0..18f3045 100644 (file)
@@ -1,7 +1,12 @@
 TEMPLATE=subdirs
 SUBDIRS = mDictionaryTests
 
-check.target = check
 check.CONFIG = recursive
 check.recurse = mDictionaryTests
 QMAKE_EXTRA_TARGETS += check
+
+coverage {
+        # add flags to compiler
+        LIBS += -lgcov
+        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs -fno-elide-constructors
+}