OSDN Git Service

Initial commit
[wordring-tm/wordring-tm.git] / proxy / tmservice.h
1 #ifndef TMSERVICE_H
2 #define TMSERVICE_H
3
4 #include "language.h"
5
6 #include <QObject>
7 #include <QByteArray>
8 #include <QString>
9 #include <QMap>
10
11 #include <QIcon>
12
13 #include <QMutex>
14
15 QT_BEGIN_NAMESPACE
16 class QSettings;
17 QT_END_NAMESPACE
18
19 class Language;
20
21 namespace TM
22 {
23
24 class Service : public QObject
25 {
26         Q_OBJECT
27 public:
28         Service(QSettings *settings, QObject *parent = 0);
29
30         void load_languages(QString const &path);
31
32         Text::pointer divide_into_sentences(int code, QString string);
33         Text::pointer divide_into_words(int code, Text::pointer sentence);
34
35
36 signals:
37         void languageLoaded(int code, QString name, QIcon icon);
38
39 public slots:
40
41 public:
42         QMutex m_mutex;
43
44         QSettings *m_settings;
45         QMap<int, Language*> m_languages;
46 };
47
48 } // namespace TM
49
50 #endif // TMSERVICE_H