Q_OBJECT
public:
CommonDictInterface(QObject *parent = 0):QObject(parent) {}
-
virtual ~CommonDictInterface() {}
//! returns source language code iso 639-2
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;
virtual QString search(QString key) = 0;
//! \returns unique value (unique for every dictionary, not plugin)
- virtual uint hash() const = 0;
+ virtual uint hash() const {
+ return _hash;
+ }
//! sets unique value (unique for every dictionary, not plugin)
- virtual void setHash(uint) = 0;
+ virtual void setHash(uint h) {
+ this->_hash=h;
+ }
//! returns current plugin settings
virtual Settings* settings() = 0;
//! stops current operation
virtual void stop() = 0;
- virtual void retranslate() = 0;
+ //! loads translations for each plugin only once
+ virtual void retranslate() {}
Q_SIGNALS:
-
- //! emitted when dictionary is ready to use afer being loaded
- void loaded(CommonDictInterface*);
-
//! emitted after change in dictionary settings
void settingsChanged();
different ways
\param QString text of the notification
*/
- void notify(Notify::NotifyType, QString, QWidget* parent = 0);
+ void notify(Notify::NotifyType, QString);
protected:
+//! removes accents from letters in searched word (e.g. ą -> a, ł -> l)
QString removeAccents(QString string) {
if(settings()->value("strip_accents") == "true")
return AccentsNormalizer::removeAccents(string);
return string;
}
+
+ uint _hash;
+
};
Q_DECLARE_INTERFACE(CommonDictInterface, "CommonDictInterface/0.1");