+++ /dev/null
-#ifndef LANGUAGE_H
-#define LANGUAGE_H
-
-#include "../utility/text.h"
-
-#include <QtPlugin>
-#include <QString>
-#include <QIcon>
-#include <QPluginLoader>
-#include <QDir>
-#include <QLocale>
-#include <QDebug>
-
-#include <memory>
-#include <cassert>
-
-class RangeData : public UserData
-{
-public:
- enum : int { Type = UserData::User + 1, };
-
-private:
- RangeData(int begin_, int tail_) : m_begin(begin_), m_tail(tail_) { }
-
-public:
- void set_tail(int tail_) { m_tail = tail_; }
- int begin() const { return m_begin; }
- int tail() const { return m_tail; }
-
- int type() const { return Type; }
-
- static pointer create(int begin_, int tail_)
- {
- return pointer(new RangeData(begin_, tail_));
- }
-
-private:
- int m_begin;
- int m_tail;
-};
-
-class Language
-{
-public:
- Language() { }
- virtual ~Language() { }
- virtual QString name() const = 0;
- virtual int code() const = 0;
- virtual QIcon icon() const = 0;
-
- virtual Text::pointer divide_into_sentences(QString string) = 0;
- virtual Text::pointer divide_into_words(Text::pointer sentence) = 0;
- Text::pointer stuff_word(
- Text::pointer parent_, QString const &string_, int begin_, int tail_)
- {
- Text::pointer result = Text::create(parent_, string_);
- result->set_data(RangeData::create(begin_, tail_));
- return result;
- }
-
-};
-
-Q_DECLARE_METATYPE(Text::weak_pointer)
-Q_DECLARE_METATYPE(Text::pointer)
-
-Q_DECLARE_INTERFACE(Language, "net.wordring.TM.Language/1.0")
-
-#endif // LANGUAGEINTERFACE_H
-