⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dictcore.h

📁 使用Qt4编写的星际译王(stardict)
💻 H
字号:
#ifndef DICTCORE_H#define DICTCORE_H#include <QObject>#include <list>#include <string>#include <vector>#include <QStringList>class Libs;class DictCore: public QObject{    Q_OBJECT    public:        DictCore(QObject *parent = 0);        ~DictCore();        void setDicts(const QStringList &orderedDicts);        QStringList orderedDicts() const;        QStringList disabledDicts();        QStringList avialableDicts();        QStringList find(const QString &str);        bool isTranslatable(const QString &str);        QString translate(const QString &str, bool simple = false, bool useHtml = true);    private:        struct SearchResult        {            std::string dictName;            std::string def;            std::string exp;            SearchResult(const std::string &dictName_, const std::string &def_, const std::string &exp_)                : dictName(dictName_), def(def_), exp(exp_)            { }        };        typedef std::vector<SearchResult> SearchResultList;        void simpleLookup(const std::string &str, SearchResultList &resultList);        void lookupWithFuzzy(const std::string &str, SearchResultList &resultList);        void lookupWithRule(const std::string &str, SearchResultList &resultList);        void lookupData(const std::string &str, SearchResultList &resultList);        Libs *sdLibs;        QStringList m_dictDirs;        QStringList m_orderedDicts;        static std::string parse_data(const char *data);        static std::string xdxf2text(const char *p);};#endif // DICTCORE_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -