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
|
|
|
|
2010-02-09 11:26:49 +00:00
|
|
|
#include "Language.h"
|
|
|
|
|
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-02-09 11:26:49 +00:00
|
|
|
* A word and its given language.
|
|
|
|
* This is used for spellchecking
|
|
|
|
* and thesaurus.
|
2002-08-06 22:38:44 +00:00
|
|
|
*/
|
|
|
|
class WordLangTuple {
|
|
|
|
public:
|
2002-08-07 08:11:41 +00:00
|
|
|
WordLangTuple() {}
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2010-02-09 11:26:49 +00:00
|
|
|
WordLangTuple(docstring const & w, Language * l)
|
2010-02-09 11:52:06 +00:00
|
|
|
: word_(w), lang_(l)
|
|
|
|
{}
|
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
|
2010-02-09 11:26:49 +00:00
|
|
|
Language const * lang() const {
|
|
|
|
return lang_;
|
2010-01-18 17:02:05 +00:00
|
|
|
}
|
|
|
|
|
2002-08-06 22:38:44 +00:00
|
|
|
private:
|
|
|
|
/// the word
|
2006-12-08 19:46:16 +00:00
|
|
|
docstring word_;
|
2010-02-09 11:26:49 +00:00
|
|
|
/// language of word
|
|
|
|
Language * lang_;
|
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
|