2003-08-23 00:17:00 +00:00
|
|
|
// -*- C++ -*-
|
2002-08-06 22:38:44 +00:00
|
|
|
/**
|
|
|
|
* \file WordLangTuple.h
|
2003-08-23 00:17:00 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-08-06 22:38:44 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-08-06 22:38:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WORD_LANG_TUPLE_H
|
|
|
|
#define WORD_LANG_TUPLE_H
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2006-12-08 19:46:16 +00:00
|
|
|
#include "support/docstring.h"
|
2003-10-07 08:16:04 +00:00
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
2002-08-06 22:38:44 +00:00
|
|
|
/**
|
2010-01-19 10:22:08 +00:00
|
|
|
* A word and its given language code ("en_US")
|
|
|
|
* plus a variety if needed.
|
2002-08-06 22:38:44 +00:00
|
|
|
* This is used for spellchecking.
|
|
|
|
*/
|
|
|
|
class WordLangTuple {
|
|
|
|
public:
|
2002-08-07 08:11:41 +00:00
|
|
|
WordLangTuple() {}
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2010-01-19 10:22:08 +00:00
|
|
|
WordLangTuple(docstring const & w, std::string const & c,
|
|
|
|
std::string const & v = std::string())
|
|
|
|
: word_(w), code_(c), variety_(v)
|
2002-08-07 08:11:41 +00:00
|
|
|
{}
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-08-06 22:38:44 +00:00
|
|
|
/// return the word
|
2006-12-08 19:46:16 +00:00
|
|
|
docstring const & word() const {
|
2002-08-06 22:38:44 +00:00
|
|
|
return word_;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// return its language code
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const & lang_code() const {
|
2002-08-06 22:38:44 +00:00
|
|
|
return code_;
|
|
|
|
}
|
|
|
|
|
2010-01-19 10:22:08 +00:00
|
|
|
/// return the language variety
|
|
|
|
std::string const & lang_variety() const {
|
|
|
|
return variety_;
|
|
|
|
}
|
|
|
|
|
2002-08-06 22:38:44 +00:00
|
|
|
private:
|
|
|
|
/// the word
|
2006-12-08 19:46:16 +00:00
|
|
|
docstring word_;
|
2002-08-06 22:38:44 +00:00
|
|
|
/// language code of word
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string code_;
|
2010-01-19 10:22:08 +00:00
|
|
|
/// language variety of word
|
|
|
|
std::string variety_;
|
2002-08-06 22:38:44 +00:00
|
|
|
};
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2002-08-06 22:38:44 +00:00
|
|
|
#endif // WORD_LANG_TUPLE_H
|